This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[toplevel] Make configure.in more autoconfy
- From: Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Mar 2004 04:34:02 -0500
- Subject: [toplevel] Make configure.in more autoconfy
I just wondered if there's a reason for these macro being expanded or
just (understandable) laziness.
Ok for mainline and src (please commit for me since I do not have access
to src)?
Paolo
2004-03-16 Paolo Bonzini <bonzini@gnu.org>
* configure.in (DEFAULT_YACC, DEFAULT_M4, DEFAULT_LEX):
Set with AC_CHECK_PROGS.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.276
diff -u -r1.276 configure.in
--- configure.in 16 Mar 2004 00:03:30 -0000 1.276
+++ configure.in 16 Mar 2004 09:34:25 -0000
@@ -1497,62 +1497,13 @@
tooldir='${exec_prefix}'/${target_alias}
build_tooldir=${tooldir}
-# Generate a default definition for YACC. This is used if the makefile can't
-# locate bison or byacc in objdir.
+# Generate default definitions for YACC, M4, FLEX. These are used if the
+# makefile can't locate these programs in objdir.
-for prog in 'bison -y' byacc yacc
-do
- set dummy $prog; tmp=$2
- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$tmp; then
- DEFAULT_YACC="$prog"
- break
- fi
- done
- IFS="$save_ifs"
-
- test -n "$DEFAULT_YACC" && break
-done
-
-# Generate a default definition for M4. This is used if the makefile can't
-# locate m4 in objdir.
-
-for prog in gm4 gnum4 m4
-do
- set dummy $prog; tmp=$2
- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$tmp; then
- DEFAULT_M4="$prog"
- break
- fi
- done
- IFS="$save_ifs"
-
- test -n "$DEFAULT_M4" && break
-done
-
-# Generate a default definition for LEX. This is used if the makefile can't
-# locate flex in objdir.
-
-for prog in flex lex
-do
- set dummy $prog; tmp=$2
- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$tmp; then
- DEFAULT_LEX="$prog"
- break
- fi
- done
- IFS="$save_ifs"
-
- test -n "$DEFAULT_LEX" && break
-done
+$MISSING=`cd $ac_aux_dir && pwd`/missing
+AC_CHECK_PROGS([DEFAULT_YACC], ['bison -y' byacc yacc], [$MISSING bison])
+AC_CHECK_PROGS([DEFAULT_M4], [gm4 gnum4 m4], [$MISSING m4])
+AC_CHECK_PROGS([DEFAULT_LEX], [flex lex], [$MISSING flex])
# FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
# Set up the list of links to be made.