Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-runtime / configure.ac
1 dnl Configuration for the gettext-runtime directory of GNU gettext
2 dnl Copyright (C) 1995-1999, 2000-2009 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([intl/dcigettext.c])
22 AC_CONFIG_AUX_DIR([../build-aux])
23 . $srcdir/../version.sh
24 gl_INIT_PACKAGE([gettext-runtime], [$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_JAVACOMP([1.3], [1.1])
39 AC_CHECK_PROG([JAR], [jar], [jar])
40 if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
41   BUILDJAVA=yes
42 else
43   BUILDJAVA=no
44 fi
45 AC_SUBST([BUILDJAVA])
46
47 gt_CSHARPCOMP
48 if test -n "$HAVE_CSHARPCOMP" && test "$CSHARP_CHOICE" != no; then
49   BUILDCSHARP=yes
50 else
51   BUILDCSHARP=no
52 fi
53 AC_SUBST([BUILDCSHARP])
54
55 dnl Check for host type.
56 AC_CANONICAL_HOST
57
58 dnl Checks for compiler output filename suffixes.
59 AC_OBJEXT
60 AC_EXEEXT
61
62 dnl Make sure we see all GNU and Solaris extensions.
63 gl_EARLY
64
65 dnl Check for build configuration.
66
67 gl_WOE32_DLL
68
69 LT_INIT([win32-dll])
70
71 dnl Prepares the libtool configuration for handling of Windows resources, and
72 dnl sets the RC variable to a program that compiles Windows resource files.
73 LT_LANG([Windows Resource])
74
75 dnl On mingw and Cygwin, we can activate special Makefile rules which add
76 dnl version information to the shared libraries and executables.
77 case "$host_os" in
78   mingw* | cygwin*) is_woe32=yes ;;
79   *) is_woe32=no ;;
80 esac
81 AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
82
83 dnl Checks for libraries.
84
85 dnl These are the only lines required to internationalize the package.
86 dnl (OK, not quite, the AC_CONFIG_FILES has also some parts.)
87 AM_GNU_GETTEXT([use-libtool], [need-ngettext])
88
89 dnl Checks for header files, functions and declarations.
90 gl_INIT
91 AC_TYPE_SIZE_T
92 AC_CHECK_FUNCS([setlocale])
93
94 dnl Put some default definitions into config.h.
95 AH_BOTTOM([
96 /* On Windows, variables that may be in a DLL must be marked specially.  */
97 #if (defined _MSC_VER && defined _DLL) && !defined IN_RELOCWRAPPER
98 # define DLL_VARIABLE __declspec (dllimport)
99 #else
100 # define DLL_VARIABLE
101 #endif
102
103 /* Extra OS/2 (emx+gcc) defines.  */
104 #ifdef __EMX__
105 # include "intl/os2compat.h"
106 #endif
107 ])
108
109 dnl Check for tools needed for formatting the documentation.
110 ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
111 AC_PATH_PROG([PERL], [perl], [$ac_aux_dir_abs/missing perl])
112
113 dnl Check for tools needed for formatting man pages.
114 CROSS_COMPILING=$cross_compiling
115 AC_SUBST([CROSS_COMPILING])
116
117 dnl Checks for optional programs for the tests/lang-* tests.
118 gt_PROG_ANSI_CXX
119
120 dnl Checks for special libraries for the tests/test-lock test.
121 dnl On some systems, sched_yield is in librt, rather than in libpthread.
122 LIBSCHED=
123 if test $gl_threads_api = posix; then
124   dnl Solaris has sched_yield in librt, not in libpthread or libc.
125   AC_CHECK_LIB([rt], [sched_yield], [LIBSCHED=-lrt],
126     [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
127      AC_CHECK_LIB([posix4], [sched_yield], [LIBSCHED=-lposix4])])
128 fi
129 AC_SUBST([LIBSCHED])
130
131 dnl Determine whether to build libasprintf.
132 AC_ARG_ENABLE([libasprintf],
133   [  --disable-libasprintf   do not build libasprintf],
134   [if test "$enableval" != no; then
135      SUBDIR_libasprintf=libasprintf
136    else
137      SUBDIR_libasprintf=
138    fi
139   ], [SUBDIR_libasprintf=libasprintf])
140 if test "$CXX" = ":"; then
141   SUBDIR_libasprintf=
142 fi
143 AM_CONDITIONAL([ENABLE_LIBASPRINTF], [test -n "$SUBDIR_libasprintf"])
144
145 AC_CONFIG_SUBDIRS([libasprintf])
146
147 AC_CONFIG_FILES([Makefile])
148
149 AC_CONFIG_FILES([doc/Makefile])
150
151 AC_CONFIG_FILES([intl/Makefile])
152
153 AC_CONFIG_FILES([intl-java/Makefile])
154
155 AC_CONFIG_FILES([intl-csharp/Makefile])
156
157 AC_CONFIG_FILES([gnulib-lib/Makefile])
158
159 AC_CONFIG_FILES([src/Makefile])
160 AC_CONFIG_FILES([src/gettext.sh], [chmod a+x src/gettext.sh])
161
162 AC_CONFIG_FILES([po/Makefile.in])
163
164 AC_CONFIG_FILES([man/Makefile],
165                 [FIX_MAKEFILE_DISTRIB])
166 AC_CONFIG_FILES([man/x-to-1])
167
168 AC_CONFIG_FILES([m4/Makefile])
169
170 AC_CONFIG_FILES([tests/Makefile])
171
172 AC_OUTPUT