diff options
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | configure.ac | 47 |
2 files changed, 43 insertions, 12 deletions
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-08-22 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * configure.ac (EMACS_CONFIG_OPTIONS): Quote systematically (Bug#13274). | ||
| 4 | This improves on the patch already installed, by quoting options | ||
| 5 | that contain spaces and suchlike systematically, so that | ||
| 6 | EMACS_CONFIG_OPTIONS is no longer ambiguous when options contain | ||
| 7 | these characters. | ||
| 8 | |||
| 1 | 2013-08-21 Paul Eggert <eggert@cs.ucla.edu> | 9 | 2013-08-21 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 10 | ||
| 3 | Port close-on-exec pty creation to FreeBSD 9.1-RELEASE (Bug#15129). | 11 | Port close-on-exec pty creation to FreeBSD 9.1-RELEASE (Bug#15129). |
diff --git a/configure.ac b/configure.ac index 14010fa5f38..25426948194 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -24,18 +24,43 @@ dnl along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |||
| 24 | AC_PREREQ(2.65) | 24 | AC_PREREQ(2.65) |
| 25 | AC_INIT(emacs, 24.3.50) | 25 | AC_INIT(emacs, 24.3.50) |
| 26 | 26 | ||
| 27 | dnl Set emacs_config_options to the options of 'configure', quoted for the shell, | ||
| 28 | dnl and then quoted again for a C string. Separate options with spaces. | ||
| 29 | dnl Add some environment variables, if they were passed via the environment | ||
| 30 | dnl rather than on the command-line. | ||
| 31 | emacs_config_options= | ||
| 32 | optsep= | ||
| 27 | dnl This is the documented way to record the args passed to configure, | 33 | dnl This is the documented way to record the args passed to configure, |
| 28 | dnl rather than $ac_configure_args. | 34 | dnl rather than $ac_configure_args. |
| 29 | emacs_config_options="$@" | 35 | for opt in ${1+"$@"} CFLAGS CPPFLAGS LDFLAGS; do |
| 30 | ## Add some environment variables, if they were passed via the environment | 36 | case $opt in |
| 31 | ## rather than on the command-line. | 37 | -n | --no-create | --no-recursion) |
| 32 | for var in CFLAGS CPPFLAGS LDFLAGS; do | 38 | continue ;; |
| 33 | case "$emacs_config_options" in | 39 | CFLAGS | CPPFLAGS | LDFLAGS) |
| 34 | *$var=*) continue ;; | 40 | eval 'test "${'$opt'+set}" = set' || continue |
| 35 | esac | 41 | case " $*" in |
| 36 | eval val="\$${var}" | 42 | *" $opt="*) continue ;; |
| 37 | test x"$val" = x && continue | 43 | esac |
| 38 | emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\"" | 44 | eval opt=$opt=\$$opt ;; |
| 45 | esac | ||
| 46 | |||
| 47 | emacs_shell_specials=$IFS\''"#$&()*;<>?@<:@\\`{|~' | ||
| 48 | case $opt in | ||
| 49 | *[["$emacs_shell_specials"]]*) | ||
| 50 | case $opt in | ||
| 51 | *\'*) | ||
| 52 | emacs_quote_apostrophes="s/'/'\\\\''/g" | ||
| 53 | opt=`AS_ECHO(["$opt"]) | sed "$emacs_quote_apostrophes"` ;; | ||
| 54 | esac | ||
| 55 | opt="'$opt'" | ||
| 56 | case $opt in | ||
| 57 | *[['"\\']]*) | ||
| 58 | emacs_quote_for_c='s/[["\\]]/\\&/g; $!s/$/\\n\\/' | ||
| 59 | opt=`AS_ECHO(["$opt"]) | sed "$emacs_quote_for_c"` ;; | ||
| 60 | esac ;; | ||
| 61 | esac | ||
| 62 | AS_VAR_APPEND([emacs_config_options], ["$optsep$opt"]) | ||
| 63 | optsep=' ' | ||
| 39 | done | 64 | done |
| 40 | 65 | ||
| 41 | AC_CONFIG_HEADER(src/config.h:src/config.in) | 66 | AC_CONFIG_HEADER(src/config.h:src/config.in) |
| @@ -4479,8 +4504,6 @@ fi | |||
| 4479 | 4504 | ||
| 4480 | AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", | 4505 | AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", |
| 4481 | [Define to the canonical Emacs configuration name.]) | 4506 | [Define to the canonical Emacs configuration name.]) |
| 4482 | dnl Replace any embedded " characters (bug#13274). | ||
| 4483 | emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g" -e 's/\\\\/\\\\\\\\/g'` | ||
| 4484 | AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}", | 4507 | AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}", |
| 4485 | [Define to the options passed to configure.]) | 4508 | [Define to the options passed to configure.]) |
| 4486 | AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure | 4509 | AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure |