4319 |
21 Feb 23 |
peter |
#! /bin/sh |
4319 |
21 Feb 23 |
peter |
# $Id$ |
4319 |
21 Feb 23 |
peter |
3 |
# |
4319 |
21 Feb 23 |
peter |
# Copyright (C) 2023 Peter Johansson |
4319 |
21 Feb 23 |
peter |
5 |
# |
4319 |
21 Feb 23 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
4319 |
21 Feb 23 |
peter |
7 |
# |
4319 |
21 Feb 23 |
peter |
# The yat library is free software; you can redistribute it |
4319 |
21 Feb 23 |
peter |
# and/or modify it under the terms of the GNU General Public License as |
4319 |
21 Feb 23 |
peter |
# published by the Free Software Foundation; either version 3 of the |
4319 |
21 Feb 23 |
peter |
# License, or (at your option) any later version. |
4319 |
21 Feb 23 |
peter |
12 |
# |
4319 |
21 Feb 23 |
peter |
# The yat library is distributed in the hope that it will be useful, |
4319 |
21 Feb 23 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4319 |
21 Feb 23 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4319 |
21 Feb 23 |
peter |
# General Public License for more details. |
4319 |
21 Feb 23 |
peter |
17 |
# |
4319 |
21 Feb 23 |
peter |
# You should have received a copy of the GNU General Public License |
4319 |
21 Feb 23 |
peter |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
4319 |
21 Feb 23 |
peter |
20 |
|
4319 |
21 Feb 23 |
peter |
21 |
|
4319 |
21 Feb 23 |
peter |
# test macro YAT_SVN_TIMESTAMP |
4319 |
21 Feb 23 |
peter |
23 |
|
4319 |
21 Feb 23 |
peter |
24 |
required="autoconf automake svnversion" |
4319 |
21 Feb 23 |
peter |
25 |
|
4319 |
21 Feb 23 |
peter |
26 |
set -e |
4319 |
21 Feb 23 |
peter |
27 |
|
4319 |
21 Feb 23 |
peter |
28 |
. test/init.sh || exit 99 |
4319 |
21 Feb 23 |
peter |
29 |
|
4319 |
21 Feb 23 |
peter |
30 |
cat >> configure.ac <<EOF |
4319 |
21 Feb 23 |
peter |
31 |
AC_PROG_CXX |
4320 |
21 Feb 23 |
peter |
32 |
YAT_SVN_TIMESTAMP([my_svn_timestamp.am]) |
4319 |
21 Feb 23 |
peter |
33 |
AC_CONFIG_FILES([Makefile]) |
4319 |
21 Feb 23 |
peter |
34 |
AC_OUTPUT |
4319 |
21 Feb 23 |
peter |
35 |
EOF |
4319 |
21 Feb 23 |
peter |
36 |
|
4319 |
21 Feb 23 |
peter |
37 |
cat > Makefile.am <<EOF |
4319 |
21 Feb 23 |
peter |
38 |
EXTRA_PROGRAMS = hello.test |
4319 |
21 Feb 23 |
peter |
39 |
hello_test_SOURCES = hello.cc |
4319 |
21 Feb 23 |
peter |
40 |
TESTS = hello.test |
4319 |
21 Feb 23 |
peter |
41 |
|
4319 |
21 Feb 23 |
peter |
42 |
CLEANFILES = hello.test |
4319 |
21 Feb 23 |
peter |
43 |
|
4319 |
21 Feb 23 |
peter |
44 |
ACLOCAL_AMFLAGS = -I m4 |
4319 |
21 Feb 23 |
peter |
45 |
DISTCLEANFILES = |
4319 |
21 Feb 23 |
peter |
46 |
EXTRA_DIST = |
4319 |
21 Feb 23 |
peter |
47 |
yat_am_dist_hooks = |
4319 |
21 Feb 23 |
peter |
48 |
|
4322 |
21 Feb 23 |
peter |
49 |
include svn_revision.am |
4319 |
21 Feb 23 |
peter |
50 |
include my_svn_timestamp.am |
4319 |
21 Feb 23 |
peter |
51 |
|
4319 |
21 Feb 23 |
peter |
52 |
nodist_noinst_DATA = .timestamp |
4319 |
21 Feb 23 |
peter |
53 |
|
4320 |
21 Feb 23 |
peter |
54 |
dist-hook: \$(yat_am_dist_hooks) |
4319 |
21 Feb 23 |
peter |
55 |
|
4319 |
21 Feb 23 |
peter |
56 |
EOF |
4319 |
21 Feb 23 |
peter |
57 |
|
4319 |
21 Feb 23 |
peter |
58 |
cat > hello.cc <<EOF |
4319 |
21 Feb 23 |
peter |
59 |
int main(void) |
4319 |
21 Feb 23 |
peter |
60 |
{ |
4319 |
21 Feb 23 |
peter |
61 |
return 0; |
4319 |
21 Feb 23 |
peter |
62 |
} |
4319 |
21 Feb 23 |
peter |
63 |
EOF |
4319 |
21 Feb 23 |
peter |
64 |
|
4319 |
21 Feb 23 |
peter |
65 |
rm -f my_svn_timestamp.am |
4323 |
22 Feb 23 |
peter |
66 |
rm -f svn_revision.am |
4319 |
21 Feb 23 |
peter |
67 |
bootstrap |
4319 |
21 Feb 23 |
peter |
# automake should have complained about missing file, but why not... |
4319 |
21 Feb 23 |
peter |
69 |
test -r my_svn_timestamp.am || exit_fail |
4319 |
21 Feb 23 |
peter |
70 |
|
4319 |
21 Feb 23 |
peter |
71 |
cat my_svn_timestamp.am |
4319 |
21 Feb 23 |
peter |
72 |
./configure $configure_opts |
4319 |
21 Feb 23 |
peter |
73 |
$MAKE all |
4319 |
21 Feb 23 |
peter |
74 |
$MAKE check |
4319 |
21 Feb 23 |
peter |
75 |
$MAKE distcheck |
4319 |
21 Feb 23 |
peter |
76 |
|
4319 |
21 Feb 23 |
peter |
77 |
exit_success; |