hacking: update advice w.r.t. synced files
[automake.git] / m4 / multi.m4
blob447591f9e80d6f8a441d5d2bd31418ddc25c1f28
1 ##                                                          -*- Autoconf -*-
2 # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2012
3 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # serial 6
11 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
12 # ---------------------------------------------------
13 # Add --enable-multilib to configure.
14 AC_DEFUN([AM_ENABLE_MULTILIB],
15 [m4_warn([obsolete], [$0 will be removed from Automake core soon.
16 Files implementing the "multilib" feature are (and will remain) available
17 to the 'contrib/' directory in the Automake distribution.])]dnl
18 [# Default to --enable-multilib
19 AC_ARG_ENABLE(multilib,
20 [  --enable-multilib       build many library versions (default)],
21 [case "$enableval" in
22   yes) multilib=yes ;;
23   no)  multilib=no ;;
24   *)   AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
25  esac],
26               [multilib=yes])
28 # We may get other options which we leave undocumented:
29 # --with-target-subdir, --with-multisrctop, --with-multisubdir
30 # See config-ml.in if you want the gory details.
32 if test "$srcdir" = "."; then
33   if test "$with_target_subdir" != "."; then
34     multi_basedir="$srcdir/$with_multisrctop../$2"
35   else
36     multi_basedir="$srcdir/$with_multisrctop$2"
37   fi
38 else
39   multi_basedir="$srcdir/$2"
41 AC_SUBST(multi_basedir)
43 # Even if the default multilib is not a cross compilation,
44 # it may be that some of the other multilibs are.
45 if test $cross_compiling = no && test $multilib = yes \
46    && test "x${with_multisubdir}" != x ; then
47    cross_compiling=maybe
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  *" ]m4_default([$1],Makefile)[ "*)
55    ac_file=]m4_default([$1],Makefile)[ . ${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