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