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