1 | #! /bin/sh
|
---|
2 | # Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
---|
3 | #
|
---|
4 | # This file is part of GNU Automake.
|
---|
5 | #
|
---|
6 | # GNU Automake is free software; you can redistribute it and/or modify
|
---|
7 | # it under the terms of the GNU General Public License as published by
|
---|
8 | # the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | # any later version.
|
---|
10 | #
|
---|
11 | # GNU Automake is distributed in the hope that it will be useful,
|
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | # GNU General Public License for more details.
|
---|
15 | #
|
---|
16 | # You should have received a copy of the GNU General Public License
|
---|
17 | # along with Automake; see the file COPYING. If not, write to
|
---|
18 | # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
19 | # Boston, MA 02110-1301, USA.
|
---|
20 |
|
---|
21 | # Check multilib support.
|
---|
22 | # Based on a test case from Ralf Corsepius.
|
---|
23 |
|
---|
24 | required='gcc GNUmake'
|
---|
25 | . ./defs || exit 1
|
---|
26 |
|
---|
27 | set -e
|
---|
28 |
|
---|
29 | cat >configure.in <<'END'
|
---|
30 | AC_INIT([multlib], [1.0])
|
---|
31 | AC_CONFIG_SRCDIR(libfoo/foo.c)
|
---|
32 | AC_CONFIG_AUX_DIR(.)
|
---|
33 | AM_INIT_AUTOMAKE
|
---|
34 | AC_CONFIG_FILES([Makefile])
|
---|
35 | AC_CONFIG_SUBDIRS(libfoo)
|
---|
36 | AC_CONFIG_SUBDIRS(libbar)
|
---|
37 | AC_OUTPUT
|
---|
38 | END
|
---|
39 |
|
---|
40 | cat >mycc <<'END'
|
---|
41 | #! /bin/sh
|
---|
42 | case ${1+"$@"} in
|
---|
43 | *-print-multi-lib*)
|
---|
44 | echo ".;"
|
---|
45 | echo "debug;@g"
|
---|
46 | exit 0 ;;
|
---|
47 | esac
|
---|
48 | gcc ${1+"$@"}
|
---|
49 | END
|
---|
50 |
|
---|
51 | chmod +x mycc
|
---|
52 |
|
---|
53 | cat >Makefile.am <<'EOF'
|
---|
54 | SUBDIRS = @subdirs@
|
---|
55 | EXTRA_DIST = config-ml.in symlink-tree
|
---|
56 | EOF
|
---|
57 |
|
---|
58 | # libfoo tests multilib supports when there are no subdirectories
|
---|
59 | # libbar tests multilib supports when there are subdirectories
|
---|
60 |
|
---|
61 | mkdir libfoo
|
---|
62 |
|
---|
63 | cat >libfoo/configure.in <<'END'
|
---|
64 | AC_PREREQ(2.57)
|
---|
65 | AC_INIT(libfoo, 0.1, nobody@localhost)
|
---|
66 | AC_CONFIG_SRCDIR(foo.c)
|
---|
67 | # Apparently it doesn't work to have auxdir=.. when
|
---|
68 | # multilib uses symlinked trees.
|
---|
69 | AC_CONFIG_AUX_DIR(.)
|
---|
70 | AM_INIT_AUTOMAKE(foreign)
|
---|
71 | AC_PROG_CC
|
---|
72 | AC_PROG_RANLIB
|
---|
73 | AM_ENABLE_MULTILIB(Makefile,[..])
|
---|
74 | AC_CONFIG_FILES([Makefile])
|
---|
75 | AC_OUTPUT
|
---|
76 | END
|
---|
77 |
|
---|
78 | cat >libfoo/Makefile.am <<'END'
|
---|
79 | noinst_LIBRARIES = libfoo.a
|
---|
80 | libfoo_a_SOURCES = foo.c
|
---|
81 | END
|
---|
82 |
|
---|
83 | : > libfoo/foo.c
|
---|
84 |
|
---|
85 | mkdir libbar
|
---|
86 |
|
---|
87 | cat >libbar/configure.in <<'END'
|
---|
88 | AC_PREREQ(2.57)
|
---|
89 | AC_INIT(libbar, 0.1, nobody@localhost)
|
---|
90 | # Apparently it doesn't work to have auxdir=.. when
|
---|
91 | # multilib uses symlinked trees.
|
---|
92 | AC_CONFIG_AUX_DIR(.)
|
---|
93 | AM_INIT_AUTOMAKE(foreign)
|
---|
94 | AC_PROG_CC
|
---|
95 | AC_PROG_RANLIB
|
---|
96 | AM_ENABLE_MULTILIB(Makefile,[..])
|
---|
97 | AC_CONFIG_FILES([Makefile sub/Makefile])
|
---|
98 | AC_OUTPUT
|
---|
99 | END
|
---|
100 |
|
---|
101 | cat >libbar/Makefile.am <<'END'
|
---|
102 | SUBDIRS = sub
|
---|
103 | noinst_LIBRARIES = libbar.a
|
---|
104 | libbar_a_SOURCES = bar.c
|
---|
105 | END
|
---|
106 |
|
---|
107 | mkdir libbar/sub
|
---|
108 |
|
---|
109 | : >libbar/sub/Makefile.am
|
---|
110 |
|
---|
111 | : > libbar/bar.c
|
---|
112 |
|
---|
113 | cp $testsrcdir/../lib/config-ml.in .
|
---|
114 | cp $testsrcdir/../lib/symlink-tree .
|
---|
115 |
|
---|
116 | $ACLOCAL
|
---|
117 | $AUTOCONF
|
---|
118 | $AUTOMAKE --add-missing
|
---|
119 | cd libfoo
|
---|
120 | $ACLOCAL
|
---|
121 | $AUTOCONF
|
---|
122 | $AUTOMAKE --add-missing
|
---|
123 | cd ../libbar
|
---|
124 | $ACLOCAL
|
---|
125 | $AUTOCONF
|
---|
126 | $AUTOMAKE --add-missing
|
---|
127 | cd ..
|
---|
128 |
|
---|
129 |
|
---|
130 | # Check VPATH builds
|
---|
131 | mkdir build
|
---|
132 | cd build
|
---|
133 | ../configure --enable-multilib CC=`pwd`/../mycc
|
---|
134 | $MAKE
|
---|
135 | $MAKE install
|
---|
136 | $MAKE distcleancheck
|
---|
137 |
|
---|
138 | # Check standard builds.
|
---|
139 | cd ..
|
---|
140 | # Why to I have to specify --with-target-subdir?
|
---|
141 | ./configure --enable-multilib --with-target-subdir=. CC=`pwd`/mycc
|
---|
142 | $MAKE
|
---|