Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / with-pic.at
1 # with-pic.at -- test the --with-pic flag -*- Autotest -*-
2
3 #   Copyright (C) 2010 Free Software Foundation, Inc.
4 #
5 #   This file is part of GNU Libtool.
6 #
7 # GNU Libtool is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or (at your option) any later version.
11 #
12 # GNU Libtool is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Libtool; see the file COPYING.  If not, a copy
19 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
20 # or obtained by writing to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 ####
23
24 AT_SETUP([test --with-pic])
25 eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`
26
27 AT_CHECK([test "z$pic_flag" != "z" || exit 77])
28 AT_CHECK([test "$at_srcdir" != . || exit 77])
29
30 CONFIGURE=$abs_top_srcdir/tests/demo/configure
31 : ${MAKE=make}
32
33 LT_AT_CONFIGURE([--disable-shared --with-pic=no], [$CONFIGURE])
34 AT_CHECK([$MAKE], [], [stdout], [ignore])
35 AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
36 $MAKE clean
37
38 LT_AT_CONFIGURE([--disable-shared --with-pic=yes], [$CONFIGURE])
39 AT_CHECK([$MAKE], [], [stdout], [ignore])
40 AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
41 $MAKE clean
42
43 LT_AT_CONFIGURE([--disable-shared --with-pic="demo,foo,bar"], [$CONFIGURE])
44 AT_CHECK([$MAKE], [], [stdout], [ignore])
45 AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
46 $MAKE clean
47
48 LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"], [$CONFIGURE])
49 AT_CHECK([$MAKE], [], [stdout], [ignore])
50 AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
51 $MAKE clean
52
53 AT_CLEANUP