~win-cross-dev/win-cross/gettext

« back to all changes in this revision

Viewing changes to gettext-tools/configure.ac

  • Committer: Nathan Osman
  • Date: 2012-08-11 05:06:52 UTC
  • Revision ID: admin@quickmediasolutions.com-20120811050652-ochkxjtonbw6kkve
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Configuration for the gettext-tools directory of GNU gettext
 
2
dnl Copyright (C) 1995-1999, 2000-2010 Free Software Foundation, Inc.
 
3
dnl
 
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 3 of the License, or
 
7
dnl (at your option) any later version.
 
8
dnl
 
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.
 
13
dnl
 
14
dnl You should have received a copy of the GNU General Public License
 
15
dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
dnl Process this file with autoconf to produce a configure script.
 
18
 
 
19
AC_PREREQ([2.59])
 
20
AC_INIT
 
21
AC_CONFIG_SRCDIR([src/msgfmt.c])
 
22
AC_CONFIG_AUX_DIR([../build-aux])
 
23
. $srcdir/../version.sh
 
24
gl_INIT_PACKAGE([gettext-tools], [$VERSION_NUMBER])
 
25
AM_INIT_AUTOMAKE([silent-rules])
 
26
AM_CONFIG_HEADER([config.h])
 
27
 
 
28
dnl Installation directories.
 
29
test "$docdir" != '${datarootdir}/doc/${PACKAGE}' || docdir='${datarootdir}/doc/gettext'
 
30
 
 
31
dnl Checks for programs.
 
32
AC_PROG_CC
 
33
AC_PROG_INSTALL
 
34
AC_PROG_YACC
 
35
 
 
36
gt_JAVA_CHOICE
 
37
 
 
38
gt_GCJ
 
39
if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
 
40
  BUILDJAVAEXE=yes
 
41
else
 
42
  BUILDJAVAEXE=no
 
43
fi
 
44
AC_SUBST([BUILDJAVAEXE])
 
45
 
 
46
gt_JAVAEXEC
 
47
gt_JAVACOMP([1.3])
 
48
AC_CHECK_PROG([JAR], [jar], [jar])
 
49
if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
 
50
  BUILDJAVA=yes
 
51
else
 
52
  BUILDJAVA=no
 
53
fi
 
54
AC_SUBST([BUILDJAVA])
 
55
if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
 
56
  TESTJAVA=yes
 
57
else
 
58
  TESTJAVA=no
 
59
fi
 
60
AC_SUBST([TESTJAVA])
 
61
 
 
62
gt_CSHARPCOMP
 
63
if test -n "$HAVE_CSHARPCOMP" && test "$CSHARP_CHOICE" != no; then
 
64
  BUILDCSHARP=yes
 
65
else
 
66
  BUILDCSHARP=no
 
67
fi
 
68
AC_SUBST([BUILDCSHARP])
 
69
 
 
70
gt_CSHARPEXEC([csharpexec-test.exe], [$srcdir/m4])
 
71
if test -n "$HAVE_CSHARPEXEC" && test $BUILDCSHARP = yes; then
 
72
  TESTCSHARP=yes
 
73
else
 
74
  TESTCSHARP=no
 
75
fi
 
76
AC_SUBST([TESTCSHARP])
 
77
 
 
78
dnl Check for host type.
 
79
AC_CANONICAL_HOST
 
80
 
 
81
dnl Checks for compiler output filename suffixes.
 
82
AC_OBJEXT
 
83
AC_EXEEXT
 
84
 
 
85
dnl Make sure we see all GNU and Solaris extensions.
 
86
gl_EARLY
 
87
gtpo_EARLY
 
88
 
 
89
dnl Check for build configuration.
 
90
 
 
91
gl_WOE32_DLL
 
92
 
 
93
LT_INIT([win32-dll])
 
94
 
 
95
dnl Prepares the libtool configuration for handling of Windows resources, and
 
96
dnl sets the RC variable to a program that compiles Windows resource files.
 
97
LT_LANG([Windows Resource])
 
98
 
 
99
case "$host_os" in
 
100
  # On Cygwin, without -no-undefined, a warning is emitted and only a static
 
