2 # Copyright (C) 2003, 2004, 2007, 2010, 2011, 2012 Free Software
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'
24 # Multilib support has been deprecated in the Automake core.
26 cat >>configure.in <<'END'
27 AM_ENABLE_MULTILIB([Makefile], [.])
31 $AUTOCONF -Wall -Werror 2>stderr && { cat stderr >&2; Exit 1; }
33 grep '^configure\.in:4:.*AM_ENABLE_MULTILIB.* removed.* soon' stderr
34 grep '"multilib".*feature' stderr
35 grep 'contrib.* in the Automake distribution' stderr
37 rm -rf autom4te*.cache aclocal.m4 configure
39 # Functional tests now.
41 cat >configure.in <<'END'
42 AC_INIT([multlib], [1.0])
43 AC_CONFIG_SRCDIR(libfoo/foo.c)
46 AC_CONFIG_FILES([Makefile])
47 AC_CONFIG_SUBDIRS(libfoo)
48 AC_CONFIG_SUBDIRS(libbar)
64 PATH=`pwd`$PATH_SEPARATOR$PATH
66 cat >Makefile.am <<'EOF'
68 EXTRA_DIST = config-ml.in symlink-tree
71 # libfoo tests multilib supports when there are no subdirectories
72 # libbar tests multilib supports when there are subdirectories
76 cat >libfoo/configure.in <<'END'
78 AC_INIT(libfoo, 0.1, nobody@localhost)
79 AC_CONFIG_SRCDIR(foo.c)
80 # Apparently it doesn't work to have auxdir=.. when
81 # multilib uses symlinked trees.
87 AM_ENABLE_MULTILIB(Makefile,[..])
88 AC_CONFIG_FILES([Makefile])
92 cat >libfoo/Makefile.am <<'END'
93 noinst_LIBRARIES = libfoo.a
94 libfoo_a_SOURCES = foo.c
101 cat >libbar/configure.in <<'END'
103 AC_INIT(libbar, 0.1, nobody@localhost)
104 # Apparently it doesn't work to have auxdir=.. when
105 # 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 "$am_scriptdir"/config-ml.in "$am_scriptdir"/symlink-tree .
130 $ACLOCAL -Wno-obsolete
131 $AUTOCONF -Werror -Wall -Wno-obsolete
132 $AUTOMAKE --add-missing
135 $AUTOCONF -Werror -Wall -Wno-obsolete
136 $AUTOMAKE --add-missing
139 $AUTOCONF -Werror -Wall -Wno-obsolete
140 $AUTOMAKE --add-missing
147 ../configure --enable-multilib CC=mycc
152 # Check standard builds.
154 # Why to I have to specify --with-target-subdir?
155 ./configure --enable-multilib --with-target-subdir=. CC=mycc