From: Wouter Wijngaards Date: Tue, 25 Aug 2009 12:10:24 +0000 (+0000) Subject: yylex_destroy configure. X-Git-Tag: release-1.4.0rc1~124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6770898042310874059fadb30408cbf74b5c05ea;p=thirdparty%2Funbound.git yylex_destroy configure. git-svn-id: file:///svn/unbound/trunk@1779 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index 982df150d..71c0be288 100644 --- a/config.h.in +++ b/config.h.in @@ -323,6 +323,9 @@ /* Define to 1 if you have the `_beginthreadex' function. */ #undef HAVE__BEGINTHREADEX +/* if lex has yylex_destroy */ +#undef LEX_HAS_YYLEX_DESTROY + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/configure b/configure index b3f355949..74c5f525e 100755 --- a/configure +++ b/configure @@ -6155,6 +6155,8 @@ if test "$srcdir" != "."; then CPPFLAGS="$CPPFLAGS -I$srcdir" fi + + for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -6368,6 +6370,20 @@ fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi + + { $as_echo "$as_me:$LINENO: checking for yylex_destroy" >&5 +$as_echo_n "checking for yylex_destroy... " >&6; } + if echo %% | $LEX -t 2>&1 | grep yylex_destroy >/dev/null 2>&1; then + +cat >>confdefs.h <<\_ACEOF +#define LEX_HAS_YYLEX_DESTROY 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; fi + for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -7262,13 +7278,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:7265: $ac_compile\"" >&5) + (eval echo "\"\$as_me:7281: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:7268: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:7284: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:7271: output\"" >&5) + (eval echo "\"\$as_me:7287: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -8473,7 +8489,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 8476 "configure"' > conftest.$ac_ext + echo '#line 8492 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9840,11 +9856,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:9843: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9859: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9847: \$? = $ac_status" >&5 + echo "$as_me:9863: \$? = $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. @@ -10179,11 +10195,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:10182: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10198: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10186: \$? = $ac_status" >&5 + echo "$as_me:10202: \$? = $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. @@ -10284,11 +10300,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:10287: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10303: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10291: \$? = $ac_status" >&5 + echo "$as_me:10307: \$? = $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 @@ -10339,11 +10355,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:10342: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10358: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10346: \$? = $ac_status" >&5 + echo "$as_me:10362: \$? = $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 @@ -13142,7 +13158,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13145 "configure" +#line 13161 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13238,7 +13254,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 13241 "configure" +#line 13257 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/configure.ac b/configure.ac index 3d1d2c4e3..900e4510b 100644 --- a/configure.ac +++ b/configure.ac @@ -182,7 +182,16 @@ if test "$srcdir" != "."; then CPPFLAGS="$CPPFLAGS -I$srcdir" fi +AC_DEFUN([ACX_YYLEX_DESTROY], [ + AC_MSG_CHECKING([for yylex_destroy]) + if echo %% | $LEX -t 2>&1 | grep yylex_destroy >/dev/null 2>&1; then + AC_DEFINE(LEX_HAS_YYLEX_DESTROY, 1, [if lex has yylex_destroy]) + AC_MSG_RESULT(yes) + else AC_MSG_RESULT(no); fi +]) + AC_PROG_LEX +ACX_YYLEX_DESTROY AC_PROG_YACC AC_CHECK_PROG(doxygen, doxygen, doxygen) AC_CHECK_TOOL(STRIP, strip) diff --git a/doc/Changelog b/doc/Changelog index b8e5604e2..50c6c6295 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,7 @@ - autotrust options: add-holddown, del-holddown, keep-missing. - autotrust store revoked status of trust points. - ctime_r compat definition. + - detect yylex_destroy(). 24 August 2009: Wouter - cleaner memory allocation on exit. autotrust test routines. diff --git a/util/config_file.c b/util/config_file.c index 2ce763905..60e53242a 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -61,8 +61,10 @@ int ub_c_lex(void); int ub_c_wrap(void); /** print error with file and line number */ void ub_c_error(const char *message); +#ifdef LEX_HAS_YYLEX_DESTROY /** remove buffers for parsing and init */ void ub_c_lex_destroy(void); +#endif /** init ports possible for use */ static void init_outgoing_availports(int* array, int num); @@ -475,7 +477,9 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot) create_cfg_parser(cfg, fname, chroot); ub_c_in = in; ub_c_parse(); +#ifdef LEX_HAS_YYLEX_DESTROY ub_c_lex_destroy(); +#endif fclose(in); if(cfg_parser->errors != 0) {