1# with-pic.at -- test the --with-pic flag -*- Autotest -*-
2
3#   Copyright (C) 2010-2015 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
24AT_SETUP([test --with-pic])
25
26# Set up a tests/demo.at style project.
27_LT_DEMO_SETUP
28
29# Bootstrap, and configure it so that we can extract libtool --config
30# settings.
31LT_AT_BOOTSTRAP([], [-I m4], [], [--add-missing], [],
32    [], [ignore])
33eval `$LIBTOOL --config | $EGREP '^(pic_flag|FGREP)='`
34
35no_dlls=:
36case " $pic_flag " in
37*" -DDLL_EXPORT "*) no_dlls=false ;;
38esac
39AT_CHECK([$no_dlls || exit 77])
40AT_CHECK([test . != "$at_srcdir" || exit 77])
41
42: ${MAKE=make}
43
44LT_AT_CONFIGURE([--disable-shared --with-pic=no])
45AT_CHECK([$MAKE], [], [stdout], [ignore])
46AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
47$MAKE clean
48
49LT_AT_CONFIGURE([--disable-shared --with-pic=yes])
50AT_CHECK([$MAKE], [], [stdout], [ignore])
51AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
52$MAKE clean
53
54LT_AT_CONFIGURE([--disable-shared --with-pic="demo,foo,bar"])
55AT_CHECK([$MAKE], [], [stdout], [ignore])
56AT_CHECK([$FGREP "$pic_flag" stdout], [], [ignore], [ignore])
57$MAKE clean
58
59LT_AT_CONFIGURE([--disable-shared --with-pic="foo,bar"])
60AT_CHECK([$MAKE], [], [stdout], [ignore])
61AT_CHECK([$FGREP -v "$pic_flag" stdout], [], [ignore], [ignore])
62$MAKE clean
63
64AT_CLEANUP
65