* 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-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
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)
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)
# 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.
$contents{'SOURCES'} = join (' ', @sources);
$contents{'OBJECTS'} = join (' ', @objects);
+ &handle_multilib;
&handle_texinfo;
&handle_emacs_lisp;
&handle_java;
}
}
+# 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
{
$seen_canonical = $AC_CANONICAL_HOST if ! $seen_canonical;
}
+ $seen_multilib = 1 if (/AM_ENABLE_MULTILIB/);
+
if (/$AM_CONDITIONAL_PATTERN/o)
{
$configure_cond{$1} = 1;
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
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)
--- /dev/null
+## 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
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)
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
--- /dev/null
+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
--- /dev/null
+## 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