]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (Configuration): Accept --env-VAR=VALUE and
authoroliva <oliva>
Wed, 15 Sep 1999 02:29:01 +0000 (02:29 +0000)
committeroliva <oliva>
Wed, 15 Sep 1999 02:29:01 +0000 (02:29 +0000)
VAR=value.
* autoconf.texi, install.texi: Document it.
* configure: Rebuilt.

ChangeLog
acgeneral.m4
autoconf.texi
configure
doc/autoconf.texi
doc/install.texi
install.texi
lib/autoconf/general.m4

index 287d7a4f18dae67843332398f2e5d45e0b6592be..a5400722dc8485e38e5da4a8561344d19160925d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1999-09-14  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * acgeneral.m4 (Configuration): Accept --env-VAR=VALUE and
+       VAR=value.
+       * autoconf.texi, install.texi: Document it.
+       * configure: Rebuilt.
+
 1999-09-14  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (AC_HELP_STRING): Rewrite in m4.  Have m4 work, and
index 4421773143c866d6397471bcabe477def3427730..bd01f41ccc7b18af8647bb90b27b4a7d8dbb215a 100644 (file)
@@ -712,6 +712,21 @@ changequote([, ])dnl
     esac
     eval "enable_${ac_feature}='$ac_optarg'" ;;
 
+  -env-* | --env-*)
+    ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+changequote(, )dnl
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+      AC_MSG_ERROR($ac_envvar: invalid variable name)
+    fi
+    case "$ac_option" in
+      *=*) ;;
+      *) AC_MSG_ERROR($ac_envvar: missing value) ;;
+    esac
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
   | --exec | --exe | --ex)
@@ -734,6 +749,7 @@ Usage: configure [options] [host]
 Options: [defaults in brackets after descriptions]
 Configuration:
   --cache-file=FILE       cache test results in FILE
+  [--env-]VAR=VALUE       set environment variable VAR to VALUE
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
@@ -979,6 +995,17 @@ changequote([, ])dnl
   -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
     ;;
 
+  *=*) 
+    ac_envvar=`echo $ac_option|sed -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+changequote(, )dnl
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+      AC_MSG_ERROR($ac_envvar: invalid variable name)
+    fi
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
 changequote(, )dnl
     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
index 6609c4f08fd22d74d0272c4251fb1d7eb5dc9797..9ca573023ca50eef59069e9d9ebec385041bf486 100644 (file)
@@ -281,6 +281,7 @@ Running @code{configure} Scripts
 * Optional Features::           Selecting optional features
 * System Type::                 Specifying the system type
 * Sharing Defaults::            Setting site-wide defaults for @code{configure}
+* Environment Variables::       Defining environment variables.
 * Operation Controls::          Changing how @code{configure} runs
 
 Questions About Autoconf
@@ -5003,6 +5004,7 @@ may use comes with Autoconf.
 * Optional Features::           Selecting optional features
 * System Type::                 Specifying the system type
 * Sharing Defaults::            Setting site-wide defaults for @code{configure}
+* Environment Variables::       Defining environment variables.
 * Operation Controls::          Changing how @code{configure} runs
 @end menu
 
index 291d770454f27dd83410a178c8949cd180e2d0a7..5e9b367350c6a3e33174de789db25235b6e1c7bd 100755 (executable)
--- a/configure
+++ b/configure
@@ -120,6 +120,19 @@ do
     esac
     eval "enable_${ac_feature}='$ac_optarg'" ;;
 
+  -env-* | --env-*)
+    ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_envvar: invalid variable name" 1>&2; exit 1; }
+    fi
+    case "$ac_option" in
+      *=*) ;;
+      *) { echo "configure: error: $ac_envvar: missing value" 1>&2; exit 1; } ;;
+    esac
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
   | --exec | --exe | --ex)
@@ -141,6 +154,7 @@ Usage: configure [options] [host]
 Options: [defaults in brackets after descriptions]
 Configuration:
   --cache-file=FILE       cache test results in FILE
+  [--env-]VAR=VALUE       set environment variable VAR to VALUE
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
@@ -381,6 +395,15 @@ EOF
   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
     ;;
 
+  *=*) 
+    ac_envvar=`echo $ac_option|sed -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_envvar: invalid variable name" 1>&2; exit 1; }
+    fi
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
       echo "configure: warning: $ac_option: invalid host type" 1>&2
@@ -897,8 +920,7 @@ ac_given_INSTALL="$INSTALL"
 # Allow concurrent executions
 conftest=cft\$\$
 
