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]
Other format: [Raw text]

cross multilibs (repost)


Apparently the first time I sent out this message it got lost.

I don't remember everything I said last time, but here's the patch for
reference.

It puts the new multi.m4 file in the toplevel config/ directory to
avoid requiring everyone to use an unreleased version of automake.
The libstdc++ configure script was apparently previously generated
with some modified version of autoconf; I don't have that version, so
I regenerated it with the released one.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-multilibcross.patch===================
Index: config/ChangeLog
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* multi.m4: New file, from automake version 2 branch.

Index: libgomp/ChangeLog
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

Index: libstdc++-v3/ChangeLog
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* aclocal.m4: Regenerate.
	* configure: Regenerate with released autoconf-2.59.

Index: libobjc/ChangeLog
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* Makefile.in: Use multi_basedir instead of toplevel_srcdir.
	* configure.ac: Use multi.m4 from aclocal rather than custom
	code.  Use multi_basedir instead of toplevel_srcdir.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

Index: libssp/ChangeLog
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

Index: libobjc/Makefile.in
===================================================================
--- libobjc/Makefile.in	(revision 117675)
+++ libobjc/Makefile.in	(working copy)
@@ -36,7 +36,7 @@
 gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER)
 host_subdir = @host_subdir@
 top_srcdir = @top_srcdir@
-toplevel_srcdir = @toplevel_srcdir@
+multi_basedir = @multi_basedir@
 toolexecdir = @toolexecdir@
 # Toolexecdir is used only by toolexeclibdir
 toolexeclibdir = @toolexeclibdir@
@@ -332,7 +332,7 @@
 install: install-libs install-headers
 
 install-libs: installdirs
-	$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
+	$(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)
 	$(LIBTOOL_INSTALL) $(INSTALL) libobjc$(libext).la $(DESTDIR)$(toolexeclibdir);
 	if [ "$(OBJC_BOEHM_GC)" ]; then \
 	  $(LIBTOOL_INSTALL) $(INSTALL) libobjc_gc$(libext).la \
@@ -343,7 +343,7 @@
 
 # Copy Objective C headers to installation include directory.
 install-headers:
-	$(SHELL) $(toplevel_srcdir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
+	$(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(libsubdir)/$(includedirname)/objc
 	for file in $(OBJC_H); do \
 	  realfile=$(srcdir)/objc/$${file}; \
 	  $(INSTALL_DATA) $${realfile} $(DESTDIR)$(libsubdir)/$(includedirname)/objc; \
Index: libobjc/configure.ac
===================================================================
--- libobjc/configure.ac	(revision 117675)
+++ libobjc/configure.ac	(working copy)
@@ -41,16 +41,6 @@
 # Options
 # -------
 
-# Default to --enable-multilib
-AC_ARG_ENABLE(multilib,
-  [  --enable-multilib       build hella library versions (default)],
-  [case "${enableval}" in
-    yes) multilib=yes ;;
-    no)  multilib=no ;;
-    *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
-   esac],
-  [multilib=yes])
-
 # We use these options to decide which functions to include.
 AC_ARG_WITH(target-subdir,
 [  --with-target-subdir=SUBDIR
@@ -90,27 +80,8 @@
 # Directories
 # -----------
 
-# 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
-    toprel=".."
-  else
-    if test "${with_target_subdir}" != "."; then
-      toprel="${with_multisrctop}../.."
-    else
-      toprel="${with_multisrctop}.."
-    fi
-  fi
-else
-  toprel=".."
-fi
-AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
-toplevel_srcdir=\${srcdir}/$toprel
-AC_SUBST(toplevel_srcdir)
+# Find the rest of the source tree framework.
+AM_ENABLE_MULTILIB(, ..)
 
 AC_CANONICAL_SYSTEM
 ACX_NONCANONICAL_TARGET
@@ -308,7 +279,7 @@
     # FIXME: We shouldn't need to set ac_file
     ac_file=Makefile
     LD="${ORIGINAL_LD_FOR_MULTILIBS}"
-    . ${toplevel_srcdir}/config-ml.in
+    . ${multi_basedir}/config-ml.in
   fi
 fi]],
 [[srcdir=${srcdir}
@@ -317,7 +288,7 @@
 with_target_subdir=${with_target_subdir}
 with_multisubdir=${with_multisubdir}
 ac_configure_args="--enable-multilib ${ac_configure_args}"
-toplevel_srcdir=${toplevel_srcdir}
+multi_basedir=${multi_basedir}
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
 ]])
Index: config/multi.m4
===================================================================
--- config/multi.m4	(revision 0)
+++ config/multi.m4	(revision 0)
@@ -0,0 +1,65 @@
+##                                                          -*- Autoconf -*-
+# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
+# ---------------------------------------------------
+# Add --enable-multilib to configure.
+AC_DEFUN([AM_ENABLE_MULTILIB],
+[# Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[  --enable-multilib       build many library versions (default)],
+[case "$enableval" in
+  yes) multilib=yes ;;
+  no)  multilib=no ;;
+  *)   AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
+ esac],
+	      [multilib=yes])
+
+# We may get other options which we leave undocumented:
+# --with-target-subdir, --with-multisrctop, --with-multisubdir
+# See config-ml.in if you want the gory details.
+
+if test "$srcdir" = "."; then
+  if test "$with_target_subdir" != "."; then
+    multi_basedir="$srcdir/$with_multisrctop../$2"
+  else
+    multi_basedir="$srcdir/$with_multisrctop$2"
+  fi
+else
+  multi_basedir="$srcdir/$2"
+fi
+AC_SUBST(multi_basedir)
+
+# Even if the default multilib is not a cross compilation,
+# it may be that some of the other multilibs are.
+if test $cross_compiling = no && test $multilib = yes \
+   && test "x${with_multisubdir}" != x ; then
+   cross_compiling=maybe
+fi
+
+AC_OUTPUT_COMMANDS([
+# Only add multilib support code if we just rebuilt the top-level
+# Makefile.
+case " $CONFIG_FILES " in
+ *" ]m4_default([$1],Makefile)[ "*)
+   ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
+   ;;
+esac],
+		   [
+srcdir="$srcdir"
+host="$host"
+target="$target"
+with_multisubdir="$with_multisubdir"
+with_multisrctop="$with_multisrctop"
+with_target_subdir="$with_target_subdir"
+ac_configure_args="${multilib_arg} ${ac_configure_args}"
+multi_basedir="$multi_basedir"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+CC="$CC"])])dnl
============================================================


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