source: libbsdport/m4/multilib-fix.m4 @ a8bf95d

B_20100615baselibbsdport-4-10-branch
Last change on this file since a8bf95d was a8bf95d, checked in by Till Straumann <strauman@…>, on Apr 22, 2009 at 10:06:58 PM
  • importing updated version from SLAC as of 20090422
  • Property mode set to 100644
File size: 2.4 KB
Line 
1# Automake-1.10's AM_ENABLE_MULTILIB is buggy - it
2# does not properly preserve quoting when copying
3# ac_configure_args to the 'config.status' it creates.
4# I guess one level of quoting is removed when the
5# copying happens (by means of a 'here'-document in
6# AC_OUTPUT_COMMANDS).
7#
8# Note that we cannot use a different name since
9# automake 'knows' about AM_ENABLE_MULTILIB and
10# behaves differently if we would, e.g., name the
11# modified macro 'MY_ENABLE_MULTILIB'.
12# Hence we hope that we can override automake/aclocal's
13# definition.
14#
15# Below (look at the 'sed' code) we replace all occurrences
16# of '$' by '\$' so that 'config.status' again says '$'.
17#
18# This is important if we want to pass e.g.,
19#
20#   --exec-prefix='${prefix}/xxx'
21#
22# correctly to the multisubdir configurations.
23#
24# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR])
25# ---------------------------------------------------
26# Add --enable-multilib to configure.
27AC_DEFUN([AM_ENABLE_MULTILIB],
28[# Default to --enable-multilib
29AC_ARG_ENABLE(multilib,
30[  --enable-multilib       build many library versions (default)],
31[case "$enableval" in
32  yes) multilib=yes ;;
33  no)  multilib=no ;;
34  *)   AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
35 esac],
36              [multilib=yes])
37
38# We may get other options which we leave undocumented:
39# --with-target-subdir, --with-multisrctop, --with-multisubdir
40# See config-ml.in if you want the gory details.
41
42if test "$srcdir" = "."; then
43  if test "$with_target_subdir" != "."; then
44    multi_basedir="$srcdir/$with_multisrctop../$2"
45  else
46    multi_basedir="$srcdir/$with_multisrctop$2"
47  fi
48else
49  multi_basedir="$srcdir/$2"
50fi
51AC_SUBST(multi_basedir)
52
53# Even if the default multilib is not a cross compilation,
54# it may be that some of the other multilibs are.
55if test $cross_compiling = no && test $multilib = yes \
56   && test "x${with_multisubdir}" != x ; then
57   cross_compiling=maybe
58fi
59
60AC_OUTPUT_COMMANDS([
61# Only add multilib support code if we just rebuilt the top-level
62# Makefile.
63case " $CONFIG_FILES " in
64 *" ]m4_default([$1],Makefile)[ "*)
65   ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
66   ;;
67esac],
68                   [
69srcdir="$srcdir"
70host="$host"
71target="$target"
72with_multisubdir="$with_multisubdir"
73with_multisrctop="$with_multisrctop"
74with_target_subdir="$with_target_subdir"
75ac_configure_args="${multilib_arg} `echo ${ac_configure_args} | sed -e 's/[$]/\\\\$/g'`"
76multi_basedir="$multi_basedir"
77CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
78CC="$CC"])])dnl
Note: See TracBrowser for help on using the repository browser.