]> sourceware.org Git - automake.git/commitdiff
Preliminary (completely untested) multilib support.
authorTom Tromey <tromey@redhat.com>
Sun, 11 Oct 1998 13:07:23 +0000 (13:07 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 11 Oct 1998 13:07:23 +0000 (13:07 +0000)
* automake.texi (Macros): Document AM_ENABLE_MULTILIB.
* m4/Makefile.am (m4data_DATA): Added multi.m4.
* Makefile.am (amfiles): Added multilib.am.
* automake.in (seen_multilib): New global.
(scan_one_configure_file): Recognize AM_ENABLE_MULTILIB.
(generate_makefile): Call handle_multilib.
(handle_multilib): New function.
* multilib.am: New file.
* m4/multi.m4: New file.

ChangeLog
Makefile.am
Makefile.in
automake.in
automake.texi
lib/am/Makefile.am
lib/am/multilib.am [new file with mode: 0644]
m4/Makefile.am
m4/Makefile.in
m4/multi.m4 [new file with mode: 0644]
multilib.am [new file with mode: 0644]

index 6fcf91662257d017e975eb667fd58e6ff3bc26d1..0d633711a4705466231a32ef8867bdaafad1b3aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+1998-10-11  Tom Tromey  <tromey@cygnus.com>
+
+       Preliminary (completely untested) multilib support.
+       * automake.texi (Macros): Document AM_ENABLE_MULTILIB.
+       * m4/Makefile.am (m4data_DATA): Added multi.m4.
+       * Makefile.am (amfiles): Added multilib.am.
+       * automake.in (seen_multilib): New global.
+       (scan_one_configure_file): Recognize AM_ENABLE_MULTILIB.
+       (generate_makefile): Call handle_multilib.
+       (handle_multilib): New function.
+       * multilib.am: New file.
+       * m4/multi.m4: New file.
+
 1998-10-08  Tom Tromey  <tromey@cygnus.com>
 
        * automake.in (handle_dist): Always include configure.in and
index b44d5e912ea3b62c5f613aac0ea15303fcb9fc7a..954ee739e9bc547d3783561d8081d32c3472119e 100644 (file)
@@ -14,9 +14,9 @@ amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
 data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \
 footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \
 library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \
-ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am program.am \
-progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \
+program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
 
index 05031dec525c930dd9a2ba2b54653cc2ad413171..da512d353b729864a7d17143625cf5f5aa38ba3e 100644 (file)
@@ -75,9 +75,9 @@ amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
 data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \
 footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \
 library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \
-ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am program.am \
-progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \
+program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
 
index ebe79d88d8e954b6c0ab2db36886bf7a97791a37..2ae6320f1e103fe0937c1bef66cb450176131b92 100755 (executable)
@@ -210,6 +210,9 @@ $seen_exeext = 0;
 # TRUE if we've seen AC_OBJEXT.
 $seen_objext = 0;
 
+# TRUE if we've seen AC_ENABLE_MULTILIB.
+$seen_multilib = 0;
+
 # Hash table of discovered configure substitutions.  Keys are names,
 # values are `FILE:LINE' strings which are used by error message
 # generation.
@@ -608,6 +611,7 @@ sub generate_makefile
     $contents{'SOURCES'} = join (' ', @sources);
     $contents{'OBJECTS'} = join (' ', @objects);
 
+    &handle_multilib;
     &handle_texinfo;
     &handle_emacs_lisp;
     &handle_java;
@@ -2211,6 +2215,16 @@ sub handle_tags
     }
 }
 
+# Handle multilib support.
+sub handle_multilib
+{
+    return unless $seen_multilib;
+
+    $output_rules .= &file_contents ('multilib.am');
+    &push_phony_cleaners ('multi');
+    push (@phony, 'all-multi', 'install-multi');
+}
+
 # Worker for handle_dist.
 sub handle_dist_worker
 {
@@ -4186,6 +4200,8 @@ sub scan_one_configure_file
            $seen_canonical = $AC_CANONICAL_HOST if ! $seen_canonical;
        }
 