101
  # library is built.
 
102
  beos* | mingw* | cygwin*) LTNOUNDEF='-no-undefined' ;;
 
103
  *) LTNOUNDEF='' ;;
 
104
esac
 
105
AC_SUBST([LTNOUNDEF])
 
106
 
 
107
dnl On mingw and Cygwin, we can activate special Makefile rules which add
 
108
dnl version information to the shared libraries and executables.
 
109
case "$host_os" in
 
110
  mingw* | cygwin*) is_woe32=yes ;;
 
111
  *) is_woe32=no ;;
 
112
esac
 
113
AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
 
114
 
 
115
dnl Checks for libraries.
 
116
 
 
117
dnl These are the only lines required to internationalize the package.
 
118
dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.)
 
119
AM_GNU_GETTEXT([use-libtool], [need-ngettext])
 
120
 
 
121
dnl This line internationalizes the bison generated parsers.
 
122
BISON_I18N
 
123
 
 
124
dnl Test whether msgmerge must be linked against libm. This is the case on
 
125
dnl most systems; but BeOS has all <math.h> functions in libc and doesn't have
 
126
dnl a libm.
 
127
MSGMERGE_LIBM=?
 
128
AC_TRY_LINK([
 
129
   #ifndef __NO_MATH_INLINES
 
130
   # define __NO_MATH_INLINES 1 /* for glibc */
 
131
   #endif
 
132
   #include <math.h>
 
133
   double x;],
 
134
  [x = ceil(x); x = sqrt(x);],
 
135
  [MSGMERGE_LIBM=])
 
136
if test "$MSGMERGE_LIBM" = "?"; then
 
137
  save_LIBS="$LIBS" 
 
138
  LIBS="$LIBS -lm"
 
139
  AC_TRY_LINK([
 
140
     #ifndef __NO_MATH_INLINES
 
141
     # define __NO_MATH_INLINES 1 /* for glibc */
 
142
     #endif
 
143
     #include <math.h>
 
144
     double x;],
 
145
    [x = ceil(x); x = sqrt(x);],
 
146
    [MSGMERGE_LIBM="-lm"])
 
147
  LIBS="$save_LIBS"
 
148
fi
 
149
if test "$MSGMERGE_LIBM" = "?"; then
 
150
  MSGMERGE_LIBM=
 
151
fi
 
152
AC_SUBST([MSGMERGE_LIBM])
 
153
 
 
154
dnl Checks for header files, functions and declarations.
 
155
gl_INIT
 
156
gtpo_INIT
 
157
 
 
158
dnl Checks for header files.
 
159
AC_CHECK_HEADERS([pwd.h])
 
160
 
 
161
dnl Checks for typedefs, structures, and compiler characteristics.
 
162
AC_C_INLINE
 
163
AC_TYPE_UNSIGNED_LONG_LONG_INT
 
164
AC_TYPE_SIZE_T
 
165
AC_CHECK_TYPES([ptrdiff_t])
 
166
gt_TYPE_SSIZE_T
 
167
AC_TYPE_PID_T
 
168
gl_GLIBC21
 
169
if test $GLIBC21 = yes; then
 
