source: trunk/test/yat_lt_link_la_ifelse_test.sh @ 3112

Last change on this file since 3112 was 3112, checked in by Peter, 8 years ago

In tests issue configure with --disable-shared/--disable-static if yat build was configure with shared/static disabled

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#! /bin/sh
2# $Id: yat_lt_link_la_ifelse_test.sh 3112 2013-11-10 05:02:19Z peter $
3#
4# Copyright (C) 2013 Peter Johansson
5#
6# This file is part of the yat library, http://dev.thep.lu.se/yat
7#
8# The yat library is free software; you can redistribute it
9# and/or modify it under the terms of the GNU General Public License as
10# published by the Free Software Foundation; either version 3 of the
11# License, or (at your option) any later version.
12#
13# The yat library is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with yat. If not, see <http://www.gnu.org/licenses/>.
20
21required="autoconf automake libtool libmy-static libmy-shared"
22set -e
23. ./test/init.sh || exit 99
24
25cat > configure.ac <<EOF
26AC_INIT([hello], [1.0])
27AC_CONFIG_MACRO_DIR([m4])
28AM_INIT_AUTOMAKE([foreign])
29AC_LANG([C++])
30AC_PROG_CXXCPP
31AC_PROG_CXX
32LT_INIT
33
34YAT_USE_LIBTOOL_PUSH
35
36rm -fr .libs
37
38LDFLAGS="-L$abs_top_builddir/test/lib"
39AC_MSG_CHECKING([whether linking against -lmy-shared works])
40LIBS=-lmy-shared
41YAT_LT_LINK_LA_IFELSE([
42    int foo_shared(void);
43    int my_func(void) { return foo_shared(); }
44  ],[
45    AC_MSG_RESULT([yes])
46  ],[
47    AC_MSG_RESULT([no])
48    AC_MSG_FAILURE
49  ])
50
51LIBS=-lmy-static
52AC_MSG_CHECKING([whether linking against -lmy-static works])
53YAT_LT_LINK_LA_IFELSE([
54namespace theplu {
55namespace yat {
56namespace utility {
57    int version(void);
58}}}
59    int my_func(void) { return theplu::yat::utility::version(); }
60  ],[
61    AC_MSG_RESULT([yes])
62    AC_MSG_FAILURE([expected configure to fail])
63  ],[
64    AC_MSG_RESULT([no])
65  ])
66
67AC_CONFIG_FILES([Makefile])
68AC_OUTPUT
69EOF
70
71bootstrap
72if ./configure $configure_opts; then
73    echo OK;
74else
75    tail -n 500 config.log;
76    exit_fail configure failed;
77fi
78
79exit_success
Note: See TracBrowser for help on using the repository browser.