1 dnl This file is part of the FreeType project.
3 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(lib/freetype.h)
7 dnl Due to a bug in autoconf we must set $srcdir explicitly to an absolute
9 srcdir=`cd $srcdir; pwd`
15 freetype_version='1.2.0'
21 [ --disable-nls don't use NLS],
22 USE_NLS=no, USE_NLS=yes)
25 dnl Checks for system type.
28 dnl Checks for programs.
32 dnl get Compiler flags right.
34 if test "x$CC" = xgcc; then
35 XX_CFLAGS="-Wall -pedantic -ansi"
39 XX_CFLAGS="-std1 -O2 -g3"
48 dnl at least Digital UNIX 4.0d needs this due to a strange make program
52 ln -s ../../MakeSub lib/arch
53 ln -s ../../MakeSub test/arch
57 AC_SUBST(freetype_version)
58 AC_SUBST(version_info)
61 if test "$USE_NLS" = "yes"; then
62 AC_REQUIRE([AC_PROG_MAKE_SET])
63 AC_CHECK_HEADERS(locale.h)
64 AC_CHECK_FUNCS(setlocale)
65 AC_SUBST(HAVE_LOCALE_H)
67 ALL_LINGUAS="de fr cs nl es"
68 AC_CHECK_HEADERS(libintl.h)
69 AC_CHECK_LIB(intl,gettext)
70 AC_SUBST(HAVE_LIBINTL_H)
71 AC_SUBST(HAVE_LIBINTL)
74 LOCALEDIR='${prefix}/share/locale'
75 AC_ARG_WITH(locale-dir,
76 [ --with-locale-dir=DIR Location of the locale file(s)
77 [PREFIX/share/locale]],[
78 if test x$withval = xyes; then
79 AC_MSG_WARN(Usage is: --with-locale-dir=basedir)
81 if test x$withval = xno; then
82 AC_MSG_WARN(Usage is: --with-locale-dir=basedir)
90 AC_PATH_PROG(MSGFMT, msgfmt, $MSGFMT)
91 if test -n "$MSGFMT"; then
92 AC_CHECK_FUNCS(dcgettext)
93 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
94 AC_PATH_PROG(XGETTEXT, xgettext, $XGETTEXT)
95 AC_PATH_PROG(MSGMERGE, msgmerge, $MSGMERGE)
97 dnl Test whether we really found GNU xgettext.
98 if test -n "$XGETTEXT"; then
99 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
103 [found xgettext program is not GNU xgettext; ignore it])
108 dnl We add another test for comparing GNU xgettext with openwin xgettext
109 if test -n "$XGETTEXT"; then
110 if $XGETTEXT --help > /dev/null 2> /dev/null; then
114 [found xgettext program is not GNU xgettext; ignore it])
119 dnl Test whether we really found GNU msgfmt.
120 if test -n "$MSGFMT"; then
121 if $MSGFMT < /dev/null 2> /dev/null; then
123 [found msgfmt program is not GNU msgfmt; NLS won't be installed])
129 [extern int _nl_msg_cat_cntr;
130 return _nl_msg_cat_cntr],
138 if test -n "$ALL_LINGUAS"; then
139 for lang in $ALL_LINGUAS; do
140 CATALOGS="$CATALOGS $lang$CATOBJEXT"
146 AC_SUBST(DATADIRNAME)
149 dnl don't use NLS, when there is no gettext installed
150 if test x"$MSGFMT" = x; then
155 AC_CHECK_PROG(RM, rm, rm)
156 AC_CHECK_PROG(RMDIR, rmdir, rmdir)
160 dnl Checks for libraries.
165 dnl Checks for header files.
167 AC_CHECK_HEADERS(stdlib.h fcntl.h unistd.h)
169 dnl Checks for typedefs, structures, and compiler characteristics.
172 AC_CHECK_SIZEOF(long)
174 dnl Checks for library functions.
176 dnl Here we check whether we can use our mmap file component.
178 if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
179 TT_FILE_COMPONENT=ttfile.c
181 TT_FILE_COMPONENT=arch/unix/ttmmap.c
183 AC_SUBST(TT_FILE_COMPONENT)
185 AC_CHECK_FUNCS(memcpy memmove)
187 AC_CONFIG_HEADER(ft_conf.h)
189 dnl Another bug: to make --srcdir work correctly we have to create the
190 dnl directory hierarchy first since autoconf only uses mkdir.
191 $srcdir/mkinstalldirs lib/arch/unix test/arch/unix
195 lib/arch/unix/Makefile
196 test/arch/unix/Makefile
198 [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
201 dnl end of configure.in