1 # with-pic.at -- test the --with-pic flag -*- Autotest -*-
3 # Copyright (C) 2010 Free Software Foundation, Inc.
5 # This file is part of GNU Libtool.
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.
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.
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.
24 AT_SETUP([test --with-pic])
25 eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`
27 AT_CHECK([test "z$pic_flag" != "z" || exit 77])
28 AT_CHECK([test "$at_srcdir" != . || exit 77])
30 CONFIGURE=$abs_top_srcdir/tests/demo/configure
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])
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])
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])
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])