]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
When building in place, set srcdir=".".
authorStepan Kasal <kasal@ucw.cz>
Tue, 16 Aug 2005 09:11:06 +0000 (09:11 +0000)
committerStepan Kasal <kasal@ucw.cz>
Tue, 16 Aug 2005 09:11:06 +0000 (09:11 +0000)
ChangeLog
lib/autoconf/general.m4
lib/autoconf/status.m4

index 90721d2e8344c8d3ae4074163c00c35eba92f1dd..9c43c211359bea79afe845347aa786499b5de318 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-08-16  Stepan Kasal  <kasal@ucw.cz>
+
+       When building in place, set srcdir="."; suggested by Tim Van Holder.
+
+       * lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Do this; to recognize
+         build in place, we need ac_pwd, and thus have to AC_REQUIRE ...
+       (_AC_INIT_DIRCHECK): ... this macro and AC_DEFUN both of them.
+       * lib/autoconf/status.m4 (_AC_SRCDIRS): Fix a comment: srcdir="."
+         does not mean "no --srcdir option".
+
 2005-08-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * tests/autoscan.at (autoscan): New file.
index 735585b37ba5314161a32bd0cf8a4612f4023349..d66e3374bdc0dc465646e8802cc1cbc179d2bf94 100644 (file)
@@ -454,7 +454,10 @@ AC_DEFUN([AC_CONFIG_SRCDIR],
 # _AC_INIT_DIRCHECK
 # -----------------
 # Set ac_pwd, and sanity-check it and the source and installation directories.
-m4_define([_AC_INIT_DIRCHECK],
+#
+# (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
+#
+AC_DEFUN([_AC_INIT_DIRCHECK],
 [m4_divert_push([PARSE_ARGS])dnl
 
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
@@ -470,8 +473,12 @@ m4_divert_pop([PARSE_ARGS])dnl
 # _AC_INIT_SRCDIR
 # ---------------
 # Compute `srcdir' based on `$ac_unique_file'.
-m4_define([_AC_INIT_SRCDIR],
-[m4_divert_push([PARSE_ARGS])dnl
+#
+# (We have to AC_DEFUN it, since we use AC_REQUIRE.)
+#
+AC_DEFUN([_AC_INIT_SRCDIR],
+[AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
+m4_divert_push([PARSE_ARGS])dnl
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -489,11 +496,17 @@ if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
   AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
 fi
-(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
-  AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work])
-dnl Remove unnecessary trailing slashes from srcdir.
-dnl Double slashes in file names in object file debugging info
-dnl mess up M-x gdb in Emacs.
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd $srcdir && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
 case $srcdir in
 */) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
 esac
@@ -1298,8 +1311,8 @@ AS_PREPARE
 m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
 _AC_INIT_DEFAULTS
 _AC_INIT_PARSE_ARGS
-_AC_INIT_SRCDIR
 _AC_INIT_DIRCHECK
+_AC_INIT_SRCDIR
 _AC_INIT_HELP
 _AC_INIT_VERSION
 _AC_INIT_CONFIG_LOG
index b23f6fab54a3ea25b260fa3389fee123446691f5..1570cd4132f4fd816905a72c781793d8b3eeb119 100644 (file)
@@ -121,7 +121,7 @@ ac_abs_builddir=$ac_pwd$ac_dir_suffix
 ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
     ac_top_srcdir=$ac_top_builddir_sub
     ac_abs_top_srcdir=$ac_pwd ;;