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
|
dnl This file is part of the FreeType project, and may only be used,
dnl modified, and distributed under the terms of the FreeType project
dnl license, LICENSE.TXT. By continuing to use, modify, or distribute
dnl this file you indicate that you have read the license and understand
dnl and accept it fully.
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/freetype.h)
dnl Due to a bug in autoconf we must set $srcdir explicitly to an absolute
dnl path.
srcdir=`cd $srcdir; pwd`
AM_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl FreeType version
freetype_version='1.5'
dnl libttf.so version
version_info='6:0:4'
AC_ARG_ENABLE(nls,
[ --disable-nls don't use NLS],
USE_NLS=no, USE_NLS=yes)
AC_SUBST(USE_NLS)
dnl Checks for system type.
AC_CANONICAL_SYSTEM
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
dnl get Compiler flags right.
if test "x$CC" = xgcc; then
XX_CFLAGS="-Wall -pedantic -ansi -D_REENTRANT"
else
case "$host" in
*-dec-osf*)
XX_CFLAGS="-std1 -O2 -g3"
;;
*)
XX_CFLAGS=
;;
esac
fi
AC_SUBST(XX_CFLAGS)
dnl at least Digital UNIX 4.0d needs this due to a strange make program
case "$host" in
*-dec-osf*)
ln -s ../../MakeSub lib/arch
ln -s ../../MakeSub test/arch
;;
esac
AC_SUBST(freetype_version)
AC_SUBST(version_info)
dnl NLS/gettext nightmare^H^H^H^H^H^H^H^H^H^H support...
dnl autoconf-2.59+ disallows AC_REQUIRE outside AC_DEFUN
AC_DEFUN([ft_AC_REQUIRE_AC_PROG_MAKE_SET],
[AC_REQUIRE([AC_PROG_MAKE_SET])])
if test "$USE_NLS" = "yes"; then
ft_AC_REQUIRE_AC_PROG_MAKE_SET
AC_CHECK_HEADERS(locale.h)
AC_CHECK_FUNCS(setlocale)
AC_SUBST(HAVE_LOCALE_H)
AC_CHECK_HEADERS(libintl.h)
AC_SUBST(HAVE_LIBINTL_H)
ALL_LINGUAS="de fr cs nl es"
dnl We now need to check whether the "intl" library is available.
dnl The bad news is that a number of possibilities can happen:
dnl a) GNU gettext support is already available from the (modern) libc
dnl b) some version of gettext is available as standalone "intl" lib
dnl No real problem (this was the only case previously detected)
dnl c) a recent version of gettext is used, and it needs the
dnl (separate) "iconv" library to work
dnl
dnl This test has been adapted from gettext.m4, written by Bruno Haible
LIBINTL=
LTLIBINTL=
dnl First, test case a)
AC_CACHE_CHECK([for GNU gettext in libc], ftgt_cv_func_gnugettext_libc,
[AC_TRY_LINK([
#include <libintl.h>
extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;
],[
bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings
], ftgt_cv_func_gnugettext_libc=yes,
ftgt_cv_func_gnugettext_libc=no)])
if test "$ftgt_cv_func_gnugettext_libc" != "yes"; then
dnl It does not come for free. Let's check case b),
dnl id est see whether libintl exists and does not depend on libiconv.
AC_CHECK_LIB(intl, gettext)
if test "$ac_cv_lib_intl_gettext" != "yes"; then
dnl Does not work; so let's check case c),
dnl id est see whether libintl exists and depends on libiconv.
AC_CACHE_CHECK([for GNU gettext in libintl, using libiconv],
ftgt_cv_func_gnugettext_libintliconv,
[AC_CHECK_LIB(intl, bindtextdomain,
ftgt_cv_func_gnugettext_libintliconv=yes LIBS="$LIBS -lintl -liconv",
[ftgt_cv_func_gnugettext_libintliconv=no
dnl No NLS support then!
USE_NLS=no],
-liconv)])
fi
fi
fi
if test "$USE_NLS" = "yes"; then
dnl Handle localedir
LOCALEDIR='${prefix}/share/locale'
AC_ARG_WITH(locale-dir,
[ --with-locale-dir=DIR Location of the locale file(s)
[PREFIX/share/locale]],[
if test x$withval = xyes; then
AC_MSG_WARN(Usage is: --with-locale-dir=basedir)
else
if test x$withval = xno; then
AC_MSG_WARN(Usage is: --with-locale-dir=basedir)
else
LOCALEDIR=$withval
fi
fi
])
AC_SUBST(LOCALEDIR)
AC_PATH_PROG(MSGFMT, msgfmt, $MSGFMT)
if test -n "$MSGFMT"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AC_PATH_PROG(XGETTEXT, xgettext, $XGETTEXT)
AC_PATH_PROG(MSGMERGE, msgmerge, $MSGMERGE)
dnl Test whether we really found GNU xgettext.
if test -n "$XGETTEXT"; then
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=""
fi
fi
dnl We add another test for comparing GNU xgettext with openwin xgettext
if test -n "$XGETTEXT"; then
if $XGETTEXT --help > /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=""
fi
fi
dnl Test whether we really found GNU msgfmt.
if test -n "$MSGFMT"; then
if $MSGFMT < /dev/null 2> /dev/null; then
AC_MSG_RESULT(
[found msgfmt program is not GNU msgfmt; NLS won't be installed])
MSGFMT=""
fi
fi
AC_TRY_LINK(,
[extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
if test -n "$ALL_LINGUAS"; then
for lang in $ALL_LINGUAS; do
CATALOGS="$CATALOGS $lang$CATOBJEXT"
done
fi
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(INSTOBJEXT)
AC_SUBST(DATADIRNAME)
fi
dnl don't use NLS, when there is no gettext installed
if test x"$MSGFMT" = x; then
USE_NLS=no
fi
AC_CHECK_PROG(RM, rm, rm)
AC_CHECK_PROG(RMDIR, rmdir, rmdir)
AC_PROG_INSTALL
AC_PROG_LN_S
dnl Checks for libraries.
sinclude(net.m4)
AC_LIBRARY_NET
AC_CHECK_LIB(m, cos)
dnl Checks for header files.
AC_PATH_XTRA
dnl Don't compile X programs (and emit a warning message)
dnl if X isn't available.
if test "$no_x" = yes; then
AC_MSG_WARN([Test programs needing X11 won't be compiled.])
else
X_PROGRAMS="\$(X_PROGRAMS)"
AC_SUBST(X_PROGRAMS)
fi
AC_CHECK_HEADERS(stdlib.h fcntl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
dnl Checks for library functions.
dnl Here we check whether we can use our mmap file component.
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
TT_FILE_COMPONENT=ttfile.c
else
TT_FILE_COMPONENT=arch/unix/ttmmap.c
fi
AC_SUBST(TT_FILE_COMPONENT)
AC_CHECK_FUNCS(memcpy memmove)
AC_CONFIG_HEADER(ft_conf.h)
dnl Another bug: to make --srcdir work correctly we have to create the
dnl directory hierarchy first since autoconf only uses mkdir.
$srcdir/mkinstalldirs lib/arch/unix test/arch/unix
AC_CONFIG_FILES([Makefile
MakeSub
lib/arch/unix/Makefile
test/arch/unix/Makefile])
AC_CONFIG_FILES([po/Makefile.in],
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
AC_OUTPUT
dnl end of configure.in
|