]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
New compat function isblank.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 5 Jul 2006 08:00:57 +0000 (08:00 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Wed, 5 Jul 2006 08:00:57 +0000 (08:00 +0000)
Actually link in the replacement funcs that were detected.
timegm compiles again.
This makes the ldns core library compile on Solaris 9.

Makefile.in
compat/isblank.c [new file with mode: 0644]
compat/timegm.c
configure.ac

index 67c58018b46c689f096ca474fea687c64bd4c79f..e0b4b4f79a5074f610e57ffa6c987c68edd9e46a 100644 (file)
@@ -58,8 +58,8 @@ LIBDNS_HEADERS        =       $(srcdir)/ldns/error.h          \
                        $(srcdir)/ldns/zone.h           \
                        $(srcdir)/ldns/update.h                 \
                        $(srcdir)/ldns/tsig.h
-LIBDNS_OBJECTS =       $(LIBDNS_SOURCES:.c=.o)
-LIBDNS_LOBJECTS        =       $(LIBDNS_SOURCES:.c=.lo)
+LIBDNS_OBJECTS =       $(LIBDNS_SOURCES:.c=.o) $(LIBOBJS)
+LIBDNS_LOBJECTS        =       $(LIBDNS_SOURCES:.c=.lo) $(LIBOBJS:.o=.lo)
 
 ALL_SOURCES    =       $(LIBDNS_SOURCES)
 
@@ -81,9 +81,8 @@ linktest:
                gcc $(srcdir)/linktest.c $(CPPFLAGS) $(CFLAGS) .libs/libldns.a $(LDFLAGS) $(PROG_LIBS) -o linktest
                rm linktest
 
-lib:           $(LIBDNS_OBJECTS) b64_pton$U.o b64_ntop$U.o
-               $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) b64_pton$U.lo b64_ntop$U.lo \
-               -rpath $(libdir)/lib
+lib:           $(LIBDNS_OBJECTS)
+               $(LINK_LIB) -o libldns.la $(LIBDNS_LOBJECTS) -rpath $(libdir)/lib
                if [ ! -d lib ] ; then ln -s .libs lib ; fi ;           
 
 copy-headers:
@@ -204,6 +203,12 @@ b64_ntop$U.o:      $(srcdir)/compat/b64_ntop.c
 malloc$U.o:    $(srcdir)/compat/malloc.c
        $(COMP_LIB) -c $(srcdir)/compat/malloc.c -o $@
 
+timegm$U.o:    $(srcdir)/compat/timegm.c
+       $(COMP_LIB) -c $(srcdir)/compat/timegm.c -o $@
+
+isblank$U.o:   $(srcdir)/compat/isblank.c
+       $(COMP_LIB) -c $(srcdir)/compat/isblank.c -o $@
+
 # Automatic dependencies.
 %.d: $(srcdir)/%.c
        $(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
diff --git a/compat/isblank.c b/compat/isblank.c
new file mode 100644 (file)
index 0000000..3b38154
--- /dev/null
@@ -0,0 +1,15 @@
+/* Just a replacement, if the original isblank is not
+   present */
+
+#if HAVE_CONFIG_H
+#include <ldns/config.h>
+#endif
+
+int isblank(int c);
+
+/* true if character is a blank (space or tab). C99. */
+int
+isblank(int c)
+{
+       return (c == ' ') || (c == '\t');
+}
index 92fe81ed58635e21d7db68d657e473c8e258ee46..111a9fc868a02f595855bf2a6206693961653afe 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include <ldns/config.h>
 #endif
 
 #include <stdio.h>
index 15eb9af9d3b5add15f00219d2ef3c4fc24d31d55..32b772d9fbfdf268d0520d0a9afae3f3cf49aeb4 100644 (file)
@@ -158,6 +158,7 @@ AC_FUNC_MALLOC
 AC_REPLACE_FUNCS(b64_pton)
 AC_REPLACE_FUNCS(b64_ntop)
 AC_REPLACE_FUNCS(timegm)
+AC_REPLACE_FUNCS(isblank)
 
 #AC_SEARCH_LIBS(RSA_new, [crypto])
 
@@ -229,6 +230,9 @@ static inline size_t b64_pton_calculate_size(size_t srcsize)
 #include <time.h>
 time_t timegm (struct tm *tm);
 #endif /* !TIMEGM */
+#ifndef HAVE_ISBLANK
+int isblank(int c);
+#endif /* !HAVE_ISBLANK */
 ])
 
 AC_CONFIG_FILES([Makefile ldns/util.h])