diff --git a/Makefile.in b/Makefile.in index a2e93e845..d06594d4f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,7 @@ LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ LIBOBJS=@LIBOBJS@ RUNTIME_PATH=@RUNTIME_PATH@ +DEPFLAG=@DEPFLAG@ DATE=$(shell date +%Y%m%d) LIBTOOL=$(libtool) ifeq "$(QUIET)" "yes" @@ -327,7 +328,7 @@ $(BUILD)%.d: $(srcdir)/%.c @if test ! -z "$(ldnsdir)" -a ! -e $(ldnsdir)/include/ldns/ldns.h; \ then (cd $(ldnsdir); $(MAKE) copy-headers); fi @-if test ! -d $(dir $@); then $(INSTALL) -d $(patsubst %/,%,$(dir $@)); fi - $Q$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< \ + $Q$(SHELL) -ec '$(CC) $(DEPFLAG) $(CPPFLAGS) $(CFLAGS) $< \ | sed '\''s!\(.*\)\.o[ :]*!$(dir $@)\1.lo $@ : !g'\'' > $@; \ [ -s $@ ] || rm -f $@' diff --git a/configure b/configure index e368f73f0..51eb415b6 100755 --- a/configure +++ b/configure @@ -819,6 +819,7 @@ UNBOUND_RUN_DIR UNBOUND_CHROOT_DIR UNBOUND_PIDFILE UNBOUND_USERNAME +DEPFLAG debug_enabled libtool AR @@ -3403,6 +3404,8 @@ _ACEOF + + # if the given code compiles without the flag, execute argument 4 # if the given code only compiles with the flag, execute argument 3 # otherwise fail, execute argument 5. @@ -3584,6 +3587,87 @@ echo "${ECHO_T}no" >&6; } fi +# test DEPFLAG +{ echo "$as_me:$LINENO: checking $CC dependency flag" >&5 +echo $ECHO_N "checking $CC dependency flag... $ECHO_C" >&6; } +echo 'void f(){}' >conftest.c +if test "`$CC -MM conftest.c 2>&1`" = "conftest.o: conftest.c"; then + DEPFLAG="-MM" +else + if test "`$CC -xM1 conftest.c 2>&1`" = "conftest.o: conftest.c"; then + DEPFLAG="-xM1" + else + DEPFLAG="-MM" # dunno do something + fi +fi +{ echo "$as_me:$LINENO: result: $DEPFLAG" >&5 +echo "${ECHO_T}$DEPFLAG" >&6; } +rm -f conftest.c + + + + +{ echo "$as_me:$LINENO: checking whether $CC supports -std=c99" >&5 +echo $ECHO_N "checking whether $CC supports -std=c99... $ECHO_C" >&6; } +cache=`echo std=c99 | sed 'y%.=/+-%___p_%'` +if { as_var=cv_prog_cc_flag_$cache; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo 'void f(){}' >conftest.c +if test -z "`$CC -std=c99 -c conftest.c 2>&1`"; then +eval "cv_prog_cc_flag_$cache=yes" +else +eval "cv_prog_cc_flag_$cache=no" +fi +rm -f conftest* + +fi + +if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +: +C99FLAG="-std=c99" +else +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +: + +fi + + + +{ echo "$as_me:$LINENO: checking whether $CC supports -xc99" >&5 +echo $ECHO_N "checking whether $CC supports -xc99... $ECHO_C" >&6; } +cache=`echo xc99 | sed 'y%.=/+-%___p_%'` +if { as_var=cv_prog_cc_flag_$cache; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo 'void f(){}' >conftest.c +if test -z "`$CC -xc99 -c conftest.c 2>&1`"; then +eval "cv_prog_cc_flag_$cache=yes" +else +eval "cv_prog_cc_flag_$cache=no" +fi +rm -f conftest* + +fi + +if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +: +C99FLAG="-xc99" +else +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +: + +fi + + { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then @@ -3951,9 +4035,74 @@ done -{ echo "$as_me:$LINENO: checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC" >&5 -echo $ECHO_N "checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC... $ECHO_C" >&6; } -cache=`echo -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE | sed 'y%.=/+- %___p__%'` + +{ echo "$as_me:$LINENO: checking whether $CC supports -Werror" >&5 +echo $ECHO_N "checking whether $CC supports -Werror... $ECHO_C" >&6; } +cache=`echo Werror | sed 'y%.=/+-%___p_%'` +if { as_var=cv_prog_cc_flag_$cache; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo 'void f(){}' >conftest.c +if test -z "`$CC -Werror -c conftest.c 2>&1`"; then +eval "cv_prog_cc_flag_$cache=yes" +else +eval "cv_prog_cc_flag_$cache=no" +fi +rm -f conftest* + +fi + +if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +: +ERRFLAG="-Werror" +else +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +: +ERRFLAG="-errwarn" +fi + + + +{ echo "$as_me:$LINENO: checking whether $CC supports -Wall" >&5 +echo $ECHO_N "checking whether $CC supports -Wall... $ECHO_C" >&6; } +cache=`echo Wall | sed 'y%.=/+-%___p_%'` +if { as_var=cv_prog_cc_flag_$cache; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +echo 'void f(){}' >conftest.c +if test -z "`$CC -Wall -c conftest.c 2>&1`"; then +eval "cv_prog_cc_flag_$cache=yes" +else +eval "cv_prog_cc_flag_$cache=no" +fi +rm -f conftest* + +fi + +if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +: +ERRFLAG="$ERRFLAG -Wall" +else +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +: +ERRFLAG="$ERRFLAG -errfmt" +fi + + + + + +{ echo "$as_me:$LINENO: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC" >&5 +echo $ECHO_N "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE as a flag for $CC... $ECHO_C" >&6; } +cache=`echo $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE | sed 'y%.=/+- %___p__%'` if { as_var=cv_prog_cc_flag_needed_$cache; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3980,6 +4129,8 @@ int test() { time_t time = 0; char *buf = NULL; const char* str = NULL; + struct msghdr msg; + msg.msg_control = 0; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); @@ -3990,18 +4141,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4014,11 +4165,16 @@ if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : -CFLAGS="$CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE" +CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE" else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4032,9 +4188,10 @@ fi -{ echo "$as_me:$LINENO: checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC" >&5 -echo $ECHO_N "checking whether we need -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC... $ECHO_C" >&6; } -cache=`echo -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE | sed 'y%.=/+- %___p__%'` + +{ echo "$as_me:$LINENO: checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC" >&5 +echo $ECHO_N "checking whether we need $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE as a flag for $CC... $ECHO_C" >&6; } +cache=`echo $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE | sed 'y%.=/+- %___p__%'` if { as_var=cv_prog_cc_flag_needed_$cache; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4061,6 +4218,8 @@ int test() { time_t time = 0; char *buf = NULL; const char* str = NULL; + struct msghdr msg; + msg.msg_control = 0; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); @@ -4071,18 +4230,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4095,11 +4254,16 @@ if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : -CFLAGS="$CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE" +CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE" else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4113,9 +4277,10 @@ fi -{ echo "$as_me:$LINENO: checking whether we need -std=c99 as a flag for $CC" >&5 -echo $ECHO_N "checking whether we need -std=c99 as a flag for $CC... $ECHO_C" >&6; } -cache=`echo -std=c99 | sed 'y%.=/+- %___p__%'` + +{ echo "$as_me:$LINENO: checking whether we need $C99FLAG as a flag for $CC" >&5 +echo $ECHO_N "checking whether we need $C99FLAG as a flag for $CC... $ECHO_C" >&6; } +cache=`echo $C99FLAG | sed 'y%.=/+- %___p__%'` if { as_var=cv_prog_cc_flag_needed_$cache; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4129,18 +4294,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -std=c99 -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -std=c99 -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -std=c99 -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4153,11 +4318,16 @@ if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : -CFLAGS="$CFLAGS -std=c99" +CFLAGS="$CFLAGS $C99FLAG" else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $C99FLAG $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4171,6 +4341,7 @@ fi + { echo "$as_me:$LINENO: checking whether we need -D_BSD_SOURCE as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D_BSD_SOURCE as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D_BSD_SOURCE | sed 'y%.=/+- %___p__%'` @@ -4188,18 +4359,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D_BSD_SOURCE -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D_BSD_SOURCE -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D_BSD_SOURCE -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4217,6 +4388,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_BSD_SOURCE $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4230,6 +4406,7 @@ fi + { echo "$as_me:$LINENO: checking whether we need -D_GNU_SOURCE as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D_GNU_SOURCE as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D_GNU_SOURCE | sed 'y%.=/+- %___p__%'` @@ -4247,18 +4424,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D_GNU_SOURCE -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D_GNU_SOURCE -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D_GNU_SOURCE -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4276,6 +4453,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_GNU_SOURCE $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4292,6 +4474,7 @@ fi # otherwise we would get the previous cached result. + { echo "$as_me:$LINENO: checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D_GNU_SOURCE -D_FRSRESGID as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D_GNU_SOURCE -D_FRSRESGID | sed 'y%.=/+- %___p__%'` @@ -4309,18 +4492,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4338,6 +4521,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_GNU_SOURCE -D_FRSRESGID $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4351,6 +4539,7 @@ fi + { echo "$as_me:$LINENO: checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D_POSIX_C_SOURCE=200112 as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D_POSIX_C_SOURCE=200112 | sed 'y%.=/+- %___p__%'` @@ -4377,18 +4566,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D_POSIX_C_SOURCE=200112 -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D_POSIX_C_SOURCE=200112 -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D_POSIX_C_SOURCE=200112 -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4406,6 +4595,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_POSIX_C_SOURCE=200112 $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -4419,6 +4613,7 @@ fi + { echo "$as_me:$LINENO: checking whether we need -D__EXTENSIONS__ as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D__EXTENSIONS__ as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D__EXTENSIONS__ | sed 'y%.=/+- %___p__%'` @@ -4451,18 +4646,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D__EXTENSIONS__ -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D__EXTENSIONS__ -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D__EXTENSIONS__ -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -4480,6 +4675,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D__EXTENSIONS__ $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -5994,7 +6194,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5997 "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=$? @@ -7308,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:7311: $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:7315: \$? = $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. @@ -7598,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:7601: $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:7605: \$? = $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. @@ -7702,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:7705: $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:7709: \$? = $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 @@ -10053,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:12580: \$? = $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. @@ -12677,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:12680: $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:12684: \$? = $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 @@ -14241,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:14244: $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:14248: \$? = $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. @@ -14345,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:14348: $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:14352: \$? = $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 @@ -16534,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:16537: $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:16541: \$? = $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. @@ -16824,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:16827: $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:16831: \$? = $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. @@ -16928,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:16931: $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:16935: \$? = $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 @@ -24868,6 +25068,7 @@ fi + { echo "$as_me:$LINENO: checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC" >&5 echo $ECHO_N "checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC... $ECHO_C" >&6; } cache=`echo -D_LARGEFILE_SOURCE=1 | sed 'y%.=/+- %___p__%'` @@ -24883,18 +25084,18 @@ int test() { } ' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else -if test -z "`$CC $CFLAGS -D_LARGEFILE_SOURCE=1 -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1` #exit 1 fi @@ -24912,6 +25113,11 @@ else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1` +#exit 1 : else @@ -27162,6 +27368,7 @@ UNBOUND_RUN_DIR!$UNBOUND_RUN_DIR$ac_delim UNBOUND_CHROOT_DIR!$UNBOUND_CHROOT_DIR$ac_delim UNBOUND_PIDFILE!$UNBOUND_PIDFILE$ac_delim UNBOUND_USERNAME!$UNBOUND_USERNAME$ac_delim +DEPFLAG!$DEPFLAG$ac_delim debug_enabled!$debug_enabled$ac_delim libtool!$libtool$ac_delim AR!$AR$ac_delim @@ -27199,7 +27406,7 @@ subdirs!$subdirs$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 61828fe46..e7bf1bcff 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,14 @@ $3 fi ]) +dnl setup flags for CHECK_COMPILER_FLAG_NEEDED +AC_DEFUN([CHECK_ERROR_FLAGS], +[ +CHECK_COMPILER_FLAG(Werror, [ERRFLAG="-Werror"], [ERRFLAG="-errwarn"]) +CHECK_COMPILER_FLAG(Wall, [ERRFLAG="$ERRFLAG -Wall"], + [ERRFLAG="$ERRFLAG -errfmt"]) +]) + dnl routine to help check for needed compiler flags. # if the given code compiles without the flag, execute argument 4 # if the given code only compiles with the flag, execute argument 3 @@ -129,24 +137,25 @@ dnl routine to help check for needed compiler flags. AC_DEFUN([CHECK_COMPILER_FLAG_NEEDED], [ AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([CHECK_ERROR_FLAGS]) AC_MSG_CHECKING(whether we need $1 as a flag for $CC) cache=`echo $1 | sed 'y%.=/+- %___p__%'` AC_CACHE_VAL(cv_prog_cc_flag_needed_$cache, [ echo '$2' > conftest.c echo 'void f(){}' >>conftest.c -if test -z "`$CC $CFLAGS -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=no" else [ -if test -z "`$CC $CFLAGS $1 -Werror -Wall -c conftest.c 2>&1`"; then +if test -z "`$CC $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_needed_$cache=yes" else eval "cv_prog_cc_flag_needed_$cache=fail" #echo 'Test with flag fails too!' #cat conftest.c -#echo "$CC $CFLAGS $1 -Werror -Wall -c conftest.c 2>&1" -#echo `$CC $CFLAGS $1 -Werror -Wall -c conftest.c` +#echo "$CC $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1` #exit 1 fi ] @@ -160,6 +169,11 @@ $3 else if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then AC_MSG_RESULT(no) +#echo 'Test with flag is no!' +#cat conftest.c +#echo "$CC $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1" +#echo `$CC $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1` +#exit 1 : $4 else @@ -176,13 +190,32 @@ AC_LANG_C CHECK_COMPILER_FLAG(g, [CFLAGS="$CFLAGS -g"]) CHECK_COMPILER_FLAG(O2, [CFLAGS="$CFLAGS -O2"]) +# test DEPFLAG +AC_MSG_CHECKING([$CC dependency flag]) +echo 'void f(){}' >conftest.c +if test "`$CC -MM conftest.c 2>&1`" = "conftest.o: conftest.c"; then + DEPFLAG="-MM" +else + if test "`$CC -xM1 conftest.c 2>&1`" = "conftest.o: conftest.c"; then + DEPFLAG="-xM1" + else + DEPFLAG="-MM" # dunno do something + fi +fi +AC_MSG_RESULT($DEPFLAG) +rm -f conftest.c +AC_SUBST(DEPFLAG) + +CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"]) +CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"]) + AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT]) # MinGW32 tests AC_CHECK_HEADERS([winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) # end mingw32 tests -CHECK_COMPILER_FLAG_NEEDED(-std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE, +CHECK_COMPILER_FLAG_NEEDED($C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE, [ #include "confdefs.h" #include @@ -205,6 +238,8 @@ int test() { time_t time = 0; char *buf = NULL; const char* str = NULL; + struct msghdr msg; + msg.msg_control = 0; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); @@ -213,9 +248,9 @@ int test() { str = gai_strerror(0); return a; } -], [CFLAGS="$CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"]) +], [CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"]) -CHECK_COMPILER_FLAG_NEEDED(-std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE, +CHECK_COMPILER_FLAG_NEEDED($C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE, [ #include "confdefs.h" #include @@ -238,6 +273,8 @@ int test() { time_t time = 0; char *buf = NULL; const char* str = NULL; + struct msghdr msg; + msg.msg_control = 0; t = ctime_r(&time, buf); tv.tv_usec = 10; srandom(32); @@ -246,9 +283,9 @@ int test() { str = gai_strerror(0); return a; } -], [CFLAGS="$CFLAGS -std=c99 -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE"]) +], [CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE"]) -CHECK_COMPILER_FLAG_NEEDED(-std=c99, +CHECK_COMPILER_FLAG_NEEDED($C99FLAG, [ #include #include @@ -256,7 +293,7 @@ int test() { int a = 0; return a; } -], [CFLAGS="$CFLAGS -std=c99"]) +], [CFLAGS="$CFLAGS $C99FLAG"]) CHECK_COMPILER_FLAG_NEEDED(-D_BSD_SOURCE, [ diff --git a/doc/Changelog b/doc/Changelog index 3d744bc96..22ab00b77 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +15 January 2009: Wouter + - bug #229: fixup configure checks for compilation with Solaris + Sun cc compiler, ./configure CC=/opt/SUNWspro/bin/cc + 14 January 2009: Wouter - 1.2.1 feature: negative caching for failed queries. Queries that failed are cached for 5 seconds (NORR_TTL). diff --git a/util/data/msgreply.c b/util/data/msgreply.c index 5d732a759..888571e3e 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -320,6 +320,7 @@ get_rrset_trust(struct msg_parse* msg, struct rrset_parse* rrset) if(AA) return rrset_trust_add_AA; else return rrset_trust_add_noAA; } + /* NOTREACHED */ return rrset_trust_none; }