multilibbing libf2c [ preliminary patch ]
Robert Lipe
robertl@dgii.com
Wed Sep 9 06:51:00 GMT 1998
For libf2c, it really was about as simple as Jeff described. You'll
find a preliminary patch at the end that makes it work on OpenServer.
It now correctly builds native ELF + COFF + PIC.
If there are no objections, I'll save the mandatory testsuite patches
(it requries patching dejagnu, sigh) until we're able to commit the
patches necessary to actually build the libraries.
robertl> When I get things less ugly, I'll start sharing patches with a
Dave> I'll help if you think I can. I'd started trying to understand
I sure hope you can. Libf2c makes more sense now than it made the last
time I looked at it (whether libf2c changed or I did isn't the point :-)
but I sure welcome your experience. There are a few mysteries to me
with the attached patch, but it works better for me than anything we've
seen to date.
*) make clean doesn't nuke the s-lib* files in the multilib directories.
*) libE77 is different than everything else. The directory is removed
during a make clean (as are the other lib?77 mutants) but the s-libe77
file remains and that seems to be enough to make a subsequent build fail
becuase there are no objects build. Manually removing this file makes
it work.
*)
Dave> it on the basis of the Chilling experience. Bits of Chill's
Dave> configuration look unreassuringly familiar!
A lot of this stuff looks pretty heavily borrowed to me.
Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/Makefile.in,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.in
--- Makefile.in 1998/08/26 22:20:34 1.20
+++ Makefile.in 1998/09/09 03:23:58
@@ -34,6 +34,14 @@ gcc_version_trigger = @gcc_version_trigg
libdir = $(exec_prefix)/lib
libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
+# Multilib support variables.
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+
# Not configured per top-level version, since that doesn't get passed
# down at configure time, but overrridden by the top-level install
# target.
@@ -78,7 +86,7 @@ F2CEXT = abort derf derfc ef1asc ef1cmc
# targets update stamp files which the $(LIBG2C) target checks in the
# sub-make. (Probably only one stamp file is really needed.)
all: i77 f77 u77 s-libe77
- $(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
+ @$(MULTIDO) $(FLAGS_TO_PASS) $(LIBG2C) multi-do DO="all $(LIBG2C)"
i77 f77 u77: g2c.h
@@ -165,16 +173,16 @@ uninstall:
mostlyclean:
rm -f $(LIBG2C)
- for i in $(SUBDIRS); do (cd $$i && $(MAKE) mostlyclean); done
+ @$(MULTICLEAN) multi-clean DO=mostlyclean
rm -fr libE77
clean: mostlyclean
rm -f config.log
- for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done
+ @$(MULTICLEAN) multi-clean DO=clean
distclean: clean
rm -f Makefile config.cache config.status g2c.h s-libe77
- for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean); done
+ @$(MULTICLEAN) multi-clean DO=distclean
maintainer-clean:
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/configure.in,v
retrieving revision 1.12
diff -u -p -r1.12 configure.in
--- configure.in 1998/07/16 00:07:37 1.12
+++ configure.in 1998/09/09 03:24:02
@@ -21,6 +21,16 @@
AC_INIT(libF77/Version.c)
+if [ "${srcdir}" = "." ] ; then
+ if [ "${with_target_subdir}" != "." ] ; then
+ topsrcdir=${with_multisrctop}../..
+ else
+ topsrcdir=${with_multisrctop}..
+ fi
+else
+ topsrcdir=${srcdir}/..
+fi
+
AC_REVISION(1.12)
dnl Checks for programs.
@@ -165,9 +175,26 @@ AC_SUBST(gcc_version)
AC_SUBST(gcc_version_trigger)
AC_CANONICAL_SYSTEM
AC_SUBST(target_alias)
-
AC_CONFIG_SUBDIRS(libU77 libI77 libF77)
-AC_OUTPUT(Makefile g2c.h:g2c.hin)
+AC_OUTPUT(g2c.h:g2c.hin Makefile,
+ [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+if test -n "$CONFIG_FILES"; then
+ if test -n "${with_target_subdir}"; then
+ # FIXME: We shouldn't need to set ac_file
+ ac_file=Makefile
+ . ${topsrcdir}/config-ml.in
+ fi
+fi],
+srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+topsrcdir=${topsrcdir}
+)
+
dnl Local Variables:
dnl comment-start: "dnl "
More information about the Gcc
mailing list