This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Make handling of toplevel configure arguments autoconfy
- From: Bonzini <bonzini at gnu dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 Mar 2004 05:39:54 -0500
- Subject: Make handling of toplevel configure arguments autoconfy
This patch adds documentation for (hopefully) all the toplevel configure's
switches, and makes the code that handles the options somewhat more
consistent (see for example the capitalized variable ENABLE_LIBADA).
2004-03-17 Paolo Bonzini <bonzini@gnu.org>
* configure.in: Document options and adjust the spacing of
the help texts so as to align the descriptions.
* configure: Regenerated.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.277
diff -u -r1.277 configure.in
--- configure.in 16 Mar 2004 22:18:08 -0000 1.277
+++ configure.in 17 Mar 2004 10:41:34 -0000
@@ -207,15 +207,19 @@
# Noconfigdirs are removed loudly.
noconfigdirs=""
-use_gnu_ld=
# Make sure we don't let GNU ld be added if we didn't want it.
+use_gnu_ld=
+AC_ARG_WITH([gnu-ld],
+[ --with/--without-gnu-ld Control building of GNU ld in a combined tree])
if test x$with_gnu_ld = xno ; then
use_gnu_ld=no
noconfigdirs="$noconfigdirs ld"
fi
-use_gnu_as=
# Make sure we don't let GNU as be added if we didn't want it.
+use_gnu_as=
+AC_ARG_WITH([gnu-as],
+[ --with/--without-gnu-as Control building of GNU as in a combined tree])
if test x$with_gnu_as = xno ; then
use_gnu_as=no
noconfigdirs="$noconfigdirs gas"
@@ -308,16 +312,18 @@
esac
AC_ARG_ENABLE(libada,
-[ --enable-libada Builds libada directory],
-ENABLE_LIBADA=$enableval,
-ENABLE_LIBADA=yes)
-if test "${ENABLE_LIBADA}" != "yes" ; then
+[ --enable-libada Builds libada directory],,
+enable_libada=yes)
+if test "${enable_libada}" != "yes" ; then
noconfigdirs="$noconfigdirs target-libada"
fi
# Save it here so that, even in case of --enable-libgcj, if the Java
# front-end isn't enabled, we still get libgcj disabled.
-libgcj_saved=$libgcj
+AC_ARG_ENABLE(libgcj,
+[ --enable-libgcj Force building libgcj directory
+ --disable-libgcj Disable building libgcj directory],,
+enable_libgcj=default)
case $enable_libgcj in
yes)
# If we reset it here, it won't get added to noconfigdirs in the
@@ -1079,22 +1085,19 @@
# the environment variable $LANGUAGES if defined. $LANGUAGES might
# go away some day.
# NB: embedded tabs in this IF block -- do not untabify
+AC_ARG_ENABLE(languages,
+[ --enable-languages=LIST In gcc tree, pick languages to build],,
+[if test x"${enable_languages}" = x ||
+ test x"${enable_languages}" = xyes; then
+ AC_MSG_ERROR([--enable-languages needs at least one language argument])
+fi],
+[if test x"${LANGUAGES+set}" = xset; then
+ enable_languages="${LANGUAGES}"
+ AC_MSG_WARNING([setting LANGUAGES is deprecated, use --enable-languages]
+else
+ enable_languages=all
+fi])
if test -d ${srcdir}/gcc; then
- if test x"${enable_languages+set}" != xset; then
- if test x"${LANGUAGES+set}" = xset; then
- enable_languages="${LANGUAGES}"
- echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
- else
- enable_languages=all
- fi
- else
- if test x"${enable_languages}" = x ||
- test x"${enable_languages}" = xyes;
- then
- echo configure.in: --enable-languages needs at least one language argument 1>&2
- exit 1
- fi
- fi
enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'`
# First scan to see if an enabled language requires some other language.
@@ -1312,7 +1315,10 @@
# Handle --with-headers=XXX. If the value is not "yes", the contents of
# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+AC_ARG_WITH([headers],
+[ --with-headers=DIR When cross compiling, copy named directory to
+ \$(tooldir)/sys-include],
+[if test x"${with_headers}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-headers is only supported when cross compiling
exit 1
@@ -1324,12 +1330,15 @@
esac
copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
fi
-fi
+fi])
# Handle --with-libs=XXX. If the value is not "yes", the contents of
# the name directories are copied to $(tooldir)/lib. Multiple directories
# are permitted.
-if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
+AC_ARG_WITH([libs],
+[ --with-libs=DIR When cross compiling, copy named directories to
+ \$(tooldir)/lib],
+[if test x"${with_libs}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-libs is only supported when cross compiling
exit 1
@@ -1345,7 +1354,7 @@
copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
done
fi
-fi
+fi])
# Handle ${copy_dirs}
set fnord ${copy_dirs}
@@ -1466,6 +1475,8 @@
# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
# can detect this case.
+AC_ARG_WITH([newlib],
+[ --with/--without-newlib Control building of newlib in a combined tree])
if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then
with_newlib=yes
extra_host_args="$extra_host_args --with-newlib"
@@ -1473,6 +1484,8 @@
# Default to using --with-stabs for certain targets.
+AC_ARG_WITH([stabs],
+[ --with/--without-stabs Control usage of the STABS debug info format])
if test x${with_stabs} = x ; then
case "${target}" in
mips*-*-irix[[56]]*)
@@ -1616,8 +1629,11 @@
# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
# binutils tools will find libbfd.so.
+AC_ARG_ENABLE([shared],
+[ --enable-shared Build shared libraries],,
+[enable_shared=no])
case "${enable_shared}" in
- no | "") SET_LIB_PATH= ;;
+ no) SET_LIB_PATH= ;;
*) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
esac
@@ -1720,9 +1736,9 @@
AC_ARG_ENABLE([serial-configure],
[ --enable-serial-[{host,target,build}-]configure
- Force sequential configuration of
- sub-packages for the host, target or build
- machine, or all sub-packages])
+ Force sequential configuration of
+ sub-packages for the host, target or build
+ machine, or all sub-packages])
case ${enable_serial_configure} in
yes)
@@ -1847,9 +1863,9 @@
fi
# Default to --enable-multilib.
-if test x${enable_multilib} = x ; then
- target_configargs="--enable-multilib ${target_configargs}"
-fi
+AC_ARG_ENABLE([multilib],
+[ --enable-multilib Enable building multilibs],,
+[target_configargs="--enable-multilib ${target_configargs}"])
# Pass --with-newlib if appropriate. Note that target_configdirs has
# changed from the earlier setting of with_newlib.
@@ -1873,6 +1889,11 @@
# Note, if you change the default, make sure to fix both here and in
# the gcc and libstdc++-v3 subdirectories.
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
+AC_ARG_WITH(gxx-include-dir,
+[ --with-gxx-include-dir Tell where to find the include files for the
+ standard C++ headers],,
+[with_gxx_include_dir=no])
+
case "${with_gxx_include_dir}" in
yes)
AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory])
@@ -2130,14 +2151,13 @@
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
-AC_MSG_RESULT($USE_MAINTAINER_MODE)
+[ --enable-maintainer-mode Enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],,
+[enable_maintainer_mode=no])
+AC_MSG_RESULT($enable_maintainer_mode)
AC_SUBST(MAINTAINER_MODE_TRUE)
AC_SUBST(MAINTAINER_MODE_FALSE)
-if test "$USE_MAINTAINER_MODE" = yes; then
+if test "$enable_maintainer_mode" = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
@@ -2172,7 +2192,7 @@
# Enable -Werror in bootstrap stage2 and later.
# Change the default to "no" on release branches.
AC_ARG_ENABLE(werror,
-[ --enable-werror enable -Werror in bootstrap stage2 and later], [],
+[ --enable-werror Enable -Werror in bootstrap stage2 and later],,
[enable_werror=yes])
case ${enable_error} in
yes) WERROR=-Werror ;;