~jeko-ios-software/openracing/mygui-or

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Jean-Christophe Hoelt
  • Date: 2009-02-28 17:17:54 UTC
  • Revision ID: jeko@ios-software.com-20090228171754-a3o4ejsnjeme4zby
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Configure paths for FreeType2
 
2
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
 
3
 
 
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
 
6
dnl
 
7
AC_DEFUN([AC_CHECK_FT2],
 
8
[dnl
 
9
dnl Get the cflags and libraries from the freetype-config script
 
10
dnl
 
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)
 
23
 
 
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
 
28
  fi
 
29
fi
 
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
 
34
  fi
 
35
fi
 
36
AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
 
37
 
 
38
min_ft_version=ifelse([$1], ,9.1.0,$1)
 
39
AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
 
40
no_ft=""
 
41
if test "$FT2_CONFIG" = "no" ; then
 
42
  no_ft=yes
 
43
else
 
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
 
59
    ft_config_is_lt=""
 
60
    if test $ft_config_major_version -lt $ft_min_major_version ; then
 
61
      ft_config_is_lt=yes
 
62
    else
 
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
 
65
          ft_config_is_lt=yes
 
66
        else
 
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
 
69
              ft_config_is_lt=yes
 
70
            fi
 
71
          fi
 
72
        fi
 
73
      fi
 
74
    fi
 
75
    if test x$ft_config_is_lt = xyes ; then
 
76
      no_ft=yes
 
77
    else
 
78
      ac_save_CFLAGS="$CFLAGS"
 
79
      ac_save_LIBS="$LIBS"
 
80
      CFLAGS="$CFLAGS $FT2_CFLAGS"
 
81
      LIBS="$FT2_LIBS $LIBS"
 
82
dnl
 
83
dnl Sanity checks for the results of freetype-config to some extent
 
84
dnl
 
85
      AC_TRY_RUN([
 
86
#include <ft2build.h>
 
87
#include FT_FREETYPE_H
 
88
#include <stdio.h>
 
89
#include <stdlib.h>
 
90
 
 
91
int
 
92
main()
 
93
{
 
94
  FT_Library library;
 
95
  FT_Error error;
 
96
 
 
97
  error = FT_Init_FreeType(&library);
 
98
 
 
99
  if (error)
 
100
    return 1;
 
101
  else
 
102
  {
 
103
    FT_Done_FreeType(library);
 
104
    return 0;
 
105
  }
 
106
}
 
107
],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
108
      CFLAGS="$ac_save_CFLAGS"
 
109
      LIBS="$ac_save_LIBS"
 
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
 
114
   AC_MSG_RESULT(yes)
 
115
   ifelse([$2], , :, [$2])
 
116
else
 
117
   AC_MSG_RESULT(no)
 
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."
 
123
   else
 
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."
 
130
     else
 
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."
 
135
     fi
 
136
   fi
 
137
   FT2_CFLAGS=""
 
138
   FT2_LIBS=""
 
139
   ifelse([$3], , :, [$3])
 
140
fi
 
141
AC_SUBST(FT2_CFLAGS)
 
142
AC_SUBST(FT2_LIBS)
 
143
])
 
144
 
 
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"
 
156
 fi
 
157
 AC_SUBST(STLPORT_CFLAGS)
 
158
 AC_SUBST(STLPORT_LIBS)
 
159
])
 
160
 
 
161
AC_DEFUN([MYGUI_CHECK_OGRE], [
 
162
    PKG_CHECK_MODULES(OGRE, OGRE >= 1.4.0,,exit)
 
163
    AC_SUBST(OGRE_CFLAGS)
 
164
    AC_SUBST(OGRE_LIBS)
 
165
])
 
166
 
 
167
AC_DEFUN([MYGUI_CHECK_OIS], [
 
168
    PKG_CHECK_MODULES(OIS, OIS >= 1.0.0,,exit)
 
169
    AC_SUBST(OIS_CFLAGS)
 
170
    AC_SUBST(OIS_LIBS)
 
171
])
 
172
 
 
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
 
184
                        [required=$1]
 
185
                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
 
186
                        if test -z "$required_major" ; then
 
187
                                [required_major=0]
 
188
                        fi
 
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
 
192
                                [required_minor=0]
 
193
                        fi
 
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
 
197
                                [required_patch=0]
 
198
                        fi
 
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
 
203
                                [available_major=0]
 
204
                        fi
 
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
 
208
                                [available_minor=0]
 
209
                        fi
 
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
 
213
                                [available_patch=0]
 
214
                        fi
 
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'
 
220
                        else
 
221
                                AC_MSG_NOTICE([SWIG executable is '$SWIG'])
 
222
                                SWIG_LIB=`$SWIG -swiglib`
 
223
                                AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
 
224
                        fi
 
225
                else
 
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'
 
228
                fi
 
229
        fi
 
230
        AC_SUBST([SWIG_LIB])
 
231
])
 
232
 
 
233
AC_DEFUN([SWIG_ENABLE_CXX],[
 
234
        AC_REQUIRE([AC_PROG_SWIG])
 
235
        AC_REQUIRE([AC_PROG_CXX])
 
236
        SWIG="$SWIG -c++"
 
237
])