autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some notes on the portability of Flex


From: Peter Eisentraut
Subject: Some notes on the portability of Flex
Date: Sat, 21 Oct 2000 00:11:45 +0200 (CEST)

The documentation now says under AC_PROG_LEX:

: You are encouraged to use Flex in your sources, since it is both
: more pleasant to use than plain Lex, and the C source it produces
: is portable.  But in order to ensure portability, you must either
: provide a function `yywrap', or if you don't use it (i.e., your
: scanner has no `#include'-like feature), simply include a
: `%noyywrap' statement in the scanner's source.  Once this done,
: the scanner is portable (well, unless _you_ felt free to use
: nonportable constructs) and does not depend on any library.  In
: this case, and in this case only, it is suggested that you use
: this Autoconf snippet:
: 
:      AC_PROG_LEX
:      if test "$LEX" != flex; then
:        LEX="$SHELL $missing_dir/missing flex"
:        AC_SUBST(LEX_OUTPUT_ROOT, lex.yy)
:        AC_SUBST(LEXLIB, '')
:      fi

This is confusing.  The wording seems to imply that you should use this
snipped in case you want to ensure portability to plain Lex.  Instead,
this snippet could be used to require Flex rather than plain Lex.

In any case, it's not a good idea to do this.  Some systems ship only
Flex, but only as "lex".  BSD/OS is one.

I've written a macro that detects Flex and Flex only:
<http://www.postgresql.org/cgi/cvsweb.cgi/pgsql/config/programs.m4>.

-- 
Peter Eisentraut      address@hidden       http://yi.org/peter-e/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]