]> git.eshelyaron.com Git - emacs.git/commitdiff
Substitute variable `vpath_sed'.
authorRoland McGrath <roland@gnu.org>
Sun, 12 Sep 1993 10:47:34 +0000 (10:47 +0000)
committerRoland McGrath <roland@gnu.org>
Sun, 12 Sep 1993 10:47:34 +0000 (10:47 +0000)
If not in $srcdir and $srcdir is configured,
issue warning that GNU make is required,
and set vpath_sed to use vpath.sed script.

configure1.in

index 24e93b66b9760e5ce906224a430a904bb5e7a98d..1d674248e7da07f398adec90cd1ddbf2e353806b 100755 (executable)
@@ -362,6 +362,23 @@ case "${srcdir}" in
   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
 esac
 
+#### Check if the source directory already has a configured system in it.
+if [ `pwd` != `(cd ${srcdir} && pwd)` ] \
+   && [ -f "${srcdir}/src/config.h" ] ; then
+  (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used"
+   echo "   as a build directory right now; it has been configured in its own"
+   echo "   right.  To configure in another directory as well, you MUST"
+   echo "   use GNU make.  If you do not have GNU make, then you must"
+   echo "   now do \`make distclean' in ${srcdir},"
+   echo "   and then run ${progname} again.") >&2
+  # We need a multi-line sed script, which cannot go in a makefile.
+  vpath_sed='-f vpath.sed'
+else
+  # Do the normal substitution for VPATH.  This will not crash non-GNU make.
+  vpath_sed='-e '\''s|^\(VPATH *=\).*$$|\1 ='\''"${srcdir}/${subdir}|"'
+fi
+] AC_SUBST(vpath_sed) [
+
 ### Make the necessary directories, if they don't exist.
 for dir in ./src ./lib-src ./cpp ./oldXMenu ./etc ; do
   if [ ! -d ${dir} ]; then
@@ -1293,4 +1310,4 @@ test -n "${prefix}" &&
 test -n "${exec_prefix}" &&
   exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
 ]
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile ${extra_output})