multi.m4 revision 1.1 1 1.1 mrg ## -*- Autoconf -*-
2 1.1 mrg # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2008
3 1.1 mrg # Free Software Foundation, Inc.
4 1.1 mrg #
5 1.1 mrg # This file is free software; the Free Software Foundation
6 1.1 mrg # gives unlimited permission to copy and/or distribute it,
7 1.1 mrg # with or without modifications, as long as this notice is preserved.
8 1.1 mrg
9 1.1 mrg # serial 6
10 1.1 mrg
11 1.1 mrg # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
12 1.1 mrg # ---------------------------------------------------
13 1.1 mrg # Add --enable-multilib to configure.
14 1.1 mrg AC_DEFUN([AM_ENABLE_MULTILIB],
15 1.1 mrg [# Default to --enable-multilib
16 1.1 mrg AC_ARG_ENABLE(multilib,
17 1.1 mrg [ --enable-multilib build many library versions (default)],
18 1.1 mrg [case "$enableval" in
19 1.1 mrg yes) multilib=yes ;;
20 1.1 mrg no) multilib=no ;;
21 1.1 mrg *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
22 1.1 mrg esac],
23 1.1 mrg [multilib=yes])
24 1.1 mrg
25 1.1 mrg # We may get other options which we leave undocumented:
26 1.1 mrg # --with-target-subdir, --with-multisrctop, --with-multisubdir
27 1.1 mrg # See config-ml.in if you want the gory details.
28 1.1 mrg
29 1.1 mrg if test "$srcdir" = "."; then
30 1.1 mrg if test "$with_target_subdir" != "."; then
31 1.1 mrg multi_basedir="$srcdir/$with_multisrctop../$2"
32 1.1 mrg else
33 1.1 mrg multi_basedir="$srcdir/$with_multisrctop$2"
34 1.1 mrg fi
35 1.1 mrg else
36 1.1 mrg multi_basedir="$srcdir/$2"
37 1.1 mrg fi
38 1.1 mrg AC_SUBST(multi_basedir)
39 1.1 mrg
40 1.1 mrg # Even if the default multilib is not a cross compilation,
41 1.1 mrg # it may be that some of the other multilibs are.
42 1.1 mrg if test $cross_compiling = no && test $multilib = yes \
43 1.1 mrg && test "x${with_multisubdir}" != x ; then
44 1.1 mrg cross_compiling=maybe
45 1.1 mrg fi
46 1.1 mrg
47 1.1 mrg AC_OUTPUT_COMMANDS([
48 1.1 mrg # Only add multilib support code if we just rebuilt the top-level
49 1.1 mrg # Makefile.
50 1.1 mrg case " $CONFIG_FILES " in
51 1.1 mrg *" ]m4_default([$1],Makefile)[ "*)
52 1.1 mrg ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
53 1.1 mrg ;;
54 1.1 mrg esac],
55 1.1 mrg [
56 1.1 mrg srcdir="$srcdir"
57 1.1 mrg host="$host"
58 1.1 mrg target="$target"
59 1.1 mrg with_multisubdir="$with_multisubdir"
60 1.1 mrg with_multisrctop="$with_multisrctop"
61 1.1 mrg with_target_subdir="$with_target_subdir"
62 1.1 mrg ac_configure_args="${multilib_arg} ${ac_configure_args}"
63 1.1 mrg multi_basedir="$multi_basedir"
64 1.1 mrg CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
65 1.1 mrg CC="$CC"
66 1.1 mrg CXX="$CXX"
67 1.1 mrg GFORTRAN="$GFORTRAN"
68 1.1 mrg GCJ="$GCJ"])])dnl
69