+       $seen_multilib = 1 if (/AM_ENABLE_MULTILIB/);
+
        if (/$AM_CONDITIONAL_PATTERN/o)
        {
            $configure_cond{$1} = 1;
index c68c43a84fa72125d9ceb9df7eae31bc6093f7d7..775ed002b0d9003b28129e92b8c211ea095767d6 100644 (file)
@@ -1113,6 +1113,16 @@ whose names end in @samp{.exe}, even if this was not specified on the
 command line.  Automake adds special code to @file{Makefile.in} to
 gracefully deal with this.
 
+@item AM_ENABLE_MULTILIB
+This is used when a ``multilib'' library is being built.  A
+@dfn{multilib} library is one that is built multiple times, once per
+target flag combination.  This is only useful when the library is
+intended to be cross-compiled.  The first optional argument is the name
+of the @file{Makefile} being generated; it defaults to @samp{Makefile}.
+The second option argument is used to find the top source directory; it
+defaults to the empty string (generally this should not be used unless
+you are familiar with the internals).
+
 @item AM_FUNC_STRTOD
 If the @code{strtod} function is not available, or does not work
 correctly (like the one on SunOS 5.4), add @file{strtod.o} to output
index b44d5e912ea3b62c5f613aac0ea15303fcb9fc7a..954ee739e9bc547d3783561d8081d32c3472119e 100644 (file)
@@ -14,9 +14,9 @@ amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
 data-clean.am data.am dejagnu.am depend.am depend2.am dist-vars.am \
 footer.am header-vars.am header.am java-clean.am java.am kr-extra.am \
 library.am libs-clean.am libs.am libtool.am lisp-clean.am lisp.am \
-ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am program.am \
-progs-clean.am progs.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am multilib.am \
+program.am progs-clean.am progs.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 $(amfiles)
 
diff --git a/lib/am/multilib.am b/lib/am/multilib.am
new file mode 100644 (file)
index 0000000..728a78d
--- /dev/null
@@ -0,0 +1,45 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1998 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+## Multilib support variables.
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+
+all-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
+install-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
+mostlyclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
+clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
+distclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
+maintainer-clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
+
+## FIXME: this is probably broken.
+all-recursive: all-multi
+install-recursive: install-multi
+mostlyclean-recursive: mostlyclean-multi
+clean-recursive: clean-multi
+distclean-recursive: distclean-multi
+maintainer-clean-recursive: maintainer-clean-multi
index b28da9472fda8437fc19cc7486531dfc344e6744..8e6cbcf1e016e95928c987ff0e2c510d12c33ec5 100644 (file)
@@ -5,7 +5,8 @@ MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = ccstdc.m4 cond.m4 dmalloc.m4 error.m4 header.m4 init.m4 \
-lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 obstack.m4        \
-protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
+lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 \
+obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
+termios.m4 winsz.m4
 
 EXTRA_DIST = $(m4data_DATA)
index 6ff3e096e77dd6189662d06732c0c020b7dd7d59..7a7f12e5c8b2bcdfb69be2c311531d9650cf78ca 100644 (file)
@@ -68,8 +68,9 @@ MAINT_CHARSET = latin1
 
 m4datadir = $(datadir)/aclocal
 m4data_DATA = ccstdc.m4 cond.m4 dmalloc.m4 error.m4 header.m4 init.m4 \
-lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 obstack.m4        \
-protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 termios.m4 winsz.m4
+lex.m4 lispdir.m4 maintainer.m4 missing.m4 mktime.m4 multi.m4 \
+obstack.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strtod.m4 \
+termios.m4 winsz.m4
 
 EXTRA_DIST = $(m4data_DATA)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/m4/multi.m4 b/m4/multi.m4
new file mode 100644 (file)
index 0000000..b0e6591
--- /dev/null
@@ -0,0 +1,41 @@
+dnl Add --enable-multilib to configure.
+dnl Usage: AM_ENABLE_MULTILIB([makefile, [rel-to-top-srcdir]])
+
+AC_DEFUN(AM_ENABLE_MULTILIB, [
+dnl 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]
+
+dnl We may get other options which we are undocumented:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+if test "[$]{srcdir}" = "."; then
+  if test "[$]{with_target_subdir}" != "."; then
+    multi_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])"
+  else
+    multi_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])"
+  fi
+else
+  multi_basedir="[$]{srcdir}/ifelse([$2],,,[$2])"
+fi
+AC_SUBST(multi_basedir)
+
+AC_OUTPUT_COMMANDS([
+if test -n "$CONFIG_FILES"; then
+   ac_file=ifelse([$1],,Makefile,[$1]) . ..ifelse([$2],,,/[$2])/config-ml.in
+fi], [
+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
diff --git a/multilib.am b/multilib.am
new file mode 100644 (file)
index 0000000..728a78d
--- /dev/null
@@ -0,0 +1,45 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 1998 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+## Multilib support variables.
+MULTISRCTOP =
+MULTIBUILDTOP =
+MULTIDIRS =
+MULTISUBDIR =
+MULTIDO = true
+MULTICLEAN = true
+
+all-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
+install-multi:
+       $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
+mostlyclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
+clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
+distclean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
+maintainer-clean-multi:
+       $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
+
+## FIXME: this is probably broken.
+all-recursive: all-multi
+install-recursive: install-multi
+mostlyclean-recursive: mostlyclean-multi
+clean-recursive: clean-multi
+distclean-recursive: distclean-multi
+maintainer-clean-recursive: maintainer-clean-multi
This page took 0.052132 seconds and 5 git commands to generate.