contrib/OWB: add correct SDL dependency, fix compilers used
[AROS-Contrib.git] / freetype1 / configure.in
blob100c847dab39a12aae004cab82453c6da6ec6359
1 dnl This file is part of the FreeType project.
2 dnl
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
8 dnl path.
9 srcdir=`cd $srcdir; pwd`
11 AM_DISABLE_STATIC
12 AM_PROG_LIBTOOL
14 dnl FreeType version
15 freetype_version='1.2.0'
17 dnl libttf.so version
18 version_info='4:0:2'
20 AC_ARG_ENABLE(nls,
21               [  --disable-nls           don't use NLS],
22               USE_NLS=no, USE_NLS=yes)
23 AC_SUBST(USE_NLS)
25 dnl Checks for system type.
26 AC_CANONICAL_SYSTEM
28 dnl Checks for programs.
29 AC_PROG_CC
30 AC_PROG_CPP
32 dnl get Compiler flags right.
34 if test "x$CC" = xgcc; then
35   XX_CFLAGS="-Wall -pedantic -ansi"
36 else
37   case "$host" in
38     *-dec-osf*)
39       XX_CFLAGS="-std1 -O2 -g3"
40       ;;
41     *)
42       XX_CFLAGS=
43       ;;
44   esac
46 AC_SUBST(XX_CFLAGS)
48 dnl at least Digital UNIX 4.0d needs this due to a strange make program
50 case "$host" in
51   *-dec-osf*)
52     ln -s ../../MakeSub lib/arch
53     ln -s ../../MakeSub test/arch
54     ;;
55 esac
57 AC_SUBST(freetype_version)
58 AC_SUBST(version_info)
60 dnl gettext support
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)
73   dnl Handle localedir
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)
80     else
81       if test x$withval = xno; then
82         AC_MSG_WARN(Usage is: --with-locale-dir=basedir)
83       else
84         LOCALEDIR=$withval
85       fi
86     fi
87   ])
88   AC_SUBST(LOCALEDIR)
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
100         : ;
101       else
102         AC_MSG_RESULT(
103           [found xgettext program is not GNU xgettext; ignore it])
104         XGETTEXT=""
105       fi
106     fi
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
111         : ;
112       else
113         AC_MSG_RESULT(
114           [found xgettext program is not GNU xgettext; ignore it])
115         XGETTEXT=""
116       fi
117     fi
119     dnl Test whether we really found GNU msgfmt.
120     if test -n "$MSGFMT"; then
121       if $MSGFMT < /dev/null 2> /dev/null; then
122         AC_MSG_RESULT(
123           [found msgfmt program is not GNU msgfmt; NLS won't be installed])
124         MSGFMT=""
125       fi
126     fi
128     AC_TRY_LINK(,
129                 [extern int _nl_msg_cat_cntr;
130                  return _nl_msg_cat_cntr],
131                 [CATOBJEXT=.gmo
132                  DATADIRNAME=share],  
133                 [CATOBJEXT=.mo
134                  DATADIRNAME=lib])
135     INSTOBJEXT=.mo
136   fi
138   if test -n "$ALL_LINGUAS"; then
139     for lang in $ALL_LINGUAS; do
140       CATALOGS="$CATALOGS $lang$CATOBJEXT"
141     done
142   fi
143   AC_SUBST(CATALOGS)
144   AC_SUBST(CATOBJEXT)
145   AC_SUBST(INSTOBJEXT)
146   AC_SUBST(DATADIRNAME)
149 dnl don't use NLS, when there is no gettext installed
150 if test x"$MSGFMT" = x; then
151   USE_NLS=no
155 AC_CHECK_PROG(RM, rm, rm)
156 AC_CHECK_PROG(RMDIR, rmdir, rmdir)
157 AC_PROG_INSTALL
158 AC_PROG_LN_S
160 dnl Checks for libraries.
161 sinclude(net.m4)
162 AC_LIBRARY_NET
163 AC_CHECK_LIB(m, cos)
165 dnl Checks for header files.
166 AC_PATH_XTRA
167 AC_CHECK_HEADERS(stdlib.h fcntl.h unistd.h)
169 dnl Checks for typedefs, structures, and compiler characteristics.
170 AC_C_CONST
171 AC_CHECK_SIZEOF(int)
172 AC_CHECK_SIZEOF(long)
174 dnl Checks for library functions.
176 dnl Here we check whether we can use our mmap file component.
177 AC_FUNC_MMAP
178 if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
179   TT_FILE_COMPONENT=ttfile.c
180 else
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
193 AC_OUTPUT(Makefile
194            MakeSub
195            lib/arch/unix/Makefile
196            test/arch/unix/Makefile 
197            po/Makefile.in,
198           [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
201 dnl end of configure.in