source: trunk/essentials/sys-devel/automake-1.7/tests/multlib.test

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

automake 1.7.9

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