Changeset 449


Ignore:
Timestamp:
Feb 26, 2009, 7:04:44 PM (11 years ago)
Author:
fielding@…
Message:

If lex is actually flex (as it is on Mac OS X), then the -l flag is
required in order to support yylineo. make uses LFLAGS to set flags
for the automatic rule for running lex.

Location:
abnfparser/bap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • abnfparser/bap/Makefile.in

    r407 r449  
    77
    88CFLAGS= @CFLAGS@ @DEFS@ -DYYDEBUG
     9LFLAGS= @FLEXFLAGS@
    910YACC=   @YACC@ -d -v
    1011CC=     @CC@
  • abnfparser/bap/configure

    r407 r449  
    272272PACKAGE_BUGREPORT=''
    273273
    274 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT YACC LIBOBJS LTLIBOBJS'
     274ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT YACC LEX LEXLIB LEX_OUTPUT_ROOT FLEXFLAGS LIBOBJS LTLIBOBJS'
    275275ac_subst_files=''
    276276
     
    22382238
    22392239
     2240for ac_prog in flex lex
     2241do
     2242  # Extract the first word of "$ac_prog", so it can be a program name with args.
     2243set dummy $ac_prog; ac_word=$2
     2244echo "$as_me:$LINENO: checking for $ac_word" >&5
     2245echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2246if test "${ac_cv_prog_LEX+set}" = set; then
     2247  echo $ECHO_N "(cached) $ECHO_C" >&6
     2248else
     2249  if test -n "$LEX"; then
     2250  ac_cv_prog_LEX="$LEX" # Let the user override the test.
     2251else
     2252as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2253for as_dir in $PATH
     2254do
     2255  IFS=$as_save_IFS
     2256  test -z "$as_dir" && as_dir=.
     2257  for ac_exec_ext in '' $ac_executable_extensions; do
     2258  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2259    ac_cv_prog_LEX="$ac_prog"
     2260    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2261    break 2
     2262  fi
     2263done
     2264done
     2265
     2266fi
     2267fi
     2268LEX=$ac_cv_prog_LEX
     2269if test -n "$LEX"; then
     2270  echo "$as_me:$LINENO: result: $LEX" >&5
     2271echo "${ECHO_T}$LEX" >&6
     2272else
     2273  echo "$as_me:$LINENO: result: no" >&5
     2274echo "${ECHO_T}no" >&6
     2275fi
     2276
     2277  test -n "$LEX" && break
     2278done
     2279test -n "$LEX" || LEX=":"
     2280
     2281if test -z "$LEXLIB"
     2282then
     2283  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
     2284echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
     2285if test "${ac_cv_lib_fl_yywrap+set}" = set; then
     2286  echo $ECHO_N "(cached) $ECHO_C" >&6
     2287else
     2288  ac_check_lib_save_LIBS=$LIBS
     2289LIBS="-lfl  $LIBS"
     2290cat >conftest.$ac_ext <<_ACEOF
     2291/* confdefs.h.  */
     2292_ACEOF
     2293cat confdefs.h >>conftest.$ac_ext
     2294cat >>conftest.$ac_ext <<_ACEOF
     2295/* end confdefs.h.  */
     2296
     2297/* Override any gcc2 internal prototype to avoid an error.  */
     2298#ifdef __cplusplus
     2299extern "C"
     2300#endif
     2301/* We use char because int might match the return type of a gcc2
     2302   builtin and then its argument prototype would still apply.  */
     2303char yywrap ();
     2304int
     2305main ()
     2306{
     2307yywrap ();
     2308  ;
     2309  return 0;
     2310}
     2311_ACEOF
     2312rm -f conftest.$ac_objext conftest$ac_exeext
     2313if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2314  (eval $ac_link) 2>conftest.er1
     2315  ac_status=$?
     2316  grep -v '^ *+' conftest.er1 >conftest.err
     2317  rm -f conftest.er1
     2318  cat conftest.err >&5
     2319  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2320  (exit $ac_status); } &&
     2321         { ac_try='test -z "$ac_c_werror_flag"
     2322                         || test ! -s conftest.err'
     2323  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2324  (eval $ac_try) 2>&5
     2325  ac_status=$?
     2326  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2327  (exit $ac_status); }; } &&
     2328         { ac_try='test -s conftest$ac_exeext'
     2329  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2330  (eval $ac_try) 2>&5
     2331  ac_status=$?
     2332  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2333  (exit $ac_status); }; }; then
     2334  ac_cv_lib_fl_yywrap=yes
     2335else
     2336  echo "$as_me: failed program was:" >&5
     2337sed 's/^/| /' conftest.$ac_ext >&5
     2338
     2339ac_cv_lib_fl_yywrap=no
     2340fi
     2341rm -f conftest.err conftest.$ac_objext \
     2342      conftest$ac_exeext conftest.$ac_ext
     2343LIBS=$ac_check_lib_save_LIBS
     2344fi
     2345echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
     2346echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
     2347if test $ac_cv_lib_fl_yywrap = yes; then
     2348  LEXLIB="-lfl"
     2349else
     2350  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
     2351echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
     2352if test "${ac_cv_lib_l_yywrap+set}" = set; then
     2353  echo $ECHO_N "(cached) $ECHO_C" >&6
     2354else
     2355  ac_check_lib_save_LIBS=$LIBS
     2356LIBS="-ll  $LIBS"
     2357cat >conftest.$ac_ext <<_ACEOF
     2358/* confdefs.h.  */
     2359_ACEOF
     2360cat confdefs.h >>conftest.$ac_ext
     2361cat >>conftest.$ac_ext <<_ACEOF
     2362/* end confdefs.h.  */
     2363
     2364/* Override any gcc2 internal prototype to avoid an error.  */
     2365#ifdef __cplusplus
     2366extern "C"
     2367#endif
     2368/* We use char because int might match the return type of a gcc2
     2369   builtin and then its argument prototype would still apply.  */
     2370char yywrap ();
     2371int
     2372main ()
     2373{
     2374yywrap ();
     2375  ;
     2376  return 0;
     2377}
     2378_ACEOF
     2379rm -f conftest.$ac_objext conftest$ac_exeext
     2380if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2381  (eval $ac_link) 2>conftest.er1
     2382  ac_status=$?
     2383  grep -v '^ *+' conftest.er1 >conftest.err
     2384  rm -f conftest.er1
     2385  cat conftest.err >&5
     2386  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2387  (exit $ac_status); } &&
     2388         { ac_try='test -z "$ac_c_werror_flag"
     2389                         || test ! -s conftest.err'
     2390  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2391  (eval $ac_try) 2>&5
     2392  ac_status=$?
     2393  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2394  (exit $ac_status); }; } &&
     2395         { ac_try='test -s conftest$ac_exeext'
     2396  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2397  (eval $ac_try) 2>&5
     2398  ac_status=$?
     2399  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2400  (exit $ac_status); }; }; then
     2401  ac_cv_lib_l_yywrap=yes
     2402else
     2403  echo "$as_me: failed program was:" >&5
     2404sed 's/^/| /' conftest.$ac_ext >&5
     2405
     2406ac_cv_lib_l_yywrap=no
     2407fi
     2408rm -f conftest.err conftest.$ac_objext \
     2409      conftest$ac_exeext conftest.$ac_ext
     2410LIBS=$ac_check_lib_save_LIBS
     2411fi
     2412echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
     2413echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
     2414if test $ac_cv_lib_l_yywrap = yes; then
     2415  LEXLIB="-ll"
     2416fi
     2417
     2418fi
     2419
     2420fi
     2421
     2422if test "x$LEX" != "x:"; then
     2423  echo "$as_me:$LINENO: checking lex output file root" >&5
     2424echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
     2425if test "${ac_cv_prog_lex_root+set}" = set; then
     2426  echo $ECHO_N "(cached) $ECHO_C" >&6
     2427else
     2428  # The minimal lex program is just a single line: %%.  But some broken lexes
     2429# (Solaris, I think it was) want two %% lines, so accommodate them.
     2430cat >conftest.l <<_ACEOF
     2431%%
     2432%%
     2433_ACEOF
     2434{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
     2435  (eval $LEX conftest.l) 2>&5
     2436  ac_status=$?
     2437  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2438  (exit $ac_status); }
     2439if test -f lex.yy.c; then
     2440  ac_cv_prog_lex_root=lex.yy
     2441elif test -f lexyy.c; then
     2442  ac_cv_prog_lex_root=lexyy
     2443else
     2444  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
     2445echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
     2446   { (exit 1); exit 1; }; }
     2447fi
     2448fi
     2449echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
     2450echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
     2451rm -f conftest.l
     2452LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
     2453
     2454echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
     2455echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
     2456if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
     2457  echo $ECHO_N "(cached) $ECHO_C" >&6
     2458else
     2459  # POSIX says lex can declare yytext either as a pointer or an array; the
     2460# default is implementation-dependent. Figure out which it is, since
     2461# not all implementations provide the %pointer and %array declarations.
     2462ac_cv_prog_lex_yytext_pointer=no
     2463echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
     2464ac_save_LIBS=$LIBS
     2465LIBS="$LIBS $LEXLIB"
     2466cat >conftest.$ac_ext <<_ACEOF
     2467`cat $LEX_OUTPUT_ROOT.c`
     2468_ACEOF
     2469rm -f conftest.$ac_objext conftest$ac_exeext
     2470if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     2471  (eval $ac_link) 2>conftest.er1
     2472  ac_status=$?
     2473  grep -v '^ *+' conftest.er1 >conftest.err
     2474  rm -f conftest.er1
     2475  cat conftest.err >&5
     2476  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2477  (exit $ac_status); } &&
     2478         { ac_try='test -z "$ac_c_werror_flag"
     2479                         || test ! -s conftest.err'
     2480  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2481  (eval $ac_try) 2>&5
     2482  ac_status=$?
     2483  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2484  (exit $ac_status); }; } &&
     2485         { ac_try='test -s conftest$ac_exeext'
     2486  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     2487  (eval $ac_try) 2>&5
     2488  ac_status=$?
     2489  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     2490  (exit $ac_status); }; }; then
     2491  ac_cv_prog_lex_yytext_pointer=yes
     2492else
     2493  echo "$as_me: failed program was:" >&5
     2494sed 's/^/| /' conftest.$ac_ext >&5
     2495
     2496fi
     2497rm -f conftest.err conftest.$ac_objext \
     2498      conftest$ac_exeext conftest.$ac_ext
     2499LIBS=$ac_save_LIBS
     2500rm -f "${LEX_OUTPUT_ROOT}.c"
     2501
     2502fi
     2503echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
     2504echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
     2505if test $ac_cv_prog_lex_yytext_pointer = yes; then
     2506
     2507cat >>confdefs.h <<\_ACEOF
     2508#define YYTEXT_POINTER 1
     2509_ACEOF
     2510
     2511fi
     2512
     2513fi
     2514if test "$LEX" = "flex"; then
     2515        FLEXFLAGS="-l"
     2516fi
     2517
     2518
    22402519
    22412520for ac_func in hcreate
     
    29733252s,@OBJEXT@,$OBJEXT,;t t
    29743253s,@YACC@,$YACC,;t t
     3254s,@LEX@,$LEX,;t t
     3255s,@LEXLIB@,$LEXLIB,;t t
     3256s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
     3257s,@FLEXFLAGS@,$FLEXFLAGS,;t t
    29753258s,@LIBOBJS@,$LIBOBJS,;t t
    29763259s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  • abnfparser/bap/configure.ac

    r407 r449  
    2727dnl fi
    2828
     29AC_PROG_LEX
     30if test "$LEX" = "flex"; then
     31        FLEXFLAGS="-l"
     32fi
     33AC_SUBST(FLEXFLAGS)
     34
    2935AC_REPLACE_FUNCS(hcreate)
    3036
Note: See TracChangeset for help on using the changeset viewer.