1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_PREREQ(2.52) |
---|
3 | AC_INIT |
---|
4 | AC_CONFIG_SRCDIR(src/msgfmt.c) |
---|
5 | AM_INIT_AUTOMAKE(gettext, 0.11.5) |
---|
6 | RELEASE_DATE=2002-08-06 dnl in "date +%Y-%m-%d" format |
---|
7 | AM_CONFIG_HEADER(config.h) |
---|
8 | |
---|
9 | dnl Checks for programs. |
---|
10 | AC_PROG_CC |
---|
11 | AC_PROG_INSTALL |
---|
12 | AC_PROG_YACC |
---|
13 | gt_PROG_LEX |
---|
14 | |
---|
15 | gt_GCJ |
---|
16 | if test -n "$HAVE_GCJ"; then |
---|
17 | BUILDJAVAEXE=yes |
---|
18 | else |
---|
19 | BUILDJAVAEXE=no |
---|
20 | fi |
---|
21 | AC_SUBST(BUILDJAVAEXE) |
---|
22 | |
---|
23 | gt_JAVACOMP |
---|
24 | AC_CHECK_PROG(JAR, jar, jar) |
---|
25 | if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then |
---|
26 | BUILDJAVA=yes |
---|
27 | else |
---|
28 | BUILDJAVA=no |
---|
29 | fi |
---|
30 | AC_SUBST(BUILDJAVA) |
---|
31 | |
---|
32 | gt_JAVAEXEC |
---|
33 | if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then |
---|
34 | TESTJAVA=yes |
---|
35 | else |
---|
36 | TESTJAVA=no |
---|
37 | fi |
---|
38 | AC_SUBST(TESTJAVA) |
---|
39 | |
---|
40 | dnl Check for host type. |
---|
41 | AC_CANONICAL_HOST |
---|
42 | |
---|
43 | dnl Checks for UNIX variants that set DEFS, |
---|
44 | AC_ISC_POSIX |
---|
45 | |
---|
46 | dnl Checks for compiler output filename suffixes. |
---|
47 | AC_OBJEXT |
---|
48 | AC_EXEEXT |
---|
49 | |
---|
50 | dnl Check for build configuration. |
---|
51 | AC_LIBTOOL_WIN32_DLL |
---|
52 | AC_PROG_LIBTOOL |
---|
53 | |
---|
54 | AC_DEFINE(_GNU_SOURCE, 1, [Make sure we see all GNU extensions.]) |
---|
55 | |
---|
56 | dnl Checks for libraries. |
---|
57 | |
---|
58 | dnl Checks for header files. |
---|
59 | AC_HEADER_STDC |
---|
60 | AC_CHECK_HEADERS(limits.h malloc.h string.h unistd.h values.h) |
---|
61 | gt_STDBOOL_H |
---|
62 | |
---|
63 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
64 | AC_C_CONST |
---|
65 | AC_C_INLINE |
---|
66 | bh_C_SIGNED |
---|
67 | AC_C_BACKSLASH_A |
---|
68 | jm_AC_TYPE_UNSIGNED_LONG_LONG |
---|
69 | AC_TYPE_OFF_T |
---|
70 | AC_TYPE_SIZE_T |
---|
71 | AC_CHECK_TYPES(ptrdiff_t) |
---|
72 | jm_AC_TYPE_UINTMAX_T |
---|
73 | gt_TYPE_SSIZE_T |
---|
74 | AC_TYPE_PID_T |
---|
75 | |
---|
76 | dnl Checks for library functions. |
---|
77 | AC_FUNC_ALLOCA |
---|
78 | AC_FUNC_VPRINTF |
---|
79 | AC_CHECK_FUNCS([getcwd mblen memcpy posix_spawn putc_unlocked raise select \ |
---|
80 | strerror strtoul uname utime utimes]) |
---|
81 | AC_REPLACE_FUNCS([memset stpcpy strcspn \ |
---|
82 | strcasecmp strncasecmp strpbrk strstr vasprintf]) |
---|
83 | AM_FUNC_GETLINE |
---|
84 | if test $am_cv_func_working_getline != yes; then |
---|
85 | AC_CHECK_FUNCS(getdelim) |
---|
86 | fi |
---|
87 | gt_FUNC_FNMATCH |
---|
88 | jm_PREREQ_MBSWIDTH |
---|
89 | gt_PREREQ_BACKUPFILE |
---|
90 | AC_FUNC_VFORK |
---|
91 | gt_UNION_WAIT |
---|
92 | gt_TMPDIR |
---|
93 | gt_FUNC_MKDTEMP |
---|
94 | gt_SIGNALBLOCKING |
---|
95 | gt_SIGINFO |
---|
96 | gt_FUNC_SETENV |
---|
97 | gt_FUNC_ERROR_AT_LINE |
---|
98 | gt_SETLOCALE |
---|
99 | |
---|
100 | gt_PREREQ_HOSTNAME |
---|
101 | |
---|
102 | dnl These are the only lines required to internationalize the package. |
---|
103 | dnl (OK, not quite, the AC_OUTPUT has also some parts.) |
---|
104 | AM_GNU_GETTEXT(use-libtool, need-ngettext) |
---|
105 | |
---|
106 | dnl Put some default definitions into config.h. |
---|
107 | AH_TOP([ |
---|
108 | /* Default value for alignment of strings in .mo file. */ |
---|
109 | #define DEFAULT_OUTPUT_ALIGNMENT 1 |
---|
110 | |
---|
111 | #ifndef PARAMS |
---|
112 | # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES |
---|
113 | # define PARAMS(args) args |
---|
114 | # else |
---|
115 | # define PARAMS(args) () |
---|
116 | # endif |
---|
117 | #endif |
---|
118 | ]) |
---|
119 | AH_BOTTOM([ |
---|
120 | /* We don't test for the basename function but still want to use the |
---|
121 | version in the libc when compiling for a system using glibc. Likewise |
---|
122 | for stpncpy. */ |
---|
123 | #ifdef __GNU_LIBRARY__ |
---|
124 | # define HAVE_BASENAME 1 |
---|
125 | # define HAVE_STPNCPY 1 |
---|
126 | #endif |
---|
127 | |
---|
128 | /* A file name cannot consist of any character possible. INVALID_PATH_CHAR |
---|
129 | contains the characters not allowed. */ |
---|
130 | #ifndef MSDOS |
---|
131 | # define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177/" |
---|
132 | #else |
---|
133 | /* Something like this for MSDOG. */ |
---|
134 | # define INVALID_PATH_CHAR "\1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31\32\33\34\35\36\37 \177\\:." |
---|
135 | #endif |
---|
136 | |
---|
137 | /* This is the page width for the message_print function. It should |
---|
138 | not be set to more than 79 characters (Emacs users will appreciate |
---|
139 | it). It is used to wrap the msgid and msgstr strings, and also to |
---|
140 | wrap the file position (#:) comments. */ |
---|
141 | #define PAGE_WIDTH 79 |
---|
142 | |
---|
143 | /* Extra OS/2 (emx+gcc) defines. */ |
---|
144 | #ifdef __EMX__ |
---|
145 | # include "intl/os2compat.h" |
---|
146 | #endif |
---|
147 | ]) |
---|
148 | |
---|
149 | dnl Check for the expat XML parser. |
---|
150 | dnl On operating systems where binary distribution vendors are likely to |
---|
151 | dnl ship both gettext and expat, we use dynamic loading to avoid a hard |
---|
152 | dnl dependency from gettext to expat. |
---|
153 | case "$host_os" in |
---|
154 | linux*) |
---|
155 | AC_DEFINE([DYNLOAD_LIBEXPAT], 1, |
---|
156 | [Define to 1 if libexpat shall be dynamically loaded via dlopen().]) |
---|
157 | LIBEXPAT="-ldl" |
---|
158 | LTLIBEXPAT="-ldl" |
---|
159 | AC_SUBST(LIBEXPAT) |
---|
160 | AC_SUBST(LTLIBEXPAT) |
---|
161 | ;; |
---|
162 | *) |
---|
163 | AC_LIB_HAVE_LINKFLAGS([expat], [], |
---|
164 | [#include <expat.h>], [XML_ExpatVersion();]) |
---|
165 | ;; |
---|
166 | esac |
---|
167 | |
---|
168 | dnl Check for Emacs and where to install .elc files. |
---|
169 | AM_PATH_LISPDIR |
---|
170 | |
---|
171 | aclocaldir='${datadir}/aclocal' |
---|
172 | AC_SUBST(aclocaldir) |
---|
173 | |
---|
174 | dnl Check for tools needed for formatting the documentation. |
---|
175 | ac_aux_dir_abs=`cd $ac_aux_dir && pwd` |
---|
176 | AC_PATH_PROG(DVIPS, dvips, $ac_aux_dir_abs/missing dvips) |
---|
177 | AC_PATH_PROG(TEXI2PDF, texi2pdf, $ac_aux_dir_abs/missing texi2pdf) |
---|
178 | AC_PATH_PROG(PERL, perl, $ac_aux_dir_abs/missing perl) |
---|
179 | |
---|
180 | dnl Check for tools needed for formatting man pages. |
---|
181 | CROSS_COMPILING=$cross_compiling |
---|
182 | AC_SUBST(CROSS_COMPILING) |
---|
183 | |
---|
184 | dnl Checks for optional programs for the tests/lang-* tests. |
---|
185 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gpp gcc CC cxx cc++ cl, :) |
---|
186 | if test "$CXX" != ":"; then |
---|
187 | dnl Use a modified version of AC_PROG_CXX_WORKS that does not exit |
---|
188 | dnl upon failure. |
---|
189 | AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) |
---|
190 | AC_LANG_PUSH(C++) |
---|
191 | AC_ARG_VAR([CXX], [C++ compiler command]) |
---|
192 | AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) |
---|
193 | echo 'int main () { return 0; }' > conftest.$ac_ext |
---|
194 | if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then |
---|
195 | ac_cv_prog_cxx_works=yes |
---|
196 | if (./conftest; exit) 2>/dev/null; then |
---|
197 | ac_cv_prog_cxx_cross=no |
---|
198 | else |
---|
199 | ac_cv_prog_cxx_cross=yes |
---|
200 | fi |
---|
201 | else |
---|
202 | ac_cv_prog_cxx_works=no |
---|
203 | fi |
---|
204 | rm -fr conftest* |
---|
205 | AC_LANG_POP(C++) |
---|
206 | AC_MSG_RESULT($ac_cv_prog_cxx_works) |
---|
207 | if test $ac_cv_prog_cxx_works = no; then |
---|
208 | CXX=: |
---|
209 | fi |
---|
210 | fi |
---|
211 | |
---|
212 | dnl Checks for tests/rpathcfg. |
---|
213 | AC_SUBST(GCC) |
---|
214 | AC_SUBST(LD) |
---|
215 | AC_SUBST(with_gnu_ld) |
---|
216 | |
---|
217 | dnl Generate the version information file in the intl/ directory. |
---|
218 | test -d intl || mkdir intl |
---|
219 | echo "GNU gettext library from $PACKAGE-$VERSION" > intl/VERSION |
---|
220 | cat > intl/ChangeLog.inst <<EOF |
---|
221 | $RELEASE_DATE GNU <bug-gnu-gettext@gnu.org> |
---|
222 | |
---|
223 | * Version $VERSION released. |
---|
224 | |
---|
225 | EOF |
---|
226 | |
---|
227 | dnl These ought to go away some day. |
---|
228 | changequote(,)dnl |
---|
229 | LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` |
---|
230 | changequote([, ])dnl |
---|
231 | AC_SUBST(LTLIBOBJS) |
---|
232 | changequote(,)dnl |
---|
233 | LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` |
---|
234 | changequote([, ])dnl |
---|
235 | AC_SUBST(LTALLOCA) |
---|
236 | |
---|
237 | AC_OUTPUT([Makefile \ |
---|
238 | lib/Makefile lib/javacomp.sh lib/javaexec.sh \ |
---|
239 | intl/Makefile intl-java/Makefile \ |
---|
240 | libuniname/Makefile \ |
---|
241 | src/Makefile src/user-email \ |
---|
242 | po/Makefile.in \ |
---|
243 | doc/Makefile man/Makefile man/x-to-1 \ |
---|
244 | tests/Makefile \ |
---|
245 | m4/Makefile \ |
---|
246 | projects/Makefile \ |
---|
247 | misc/Makefile misc/gettextize misc/autopoint], [ |
---|
248 | dnl Fix unesthetic build commands generated by automake. |
---|
249 | for m in lib/Makefile src/Makefile tests/Makefile; do |
---|
250 | sed -e "s,\`test -f \\\$< || echo '\\\$(srcdir)/'\`\\\$<,\\\$<," < $m > $m.tmp |
---|
251 | mv $m.tmp $m |
---|
252 | done |
---|
253 | dnl Fix an automake-1.5 bug. |
---|
254 | for m in Makefile doc/Makefile; do |
---|
255 | sed -e 's,^#distdir:,distdir:,' < $m > $m.tmp |
---|
256 | mv $m.tmp $m |
---|
257 | done |
---|
258 | dnl Fix an automake-1.5 bug: all info files are erased by "make". |
---|
259 | for m in doc/Makefile; do |
---|
260 | sed -e '/cd \$(srcdir) && rm -f /d' < $m > $m.tmp |
---|
261 | mv $m.tmp $m |
---|
262 | done |
---|
263 | dnl Fix permissions of misc/gettextize and misc/autopoint. |
---|
264 | chmod a+x misc/gettextize misc/autopoint |
---|
265 | ]) |
---|