170
  AC_CHECK_MEMBERS([struct __locale_struct.__names], , , [#include <xlocale.h>])
 
171
fi
 
172
 
 
173
dnl Checks for library functions.
 
174
AC_CHECK_FUNCS([select])
 
175
AC_FUNC_VFORK
 
176
gt_SIGINFO
 
177
gt_SETLOCALE
 
178
gt_LIBGREP
 
179
 
 
180
AC_C_BIGENDIAN([endianness=1], [endianness=0],
 
181
  [echo "AC-C-BIGENDIAN fails to work on your system." | sed -e 's,-,_,g' 1>&2
 
182
   echo "Please report this as a bug to bug-autoconf@gnu.org" 1>&2
 
183
   exit 1],
 
184
  [endianness=universal])
 
185
if test $endianness != universal; then
 
186
  AC_DEFINE_UNQUOTED([ENDIANNESS], [$endianness],
 
187
    [Define according to the byte order of the target machine: 1 for big endian, 0 for little endian.])
 
188
fi
 
189
dnl For possibly universal binaries, it's not possible to determine the
 
190
dnl endianness at configure time. So determine it at compile time.
 
191
AH_BOTTOM([
 
192
#ifndef ENDIANNESS
 
193
# if defined __BIG_ENDIAN__
 
194
#  define ENDIANNESS 1
 
195
# endif
 
196
# if defined __LITTLE_ENDIAN__
 
197
#  define ENDIANNESS 0
 
198
# endif
 
199
#endif
 
200
])
 
201
 
 
202
gt_PREREQ_HOSTNAME
 
203
 
 
204
dnl Compilation on mingw and Cygwin needs special Makefile rules, because
 
205
dnl 1. when we install a shared library, we must arrange to export
 
206
dnl    auxiliary pointer variables for every exported variable,
 
207
dnl 2. when we install a shared library and a static library simultaneously,
 
208
dnl    the include file specifies __declspec(dllimport) and therefore we
 
209
dnl    must arrange to define the auxiliary pointer variables for the
 
210
dnl    exported variables _also_ in the static library.
 
211
if test "$enable_shared" = yes; then
 
212
  case "$host_os" in
 
213
    mingw* | cygwin*) is_woe32dll=yes ;;
 
214
    *) is_woe32dll=no ;;
 
215
  esac
 
216
else
 
217
  is_woe32dll=no
 
218
fi
 
219
AM_CONDITIONAL([WOE32DLL], [test $is_woe32dll = yes])
 
220
if test $is_woe32dll = yes; then
 
221
  AC_DEFINE([WOE32DLL], [1],
 
222
    [Define when --enable-shared is used on mingw or Cygwin.])
 
223
fi
 
224
 
 
225
dnl woe32dll/gettextlib-exports.c needs to know whether the getopt facility
 
226
dnl is replaced by gnulib. GETOPT_H is set by gl_FUNC_GETOPT_POSIX, inside
 
227
dnl gl_INIT.
 
228
if test -n "$GETOPT_H"; then
 
229
  GETTEXTLIB_EXPORTS_FLAGS="-DGNULIB_DEFINED_GETOPT"
 
230
else
 
231
  GETTEXTLIB_EXPORTS_FLAGS=
 
232
fi
 
233
AC_SUBST([GETTEXTLIB_EXPORTS_FLAGS])
 
234
 
 
235
dnl Put some default definitions into config.h.
 
236
AH_TOP([
 
237
/* Default value for alignment of strings in .mo file.  */
 
238
#define DEFAULT_OUTPUT_ALIGNMENT 1
 
239
])
 
240
AH_BOTTOM([
 
241
/* A file name cannot consist of any character possible.  INVALID_PATH_CHAR
 
242
   contains the characters not allowed.  */
 
243
#if defined _MSC_VER || defined __MINGW32__
 
244
/* Woe32.  This string is valid for Windows NT/2000.  On Windows 95/98/ME some
 
245
   few characters in the range 0x80..0xff are invalid as well, but this doesn't
 
246
   matter much for our purposes.  */
 
247
# 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\"*/:<>?\\|"
 
248
#elif defined MSDOS
 
249
/* Something like this for MSDOG.  */
 
250
# 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\\:."
 
251
#else
 
252
/* Unix.  */
 
253
# 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/"
 
254
#endif
 
255
 
 
256
/* This is the page width for the message_print function.  It should
 
257
   not be set to more than 79 characters (Emacs users will appreciate
 
258
   it).  It is used to wrap the msgid and msgstr strings, and also to
 
259
   wrap the file position (#:) comments.  */
 
260
#define PAGE_WIDTH 79
 
261
 
 
262
/* On Windows, variables that may be in a DLL must be marked specially.  */
 
263
#if ((defined _MSC_VER && defined _DLL) || defined WOE32DLL) && !defined IN_RELOCWRAPPER
 
264
# define DLL_VARIABLE __declspec (dllimport)
 
265
#else
 
266
# define DLL_VARIABLE
 
267
#endif
 
268
 
 
269
/* Extra OS/2 (emx+gcc) defines.  */
 
270
#ifdef __EMX__
 
271
# include "intl/os2compat.h"
 
272
#endif
 
273
])
 
