| 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([OGRE_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([OGRE_GET_PLATFORM], |
|---|
| 162 | [OGRE_PLATFORM=GLX |
|---|
| 163 | AC_ARG_WITH(platform, |
|---|
| 164 | AC_HELP_STRING([--with-platform=PLATFORM], |
|---|
| 165 | [the platform to build, currently GLX or Win32]), |
|---|
| 166 | OGRE_PLATFORM=$withval, |
|---|
| 167 | OGRE_PLATFORM=GLX) |
|---|
| 168 | |
|---|
| 169 | PLATFORM_CFLAGS="" |
|---|
| 170 | PLATFORM_LIBS="" |
|---|
| 171 | |
|---|
| 172 | dnl Do the extra checks per type here |
|---|
| 173 | case $OGRE_PLATFORM in |
|---|
| 174 | GLX) |
|---|
| 175 | AC_CHECK_HEADERS([X11/Intrinsic.h],, [AC_MSG_ERROR("libxt headers not found")]) |
|---|
| 176 | AC_CHECK_HEADERS([X11/Xaw/Command.h],, [AC_MSG_ERROR("libxaw headers not found")]) |
|---|
| 177 | AC_CHECK_HEADERS([X11/extensions/xf86vmode.h],, [AC_MSG_ERROR("libxf86vm headers not found")],[#include <X11/Xlib.h>]) |
|---|
| 178 | AC_CHECK_HEADERS([X11/extensions/Xrandr.h],, [AC_MSG_ERROR("libxrandr headers not found")],[#include <X11/Xlib.h>]) |
|---|
| 179 | AC_PATH_X |
|---|
| 180 | if test x"$x_includes" != x; then |
|---|
| 181 | if test x"$x_includes" != xNONE; then |
|---|
| 182 | PLATFORM_CFLAGS="-I$x_includes" |
|---|
| 183 | fi |
|---|
| 184 | fi |
|---|
| 185 | if test x"$x_libraries" != x; then |
|---|
| 186 | if test x"$x_libraries" != xNONE; then |
|---|
| 187 | PLATFORM_LIBS="-L$x_libraries -lX11 -lXaw" |
|---|
| 188 | fi |
|---|
| 189 | dnl In case of xorg 7.x, $x_libraries is empty |
|---|
| 190 | else |
|---|
| 191 | PLATFORM_LIBS="-lX11 -lXaw" |
|---|
| 192 | fi |
|---|
| 193 | ;; |
|---|
| 194 | Win32) |
|---|
| 195 | PLATFORM_CFLAGS="" |
|---|
| 196 | PLATFORM_LIBS="-lgdi32 -lwinmm -ldinput8 -ldxguid" |
|---|
| 197 | ;; |
|---|
| 198 | esac |
|---|
| 199 | |
|---|
| 200 | AC_SUBST(PLATFORM_CFLAGS) |
|---|
| 201 | AC_SUBST(PLATFORM_LIBS) |
|---|
| 202 | AC_SUBST(OGRE_PLATFORM) |
|---|
| 203 | ]) |
|---|
| 204 | |
|---|
| 205 | AC_DEFUN([OGRE_GET_GLSUPPORT], |
|---|
| 206 | [OGRE_GLSUPPORT=none |
|---|
| 207 | AC_ARG_WITH(gl-support, |
|---|
| 208 | AC_HELP_STRING([--with-gl-support=PLATFORM], |
|---|
| 209 | [ The GLsupport to build (GLX or Win32). Defaults to the platform. Only set this if you know what you are doing. Use --with-platform otherwise.]), |
|---|
| 210 | OGRE_GLSUPPORT=$withval, |
|---|
| 211 | OGRE_GLSUPPORT=none) |
|---|
| 212 | |
|---|
| 213 | if test "$OGRE_GLSUPPORT" = "none" ; then |
|---|
| 214 | OGRE_GLSUPPORT="$OGRE_PLATFORM" |
|---|
| 215 | AC_MSG_NOTICE([setting gl-support to platform: $OGRE_GLSUPPORT]) |
|---|
| 216 | fi |
|---|
| 217 | if test "$OGRE_GLSUPPORT" = "Win32" ; then |
|---|
| 218 | # Uppercase/lowercase |
|---|
| 219 | OGRE_GLSUPPORT=win32 |
|---|
| 220 | fi |
|---|
| 221 | |
|---|
| 222 | GLSUPPORT_CFLAGS="" |
|---|
| 223 | GLSUPPORT_LIBS="" |
|---|
| 224 | |
|---|
| 225 | dnl Do the extra checks per type here |
|---|
| 226 | case $OGRE_GLSUPPORT in |
|---|
| 227 | GLX) |
|---|
| 228 | AC_PATH_X |
|---|
| 229 | if test x"$x_includes" != x; then |
|---|
| 230 | if test x"$x_includes" != xNONE; then |
|---|
| 231 | GLSUPPORT_CFLAGS="-I$x_includes" |
|---|
| 232 | fi |
|---|
| 233 | fi |
|---|
| 234 | if test x"$x_libraries" != x; then |
|---|
| 235 | if test x"$x_libraries" != xNONE; then |
|---|
| 236 | GLSUPPORT_LIBS="-L$x_libraries -lX11 -lXext -lGL -lXrandr -lXxf86vm" |
|---|
| 237 | fi |
|---|
| 238 | dnl In case of xorg 7.x $x_libraries might be empty |
|---|
| 239 | else |
|---|
| 240 | GLSUPPORT_LIBS="-lX11 -lXext -lGL -lXrandr -lXxf86vm" |
|---|
| 241 | fi |
|---|
| 242 | ;; |
|---|
| 243 | win32) |
|---|
| 244 | GLSUPPORT_CFLAGS="" |
|---|
| 245 | GLSUPPORT_LIBS="-lgdi32 -lwinmm" |
|---|
| 246 | ;; |
|---|
| 247 | esac |
|---|
| 248 | |
|---|
| 249 | AC_SUBST(GLSUPPORT_CFLAGS) |
|---|
| 250 | AC_SUBST(GLSUPPORT_LIBS) |
|---|
| 251 | AC_SUBST(OGRE_GLSUPPORT) |
|---|
| 252 | AC_CONFIG_FILES([RenderSystems/GL/src/GLX/Makefile |
|---|
| 253 | RenderSystems/GL/src/win32/Makefile]) |
|---|
| 254 | ]) |
|---|
| 255 | |
|---|
| 256 | AC_DEFUN([OGRE_SETUP_FOR_TARGET], |
|---|
| 257 | [case $host in |
|---|
| 258 | *-*-cygwin* | *-*-mingw* | *-*-pw32*) |
|---|
| 259 | AC_SUBST(SHARED_FLAGS, "-shared -no-undefined -Xlinker --export-all-symbols") |
|---|
| 260 | AC_SUBST(PLUGIN_FLAGS, "-shared -no-undefined -avoid-version") |
|---|
| 261 | AC_SUBST(GL_LIBS, "-lopengl32 -lglu32") |
|---|
| 262 | AC_CHECK_TOOL(RC, windres) |
|---|
| 263 | nt=true |
|---|
| 264 | ;; |
|---|
| 265 | *-*-darwin*) |
|---|
| 266 | AC_SUBST(SHARED_FLAGS, "-shared") |
|---|
| 267 | AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version") |
|---|
| 268 | AC_SUBST(GL_LIBS, "-lGL -lGLU") |
|---|
| 269 | osx=true |
|---|
| 270 | ;; |
|---|
| 271 | *) dnl default to standard linux |
|---|
| 272 | AC_SUBST(SHARED_FLAGS, "-shared") |
|---|
| 273 | AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version") |
|---|
| 274 | AC_SUBST(GL_LIBS, "-lGL -lGLU") |
|---|
| 275 | linux=true |
|---|
| 276 | ;; |
|---|
| 277 | esac |
|---|
| 278 | dnl you must arrange for every AM_conditional to run every time configure runs |
|---|
| 279 | AM_CONDITIONAL(OGRE_NT, test x$nt = xtrue) |
|---|
| 280 | AM_CONDITIONAL(OGRE_LINUX, test x$linux = xtrue) |
|---|
| 281 | AM_CONDITIONAL(OGRE_OSX,test x$osx = xtrue ) |
|---|
| 282 | ]) |
|---|
| 283 | |
|---|
| 284 | |
|---|
| 285 | AC_DEFUN([OGRE_DETECT_ENDIAN], |
|---|
| 286 | [AC_TRY_RUN([ |
|---|
| 287 | int main() |
|---|
| 288 | { |
|---|
| 289 | short s = 1; |
|---|
| 290 | short* ptr = &s; |
|---|
| 291 | unsigned char c = *((char*)ptr); |
|---|
| 292 | return c; |
|---|
| 293 | } |
|---|
| 294 | ] |
|---|
| 295 | ,[AC_DEFINE(OGRE_CONFIG_BIG_ENDIAN,,[Big endian machine]) |
|---|
| 296 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_BIG_ENDIAN"] |
|---|
| 297 | ,[AC_DEFINE(OGRE_CONFIG_LITTLE_ENDIAN,,[Little endian machine]) |
|---|
| 298 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_CONFIG_LITTLE_ENDIAN"]) |
|---|
| 299 | ]) |
|---|
| 300 | |
|---|
| 301 | AC_DEFUN([OGRE_CHECK_OPENEXR], |
|---|
| 302 | [AC_ARG_ENABLE(openexr, |
|---|
| 303 | AC_HELP_STRING([--enable-openexr], |
|---|
| 304 | [Build the OpenEXR plugin]), |
|---|
| 305 | [build_exr=$enableval], |
|---|
| 306 | [build_exr=no]) |
|---|
| 307 | |
|---|
| 308 | if test "x$build_exr" = "xyes" ; then |
|---|
| 309 | PKG_CHECK_MODULES(OPENEXR, OpenEXR, [build_exr=yes], [build_exr=no]) |
|---|
| 310 | |
|---|
| 311 | if test "x$build_exr" = "xyes" ; then |
|---|
| 312 | AC_CONFIG_FILES([ PlugIns/EXRCodec/Makefile \ |
|---|
| 313 | PlugIns/EXRCodec/src/Makefile \ |
|---|
| 314 | PlugIns/EXRCodec/include/Makefile]) |
|---|
| 315 | AC_SUBST(OPENEXR_CFLAGS) |
|---|
| 316 | AC_SUBST(OPENEXR_LIBS) |
|---|
| 317 | |
|---|
| 318 | fi |
|---|
| 319 | |
|---|
| 320 | fi |
|---|
| 321 | |
|---|
| 322 | AM_CONDITIONAL(BUILD_EXRPLUGIN, test x$build_exr = xyes) |
|---|
| 323 | |
|---|
| 324 | ]) |
|---|
| 325 | |
|---|
| 326 | AC_DEFUN([OGRE_CHECK_CG], |
|---|
| 327 | [AC_ARG_ENABLE(cg, |
|---|
| 328 | AC_HELP_STRING([--disable-cg], |
|---|
| 329 | [Do not build the Cg plugin (recommended you do so!)]), |
|---|
| 330 | [build_cg=$enableval], |
|---|
| 331 | [build_cg=yes]) |
|---|
| 332 | |
|---|
| 333 | if test "x$build_cg" = "xyes" ; then |
|---|
| 334 | AC_CHECK_LIB(Cg, cgCreateProgram,,AC_MSG_ERROR([ |
|---|
| 335 | **************************************************************** |
|---|
| 336 | * You do not have the nVidia Cg libraries installed. * |
|---|
| 337 | * Go to http://developer.nvidia.com/object/cg_toolkit.html * |
|---|
| 338 | * (Click on Cg_Linux.tar.gz). * |
|---|
| 339 | * You can disable the building of Cg support by providing * |
|---|
| 340 | * --disable-cg to this configure script but this is highly * |
|---|
| 341 | * discouraged as this breaks many of the examples. * |
|---|
| 342 | ****************************************************************]) |
|---|
| 343 | ) |
|---|
| 344 | fi |
|---|
| 345 | |
|---|
| 346 | AM_CONDITIONAL(BUILD_CGPLUGIN, test x$build_cg = xyes) |
|---|
| 347 | |
|---|
| 348 | ]) |
|---|
| 349 | |
|---|
| 350 | AC_DEFUN([OGRE_CHECK_CPPUNIT], |
|---|
| 351 | [ |
|---|
| 352 | AM_PATH_CPPUNIT([1.10.0], [build_unit_tests=true]) |
|---|
| 353 | AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$build_unit_tests = xtrue]) |
|---|
| 354 | ]) |
|---|
| 355 | |
|---|
| 356 | |
|---|
| 357 | AC_DEFUN([OGRE_CHECK_DX9], |
|---|
| 358 | [AC_ARG_ENABLE(direct3d, |
|---|
| 359 | AC_HELP_STRING([--enable-direct3d], |
|---|
| 360 | [Build the DirectX 9 Render System]), |
|---|
| 361 | [build_dx9=$enableval], |
|---|
| 362 | [build_dx9=no]) |
|---|
| 363 | |
|---|
| 364 | AM_CONDITIONAL(BUILD_DX9RENDERSYSTEM, test x$build_dx9 = xyes) |
|---|
| 365 | |
|---|
| 366 | ]) |
|---|
| 367 | |
|---|
| 368 | |
|---|
| 369 | AC_DEFUN([OGRE_CHECK_FREEIMAGE], |
|---|
| 370 | [AC_ARG_ENABLE(freeimage, |
|---|
| 371 | AC_HELP_STRING([--disable-freeimage], |
|---|
| 372 | [Don't use FreeImage for image loading. This is not recommended unless you provide your own image loading codecs.]), |
|---|
| 373 | [build_freeimage=$enableval], |
|---|
| 374 | [build_freeimage=yes]) |
|---|
| 375 | |
|---|
| 376 | |
|---|
| 377 | AM_CONDITIONAL(USE_FREEIMAGE, test x$build_freeimage = xyes) |
|---|
| 378 | |
|---|
| 379 | if test "x$build_freeimage" = "xyes" ; then |
|---|
| 380 | AC_CHECK_LIB(freeimage, FreeImage_Load,,AC_MSG_ERROR([ |
|---|
| 381 | **************************************************************** |
|---|
| 382 | * You do not have FreeImage installed. This is required. * |
|---|
| 383 | * You may find it at http://freeimage.sourceforge.net/. * |
|---|
| 384 | * Note: You can also provide --disable-freeimage to the build * |
|---|
| 385 | * process to build without it. This is an advanced option * |
|---|
| 386 | * useful only if you provide your own image loading codecs. * |
|---|
| 387 | ****************************************************************]), -lstdc++) |
|---|
| 388 | AC_DEFINE([OGRE_NO_FREEIMAGE], [0], [Do not use freeimage to load images]) |
|---|
| 389 | else |
|---|
| 390 | AC_DEFINE([OGRE_NO_FREEIMAGE], [1], [Load images using the freeimage library]) |
|---|
| 391 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_NO_FREEIMAGE" |
|---|
| 392 | fi |
|---|
| 393 | |
|---|
| 394 | |
|---|
| 395 | ]) |
|---|
| 396 | |
|---|
| 397 | |
|---|
| 398 | AC_DEFUN([OGRE_CHECK_DEVIL], |
|---|
| 399 | [AC_ARG_ENABLE(devil, |
|---|
| 400 | AC_HELP_STRING([--disable-devil], |
|---|
| 401 | [Don't use DevIL for image loading. This is not recommended unless you provide your own image loading codecs.]), |
|---|
| 402 | [build_il=$enableval], |
|---|
| 403 | [build_il=yes]) |
|---|
| 404 | |
|---|
| 405 | AM_CONDITIONAL(USE_DEVIL, test x$build_il = xyes && test x$build_freeimage = xno) |
|---|
| 406 | |
|---|
| 407 | if test "x$build_freeimage" = "xyes"; then |
|---|
| 408 | AC_MSG_NOTICE([Freeimage is being built, disabling check for DevIL.]) |
|---|
| 409 | [build_il=no] |
|---|
| 410 | AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil]) |
|---|
| 411 | else |
|---|
| 412 | if test "x$build_il" = "xyes"; then |
|---|
| 413 | AC_CHECK_LIB(IL, ilInit,,AC_MSG_ERROR([ |
|---|
| 414 | **************************************************************** |
|---|
| 415 | * You do not have DevIL installed. This is required to build. * |
|---|
| 416 | * You may find it at http://openil.sourceforge.net/. * |
|---|
| 417 | * Note: You can also provide --disable-devil to the build * |
|---|
| 418 | * process to build without DevIL. This is an advanced option * |
|---|
| 419 | * useful only if you provide your own image loading codecs. * |
|---|
| 420 | ****************************************************************])) |
|---|
| 421 | AC_CHECK_LIB(ILU, iluFlipImage) |
|---|
| 422 | AC_DEFINE([OGRE_NO_DEVIL], [0], [Build devil]) |
|---|
| 423 | else |
|---|
| 424 | AC_DEFINE([OGRE_NO_DEVIL], [1], [Build devil]) |
|---|
| 425 | fi |
|---|
| 426 | fi |
|---|
| 427 | |
|---|
| 428 | ]) |
|---|
| 429 | |
|---|
| 430 | |
|---|
| 431 | |
|---|
| 432 | AC_DEFUN([OGRE_CHECK_PIC], |
|---|
| 433 | [ |
|---|
| 434 | AC_MSG_CHECKING([whether -fPIC is needed]) |
|---|
| 435 | case $host in |
|---|
| 436 | x86_64-*) |
|---|
| 437 | CXXFLAGS="$CXXFLAGS -fPIC" |
|---|
| 438 | AC_MSG_RESULT(yes) |
|---|
| 439 | ;; |
|---|
| 440 | *) |
|---|
| 441 | AC_MSG_RESULT(no) |
|---|
| 442 | ;; |
|---|
| 443 | esac |
|---|
| 444 | ]) |
|---|
| 445 | |
|---|
| 446 | AC_DEFUN([OGRE_CHECK_CEGUI], [ |
|---|
| 447 | PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.5.0, |
|---|
| 448 | [build_cegui_sample=true], [build_cegui_sample=false]) |
|---|
| 449 | if test x$build_cegui_sample = xtrue; then |
|---|
| 450 | AC_CONFIG_FILES([Samples/Common/CEGUIRenderer/Makefile \ |
|---|
| 451 | Samples/Common/CEGUIRenderer/CEGUI-OGRE.pc |
|---|
| 452 | Samples/Common/CEGUIRenderer/src/Makefile \ |
|---|
| 453 | Samples/Common/CEGUIRenderer/include/Makefile \ |
|---|
| 454 | Samples/Gui/Makefile \ |
|---|
| 455 | Samples/Gui/src/Makefile]) |
|---|
| 456 | AC_SUBST(CEGUI_CFLAGS) |
|---|
| 457 | AC_SUBST(CEGUI_LIBS) |
|---|
| 458 | AC_MSG_RESULT([CEGUI available, Gui and FacialAnimation samples will be built]) |
|---|
| 459 | else |
|---|
| 460 | AC_MSG_RESULT([CEGUI not available, Gui and FacialAnimation samples will not be built]) |
|---|
| 461 | fi |
|---|
| 462 | AM_CONDITIONAL([HAVE_CEGUI], [test x$build_cegui_sample = xtrue]) |
|---|
| 463 | ]) |
|---|
| 464 | |
|---|
| 465 | AC_DEFUN([OGRE_CHECK_DOUBLE], |
|---|
| 466 | [ |
|---|
| 467 | AC_ARG_ENABLE(double, |
|---|
| 468 | AC_HELP_STRING([--enable-double], |
|---|
| 469 | [Build OGRE in double floating point precision mode. This is not recommended for normal use as it is slower.]), |
|---|
| 470 | [build_double=$enableval], |
|---|
| 471 | [build_double=no]) |
|---|
| 472 | AC_MSG_CHECKING([whether to use double floating point precision]) |
|---|
| 473 | case $build_double in |
|---|
| 474 | yes) |
|---|
| 475 | AC_DEFINE([OGRE_DOUBLE_PRECISION], [1], [Build with double precision]) |
|---|
| 476 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_DOUBLE_PRECISION" |
|---|
| 477 | AC_MSG_RESULT(yes) |
|---|
| 478 | ;; |
|---|
| 479 | *) |
|---|
| 480 | AC_DEFINE([OGRE_DOUBLE_PRECISION], [0], [Build with single precision]) |
|---|
| 481 | AC_MSG_RESULT(no) |
|---|
| 482 | ;; |
|---|
| 483 | esac |
|---|
| 484 | ]) |
|---|
| 485 | |
|---|
| 486 | AC_DEFUN([OGRE_CHECK_THREADING], |
|---|
| 487 | [ |
|---|
| 488 | AC_ARG_ENABLE(threading, |
|---|
| 489 | AC_HELP_STRING([--enable-threading], |
|---|
| 490 | [Indicate general support for multithreading. This will enable threading support in certain parts of the engine, mainly resource loading and SharedPtr handling. WARNING: highly experimental, use with caution.]), |
|---|
| 491 | [build_threads=$enableval], |
|---|
| 492 | [build_threads=no]) |
|---|
| 493 | case $build_threads in |
|---|
| 494 | yes) |
|---|
| 495 | AC_DEFINE([OGRE_THREAD_SUPPORT], [1], [Build with thread support]) |
|---|
| 496 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_THREAD_SUPPORT" |
|---|
| 497 | # Check for the C++ Boost library |
|---|
| 498 | AC_CHECK_LIB(boost_thread, main, OGRE_THREAD_LIBS="-lboost_thread", [ |
|---|
| 499 | AC_CHECK_LIB(boost_thread-mt, main, OGRE_THREAD_LIBS="-lboost_thread-mt", [ |
|---|
| 500 | AC_MSG_ERROR([You need the C++ boost libraries.])])]) |
|---|
| 501 | ;; |
|---|
| 502 | *) |
|---|
| 503 | AC_DEFINE([OGRE_THREAD_SUPPORT], [0], [Build with thread support]) |
|---|
| 504 | OGRE_THREAD_LIBS="" |
|---|
| 505 | AC_MSG_RESULT(no) |
|---|
| 506 | ;; |
|---|
| 507 | esac |
|---|
| 508 | AC_SUBST(OGRE_THREAD_LIBS) |
|---|
| 509 | ]) |
|---|
| 510 | |
|---|
| 511 | AC_DEFUN([OGRE_BUILD_DEMOS], [ |
|---|
| 512 | AC_ARG_ENABLE(ogre_demos, |
|---|
| 513 | AC_HELP_STRING([--disable-ogre-demos], |
|---|
| 514 | [Do not build Ogre demos (CEGUI Renderer - if enabled/disabled, is not affected by this]), |
|---|
| 515 | [build_ogre_demos=$enableval], [build_ogre_demos=yes]) |
|---|
| 516 | |
|---|
| 517 | if test "x$build_ogre_demos" = "xyes" ; then |
|---|
| 518 | PKG_CHECK_MODULES(OIS, OIS >= 1.0.0, [ois_found=yes],[ois_found=no]) |
|---|
| 519 | AC_SUBST(OIS_CFLAGS) |
|---|
| 520 | AC_SUBST(OIS_LIBS) |
|---|
| 521 | |
|---|
| 522 | if test "x$ois_found" = "xyes" ; then |
|---|
| 523 | AC_MSG_NOTICE([*** Ogre Demos will be built ***]) |
|---|
| 524 | else |
|---|
| 525 | build_ogre_demos=no |
|---|
| 526 | AC_MSG_NOTICE([ |
|---|
| 527 | **************************************************************** |
|---|
| 528 | * You do not have OIS installed. This is required to build * |
|---|
| 529 | * Ogre demos. You may find it at: * |
|---|
| 530 | * http://www.sourceforge.net/projects/wgois. * |
|---|
| 531 | * If you do not want to build the demos, you can safely ignore * |
|---|
| 532 | * this. * |
|---|
| 533 | ****************************************************************]) |
|---|
| 534 | fi |
|---|
| 535 | else |
|---|
| 536 | build_ogre_demos=no |
|---|
| 537 | AC_MSG_NOTICE([*** Building of Ogre demos disabled ***]) |
|---|
| 538 | fi |
|---|
| 539 | |
|---|
| 540 | AM_CONDITIONAL([OGRE_BUILDING_DEMOS], [test x$build_ogre_demos = xyes]) |
|---|
| 541 | ]) |
|---|
| 542 | |
|---|
| 543 | dnl GUI selection support for configuration/error dialogs |
|---|
| 544 | AC_DEFUN([OGRE_CHECK_GUI], |
|---|
| 545 | [ |
|---|
| 546 | AC_ARG_WITH([gui], |
|---|
| 547 | AC_HELP_STRING([--with-gui=type], [Select the GUI type to use for dialogs (win32, gtk, Xt) (default: auto)]), |
|---|
| 548 | [with_gui=${withval}], [with_gui=auto]) |
|---|
| 549 | |
|---|
| 550 | #remove any old files |
|---|
| 551 | rm -f OgreMain/src/OgreConfigDialog.lo OgreMain/src/OgreErrorDialog.lo |
|---|
| 552 | |
|---|
| 553 | # Prefer win32, then gtk, then Xt |
|---|
| 554 | if test "x$with_gui" == "xauto" && test "x$OGRE_PLATFORM" == "xWIN32"; then |
|---|
| 555 | with_gui=win32 |
|---|
| 556 | fi |
|---|
| 557 | |
|---|
| 558 | if test "x$with_gui" == "xauto" || test "x$with_gui" == "xgtk"; then |
|---|
| 559 | PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.0, [with_gui=gtk], [ |
|---|
| 560 | if test "x$with_gui" == "xgtk"; then |
|---|
| 561 | AC_MSG_ERROR([You chose gtk for the GUI but gtk is not available.]) |
|---|
| 562 | fi |
|---|
| 563 | ]) |
|---|
| 564 | fi |
|---|
| 565 | |
|---|
| 566 | if test "x$with_gui" == "xauto"; then |
|---|
| 567 | with_gui=Xt |
|---|
| 568 | fi |
|---|
| 569 | |
|---|
| 570 | if test "x$with_gui" == "xwin32"; then |
|---|
| 571 | OGRE_GUI=WIN32 |
|---|
| 572 | elif test "x$with_gui" == "xgtk"; then |
|---|
| 573 | OGRE_GUI=gtk |
|---|
| 574 | elif test "x$with_gui" == "xXt"; then |
|---|
| 575 | OGRE_GUI=GLX |
|---|
| 576 | PLATFORM_LIBS="$PLATFORM_LIBS -lXt -lSM -lICE" |
|---|
| 577 | else |
|---|
| 578 | AC_MSG_ERROR([The GUI dialogs for $with_gui are not available.]) |
|---|
| 579 | fi |
|---|
| 580 | |
|---|
| 581 | # Add the OGRE_GUI_xxx flag to compiler command line |
|---|
| 582 | PLATFORM_CFLAGS="$PLATFORM_CFLAGS -DOGRE_GUI_$OGRE_GUI" |
|---|
| 583 | # And export it to client applications as well |
|---|
| 584 | OGRE_CFLAGS="$OGRE_CFLAGS -DOGRE_GUI_$OGRE_GUI" |
|---|
| 585 | |
|---|
| 586 | AC_SUBST(OGRE_GUI) |
|---|
| 587 | AC_SUBST(GTK_CFLAGS) |
|---|
| 588 | AC_SUBST(GTK_LIBS) |
|---|
| 589 | ]) |
|---|
| 590 | |
|---|
| 591 | dnl Check whether Ogre platform and GUI to be built are the same |
|---|
| 592 | dnl Fixes problem with running make distclean |
|---|
| 593 | AC_DEFUN([OGRE_PLATFORM_AND_GUI], |
|---|
| 594 | [AM_CONDITIONAL(SAME_PLATFORM_AND_GUI, test "x$OGRE_PLATFORM" = "x$OGRE_GUI") |
|---|
| 595 | ]) |
|---|
| 596 | |
|---|
| 597 | dnl SSE support |
|---|
| 598 | AC_DEFUN([OGRE_CHECK_SSE], |
|---|
| 599 | [ |
|---|
| 600 | AC_MSG_CHECKING(whether to use SSE) |
|---|
| 601 | case $target_cpu in |
|---|
| 602 | i386 | i486 | i586 | i686 | x86_64 | amd64) |
|---|
| 603 | build_sse=yes |
|---|
| 604 | ;; |
|---|
| 605 | *) |
|---|
| 606 | build_sse=no |
|---|
| 607 | ;; |
|---|
| 608 | esac |
|---|
| 609 | AC_MSG_RESULT($build_sse) |
|---|
| 610 | AM_CONDITIONAL(OGRE_BUILD_SSE, test x$build_sse = xyes) |
|---|
| 611 | ]) |
|---|