www.delorie.com/gnu/docs/autoconf/autoconf_40.html   search  
Buy the book!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2.1 Particular Program Checks

These macros check for particular programs--whether they exist, and in some cases whether they support certain features.

Check for gawk, mawk, nawk, and awk, in that order, and set output variable AWK to the first one that is found. It tries gawk first because that is reported to be the best implementation.

Check for grep -E and egrep, in that order, and set output variable EGREP to the first one that is found.

Check for grep -F and fgrep, in that order, and set output variable FGREP to the first one that is found.

Set output variable INSTALL to the path of a BSD-compatible install program, if one is found in the current PATH. Otherwise, set INSTALL to `dir/install-sh -c', checking the directories specified to AC_CONFIG_AUX_DIR (or its default directories) to determine dir (see section 4.4 Outputting Files). Also set the variables INSTALL_PROGRAM and INSTALL_SCRIPT to `${INSTALL}' and INSTALL_DATA to `${INSTALL} -m 644'.

This macro screens out various instances of install known not to work. It prefers to find a C program rather than a shell script, for speed. Instead of `install-sh', it can also use `install.sh', but that name is obsolete because some make programs have a rule that creates `install' from it if there is no `Makefile'.

Autoconf comes with a copy of `install-sh' that you can use. If you use AC_PROG_INSTALL, you must include either `install-sh' or `install.sh' in your distribution, or configure will produce an error message saying it can't find them--even if the system you're on has a good install program. This check is a safety measure to prevent you from accidentally leaving that file out, which would prevent your package from installing on systems that don't have a BSD-compatible install program.

If you need to use your own installation program because it has features not found in standard install programs, there is no reason to use AC_PROG_INSTALL; just put the file name of your program into your `Makefile.in' files.

If flex is found, set output variable LEX to `flex' and LEXLIB to `-lfl', if that library is in a standard place. Otherwise set LEX to `lex' and LEXLIB to `-ll'.

Define YYTEXT_POINTER if yytext is a `char *' instead of a `char []'. Also set output variable LEX_OUTPUT_ROOT to the base of the file name that the lexer generates; usually `lex.yy', but sometimes something else. These results vary according to whether lex or flex is being used.

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. In order to ensure portability, however, you must either provide a function yywrap or, if you don't use it (e.g., your scanner has no `#include'-like feature), simply include a `%noyywrap' statement in the scanner's source. Once this done, the scanner is portable (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:

if test "$LEX" != flex; then
  LEX="$SHELL $missing_dir/missing flex"

The shell script missing can be found in the Automake distribution.

To ensure backward compatibility, Automake's AM_PROG_LEX invokes (indirectly) this macro twice, which will cause an annoying but benign "AC_PROG_LEX invoked multiple times" warning. Future versions of Automake will fix this issue; meanwhile, just ignore this message.

If `ln -s' works on the current file system (the operating system and file system support symbolic links), set the output variable LN_S to `ln -s'; otherwise, if `ln' works, set LN_S to `ln', and otherwise set it to `cp -p'.

If you make a link in a directory other than the current directory, its meaning depends on whether `ln' or `ln -s' is used. To safely create links using `$(LN_S)', either find out which form is used and adjust the arguments, or always invoke ln in the directory where the link is to be created.

In other words, it does not work to do:
$(LN_S) foo /x/bar

Instead, do:

(cd /x && $(LN_S) foo bar)

Set output variable RANLIB to `ranlib' if ranlib is found, and otherwise to `:' (do nothing).

If bison is found, set output variable YACC to `bison -y'. Otherwise, if byacc is found, set YACC to `byacc'. Otherwise set YACC to `yacc'.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003