source: trunk/test/gen_libmy_shared.sh @ 3130

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

merge release 0.11 into trunk

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1# $Id: gen_libmy_shared.sh 3130 2013-11-18 07:38:59Z peter $
2
3# Create a shared library: test/lib/libmy-shared.la
4
5# Copyright (C) 2013 Peter Johansson
6#
7# This file is part of the yat library, http://dev.thep.lu.se/yat
8#
9# The yat library is free software; you can redistribute it
10# and/or modify it under the terms of the GNU General Public License as
11# published by the Free Software Foundation; either version 3 of the
12# License, or (at your option) any later version.
13#
14# The yat library is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with yat. If not, see <http://www.gnu.org/licenses/>.
21
22set -e
23. test/defs.sh || exit 99
24
25rm -rf $test_dir/*
26$mkdir_p $test_dir
27cd $test_dir
28
29# redefine so we can call check_requirment without exit
30exit_skip ()
31{
32    req_failed=yes
33}
34
35required="autoconf automake libtool shared"
36check_requirements > stdout 2> stderr
37
38# if requirments are misssing we just create an empty dummy file (to
39# avoid triggering the make target over and over again)
40if test x$req_failed = xyes; then
41    $mkdir_p $abs_top_builddir/test/lib
42    : > $abs_top_builddir/test/lib/libmy-shared.la
43    exit 0
44fi
45
46cat > configure.ac <<EOF
47AC_INIT([foo], [1])
48AC_CONFIG_MACRO_DIR([m4])
49AM_INIT_AUTOMAKE([foreign])
50AC_PROG_CXX
51LT_INIT([disable-static])
52AC_CONFIG_FILES([Makefile])
53AC_OUTPUT
54EOF
55
56cat > Makefile.am <<EOF
57ACLOCAL_AMFLAGS = -I m4
58lib_LTLIBRARIES = libmy-shared.la
59libmy_shared_la_SOURCES = foo.cc
60EOF
61
62cat > foo.cc <<EOF
63int foo_shared(void) { return 0; }
64EOF
65
66verbose=
67bootstrap
68./configure --libdir=$abs_top_builddir/test/lib || exit 1
69
70unset MAKEFLAGS
71make install V=0 || exit 1
72exit 0
Note: See TracBrowser for help on using the repository browser.