1
# Configure paths for FreeType2
2
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
4
dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
5
dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
7
AC_DEFUN([AC_CHECK_FT2],
9
dnl Get the cflags and libraries from the freetype-config script
11
AC_ARG_WITH(ft-prefix,
12
[ --with-ft-prefix=PREFIX
13
Prefix where FreeType is installed (optional)],
14
ft_config_prefix="$withval", ft_config_prefix="")
15
AC_ARG_WITH(ft-exec-prefix,
16
[ --with-ft-exec-prefix=PREFIX
17
Exec prefix where FreeType is installed (optional)],
18
ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
19
AC_ARG_ENABLE(freetypetest,
20
[ --disable-freetypetest Do not try to compile and run
21
a test FreeType program],
22
[], enable_fttest=yes)
24
if test x$ft_config_exec_prefix != x ; then
25
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
26
if test x${FT2_CONFIG+set} != xset ; then
27
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
30
if test x$ft_config_prefix != x ; then
31
ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
32
if test x${FT2_CONFIG+set} != xset ; then
33
FT2_CONFIG=$ft_config_prefix/bin/freetype-config
36
AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
38
min_ft_version=ifelse([$1], ,9.1.0,$1)
39
AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
41
if test "$FT2_CONFIG" = "no" ; then
44
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
45
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
46
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
47
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
48
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
49
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
50
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
51
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
52
ft_min_major_version=`echo $min_ft_version | \
53
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
54
ft_min_minor_version=`echo $min_ft_version | \
55
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
56
ft_min_micro_version=`echo $min_ft_version | \
57
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
58
if test x$enable_fttest = xyes ; then
60
if test $ft_config_major_version -lt $ft_min_major_version ; then
63
if test $ft_config_major_version -eq $ft_min_major_version ; then
64
if test $ft_config_minor_version -lt $ft_min_minor_version ; then
67
if test $ft_config_minor_version -eq $ft_min_minor_version ; then
68
if test $ft_config_micro_version -lt $ft_min_micro_version ; then
75
if test x$ft_config_is_lt = xyes ; then
78
ac_save_CFLAGS="$CFLAGS"
80
CFLAGS="$CFLAGS $FT2_CFLAGS"
81
LIBS="$FT2_LIBS $LIBS"
83
dnl Sanity checks for the results of freetype-config to some extent
87
#include FT_FREETYPE_H
97
error = FT_Init_FreeType(&library);
103
FT_Done_FreeType(library);
107
],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
108
CFLAGS="$ac_save_CFLAGS"
110
fi # test $ft_config_version -lt $ft_min_version
111
fi # test x$enable_fttest = xyes
112
fi # test "$FT2_CONFIG" = "no"
113
if test x$no_ft = x ; then
115
ifelse([$2], , :, [$2])
118
if test "$FT2_CONFIG" = "no" ; then
119
echo "*** The freetype-config script installed by FreeType 2 could not be found."
120
echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
121
echo "*** your path, or set the FT2_CONFIG environment variable to the"
122
echo "*** full path to freetype-config."
124
if test x$ft_config_is_lt = xyes ; then
125
echo "*** Your installed version of the FreeType 2 library is too old."
126
echo "*** If you have different versions of FreeType 2, make sure that"
127
echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
128
echo "*** are used, or set the FT2_CONFIG environment variable to the"
129
echo "*** full path to freetype-config."
131
echo "*** The FreeType test program failed to run. If your system uses"
132
echo "*** shared libraries and they are installed outside the normal"
133
echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
134
echo "*** (or whatever is appropiate for your system) is correctly set."
139
ifelse([$3], , :, [$3])
145
AC_DEFUN([MYGUI_USE_STLPORT],
146
[AC_ARG_WITH(stlport,
147
AC_HELP_STRING([--with-stlport=PATH],
148
[the path to STLPort.]),
149
ac_cv_use_stlport=$withval,
150
ac_cv_use_stlport=no)
151
AC_CACHE_CHECK([whether to use STLPort], ac_cv_use_stlport,
152
ac_cv_use_stlport=no)
153
if test x$ac_cv_use_stlport != xno; then
154
STLPORT_CFLAGS="-I$ac_cv_use_stlport/stlport"
155
STLPORT_LIBS="-L$ac_cv_use_stlport/lib -lstlport"
157
AC_SUBST(STLPORT_CFLAGS)
158
AC_SUBST(STLPORT_LIBS)
161
AC_DEFUN([MYGUI_CHECK_OGRE], [
162
PKG_CHECK_MODULES(OGRE, OGRE >= 1.4.0,,exit)
163
AC_SUBST(OGRE_CFLAGS)
167
AC_DEFUN([MYGUI_CHECK_OIS], [
168
PKG_CHECK_MODULES(OIS, OIS >= 1.0.0,,exit)
173
AC_DEFUN([AC_PROG_SWIG],[
174
AC_PATH_PROG([SWIG],[swig])
175
if test -z "$SWIG" ; then
176
AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
177
SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
178
elif test -n "$1" ; then
179
AC_MSG_CHECKING([for SWIG version])
180
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
181
AC_MSG_RESULT([$swig_version])
182
if test -n "$swig_version" ; then
183
# Calculate the required version number components
185
[required_major=`echo $required | sed 's/[^0-9].*//'`]
186
if test -z "$required_major" ; then
189
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
190
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
191
if test -z "$required_minor" ; then
194
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
195
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
196
if test -z "$required_patch" ; then
199
# Calculate the available version number components
200
[available=$swig_version]
201
[available_major=`echo $available | sed 's/[^0-9].*//'`]
202
if test -z "$available_major" ; then
205
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
206
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
207
if test -z "$available_minor" ; then
210
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
211
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
212
if test -z "$available_patch" ; then
215
if test $available_major -ne $required_major \
216
-o $available_minor -ne $required_minor \
217
-o $available_patch -lt $required_patch ; then
218
AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
219
SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
221
AC_MSG_NOTICE([SWIG executable is '$SWIG'])
222
SWIG_LIB=`$SWIG -swiglib`
223
AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
226
AC_MSG_WARN([cannot determine SWIG version])
227
SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false'
233
AC_DEFUN([SWIG_ENABLE_CXX],[
234
AC_REQUIRE([AC_PROG_SWIG])
235
AC_REQUIRE([AC_PROG_CXX])