source: trunk/test/yat_lt_link_la_ifelse_test.sh @ 3069

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

New macro YAT_LT_LINK_LA_IFELSE that tests if we can use code and LIBS
to create a libtool archive.

test/yat_lt_link_la_ifelse_test.sh: Test for new macro

test/yat_lt_compile_ifelse_test.sh: Another test checking that
compiling works with YAT_USE_LIBTOOL_PUSH

refs #759

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/sh
2# $Id: yat_lt_link_la_ifelse_test.sh 3069 2013-08-27 03:33:22Z 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"
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([
54    int foo_static(void);
55    int my_func(void) { return foo_static(); }
56  ],[
57    AC_MSG_RESULT([yes])
58    AC_MSG_FAILURE
59  ],[
60    AC_MSG_RESULT([no])
61  ])
62
63AC_CONFIG_FILES([Makefile])
64AC_OUTPUT
65EOF
66
67bootstrap
68./configure || exit_fail
69exit_success
Note: See TracBrowser for help on using the repository browser.