2 # Copyright (C) 1998-2024 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
10 # AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
11 # ---------------------------------------------------
12 # Add --enable-multilib to configure.
13 AC_DEFUN([AM_ENABLE_MULTILIB],
14 [# Default to --enable-multilib
15 AC_ARG_ENABLE(multilib,
16 [ --enable-multilib build many library versions (default)],
20 *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
24 # We may get other options which we leave undocumented:
25 # --with-target-subdir, --with-multisrctop, --with-multisubdir
26 # See config-ml.in if you want the gory details.
28 if test "$srcdir" = "."; then
29 if test "$with_target_subdir" != "."; then
30 multi_basedir="$srcdir/$with_multisrctop../$2"
32 multi_basedir="$srcdir/$with_multisrctop$2"
35 multi_basedir="$srcdir/$2"
37 AC_SUBST(multi_basedir)
39 # Even if the default multilib is not a cross compilation,
40 # it may be that some of the other multilibs are.
41 if test $cross_compiling = no && test $multilib = yes \
42 && test "x${with_multisubdir}" != x ; then
47 # Only add multilib support code if we just rebuilt the top-level
49 case " $CONFIG_FILES " in
50 *" ]m4_default([$1],Makefile)[ "*)
51 ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
58 with_multisubdir="$with_multisubdir"
59 with_multisrctop="$with_multisrctop"
60 with_target_subdir="$with_target_subdir"
61 ac_configure_args="${multilib_arg} ${ac_configure_args}"
62 multi_basedir="$multi_basedir"
63 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}