source: trunk/test/yat_lt_link_ifelse_test.sh @ 2245

Last change on this file since 2245 was 2245, checked in by Peter, 12 years ago

first version of macro YAT_LT_LINK_IFELSE. Currently limited to C++ and the output in config.log should probably be limited. refs #496

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1#! /bin/sh
2# $Id: yat_lt_link_ifelse_test.sh 2245 2010-04-21 13:46:24Z peter $
3#
4# Copyright (C) 2009 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
21
22# build a `hello world' project that uses macro YAT_LT_LINK_IFELSE in its
23# configure.ac. Test if the macro works against an uninstalled yat.
24
25required="autoconf automake libtool"
26
27set -e
28
29. ./common_defs.sh || exit 1
30
31cat >> configure.ac <<EOF
32YAT_FIND_YAT
33m4_define([PROG],
34          [AC_LANG_PROGRAM([@%:@include <string>
35                            namespace theplu{
36                            namespace yat {
37                            namespace utility {
38                              std::string version(void);
39                            }}}
40                           ],
41                           [using namespace theplu::yat::utility;
42                            std::string s=version();
43                           ])
44           ])
45LIBS=-lrapakalja
46YAT_LT_LINK_IFELSE([PROG],
47                   [AC_MSG_ERROR([unexpectedly succesful linking with $LIBS])])
48LIBS=\`\$yat_config --link-libtool\`;
49YAT_LT_LINK_IFELSE([PROG],
50                   [test_result=ok; AC_SUBST(test_result)],
51                   [AC_MSG_ERROR([cannot libtool link yat])])
52AC_CONFIG_FILES([Makefile])
53AC_OUTPUT
54EOF
55
56# bootstrapping
57bootstrap
58if ./configure --with-yat=$abs_top_builddir/build_support/yat-config; then
59    echo OK;
60else
61    tail -n 30 config.log;
62    exit 1;
63fi
64
65grep test_result Makefile || exit 1
Note: See TracBrowser for help on using the repository browser.