]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Rollback of last changes, because stdbool.h in solaris is only available when using...
authorWillem Toorop <willem@NLnetLabs.nl>
Wed, 11 May 2011 12:52:15 +0000 (12:52 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Wed, 11 May 2011 12:52:15 +0000 (12:52 +0000)
Otherwise an error is produced.
From /usr/include/stdbool.h:42:2: #error "Use of <stdbool.h> is valid only in a c99 compilation environment.

Makefile.in
configure.ac
ldns/common.h [moved from ldns/common.h.in with 71% similarity]

index dfa28929bbac1e54eb1de5b037ff42b87d6843c2..8b769d23f57e886a58dabd4469246a4ed024d22c 100644 (file)
@@ -76,6 +76,7 @@ LIBDNS_SOURCES        =       rdata.c util.c rr.c packet.c wire2host.c \
                        sha1.c sha2.c
 LIBDNS_HEADERS =       $(srcdir)/ldns/error.h          \
                        $(srcdir)/ldns/packet.h         \
+                       $(srcdir)/ldns/common.h         \
                        $(srcdir)/ldns/rdata.h          \
                        $(srcdir)/ldns/rr.h             \
                        $(srcdir)/ldns/wire2host.h      \
@@ -110,7 +111,7 @@ COMP_LIB    = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS)
 LINK           = $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS))
 LINK_LIB       = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined)
 
-%.o:    $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/common.h ldns/config.h
+%.o:    $(srcdir)/%.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h
        $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $<
 
 .PHONY:        clean realclean docclean manpages doc lint all lib pyldns test