-: \${CONFIG_FILES="Makefile
-testsuite/Makefile"}
+: \${CONFIG_FILES="Makefile testsuite/Makefile"}
 rm -fr \`echo "\$CONFIG_FILES " | sed "s/:@BKL@^ @BKR@*//g"\`
 trap 'rm -fr \$conftest*; exit 1' 1 2 15
 
index 6609c4f08fd22d74d0272c4251fb1d7eb5dc9797..9ca573023ca50eef59069e9d9ebec385041bf486 100644 (file)
@@ -281,6 +281,7 @@ Running @code{configure} Scripts
 * Optional Features::           Selecting optional features
 * System Type::                 Specifying the system type
 * Sharing Defaults::            Setting site-wide defaults for @code{configure}
+* Environment Variables::       Defining environment variables.
 * Operation Controls::          Changing how @code{configure} runs
 
 Questions About Autoconf
@@ -5003,6 +5004,7 @@ may use comes with Autoconf.
 * Optional Features::           Selecting optional features
 * System Type::                 Specifying the system type
 * Sharing Defaults::            Setting site-wide defaults for @code{configure}
+* Environment Variables::       Defining environment variables.
 * Operation Controls::          Changing how @code{configure} runs
 @end menu
 
index f26dfcd41e3a195e4e46e29e980deaa286198951..a9432a9e26d4045c2f5f168369527414c35c066e 100644 (file)
@@ -73,13 +73,7 @@ the @code{configure} script does not know about.  You can give
 environment.  Using a Bourne-compatible shell, you can do that on the
 command line like this:
 @example
-CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-@end example
-
-@noindent
-Or on systems that have the @code{env} program, you can do it like this:
-@example
-env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
 @end example
 
 @node Multiple Architectures
@@ -174,6 +168,19 @@ default values for variables like @code{CC}, @code{cache_file}, and
 the @code{CONFIG_SITE} environment variable to the location of the site
 script.  A warning: not all @code{configure} scripts look for a site script.
 
+@node Environment Variables
+@section Environment Variables
+
+Variables not defined in a site shell script can be set in the
+environment passed to configure.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you can set them
+in the @code{configure} command line, using @samp{--env-VAR=value} or
+@samp{VAR=value}.  For example, the switch
+@samp{--env-CC=/usr/local2/bin/gcc} will cause the specified gcc to be
+used as the C compiler (unless it is overridden in the site shell
+script).
+
 @node Operation Controls
 @section Operation Controls
 
index f26dfcd41e3a195e4e46e29e980deaa286198951..a9432a9e26d4045c2f5f168369527414c35c066e 100644 (file)
@@ -73,13 +73,7 @@ the @code{configure} script does not know about.  You can give
 environment.  Using a Bourne-compatible shell, you can do that on the
 command line like this:
 @example
-CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-@end example
-
-@noindent
-Or on systems that have the @code{env} program, you can do it like this:
-@example
-env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
 @end example
 
 @node Multiple Architectures
@@ -174,6 +168,19 @@ default values for variables like @code{CC}, @code{cache_file}, and
 the @code{CONFIG_SITE} environment variable to the location of the site
 script.  A warning: not all @code{configure} scripts look for a site script.
 
+@node Environment Variables
+@section Environment Variables
+
+Variables not defined in a site shell script can be set in the
+environment passed to configure.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you can set them
+in the @code{configure} command line, using @samp{--env-VAR=value} or
+@samp{VAR=value}.  For example, the switch
+@samp{--env-CC=/usr/local2/bin/gcc} will cause the specified gcc to be
+used as the C compiler (unless it is overridden in the site shell
+script).
+
 @node Operation Controls
 @section Operation Controls
 
index 4421773143c866d6397471bcabe477def3427730..bd01f41ccc7b18af8647bb90b27b4a7d8dbb215a 100644 (file)
@@ -712,6 +712,21 @@ changequote([, ])dnl
     esac
     eval "enable_${ac_feature}='$ac_optarg'" ;;
 
+  -env-* | --env-*)
+    ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+changequote(, )dnl
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+      AC_MSG_ERROR($ac_envvar: invalid variable name)
+    fi
+    case "$ac_option" in
+      *=*) ;;
+      *) AC_MSG_ERROR($ac_envvar: missing value) ;;
+    esac
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
   | --exec | --exe | --ex)
@@ -734,6 +749,7 @@ Usage: configure [options] [host]
 Options: [defaults in brackets after descriptions]
 Configuration:
   --cache-file=FILE       cache test results in FILE
+  [--env-]VAR=VALUE       set environment variable VAR to VALUE
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
@@ -979,6 +995,17 @@ changequote([, ])dnl
   -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
     ;;
 
+  *=*) 
+    ac_envvar=`echo $ac_option|sed -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+changequote(, )dnl
+    if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then
+changequote([, ])dnl
+      AC_MSG_ERROR($ac_envvar: invalid variable name)
+    fi
+    eval "${ac_envvar}='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
 changequote(, )dnl
     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then