* ChangeLog, ChangeLog.1996, ChangeLog.1998, ChangeLog.2000,
[platform/upstream/automake.git] / m4 / multi.m4
1 # serial 2
2
3 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
4 # ---------------------------------------------------
5 # Add --enable-multilib to configure.
6
7 # Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
8
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # 02111-1307, USA.
23
24 AC_DEFUN([AM_ENABLE_MULTILIB],
25 [# Default to --enable-multilib
26 AC_ARG_ENABLE(multilib,
27 [  --enable-multilib         build many library versions (default)],
28 [case "$enableval" in
29   yes) multilib=yes ;;
30   no)  multilib=no ;;
31   *)   AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
32  esac],
33               [multilib=yes])
34
35 # We may get other options which we leave undocumented:
36 # --with-target-subdir, --with-multisrctop, --with-multisubdir
37 # See config-ml.in if you want the gory details.
38
39 if test "$srcdir" = "."; then
40   if test "$with_target_subdir" != "."; then
41     multi_basedir="$srcdir/$with_multisrctop../$2"
42   else
43     multi_basedir="$srcdir/$with_multisrctop$2"
44   fi
45 else
46   multi_basedir="$srcdir/$2"
47 fi
48 AC_SUBST(multi_basedir)
49
50 AC_OUTPUT_COMMANDS([
51 # Only add multilib support code if we just rebuilt the top-level
52 # Makefile.
53 case " $CONFIG_FILES " in
54  *" ifelse([$1],,Makefile,[$1]) "*)
55    ac_file=ifelse([$1],,Makefile,[$1]) . ${multi_basedir}/config-ml.in
56    ;;
57 esac],
58                    [
59 srcdir="$srcdir"
60 host="$host"
61 target="$target"
62 with_multisubdir="$with_multisubdir"
63 with_multisrctop="$with_multisrctop"
64 with_target_subdir="$with_target_subdir"
65 ac_configure_args="${multilib_arg} ${ac_configure_args}"
66 multi_basedir="$multi_basedir"
67 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
68 CC="$CC"])])dnl