@@ -119,7 +120,7 @@ LINK_LIB    = $(LIBTOOL) --mode=link $(CC) $(strip $(CFLAGS) $(LDFLAGS) $(LIBS) -ve
 
 all:           copy-headers lib linktest manpages @PYLDNS@
 
-linktest:      $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/common.h ldns/config.h libldns.la
+linktest:      $(srcdir)/linktest.c $(LIBDNS_HEADERS) ldns/net.h ldns/util.h ldns/config.h libldns.la
                $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest
 
 lib:           libldns.la
@@ -139,12 +140,12 @@ $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))): include/ldns/%.h: $(src
                @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ;
                $(INSTALL) -c -m 644 $< ./include/ldns/
 
-include/ldns/util.h include/ldns/net.h include/ldns/common.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h
+include/ldns/util.h include/ldns/net.h include/ldns/config.h: include/ldns/%.h: ./ldns/%.h
                @if [ ! -d include ] ; then ($(INSTALL) -d include || echo "include exists") ; fi ;
                @if [ ! -d include/ldns ] ; then (cd include; ln -s ../ldns ./ldns || echo "include/ldns exists") ; fi ;
                $(INSTALL) -c -m 644 $< ./include/ldns/
 
-copy-headers:  $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/util.h include/ldns/net.h include/ldns/common.h include/ldns/config.h
+copy-headers:  $(addprefix include/ldns/, $(notdir $(LIBDNS_HEADERS))) include/ldns/util.h include/ldns/net.h include/ldns/config.h
 
 mancheck:
                sh -c 'find . -name \*.\[13\] -exec troff -z {} \;' 2>&1 | sed "s/^\.\///" | sed "s/\(:[0\-9]\+:\)/\1 warning:/g"
@@ -166,10 +167,10 @@ manpages: $(srcdir)/doc/function_manpages
 
 pyldns:                _ldns.la
 
-$(pywrapdir)/ldns_wrapper.c:   $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/util.h ldns/common.h ldns/config.h
+$(pywrapdir)/ldns_wrapper.c:   $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $(LIBDNS_HEADERS) ldns/util.h ldns/config.h
        $(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $<
 
-ldns_wrapper.lo:       $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/util.h ldns/common.h ldns/config.h
+ldns_wrapper.lo:       $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/util.h ldns/config.h
        $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) -c $< -o $@
 
 _ldns.la: ldns_wrapper.lo libldns.la 
@@ -177,7 +178,7 @@ _ldns.la: ldns_wrapper.lo libldns.la
 
 install:       install-h install-lib install-config install-manpages $(pyldns_inst)
 
-uninstall:     uninstall-config uninstall-manpages uninstall-h uninstall-lib $(pyldns_uninst)
+uninstall:     uninstall-manpages uninstall-h uninstall-lib $(pyldns_uninst)
 
 destclean:     uninstall
 
@@ -187,12 +188,6 @@ install-config:
                $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/; \
        fi
 
-uninstall-config:
-       if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
-               rm -f $(DESTDIR)$(bindir)/ldns-config; \
-               rmdir -p $(DESTDIR)$(bindir) || echo "ok, dir already gone"; \
-       fi
-
 install-manpages:      manpages
                ${INSTALL} -d $(DESTDIR)$(mandir)/man3
                for f in doc/man/man3/*; do \
@@ -209,15 +204,11 @@ install-h:        lib
                for i in $(LIBDNS_HEADERS); do \
                        $(INSTALL) -c -m 644 $$i $(DESTDIR)$(includedir)/ldns/; done
                $(INSTALL) -c -m 644 include/ldns/util.h $(DESTDIR)$(includedir)/ldns/
-               $(INSTALL) -c -m 644 include/ldns/common.h $(DESTDIR)$(includedir)/ldns/
                $(INSTALL) -c -m 644 include/ldns/net.h $(DESTDIR)$(includedir)/ldns/
 
 uninstall-h:
                for i in $(LIBDNS_HEADERS); do \
                        rm -f $(DESTDIR)$(includedir)/$$i; done
-               rm -f $(DESTDIR)$(includedir)/ldns/util.h
-               rm -f $(DESTDIR)$(includedir)/ldns/common.h
-               rm -f $(DESTDIR)$(includedir)/ldns/net.h
                [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone"
                exit 0
 
@@ -264,7 +255,6 @@ realclean: clean docclean libclean
        rm -f ldns/config.h.in
        rm -f ldns/config.h
        rm -f ldns/util.h
-       rm -f ldns/common.h
        rm -f config.h.in
        rm -f configure
        rm -f config.sub
@@ -285,7 +275,7 @@ libclean:
        $(LIBTOOL) --mode clean rm -f libldns.so
        $(LIBTOOL) --mode clean rm -f libldns.so.*
        $(LIBTOOL) --mode clean rm -f _ldns.la
-       rm -rf ldns/net.h ldns/util.h ldns/common.h ldns/config.h
+       rm -rf ldns/net.h ldns/util.h ldns/config.h
        rm -rf *.lo
        rm -rf .libs
        rm -rf libtool
index aa5d1b074f33f00076def1de86eecf0238fbeda4..12f88b37d3775169ae79d2b062606ce169079c94 100644 (file)
@@ -229,27 +229,10 @@ AC_C_BIGENDIAN
 
 # Checks for header files.
 AC_HEADER_STDC
-
-# AC_HEADER_STDBOOL
-# Below a workaround to export HAVE_STDBOOL_H and HAVE__BOOL as Output 
-# variables as well.
-#
-AC_CHECK_HEADER(stdbool.h, [
-AC_SUBST(HAVE_STDBOOL_H, 1)
-],[
-AC_SUBST(HAVE_STDBOOL_H, 0)
-],[AC_INCLUDES_DEFAULT])
-
-AC_CHECK_TYPES(_Bool,[
-AC_SUBST(HAVENOT__BOOL, 0)
-],[
-AC_SUBST(HAVENOT__BOOL, 1)
-],[AC_INCLUDES_DEFAULT])
-
 #AC_HEADER_SYS_WAIT
 #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h])
 # do the very minimum - we can always extend this
-AC_CHECK_HEADERS([getopt.h stdarg.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT])
+AC_CHECK_HEADERS([getopt.h stdarg.h stdbool.h openssl/ssl.h netinet/in.h time.h arpa/inet.h netdb.h],,, [AC_INCLUDES_DEFAULT])
 AC_CHECK_HEADERS(sys/param.h sys/mount.h,,,
 [AC_INCLUDES_DEFAULT
   [
@@ -510,7 +493,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
 #endif
 ])
 
-AC_CONFIG_FILES([Makefile ldns/common.h ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config])
+AC_CONFIG_FILES([Makefile ldns/net.h ldns/util.h packaging/libldns.pc packaging/ldns-config])
 
 AC_CONFIG_HEADER([ldns/config.h])
 AC_OUTPUT
similarity index 71%
rename from ldns/common.h.in
rename to ldns/common.h
index a515766e58a3c9a80172981eb5d9767bf46e00c3..cc7dd89d1adf9a8079a85ffe675333f8ae0259a0 100644 (file)
 #ifndef LDNS_COMMON_H
 #define LDNS_COMMON_H
 
-#if @HAVE_STDBOOL_H@
-# include <stdbool.h>
+#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
+
+#if defined(HAVE_STDBOOL_H)
+#include <stdbool.h>
 #else
-# if @HAVENOT__BOOL@
-#  ifdef __cplusplus
-typedef bool _Bool;
-#  else
-#   define _Bool signed char
-#  endif
-# endif
-# define bool _Bool
-# define false 0
-# define true 1
-# define __bool_true_false_are_defined 1
+
+/*@ignore@*/
+/* splint barfs on this construct */
+typedef unsigned int bool;
+#define bool bool
+#define false 0
+#define true  1
+#define __bool_true_false_are_defined 1
+/*@end@*/
+
+#endif
+
 #endif
 
 #ifdef HAVE_ATTR_FORMAT