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