]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Resolve Python issue 1676135 regarding configure directory args.
authorEric Blake <ebb9@byu.net>
Fri, 5 Oct 2007 17:26:26 +0000 (11:26 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 5 Oct 2007 17:57:09 +0000 (11:57 -0600)
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Strip trailing
slashes from directory arguments.
* tests/base.at (configure directories): New test.
* doc/autoconf.texi (Installation Directory Variables): Document
the change.
* NEWS: Likewise.
* THANKS: Update.
Reported by Björn Lindqvist.
http://bugs.python.org/issue1676135

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
THANKS
doc/autoconf.texi
lib/autoconf/general.m4
tests/base.at

index 57dfbb5a92c4fc148b4729506b77d2670d97910d..e5e01c27db332be42ac04b535581ad6d27df67e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2007-10-05  Eric Blake  <ebb9@byu.net>
 
+       Resolve Python issue 1676135 regarding configure directory args.
+       * lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Strip trailing
+       slashes from directory arguments.
+       * tests/base.at (configure directories): New test.
+       * doc/autoconf.texi (Installation Directory Variables): Document
+       the change.
+       * NEWS: Likewise.
+       * THANKS: Update.
+       Reported by Björn Lindqvist.
+
        Provide better short-circuiting operation.
        * lib/m4sugar/m4sugar.m4 (m4_cond, m4_newline): New macros.
        (m4_text_wrap): Use it.  Also avoid useless m4_for.
diff --git a/NEWS b/NEWS
index 1bd5f5ab4e9402414e8e2aa1b7cf156f81083669..70a4a1a2df60d381a602bdfd9b35f6cf286c8850 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,12 @@ GNU Autoconf NEWS - User visible changes.
 
 ** The command 'autoconf -' now correctly processes a file from stdin.
 
+** For all of the directory arguments for 'configure', such as '--prefix'
+   or '--bindir', trailing slashes are stripped.  As an example, if
+   tab completion in the user's shell appends trailing slashes, the
+   command './configure --prefix=/usr/' will still result in an
+   expanded libdir value of /usr/lib, not /usr//lib.
+
 ** AT_SETUP now handles macro expansions properly when calculating line
    length.  However, as a side effect, any whitespace immediately
    following a single-quoted comma is lost.  If you previously used
diff --git a/THANKS b/THANKS
index 13318e0deec033aaa30e93f7932541f2823daa8a..a3c215b21d64463a10d2d5cf01704e7c16329202 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -52,6 +52,7 @@ Brian Gough                 bjg@network-theory.co.uk
 Bruce Korb                  bkorb@gnu.org
 Bruce Lilly                 ?
 Bruno Haible                haible@ilog.fr
+Björn Lindqvist             bjourne@gmail.com
 Carl Edman                  cedman@princeton.edu
 Carlos Velasco              carlosev@newipnet.com
 Chad R. Larson              chad@anasazi.com
index ecc496b4c590ee1caaaeeceb958f0831ecf7ea2e..1b470eb392b2558a8c3ecef2e08e0474910f9550 100644 (file)
@@ -1728,7 +1728,7 @@ M4.
 
 The following M4 macros (e.g., @code{AC_PACKAGE_NAME}), output variables
 (e.g., @code{PACKAGE_NAME}), and preprocessor symbols (e.g.,
-@code{PACKAGE_NAME}) are defined by @code{AC_INIT}:
+@code{PACKAGE_NAME}), are defined by @code{AC_INIT}:
 
 @table @asis
 @item @code{AC_PACKAGE_NAME}, @code{PACKAGE_NAME}
@@ -2465,7 +2465,10 @@ Absolute name of @code{top_srcdir}.
 The following variables specify the directories for
 package installation, see @ref{Directory Variables, , Variables for
 Installation Directories, standards, The @acronym{GNU} Coding
-Standards}, for more information.  See the end of this section for
+Standards}, for more information.  Each variable corresponds to an
+argument of @command{configure}; trailing slashes are stripped so that
+expressions such as @samp{$@{prefix@}/lib} expand with only one slash
+between directory names.  See the end of this section for
 details on when and how to use these variables.
 
 @defvar bindir
index df501ec43f53ff5dd37de113f177f4e0359e15a6..0f8a5dcfea8443f235df2896cf3cd966d9c52a48 100644 (file)
@@ -895,13 +895,19 @@ if test -n "$ac_unrecognized_opts"; then
   esac
 fi
 
-# Be sure to have absolute directory names.
+# Check all directory arguments for consistency.
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
                libdir localedir mandir
 do
   eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    / | // ) ;;
+    */ ) eval $ac_var='`echo "$ac_val" | sed "s|/*\$||"`' ;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [[\\/$]]* | ?:[[\\/]]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
index afbe88446a9c391042a29cc29299fcc733f4a4f8..f1f1a9da9a4491064bfe07b2fee973b84b7412f7 100644 (file)
@@ -321,3 +321,37 @@ AT_CHECK_CONFIGURE([FOO=bar --enable-baz --without-zork --silent], [0], [stdout]
 AT_CHECK([grep 'FOO=bar --enable-baz --without-zork --silent' stdout], [0], [ignore], [ignore])
 
 AT_CLEANUP
+
+
+## --------------------- ##
+## configure directories ##
+## --------------------- ##
+
+AT_SETUP([configure directories])
+
+AT_DATA([foo.in],
+[[prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+]])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_FILES([foo])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+dnl check that relative paths are rejected
+AT_CHECK_CONFIGURE([--libdir=.], [1], [ignore], [stderr])
+AT_CHECK([grep 'expected an absolute directory name for --libdir: \.' stderr],
+        [0], [ignore])
+
+dnl check that extra slashes are stripped, and that defaults are not expanded
+AT_CHECK_CONFIGURE([--prefix=/usr//])
+AT_CHECK([cat foo], [0], [[prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+]])
+
+AT_CLEANUP