274
 
 
275
dnl Check for the expat XML parser.
 
276
dnl On operating systems where binary distribution vendors are likely to
 
277
dnl ship both gettext and expat, we use dynamic loading to avoid a hard
 
278
dnl dependency from gettext to expat.
 
279
case "$host_os" in
 
280
  linux*)
 
281
    AC_DEFINE([DYNLOAD_LIBEXPAT], [1],
 
282
      [Define to 1 if libexpat shall be dynamically loaded via dlopen().])
 
283
    LIBEXPAT="-ldl"
 
284
    LTLIBEXPAT="-ldl"
 
285
    AC_SUBST([LIBEXPAT])
 
286
    AC_SUBST([LTLIBEXPAT])
 
287
    ;;
 
288
  *)
 
289
    AC_LIB_HAVE_LINKFLAGS([expat], [],
 
290
      [#include <expat.h>], [XML_ExpatVersion();])
 
291
    ;;
 
292
esac
 
293
 
 
294
dnl Check for nm output filter that yields the exported symbols.
 
295
gt_GLOBAL_SYMBOL_PIPE
 
296
 
 
297
dnl Check for Emacs and where to install .elc files.
 
298
AM_PATH_LISPDIR
 
299
dnl Sometimes Emacs is badly installed. Allow the user to work around it.
 
300
AC_ARG_WITH([emacs],
 
301
  [  --without-emacs         do not use Emacs, don't install po-mode],
 
302
  [gt_use_emacs=$withval],
 
303
  [gt_use_emacs=yes])
 
304
if test "$EMACS" != no; then
 
305
  AC_MSG_CHECKING([whether Emacs support is requested])
 
306
  AC_MSG_RESULT([$gt_use_emacs])
 
307
  if test "$gt_use_emacs" = no; then
 
308
    EMACS=no
 
309
  fi
 
310
fi
 
311
 
 
312
aclocaldir='${datadir}/aclocal'
 
313
AC_SUBST([aclocaldir])
 
314
 
 
315
dnl Check how to install the set of previous versions, for autopoint.
 
316
AC_ARG_WITH([cvs],
 
317
  [  --without-cvs           don't use cvs to compress the infrastructure archive],
 
318
  [gt_use_cvs=$withval],
 
319
  [gt_use_cvs=maybe])
 
320
AC_ARG_WITH([git],
 
321
  [  --with-git              use git to compress the infrastructure archive],
 
322
  [gt_use_git=$withval],
 
323
  [gt_use_git=no])
 
324
if test "$gt_use_cvs" != no && test "$gt_use_cvs" != maybe; then
 
325
  # --with-cvs is specified. Even if --with-git is also specified, we use the
 
326
  # cvs format, because it yields smaller archives than the git format.
 
327
  ARCHIVE_FORMAT=cvs
 
328
else
 
329
  if test "$gt_use_git" != no; then
 
330
    # --with-git is specified.
 
331
    ARCHIVE_FORMAT=git
 
332
  else
 
333
    # Neither --with-cvs not --with-git is specified.
 
334
    if test "$gt_use_cvs" != no; then
 
335
      # --without-cvs is not specified. Use cvs format.
 
336
      ARCHIVE_FORMAT=cvs
 
337
    else
 
338
      # --without-cvs is specified.
 
339
      ARCHIVE_FORMAT=dir
 
340
    fi
 
341
  fi
 
342
fi
 
343
AC_SUBST([ARCHIVE_FORMAT])
 
344
 
 
345
dnl Check for tools needed for formatting the documentation.
 
346
ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
 
347
AC_PATH_PROG([DVIPS], [dvips], [$ac_aux_dir_abs/missing dvips])
 
348
AC_PATH_PROG([TEXI2PDF], [texi2pdf], [$ac_aux_dir_abs/missing texi2pdf])
 
349
AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
 
350
 
 
351
dnl Check for tools needed for formatting man pages.
 
352
CROSS_COMPILING=$cross_compiling
 
353
AC_SUBST([CROSS_COMPILING])
 
354
 
 
355
dnl Checks for optional programs for the tests/lang-*, tests/recode-* tests.
 
356
gt_PROG_ANSI_CXX
 
357
gt_LOCALE_FR
 
358
gt_LOCALE_FR_UTF8
 
359
gt_LOCALE_JA
 
360
 
 
361
dnl Checks for functions for the tests/*.c tests.
 
362
AC_CHECK_FUNCS_ONCE([getrlimit setrlimit uselocale])
 
363
 
 
364
dnl Prepares the libtool configuration for languages used by the tests.
 
365
LT_LANG([C++])
 
366
 
 
367
dnl Check whether to execute tests that rely on libasprintf.
 
368
dnl This test must be consistent with gettext-runtime/configure.ac.
 
369
if test "${enable_libasprintf+set}" = set; then
 
370
  if test "$enable_libasprintf" != no; then
 
371
    TESTLIBASPRINTF=yes
 
372
  else
 
373
    TESTLIBASPRINTF=no
 
374
  fi
 
375
else
 
376
  TESTLIBASPRINTF=yes
 
377
fi
 
378
if test "$CXX" = ":"; then
 
379
  TESTLIBASPRINTF=no
 
380
fi
 
381
AC_SUBST([TESTLIBASPRINTF])
 
382
 
 
383
dnl Generate the version information file in the intl/ directory.
 
384
test -d intl || mkdir intl
 
385
echo "GNU gettext library from gettext-$VERSION" > intl/VERSION
 
386
cat > intl/ChangeLog.inst <<EOF
 
387
$RELEASE_DATE  GNU  <bug-gnu-gettext@gnu.org>
 
388
 
 
389
        * Version $VERSION released.
 
390
 
 
391
EOF
 
392
 
 
393
AC_CONFIG_SUBDIRS([examples])
 
394
 
 
395
AC_CONFIG_FILES([Makefile])
 
396
 
 
397
AC_CONFIG_FILES([doc/Makefile])
 
398
 
 
399
AC_CONFIG_FILES([intl/Makefile:../gettext-runtime/intl/Makefile.in], [
 
400
  # Change srcdir variable so that it points to ../gettext-runtime/intl.
 
401
  sed -e 's|^srcdir =.*$|srcdir = $(top_srcdir)/../gettext-runtime/intl|' \
 
402
      -e 's|^VPATH =.*$||' \
 
403
    < intl/Makefile > intl/Makefile.tmp
 
404
  mv intl/Makefile.tmp intl/Makefile
 
405
  ])
 
406
 
 
407
AC_CONFIG_FILES([gnulib-lib/Makefile])
 
408
 
 
409
AC_CONFIG_FILES([libgrep/Makefile])
 
410
 
 
411
AC_CONFIG_FILES([src/Makefile])
 
412
AC_CONFIG_FILES([src/user-email:src/user-email.sh.in])
 
413
 
 
414
AC_CONFIG_FILES([libgettextpo/Makefile])
 
415
AC_CONFIG_FILES([libgettextpo/exported.sh])
 
416
 
 
417
AC_CONFIG_FILES([po/Makefile.in])
 
418
 
 
419
AC_CONFIG_FILES([projects/Makefile])
 
420
 
 
421
AC_CONFIG_FILES([styles/Makefile])
 
422
 
 
423
AC_CONFIG_FILES([misc/Makefile])
 
424
AC_CONFIG_FILES([misc/gettextize], [chmod a+x misc/gettextize])
 
425
AC_CONFIG_FILES([misc/autopoint], [chmod a+x misc/autopoint])
 
426
AC_CONFIG_FILES([misc/convert-archive], [chmod a+x misc/convert-archive])
 
427
 
 
428
AC_CONFIG_FILES([man/Makefile],
 
429
                [FIX_MAKEFILE_DISTRIB])
 
430
AC_CONFIG_FILES([man/x-to-1])
 
431
 
 
432
AC_CONFIG_FILES([m4/Makefile])
 
433
 
 
434
AC_CONFIG_FILES([tests/Makefile])
 
435
 
 
436
AC_CONFIG_FILES([gnulib-tests/Makefile])
 
437
 
 
438
AC_OUTPUT