• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test for sanity checks.
5
6: ${AUTOCONF=autoconf}
7${AUTOCONF} --version >/dev/null 2>/dev/null \
8  || { echo "Skipping test: autoconf not found"; Exit 77; }
9
10cat <<\EOF >configure.ac
11AC_PREREQ([2.60])
12EOF
13
14${AUTOCONF} >/dev/null 2>/dev/null \
15  || { echo "Skipping test: autoconf version too old"; Exit 77; }
16
17rm -f configure.ac
18
19gettext_datadir=$top_builddir/misc
20export gettext_datadir
21
22# Check if sanity checks are actually working.
23
24# no configure.ac
25$gettext_datadir/autopoint 2>&1 | grep 'Missing configure.in or configure.ac' 2>&1 >/dev/null \
26    || Exit 1
27
28test ! -d intl || Exit 1
29test ! -d m4 || Exit 1
30test ! -d po || Exit 1
31
32# configure.ac without AM_GNU_GETTEXT_VERSION
33cat <<\EOF >configure.ac
34AC_INIT
35AC_CONFIG_SRCDIR(hello.c)
36
37AC_PROG_CC
38
39AC_CONFIG_FILES([Makefile])
40AC_OUTPUT
41EOF
42
43$gettext_datadir/autopoint 2>&1 | grep 'Missing version' 2>&1 >/dev/null \
44    || Exit 1
45
46test ! -d intl || Exit 1
47test ! -d m4 || Exit 1
48test ! -d po || Exit 1
49
50# VERSION specified through intl/VERSION file, but in wrong format
51cat <<\EOF >configure.ac
52AC_INIT
53AC_CONFIG_SRCDIR(hello.c)
54
55AC_PROG_CC
56
57AC_CONFIG_FILES([Makefile])
58AC_OUTPUT
59EOF
60
61test -d intl || mkdir intl
62echo bogus-version > intl/VERSION
63
64$gettext_datadir/autopoint 2>&1 | grep 'Missing version' 2>&1 >/dev/null \
65    || Exit 1
66
67test ! -d m4 || Exit 1
68test ! -d po || Exit 1
69
70# VERSION specified through intl/VERSION file
71cat <<\EOF >configure.ac
72AC_INIT
73AC_CONFIG_SRCDIR(hello.c)
74
75AC_PROG_CC
76
77AC_CONFIG_FILES([Makefile])
78AC_OUTPUT
79EOF
80
81test -d intl || mkdir intl
82
83echo gettext-0.15 > intl/VERSION
84
85# For further investigation, autopoint keeps autopoint.diff in $TMPDIR
86# if there is a mismatch.  Set TMPDIR not to pollute /tmp.
87TMPDIR="$PWD" $gettext_datadir/autopoint 2>&1 | grep 'locally modified' 2>&1 >/dev/null || Exit 1
88
89test ! -d m4 || Exit 1
90test ! -d po || Exit 1
91
92echo 'GNU gettext library from gettext-0.15' > intl/VERSION
93
94TMPDIR="$PWD" $gettext_datadir/autopoint 2>&1 || Exit 1
95
96rm -fr intl
97
98Exit 0
99