source: vendor/automake/1.9.6/tests/multlib.test

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 3.0 KB
Line 
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
24required='gcc GNUmake'
25. ./defs || exit 1
26
27set -e
28
29cat >configure.in <<'END'
30AC_INIT([multlib], [1.0])
31AC_CONFIG_SRCDIR(libfoo/foo.c)
32AC_CONFIG_AUX_DIR(.)
33AM_INIT_AUTOMAKE
34AC_CONFIG_FILES([Makefile])
35AC_CONFIG_SUBDIRS(libfoo)
36AC_CONFIG_SUBDIRS(libbar)
37AC_OUTPUT
38END
39
40cat >mycc <<'END'
41#! /bin/sh
42case ${1+"$@"} in
43 *-print-multi-lib*)
44 echo ".;"
45 echo "debug;@g"
46 exit 0 ;;
47esac
48gcc ${1+"$@"}
49END
50
51chmod +x mycc
52
53cat >Makefile.am <<'EOF'
54SUBDIRS = @subdirs@
55EXTRA_DIST = config-ml.in symlink-tree
56EOF
57
58# libfoo tests multilib supports when there are no subdirectories
59# libbar tests multilib supports when there are subdirectories
60
61mkdir libfoo
62
63cat >libfoo/configure.in <<'END'
64AC_PREREQ(2.57)
65AC_INIT(libfoo, 0.1, nobody@localhost)
66AC_CONFIG_SRCDIR(foo.c)
67# Apparently it doesn't work to have auxdir=.. when
68# multilib uses symlinked trees.
69AC_CONFIG_AUX_DIR(.)
70AM_INIT_AUTOMAKE(foreign)
71AC_PROG_CC
72AC_PROG_RANLIB
73AM_ENABLE_MULTILIB(Makefile,[..])
74AC_CONFIG_FILES([Makefile])
75AC_OUTPUT
76END
77
78cat >libfoo/Makefile.am <<'END'
79noinst_LIBRARIES = libfoo.a
80libfoo_a_SOURCES = foo.c
81END
82
83: > libfoo/foo.c
84
85mkdir libbar
86
87cat >libbar/configure.in <<'END'
88AC_PREREQ(2.57)
89AC_INIT(libbar, 0.1, nobody@localhost)
90# Apparently it doesn't work to have auxdir=.. when
91# multilib uses symlinked trees.
92AC_CONFIG_AUX_DIR(.)
93AM_INIT_AUTOMAKE(foreign)
94AC_PROG_CC
95AC_PROG_RANLIB
96AM_ENABLE_MULTILIB(Makefile,[..])
97AC_CONFIG_FILES([Makefile sub/Makefile])
98AC_OUTPUT
99END
100
101cat >libbar/Makefile.am <<'END'
102SUBDIRS = sub
103noinst_LIBRARIES = libbar.a
104libbar_a_SOURCES = bar.c
105END
106
107mkdir libbar/sub
108
109: >libbar/sub/Makefile.am
110
111: > libbar/bar.c
112
113cp $testsrcdir/../lib/config-ml.in .
114cp $testsrcdir/../lib/symlink-tree .
115
116$ACLOCAL
117$AUTOCONF
118$AUTOMAKE --add-missing
119cd libfoo
120$ACLOCAL
121$AUTOCONF
122$AUTOMAKE --add-missing
123cd ../libbar
124$ACLOCAL
125$AUTOCONF
126$AUTOMAKE --add-missing
127cd ..
128
129
130# Check VPATH builds
131mkdir build
132cd build
133../configure --enable-multilib CC=`pwd`/../mycc
134$MAKE
135$MAKE install
136$MAKE distcleancheck
137
138# Check standard builds.
139cd ..
140# Why to I have to specify --with-target-subdir?
141./configure --enable-multilib --with-target-subdir=. CC=`pwd`/mycc
142$MAKE
Note: See TracBrowser for help on using the repository browser.