1 dnl Configuration for the gettext-tools directory of GNU gettext
2 dnl Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
4 dnl This program is free software; you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation; either version 2, or (at your option)
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 dnl Process this file with autoconf to produce a configure script.
22 AC_CONFIG_SRCDIR(src/msgfmt.c)
23 AC_CONFIG_AUX_DIR(../build-aux)
24 . $srcdir/../version.sh
25 AM_INIT_AUTOMAKE(gettext-tools, $VERSION_NUMBER)
26 AM_CONFIG_HEADER(config.h)
28 dnl Installation directories.
29 AC_SUBST([localedir], ['${datadir}/locale'])
30 AC_SUBST([docdir], ['${datadir}/doc/gettext'])
31 dnl Prefer modern Filesystem Hierarchy Standard over antiquated GNU standards.
32 test "$mandir" != '${prefix}/man' || mandir='${datadir}/man'
34 dnl Checks for programs.
40 if test -n "$HAVE_GCJ"; then
45 AC_SUBST(BUILDJAVAEXE)
48 AC_CHECK_PROG(JAR, jar, jar)
49 if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
57 if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
65 if test -n "$HAVE_CSHARPCOMP" && test "$CSHARP_CHOICE" != no; then
73 if test -n "$HAVE_CSHARPEXEC" && test $BUILDCSHARP = yes; then
80 dnl Check for host type.
83 dnl Checks for UNIX variants that set DEFS,
86 dnl Checks for compiler output filename suffixes.
90 dnl Make sure we see all GNU and Solaris extensions.
92 gl_USE_SYSTEM_EXTENSIONS
94 dnl Check for build configuration.
100 dnl Checks for libraries.
102 dnl Checks for header files.
104 AC_CHECK_HEADERS(limits.h malloc.h pwd.h string.h unistd.h utime.h values.h)
107 dnl Checks for typedefs, structures, and compiler characteristics.
110 gl_AC_TYPE_UNSIGNED_LONG_LONG
112 AC_CHECK_TYPES(ptrdiff_t)
119 dnl Checks for library functions.
122 AC_CHECK_FUNCS([chown getcwd posix_spawn raise select strerror strtoul uname \
123 utime utimes waitid])
124 AC_REPLACE_FUNCS([atexit memmove memset stpcpy strcspn \
125 strpbrk strstr vasprintf])
127 if test $am_cv_func_working_getline != yes; then
128 AC_CHECK_FUNCS(getdelim)
131 gl_FUNC_FNMATCH_POSIX
147 gl_FUNC_GLIBC_UNLOCKED_IO
161 dnl These are the only lines required to internationalize the package.
162 dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.)
163 AM_GNU_GETTEXT(use-libtool, need-ngettext)
165 dnl Put some default definitions into config.h.
167 /* Default value for alignment of strings in .mo file. */
168 #define DEFAULT_OUTPUT_ALIGNMENT 1
171 /* A file name cannot consist of any character possible. INVALID_PATH_CHAR
172 contains the characters not allowed. */
173 #if defined _MSC_VER || defined __MINGW32__
174 /* Woe32. This string is valid for Windows NT/2000. On Windows 95/98/ME some
175 few characters in the range 0x80..0xff are invalid as well, but this doesn't
176 matter much for our purposes. */
177 # define INVALID_PATH_CHAR "\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\"*/:<>?\\|"
179 /* Something like this for MSDOG. */
180 # define INVALID_PATH_CHAR "\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 \177\\:."
183 # define INVALID_PATH_CHAR "\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 \177/"
186 /* This is the page width for the message_print function. It should
187 not be set to more than 79 characters (Emacs users will appreciate
188 it). It is used to wrap the msgid and msgstr strings, and also to
189 wrap the file position (#:) comments. */
190 #define PAGE_WIDTH 79
192 /* On Windows, variables that may be in a DLL must be marked specially. */
193 #if defined _MSC_VER && defined _DLL
194 # define DLL_VARIABLE __declspec (dllimport)
196 # define DLL_VARIABLE
199 /* Extra OS/2 (emx+gcc) defines. */
201 # include "intl/os2compat.h"
205 dnl Check for the expat XML parser.
206 dnl On operating systems where binary distribution vendors are likely to
207 dnl ship both gettext and expat, we use dynamic loading to avoid a hard
208 dnl dependency from gettext to expat.
211 AC_DEFINE([DYNLOAD_LIBEXPAT], 1,
212 [Define to 1 if libexpat shall be dynamically loaded via dlopen().])
219 AC_LIB_HAVE_LINKFLAGS([expat], [],
220 [#include <expat.h>], [XML_ExpatVersion();])
224 dnl Check for Emacs and where to install .elc files.
227 aclocaldir='${datadir}/aclocal'
230 dnl Check for tools needed for formatting the documentation.
231 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
232 AC_PATH_PROG(DVIPS, dvips, $ac_aux_dir_abs/missing dvips)
233 AC_PATH_PROG(TEXI2PDF, texi2pdf, $ac_aux_dir_abs/missing texi2pdf)
234 AC_PATH_PROG(PERL, perl, $ac_aux_dir_abs/missing perl)
236 dnl Check for tools needed for formatting man pages.
237 CROSS_COMPILING=$cross_compiling
238 AC_SUBST(CROSS_COMPILING)
240 dnl Checks for optional programs for the tests/lang-* tests.
245 dnl Check whether to execute tests that rely on libasprintf.
246 dnl This test must be consistent with gettext-runtime/configure.ac.
247 if test "${enable_libasprintf+set}" = set; then
248 if test "$enable_libasprintf" != no; then
256 if test "$CXX" = ":"; then
259 AC_SUBST(TESTLIBASPRINTF)
261 dnl Generate the version information file in the intl/ directory.
262 test -d intl || mkdir intl
263 echo "GNU gettext library from gettext-$VERSION" > intl/VERSION
264 cat > intl/ChangeLog.inst <<EOF
265 $RELEASE_DATE GNU <bug-gnu-gettext@gnu.org>
267 * Version $VERSION released.
271 AC_CONFIG_FILES([Makefile])
273 AC_CONFIG_FILES([doc/Makefile],
274 [FIX_MAKEFILE_COMPILE
278 AC_CONFIG_FILES([intl/Makefile:../gettext-runtime/intl/Makefile.in], [
279 # Change srcdir variable so that it points to ../gettext-runtime/intl.
280 sed -e 's|^srcdir =.*$|srcdir = $(top_srcdir)/../gettext-runtime/intl|' \
281 < intl/Makefile > intl/Makefile.tmp
282 mv intl/Makefile.tmp intl/Makefile
285 AC_CONFIG_FILES([lib/Makefile],
286 [FIX_MAKEFILE_COMPILE])
287 AC_CONFIG_FILES([lib/javacomp.sh lib/javaexec.sh])
288 AC_CONFIG_FILES([lib/csharpcomp.sh lib/csharpexec.sh])
290 AC_CONFIG_FILES([libgrep/Makefile],
291 [FIX_MAKEFILE_COMPILE])
293 AC_CONFIG_FILES([libuniname/Makefile],
294 [FIX_MAKEFILE_COMPILE])
296 AC_CONFIG_FILES([src/Makefile],
297 [FIX_MAKEFILE_COMPILE])
298 AC_CONFIG_FILES([src/user-email:src/user-email.sh.in])
300 AC_CONFIG_FILES([po/Makefile.in])
302 AC_CONFIG_FILES([projects/Makefile])
304 AC_CONFIG_FILES([misc/Makefile])
305 AC_CONFIG_FILES([misc/gettextize], [chmod a+x misc/gettextize])
306 AC_CONFIG_FILES([misc/autopoint], [chmod a+x misc/autopoint])
308 AC_CONFIG_FILES([man/Makefile],
309 [FIX_MAKEFILE_DISTRIB])
310 AC_CONFIG_FILES([man/x-to-1])
312 AC_CONFIG_FILES([m4/Makefile])
314 AC_CONFIG_FILES([tests/Makefile],
315 [FIX_MAKEFILE_COMPILE])
317 AC_CONFIG_FILES([examples/Makefile],
318 [FIX_MAKEFILE_DISTRIB])
319 AC_CONFIG_FILES([examples/installpaths])
320 AC_CONFIG_FILES([examples/po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE])