From: Wouter Wijngaards Date: Thu, 5 Feb 2009 14:01:37 +0000 (+0000) Subject: option to force builtin ldns version. X-Git-Tag: release-1.3.0~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e0d34659bbab9514191a66fc9de307bb921104b;p=thirdparty%2Funbound.git option to force builtin ldns version. git-svn-id: file:///svn/unbound/trunk@1454 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/configure b/configure index 0b1f96aef..3d4b28c30 100755 --- a/configure +++ b/configure @@ -1485,8 +1485,7 @@ Optional Packages: an explicit path). Slower, but allows use of large outgoing port ranges. --with-ldns=PATH specify prefix of path of ldns library to use - - + --with-ldns-builtin forces use of package included with this one Some influential environment variables: CC C compiler command @@ -6195,7 +6194,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 6198 "configure"' > conftest.$ac_ext + echo '#line 6197 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7509,11 +7508,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7512: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7511: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7516: \$? = $ac_status" >&5 + echo "$as_me:7515: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7799,11 +7798,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7802: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7801: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7806: \$? = $ac_status" >&5 + echo "$as_me:7805: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7903,11 +7902,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7906: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7905: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7910: \$? = $ac_status" >&5 + echo "$as_me:7909: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10254,7 +10253,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12776: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12781: \$? = $ac_status" >&5 + echo "$as_me:12780: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12878,11 +12877,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12881: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12880: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12885: \$? = $ac_status" >&5 + echo "$as_me:12884: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14442,11 +14441,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14445: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14444: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14449: \$? = $ac_status" >&5 + echo "$as_me:14448: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14546,11 +14545,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14549: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14548: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14553: \$? = $ac_status" >&5 + echo "$as_me:14552: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16735,11 +16734,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16738: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16737: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16742: \$? = $ac_status" >&5 + echo "$as_me:16741: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17025,11 +17024,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17028: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17027: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17032: \$? = $ac_status" >&5 + echo "$as_me:17031: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17129,11 +17128,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17132: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17131: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17136: \$? = $ac_status" >&5 + echo "$as_me:17135: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -26417,19 +26416,31 @@ done # check this after all other compilation checks, since the linking of the lib # may break checks after this. +use_ldns_builtin="no" # Check whether --with-ldns was given. if test "${with_ldns+set}" = set; then withval=$with_ldns; specialldnsdir="$withval" - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval -L$withval/lib -lldns" + CPPFLAGS="-I$withval/include $CPPFLAGS" + LDFLAGS="-L$withval -L$withval/lib $LDFLAGS -lldns" ldnsdir="$withval" fi -{ echo "$as_me:$LINENO: checking for ldns_buffer_copy in -lldns" >&5 + +# Check whether --with-ldns-builtin was given. +if test "${with_ldns_builtin+set}" = set; then + withval=$with_ldns_builtin; + use_ldns_builtin="yes" + +fi + + +# check if ldns is good enough +if test "$use_ldns_builtin" = "no"; then + { echo "$as_me:$LINENO: checking for ldns_buffer_copy in -lldns" >&5 echo $ECHO_N "checking for ldns_buffer_copy in -lldns... $ECHO_C" >&6; } if test "${ac_cv_lib_ldns_ldns_buffer_copy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -26563,7 +26574,7 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for ldns_b32_ntop_extended_hex" >&5 + { echo "$as_me:$LINENO: checking for ldns_b32_ntop_extended_hex" >&5 echo $ECHO_N "checking for ldns_b32_ntop_extended_hex... $ECHO_C" >&6; } if test "${ac_cv_func_ldns_b32_ntop_extended_hex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -26648,7 +26659,7 @@ if test $ac_cv_func_ldns_b32_ntop_extended_hex = yes; then : else - { { echo "$as_me:$LINENO: error: ldns version too old, need >=1.4.0" >&5 + { { echo "$as_me:$LINENO: error: ldns version too old, need >=1.4.0" >&5 echo "$as_me: error: ldns version too old, need >=1.4.0" >&2;} { (exit 1); exit 1; }; } fi @@ -26656,6 +26667,13 @@ fi else + use_ldns_builtin="yes" + +fi + +fi + +if test "$use_ldns_builtin" = "yes"; then if test ! -f $srcdir/ldns-src.tar.gz; then { { echo "$as_me:$LINENO: error: No ldns library found and no ldns-src.tar.gz, use --with-ldns=path." >&5 echo "$as_me: error: No ldns library found and no ldns-src.tar.gz, use --with-ldns=path." >&2;} @@ -26663,7 +26681,6 @@ echo "$as_me: error: No ldns library found and no ldns-src.tar.gz, use --with-ld fi echo "****************************************************************" echo "*** ***" -echo "*** ldns library not found (--with-ldns= to specify by hand) ***" echo "*** Building ldns library from package included in this one. ***" echo "*** ***" echo "****************************************************************" @@ -26677,9 +26694,7 @@ subdirs="$subdirs ldns-src" CPPFLAGS="-I$ldnsdir/include $CPPFLAGS" LDFLAGS="$LDFLAGS $ldnsdir/*.lo" - fi - LDFLAGS="$LATE_LDFLAGS $LDFLAGS" diff --git a/configure.ac b/configure.ac index 48a4385e8..91202521b 100644 --- a/configure.ac +++ b/configure.ac @@ -1032,28 +1032,40 @@ AC_REPLACE_FUNCS(gmtime_r) # check this after all other compilation checks, since the linking of the lib # may break checks after this. -AC_ARG_WITH(ldns, - AC_HELP_STRING([--with-ldns=PATH specify prefix of path of ldns library to use]) - , [ specialldnsdir="$withval" - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval -L$withval/lib -lldns" +use_ldns_builtin="no" +AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATH], + [specify prefix of path of ldns library to use]), + [ specialldnsdir="$withval" + CPPFLAGS="-I$withval/include $CPPFLAGS" + LDFLAGS="-L$withval -L$withval/lib $LDFLAGS -lldns" ldnsdir="$withval" AC_SUBST(ldnsdir) ]) -AC_CHECK_LIB(ldns, ldns_buffer_copy, [ -dnl ldns was found, check compat functions -AC_CHECK_LIB(ldns, [ldns_rr_free]) -AC_CHECK_FUNC([ldns_b32_ntop_extended_hex],, [ - AC_MSG_ERROR([ldns version too old, need >=1.4.0])]) -] , [ +AC_ARG_WITH(ldns-builtin, AC_HELP_STRING([--with-ldns-builtin], + [forces use of package included with this one]), [ + use_ldns_builtin="yes" +]) + +# check if ldns is good enough +if test "$use_ldns_builtin" = "no"; then + AC_CHECK_LIB(ldns, ldns_buffer_copy, [ + dnl ldns was found, check compat functions + AC_CHECK_LIB(ldns, [ldns_rr_free]) + AC_CHECK_FUNC([ldns_b32_ntop_extended_hex],, [ + AC_MSG_ERROR([ldns version too old, need >=1.4.0])]) + ] , [ + use_ldns_builtin="yes" + ]) +fi + +if test "$use_ldns_builtin" = "yes"; then dnl use the builtin ldns-src.tar.gz file to build ldns. if test ! -f $srcdir/ldns-src.tar.gz; then AC_MSG_ERROR([No ldns library found and no ldns-src.tar.gz, use --with-ldns=path.]) fi echo "****************************************************************" echo "*** ***" -echo "*** ldns library not found (--with-ldns= to specify by hand) ***" echo "*** Building ldns library from package included in this one. ***" echo "*** ***" echo "****************************************************************" @@ -1065,7 +1077,8 @@ AC_CONFIG_SUBDIRS([ldns-src]) CPPFLAGS="-I$ldnsdir/include $CPPFLAGS" LDFLAGS="$LDFLAGS $ldnsdir/*.lo" AC_SUBST(ldnsdir) -]) +fi dnl end of use_ldns_builtin == yes + LDFLAGS="$LATE_LDFLAGS $LDFLAGS" AC_DEFINE_UNQUOTED([MAXSYSLOGMSGLEN], [5120], [Define to the maximum message length to pass to syslog.]) diff --git a/doc/Changelog b/doc/Changelog index 5ea311b47..bd76d2549 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -11,6 +11,10 @@ - MacOSX Leopard cleaner text output from configure. - initgroups(3) is called to drop secondary group permissions, if applicable. + - configure option --with-ldns-builtin forces the use of the + inluded ldns package with the unbound source. The -I include + is put before the others, so it avoids bad include files from + an older ldns install. 4 February 2009: Wouter - tag for release 1.2.1. diff --git a/doc/TODO b/doc/TODO index 58bbe3eba..fdd2177bb 100644 --- a/doc/TODO +++ b/doc/TODO @@ -57,7 +57,6 @@ o on windows version, implement that OS ancillary data capabilities for o local-zone directive with authority service, full authority server is a non-goal. -o configure option to force use of builtin ldns tarball. o make so revoke bit keys cannot verify signatures o option to print UTC timestamps instead of epoch in seconds. o print querier IP address on high loglevels. @@ -74,4 +73,3 @@ o see if we can use daemon(3), cleaner posix usage. o see if we can include the python bindings (contrib). o see if we can suport var:value (nospace) by parser. o remote control read ssl information while priviledged. -o call initgroups(3) to drop secondary group permissions.