This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++-v3 bootstrap error: srcdir = objdir


On Jan 31, 2001, Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> wrote:

> On 31 Jan 2001, Alexandre Oliva wrote:
>>> configure: error: can not find install-sh or install.sh in .. ./..
>> Please try this patch.

> Thanks! It does change the situation somewhat, but I am afraid it is not
> sufficient:

Indeed.  There's some configuration code in there that's very iffy.
Here's something that works for me with srcdir == builddir.  Now, I've
got to check whether it works for srcdir != builddir too, for full and
relative pathnames for srcdir :-(

I haven't included generated or removes files in the patch.

Index: libstdc++-v3/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in (toplevel_srcdir, auxdir): Set.
	* acinclude.m4 (glibcpp_basedir): Set based on auxdir.
	* aclocal.m4, configure, Makefile.in: Rebuilt.
	* libio/Makefile.in, math/Makefile.in, src/Makefile.in: Likewise.
	* libsupc++-v3/Makefile.am (INCLUDES): Use toplevel_srcdir.
	* libsupc++-v3/Makefile.in: Rebuilt.
	* libsupc++-v3/configure.in, libsupc++-v3/configure: Removed.
	* libsupc++-v3/aclocal.m4, libsupc++-v3/config.h.in: Likewise.

Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.124
diff -u -p -r1.124 acinclude.m4
--- libstdc++-v3/acinclude.m4	2001/01/30 09:18:48	1.124
+++ libstdc++-v3/acinclude.m4	2001/01/31 20:54:58
@@ -14,17 +14,7 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
     *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
    esac], [multilib=yes])dnl
 
-  dnl We may get other options which we dont document:
-  dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-  if test "[$]{srcdir}" = "."; then
-    if test "[$]{with_target_subdir}" != "."; then
-      glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
-    else
-      glibcpp_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
-    fi
-  else
-    glibcpp_basedir="[$]{srcdir}/$1"
-  fi
+  glibcpp_basedir=$auxdir/$1/libstdc++-v3
   AC_SUBST(glibcpp_basedir)
 
   AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
Index: libstdc++-v3/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.50
diff -u -p -r1.50 configure.in
--- libstdc++-v3/configure.in	2001/01/30 09:18:49	1.50
+++ libstdc++-v3/configure.in	2001/01/31 20:54:59
@@ -3,7 +3,34 @@
 
 AC_PREREQ(2.13)
 AC_INIT(src/ios.cc)
-AC_CONFIG_AUX_DIR(..)
+
+# When building with srcdir == objdir, links to the source files will
+# be created in directories within the target_subdir.  We have to
+# adjust toplevel_srcdir accordingly, so that configure finds
+# install-sh and other auxiliary files that live in the top-level
+# source directory.
+if test "${srcdir}" = "."; then
+  if test -z "${with_target_subdir}"; then
+    toplevel_srcdir="\${top_srcdir}/.."
+    auxdir="${srcdir}/.."
+  else
+    if test "${with_target_subdir}" != "."; then
+      toplevel_srcdir="\${top_srcdir}/${with_multisrctop}../.."
+      auxdir="${srcdir}/${with_multisrctop}../.."
+    else
+      toplevel_srcdir="\${top_srcdir}/${with_multisrctop}.."
+      auxdir="${srcdir}/${with_multisrctop}.."
+    fi
+  fi
+else
+  toplevel_srcdir="\${top_srcdir}/.."
+  auxdir="${srcdir}/.."
+fi
+AC_CONFIG_AUX_DIR($auxdir)
+AC_SUBST(toplevel_srcdir)
+
+dnl This is here just to satisfy automake.
+ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
 
 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
 AC_CANONICAL_SYSTEM
Index: libstdc++-v3/libsupc++/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile.am
--- libstdc++-v3/libsupc++/Makefile.am	2001/01/23 08:57:34	1.15
+++ libstdc++-v3/libsupc++/Makefile.am	2001/01/31 20:54:59
@@ -72,7 +72,7 @@ LIBIO_INCLUDES = @LIBIO_INCLUDES@
 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
 
 INCLUDES = \
-	-I$(top_srcdir)/../gcc -I$(top_srcdir)/../include \
+	-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include \
 	-I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
 	 $(LIBSUPCXX_INCLUDES)
 

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]