2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test the autopoint program, without Automake.
7 ${AUTOCONF} --version >/dev/null 2>/dev/null \
8 || { echo "Skipping test: autoconf not found"; exit 77; }
10 cat <<\EOF >configure.ac
14 ${AUTOCONF} >/dev/null 2>/dev/null \
15 || { echo "Skipping test: autoconf version too old"; exit 77; }
19 gettext_datadir=$top_builddir/misc
20 export gettext_datadir
22 # Check for not copying libintl source.
23 cat <<EOF >configure.ac
25 AC_CONFIG_SRCDIR(hello.c)
26 AC_CONFIG_AUX_DIR([build-aux])
29 AM_GNU_GETTEXT([external])
30 AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION])
32 AC_CONFIG_FILES([Makefile])
33 AC_CONFIG_FILES([po/Makefile.in])
37 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
38 test $? = 0 || { cat autopoint.err; exit 1; }
40 test ! -d intl || exit 1
43 test -d build-aux || exit 1
45 test -f m4/po.m4 || exit 1
46 test -f po/Makefile.in.in || exit 1
47 test -f build-aux/config.rpath || exit 1
51 # Check for copying libintl source.
52 cat <<EOF >configure.ac
54 AC_CONFIG_SRCDIR(hello.c)
58 AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION])
60 AC_CONFIG_FILES([Makefile])
61 AC_CONFIG_FILES([po/Makefile.in])
65 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
66 test $? = 0 || { cat autopoint.err; exit 1; }
68 test -d intl || exit 1
72 test -f intl/VERSION || exit 1
73 test -f m4/po.m4 || exit 1
74 test -f po/Makefile.in.in || exit 1
78 # Check for custom macro directory.
79 cat <<EOF >configure.ac
81 AC_CONFIG_SRCDIR(hello.c)
84 AM_GNU_GETTEXT([external])
85 AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION])
87 # first macro directory, in which po.m4, etc. belong
88 AC_CONFIG_MACRO_DIR([gettext-m4])
90 # second macro directory
91 AC_CONFIG_MACRO_DIR([m4])
93 AC_CONFIG_FILES([Makefile])
94 AC_CONFIG_FILES([po/Makefile.in])
98 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
99 test $? = 0 || { cat autopoint.err; exit 1; }
101 test ! -d intl || exit 1
102 test ! -d m4 || exit 1
103 test -d gettext-m4 || exit 1
106 test -f gettext-m4/po.m4 || exit 1
107 test -f po/Makefile.in.in || exit 1
111 # Check for multiple arguments to AM_GNU_GETTEXT
112 # <https://savannah.gnu.org/bugs/?40082>
113 cat <<EOF >configure.ac
115 AC_CONFIG_SRCDIR(hello.c)
118 AM_GNU_GETTEXT([external], [need-formatstring-macros])
119 AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION])
121 AC_CONFIG_FILES([Makefile])
122 AC_CONFIG_FILES([po/Makefile.in])
126 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
127 test $? = 0 || { cat autopoint.err; exit 1; }
129 test ! -d intl || exit 1
133 test -f m4/po.m4 || exit 1
134 test -f po/Makefile.in.in || exit 1
138 # Check for certain built-in macros are not in effect when tracing:
139 # <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764580>
140 cat <<EOF >configure.ac
142 AC_CONFIG_SRCDIR(hello.c)
144 dnl m4_shiftn internally calls m4_assert, which is disabled by autopoint
145 m4_define([_gt_recurse],
146 [m4_ifblank([\$1], , [_gt_recurse(m4_shiftn(1, \$@))])])
147 _gt_recurse([a], [b], , [c])
150 AM_GNU_GETTEXT([external])
151 AM_GNU_GETTEXT_VERSION([$ARCHIVE_VERSION])
153 AC_CONFIG_FILES([Makefile])
154 AC_CONFIG_FILES([po/Makefile.in])
158 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
159 test $? = 0 || { cat autopoint.err; exit 1; }
161 test ! -d intl || exit 1
165 test -f m4/po.m4 || exit 1
166 test -f po/Makefile.in.in || exit 1
170 # Check for AM_GNU_GETTEXT_REQUIRE_VERSION.
171 cat <<EOF >configure.ac
173 AC_CONFIG_SRCDIR(hello.c)
176 AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
177 AM_GNU_GETTEXT([external])
179 AC_CONFIG_FILES([Makefile])
180 AC_CONFIG_FILES([po/Makefile.in])
184 $gettext_datadir/autopoint >/dev/null 2>autopoint.err
185 test $? = 0 || { cat autopoint.err; exit 1; }
187 test ! -d intl || exit 1
191 test -f m4/po.m4 || exit 1
192 test -f po/Makefile.in.in || exit 1
194 # Check for the case where both AM_GNU_GETTEXT_REQUIRE_VERSION and
195 # AM_GNU_GETTEXT_VERSION are used.
196 cat <<EOF >configure.ac
198 AC_CONFIG_SRCDIR(hello.c)
202 AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
203 # This shall be ignored when AM_GNU_GETTEXT_REQUIRE_VERSION is defined
204 AM_GNU_GETTEXT_VERSION([0.19])
206 AC_CONFIG_MACRO_DIR([m4])
208 AC_CONFIG_FILES([Makefile])
209 AC_CONFIG_FILES([po/Makefile.in])
213 $gettext_datadir/autopoint >autopoint.out 2>autopoint.err
214 test $? = 0 || { cat autopoint.err; exit 1; }
216 grep 'using AM_GNU_GETTEXT_REQUIRE_VERSION' autopoint.out 2>&1 >/dev/null || exit 1
218 test -d intl || exit 1
222 cat >autopoint.ver <<EOF
223 GNU gettext library from gettext-$ARCHIVE_VERSION
226 ${DIFF} autopoint.ver intl/VERSION || exit 1
227 test -f m4/po.m4 || exit 1
228 test -f po/Makefile.in.in || exit 1