aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac47
2 files changed, 43 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 161069800a4..35dbeb6065c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12013-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
12013-08-21 Paul Eggert <eggert@cs.ucla.edu> 92013-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/>.
24AC_PREREQ(2.65) 24AC_PREREQ(2.65)
25AC_INIT(emacs, 24.3.50) 25AC_INIT(emacs, 24.3.50)
26 26
27dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
28dnl and then quoted again for a C string. Separate options with spaces.
29dnl Add some environment variables, if they were passed via the environment
30dnl rather than on the command-line.
31emacs_config_options=
32optsep=
27dnl This is the documented way to record the args passed to configure, 33dnl This is the documented way to record the args passed to configure,
28dnl rather than $ac_configure_args. 34dnl rather than $ac_configure_args.
29emacs_config_options="$@" 35for 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)
32for 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=' '
39done 64done
40 65
41AC_CONFIG_HEADER(src/config.h:src/config.in) 66AC_CONFIG_HEADER(src/config.h:src/config.in)
@@ -4479,8 +4504,6 @@ fi
4479 4504
4480AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", 4505AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}",
4481 [Define to the canonical Emacs configuration name.]) 4506 [Define to the canonical Emacs configuration name.])
4482dnl Replace any embedded " characters (bug#13274).
4483emacs_config_options=`echo "$emacs_config_options " | sed -e 's/--no-create //' -e 's/--no-recursion //' -e 's/ *$//' -e "s/\"/'/g" -e 's/\\\\/\\\\\\\\/g'`
4484AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}", 4507AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
4485 [Define to the options passed to configure.]) 4508 [Define to the options passed to configure.])
4486AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure 4509AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure