2 # Copyright (C) 2003, 2004, 2007, 2010, 2012 Free Software Foundation,
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Check multilib support.
19 # Based on a test case from Ralf Corsepius.
21 required='gcc GNUmake'
26 # Multilib support has been deprecated in the Automake core.
28 cat >>configure.in <<'END'
29 AM_ENABLE_MULTILIB([Makefile], [.])
33 $AUTOCONF -Wall -Werror 2>stderr && { cat stderr >&2; Exit 1; }
35 grep '^configure\.in:4:.*AM_ENABLE_MULTILIB.* removed.* soon' stderr
36 grep '"multilib".*feature' stderr
37 grep 'contrib.* in the Automake distribution' stderr
39 rm -rf autom4te*.cache aclocal.m4 configure
41 # Functional tests now.
43 cat >configure.in <<'END'
44 AC_INIT([multlib], [1.0])
45 AC_CONFIG_SRCDIR(libfoo/foo.c)
48 AC_CONFIG_FILES([Makefile])
49 AC_CONFIG_SUBDIRS(libfoo)
50 AC_CONFIG_SUBDIRS(libbar)
66 PATH=`pwd`$PATH_SEPARATOR$PATH
68 cat >Makefile.am <<'EOF'
70 EXTRA_DIST = config-ml.in symlink-tree
73 # libfoo tests multilib supports when there are no subdirectories
74 # libbar tests multilib supports when there are subdirectories
78 cat >libfoo/configure.in <<'END'
80 AC_INIT(libfoo, 0.1, nobody@localhost)
81 AC_CONFIG_SRCDIR(foo.c)
82 # Apparently it doesn't work to have auxdir=.. when
83 # multilib uses symlinked trees.
88 AM_ENABLE_MULTILIB(Makefile,[..])
89 AC_CONFIG_FILES([Makefile])
93 cat >libfoo/Makefile.am <<'END'
94 noinst_LIBRARIES = libfoo.a
95 libfoo_a_SOURCES = foo.c
102 cat >libbar/configure.in <<'END'
104 AC_INIT(libbar, 0.1, nobody@localhost)
105 # Apparently it doesn't work to have auxdir=.. when
106 # multilib uses symlinked trees.
111 AM_ENABLE_MULTILIB(Makefile,[..])
112 AC_CONFIG_FILES([Makefile sub/Makefile])
116 cat >libbar/Makefile.am <<'END'
118 noinst_LIBRARIES = libbar.a
119 libbar_a_SOURCES = bar.c
124 : >libbar/sub/Makefile.am
128 cp "$testsrcdir/../lib/config-ml.in" .
129 cp "$testsrcdir/../lib/symlink-tree" .
131 $ACLOCAL -Wno-obsolete
132 $AUTOCONF -Werror -Wall -Wno-obsolete
133 $AUTOMAKE --add-missing
136 $AUTOCONF -Werror -Wall -Wno-obsolete
137 $AUTOMAKE --add-missing
140 $AUTOCONF -Werror -Wall -Wno-obsolete
141 $AUTOMAKE --add-missing
148 ../configure --enable-multilib CC=mycc
153 # Check standard builds.
155 # Why to I have to specify --with-target-subdir?
156 ./configure --enable-multilib --with-target-subdir=. CC=mycc