1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
|
# Usage:
# SIM_AC_CHECK_PTHREAD([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
#
# Try to find the PTHREAD development system. If it is found, these
# shell variables are set:
#
# $sim_ac_pthread_cppflags (extra flags the compiler needs for pthread)
# $sim_ac_pthread_ldflags (extra flags the linker needs for pthread)
# $sim_ac_pthread_libs (link libraries the linker needs for pthread)
#
# The CPPFLAGS, LDFLAGS and LIBS flags will also be modified accordingly.
# In addition, the variable $sim_ac_pthread_avail is set to "yes" if the
# pthread development system is found.
#
#
# Author: Morten Eriksen, <mortene@sim.no>.
AC_DEFUN([SIM_AC_CHECK_PTHREAD], [
AC_ARG_WITH(
[pthread],
[ --with-pthread pthread installation directory],
[],[with_pthread=yes])
sim_ac_pthread_avail=no
if test x"$with_pthread" != xno; then
if test x"$with_pthread" != xyes; then
sim_ac_pthread_cppflags="-I${with_pthread}/include"
sim_ac_pthread_ldflags="-L${with_pthread}/lib"
fi
sim_ac_pthread_libs_first="-lpthread"
sim_ac_pthread_libs_second="-pthread"
sim_ac_pthread_libs_third="-lc_r"
sim_ac_pthread_libs=""
# FreeBSD 4.x use "-pthread" or "-lc_r"
sim_ac_save_cppflags=$CPPFLAGS
sim_ac_save_ldflags=$LDFLAGS
sim_ac_save_libs=$LIBS
AC_CACHE_CHECK(
[whether the pthread development system is available],
sim_cv_lib_pthread_avail,
[
for sim_pthread_libs in $sim_ac_pthread_libs_first \
$sim_ac_pthread_libs_second $sim_ac_pthread_libs_third ; do
if test x"$sim_cv_lib_pthread_avail" != x"yes" ; then
CPPFLAGS="$CPPFLAGS $sim_ac_pthread_cppflags"
LDFLAGS="$LDFLAGS $sim_ac_pthread_ldflags"
LIBS="$sim_pthread_libs $LIBS"
AC_TRY_LINK([#include <pthread.h>],
[(void)pthread_create(0L, 0L, 0L, 0L);],
[sim_cv_lib_pthread_avail=yes
sim_ac_pthread_libs="$sim_pthread_libs"
],
[sim_cv_lib_pthread_avail=no])
fi
if test x"$sim_cv_lib_pthread_avail" != x"yes"; then
CPPFLAGS=$sim_ac_save_cppflags
LDFLAGS=$sim_ac_save_ldflags
LIBS=$sim_ac_save_libs
fi
done
]
)
if test x"$sim_cv_lib_pthread_avail" = xyes; then
sim_ac_pthread_avail=yes
$1
else
CPPFLAGS=$sim_ac_save_cppflags
LDFLAGS=$sim_ac_save_ldflags
LIBS=$sim_ac_save_libs
$2
fi
fi
])
# Usage:
# SIM_AC_CHECK_OPENGL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
#
# Try to find an OpenGL development system, either a native
# implementation or the OpenGL-compatible Mesa library. If
# it is found, these shell variables are set:
#
# $sim_ac_gl_cppflags (extra flags the compiler needs for OpenGL/Mesa)
# $sim_ac_gl_ldflags (extra flags the linker needs for OpenGL/Mesa)
# $sim_ac_gl_libs (link libraries the linker needs for OpenGL/Mesa)
#
# The CPPFLAGS, LDFLAGS and LIBS flags will also be modified accordingly.
# In addition, the variable $sim_ac_gl_avail is set to "yes" if an
# OpenGL-compatible development system is found.
#
#
# Author: Morten Eriksen, <mortene@sim.no>.
AC_DEFUN(SIM_AC_CHECK_OPENGL, [
unset sim_ac_gl_cppflags
unset sim_ac_gl_ldflags
unset sim_ac_gl_libs
sim_ac_gl_avail=no
AC_ARG_WITH(
[mesa],
[ --with-mesa prefer MesaGL (if found) over OpenGL [[default=yes]]],
[],[with_mesa=yes])
# It's usually libGL.so on UNIX systems and opengl32.lib on MSWindows.
sim_ac_gl_glnames="-lGL -lopengl32"
sim_ac_gl_mesaglnames=-lMesaGL
GL_LIBS=""
if test "x$with_mesa" = "xyes"; then
sim_ac_gl_first=$sim_ac_gl_mesaglnames
sim_ac_gl_second=$sim_ac_gl_glnames
else
sim_ac_gl_first=$sim_ac_gl_glnames
sim_ac_gl_second=$sim_ac_gl_mesaglnames
fi
AC_ARG_WITH(
[opengl],
[ --with-opengl OpenGL/Mesa installation directory],[],[with_opengl=yes])
if test x"$with_opengl" != xno; then
if test x"$with_opengl" != xyes; then
sim_ac_gl_cppflags="-I${with_opengl}/include"
sim_ac_gl_ldflags="-L${with_opengl}/lib"
else
# This is a common location for the OpenGL library on HPUX.
sim_ac_gl_hpux=/opt/graphics/OpenGL
if test -d $sim_ac_gl_hpux; then
sim_ac_gl_cppflags=-I$sim_ac_gl_hpux/include
sim_ac_gl_ldflags=-L$sim_ac_gl_hpux/lib
fi
fi
sim_ac_save_cppflags=$CPPFLAGS
sim_ac_save_ldflags=$LDFLAGS
sim_ac_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS $sim_ac_gl_cppflags"
LDFLAGS="$LDFLAGS $sim_ac_gl_ldflags"
AC_CACHE_CHECK(
[whether OpenGL library is available],
sim_cv_lib_gl,
[sim_cv_lib_gl=UNRESOLVED
for sim_ac_gl_libcheck in $sim_ac_gl_first $sim_ac_gl_second; do
if test "x$sim_cv_lib_gl" = "xUNRESOLVED"; then
LIBS="$sim_ac_gl_libcheck $sim_ac_save_libs -lm"
AC_TRY_LINK([
#if HAVE_WINDOWS_H
#include <windows.h>
#endif /* HAVE_WINDOWS_H */
#include <GL/gl.h>
],
[glPointSize(1.0f);],
[sim_cv_lib_gl="$sim_ac_gl_libcheck"],
)
fi
done
])
LIBS="$sim_ac_save_libs"
if test "x$sim_cv_lib_gl" != "xUNRESOLVED"; then
sim_ac_gl_libs="$sim_cv_lib_gl"
else
AC_MSG_WARN([couldn't compile or link with OpenGL library -- trying with pthread library in place...])
SIM_AC_CHECK_PTHREAD([
sim_ac_gl_cppflags="$sim_ac_gl_cppflags $sim_ac_pthread_cppflags"
sim_ac_gl_ldflags="$sim_ac_gl_ldflags $sim_ac_pthread_ldflags"],
[AC_MSG_WARN([couldn't compile or link with pthread library])])
if test "x$sim_ac_pthread_avail" = "xyes"; then
AC_CACHE_CHECK(
[whether OpenGL library can be linked with pthread library],
sim_cv_lib_gl_pthread,
[sim_cv_lib_gl_pthread=UNRESOLVED
for sim_ac_gl_libcheck in $sim_ac_gl_first $sim_ac_gl_second; do
if test "x$sim_cv_lib_gl_pthread" = "xUNRESOLVED"; then
LIBS="$sim_ac_gl_libcheck $sim_ac_pthread_libs $sim_ac_save_libs"
AC_TRY_LINK([
#if HAVE_WINDOWS_H
#include <windows.h>
#endif /* HAVE_WINDOWS_H */
#include <GL/gl.h>
],
[
glPointSize(1.0f);
],
[sim_cv_lib_gl_pthread="$sim_ac_gl_libcheck"])
fi
done
])
if test "x$sim_cv_lib_gl_pthread" != "xUNRESOLVED"; then
sim_ac_gl_libs="$sim_cv_lib_gl_pthread $sim_ac_pthread_libs"
fi
fi
fi
if test "x$sim_ac_gl_libs" != "x"; then
LIBS="$sim_ac_save_libs"
GL_LIBS="$sim_ac_gl_libs"
sim_ac_gl_avail=yes
$1
else
CPPFLAGS=$sim_ac_save_cppflags
LDFLAGS=$sim_ac_save_ldflags
LIBS=$sim_ac_save_libs
$2
fi
fi
])
# Usage:
# SIM_AC_CHECK_GLU([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
#
# Try to use the OpenGL utility library; GLU. If it is found,
# these shell variables are set:
#
# $sim_ac_glu_cppflags (extra flags the compiler needs for GLU)
# $sim_ac_glu_ldflags (extra flags the linker needs for GLU)
# $sim_ac_glu_libs (link libraries the linker needs for GLU)
#
# The CPPFLAGS, LDFLAGS and LIBS flags will also be modified accordingly.
# In addition, the variable $sim_ac_gly_avail is set to "yes" if GLU
# is found.
#
#
# Author: Morten Eriksen, <mortene@sim.no>.
AC_DEFUN(SIM_AC_CHECK_GLU, [
unset sim_ac_glu_cppflags
unset sim_ac_glu_ldflags
unset sim_ac_glu_libs
sim_ac_glu_avail=no
# It's usually libGLU.so on UNIX systems and glu32.lib on MSWindows.
sim_ac_glu_names="-lGLU -lglu32"
sim_ac_glu_mesanames=-lMesaGLU
# with_mesa is set from the SIM_AC_CHECK_OPENGL macro.
if test "x$with_mesa" = "xyes"; then
sim_ac_glu_first=$sim_ac_glu_mesanames
sim_ac_glu_second=$sim_ac_glu_names
else
sim_ac_glu_first=$sim_ac_glu_names
sim_ac_glu_second=$sim_ac_glu_mesanames
fi
AC_ARG_WITH(
[glu],[ --with-glu use the OpenGL utility library [[default=yes]]],[],[with_glu=yes])
if test x"$with_glu" != xno; then
if test x"$with_glu" != xyes; then
sim_ac_glu_cppflags="-I${with_glu}/include"
sim_ac_glu_ldflags="-L${with_glu}/lib"
fi
sim_ac_save_cppflags=$CPPFLAGS
sim_ac_save_ldflags=$LDFLAGS
sim_ac_save_libs=$LIBS
CPPFLAGS="$CPPFLAGS $sim_ac_glu_cppflags"
LDFLAGS="$LDFLAGS $sim_ac_glu_ldflags"
AC_CACHE_CHECK(
[whether GLU is available],
sim_cv_lib_glu,
[sim_cv_lib_glu=UNRESOLVED
# Some platforms (like BeOS) have the GLU functionality in the GL
# library (and no GLU library present).
for sim_ac_glu_libcheck in "" $sim_ac_glu_first $sim_ac_glu_second; do
if test "x$sim_cv_lib_glu" = "xUNRESOLVED"; then
LIBS="$sim_ac_glu_libcheck $sim_ac_save_libs $GL_LIBS"
AC_TRY_LINK([
#if HAVE_WINDOWS_H
#include <windows.h>
#endif /* HAVE_WINDOWS_H */
#include <GL/gl.h>
#include <GL/glu.h>
],
[
gluSphere(0L, 1.0, 1, 1);
],
[sim_cv_lib_glu="$sim_ac_glu_libcheck"])
fi
done
])
LIBS="$sim_ac_save_libs"
if test "x$sim_cv_lib_glu" != "xUNRESOLVED"; then
sim_ac_glu_libs="$sim_cv_lib_glu"
LIBS="$sim_ac_save_libs"
GL_LIBS="$GL_LIBS $sim_ac_glu_libs"
sim_ac_glu_avail=yes
$1
else
CPPFLAGS=$sim_ac_save_cppflags
LDFLAGS=$sim_ac_save_ldflags
LIBS=$sim_ac_save_libs
$2
fi
fi
])
## ------------------------ -*- Autoconf -*-
## Python file handling
## From Andrew Dalke
## Updated by James Henstridge
## Mucked with by Warren DeLano (clueless about auto*)
## ------------------------
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# WLD_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
# Adds support for distributing Python modules and packages. To
# install modules, copy them to $(pythondir), using the python_PYTHON
# automake variable. To install a package with the same name as the
# automake package, install to $(pkgpythondir), or use the
# pkgpython_PYTHON automake variable.
#
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
# locations to install python extension modules (shared libraries).
# Another macro is required to find the appropriate flags to compile
# extension modules.
#
# If your package is configured with a different prefix to python,
# users will have to add the install directory to the PYTHONPATH
# environment variable, or create a .pth file (see the python
# documentation for details).
#
# If the MINIMUM-VERSION argument is passed, WLD_PATH_PYTHON will
# cause an error if the version of python installed on the system
# doesn't meet the requirement. MINIMUM-VERSION should consist of
# numbers and dots only.
AC_DEFUN([WLD_PATH_PYTHON],
[
dnl Find a Python interpreter. Python versions prior to 1.5 are not
dnl supported because the default installation locations changed from
dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
dnl in 1.5.
m4_define_default([_WLD_PYTHON_INTERPRETER_LIST],
[python python2 python2.5 python2.4 python2.3 python2.2 dnl
python2.1 python2.0 python1.6 python1.5])
m4_if([$1],[],[
dnl No version check is needed.
# Find any Python interpreter.
if test -z "$PYTHON"; then
AC_PATH_PROGS([PYTHON], _WLD_PYTHON_INTERPRETER_LIST, :)
fi
am_display_PYTHON=python
], [
dnl A version check is needed.
if test -n "$PYTHON"; then
# If the user set $PYTHON, use it and don't search something else.
AC_MSG_CHECKING([whether $PYTHON version >= $1])
WLD_PYTHON_CHECK_VERSION([$PYTHON], [$1],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR(too old)])
am_display_PYTHON=$PYTHON
else
# Otherwise, try each interpreter until we find one that satisfies
# VERSION.
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
[am_cv_pathless_PYTHON],[
for am_cv_pathless_PYTHON in _WLD_PYTHON_INTERPRETER_LIST none; do
test "$am_cv_pathless_PYTHON" = none && break
WLD_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
done])
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
if test "$am_cv_pathless_PYTHON" = none; then
PYTHON=:
else
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
fi
am_display_PYTHON=$am_cv_pathless_PYTHON
fi
])
if test "$PYTHON" = :; then
dnl Run any user-specified action, or abort.
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
else
dnl Query Python for its version number. Getting [:3] seems to be
dnl the best way to do this; it's what "site.py" does in the standard
dnl library.
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
[am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
dnl Use the values of $prefix and $exec_prefix for the corresponding
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
dnl distinct variables so they can be overridden if need be. However,
dnl general consensus is that you shouldn't need this ability.
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
dnl At times (like when building shared libraries) you may want
dnl to know which OS platform Python thinks this is.
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
[am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
dnl Set up 4 directories:
dnl pythondir -- where to install python scripts. This is the
dnl site-packages directory, not the python standard library
dnl directory like in previous automake betas. This behavior
dnl is more consistent with lispdir.m4 for example.
dnl Query distutils for this directory. distutils does not exist in
dnl Python 1.5, so we fall back to the hardcoded directory if it
dnl doesn't work.
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
[am_cv_python_pythondir],
[am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0)" 2>/dev/null ||
echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
AC_SUBST([pythondir], [$am_cv_python_pythondir])
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
dnl more consistent with the rest of automake.
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
dnl pyexecdir -- directory for installing python extension modules
dnl (shared libraries)
dnl Query distutils for this directory. distutils does not exist in
dnl Python 1.5, so we fall back to the hardcoded directory if it
dnl doesn't work.
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
[am_cv_python_pyexecdir],
[am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0)" 2>/dev/null ||
echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
dnl pythoninc -- python include
AC_CACHE_CHECK([for $am_display_PYTHON include directory],
[am_cv_python_pythoninc],
[am_cv_python_pythoninc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null ||
echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION"`])
AC_SUBST([pythoninc], [$am_cv_python_pythoninc])
dnl Run any user-specified action.
$2
fi
])
# WLD_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ---------------------------------------------------------------------------
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
# Run ACTION-IF-FALSE otherwise.
# This test uses sys.hexversion instead of the string equivalent (first
# word of sys.version), in order to cope with versions such as 2.2c1.
# hexversion has been introduced in Python 1.5.2; it's probably not
# worth to support older versions (1.5.1 was released on October 31, 1998).
AC_DEFUN([WLD_PYTHON_CHECK_VERSION],
[prog="import sys, string
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
minverhex = 0
for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
sys.exit(sys.hexversion < minverhex)"
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
# Configure paths for FreeType2
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
#
# serial 2
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
# FreeType 2.0.4).
#
AC_DEFUN([AC_CHECK_FT2],
[# Get the cflags and libraries from the freetype-config script
#
AC_ARG_WITH([ft-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-prefix=PREFIX],
[Prefix where FreeType is installed (optional)]),
[ft_config_prefix="$withval"],
[ft_config_prefix=""])
AC_ARG_WITH([ft-exec-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
[Exec prefix where FreeType is installed (optional)]),
[ft_config_exec_prefix="$withval"],
[ft_config_exec_prefix=""])
AC_ARG_ENABLE([freetypetest],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--disable-freetypetest],
[Do not try to compile and run a test FreeType program]),
[],
[enable_fttest=yes])
if test x$ft_config_exec_prefix != x ; then
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
if test x${FT2_CONFIG+set} != xset ; then
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
fi
fi
if test x$ft_config_prefix != x ; then
ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
if test x${FT2_CONFIG+set} != xset ; then
FT2_CONFIG=$ft_config_prefix/bin/freetype-config
fi
fi
AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
min_ft_version=m4_if([$1], [], [7.0.1], [$1])
AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
no_ft=""
if test "$FT2_CONFIG" = "no" ; then
no_ft=yes
else
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
ft_min_major_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
ft_min_minor_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
ft_min_micro_version=`echo $min_ft_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test x$enable_fttest = xyes ; then
ft_config_is_lt=""
if test $ft_config_major_version -lt $ft_min_major_version ; then
ft_config_is_lt=yes
else
if test $ft_config_major_version -eq $ft_min_major_version ; then
if test $ft_config_minor_version -lt $ft_min_minor_version ; then
ft_config_is_lt=yes
else
if test $ft_config_minor_version -eq $ft_min_minor_version ; then
if test $ft_config_micro_version -lt $ft_min_micro_version ; then
ft_config_is_lt=yes
fi
fi
fi
fi
fi
if test x$ft_config_is_lt = xyes ; then
no_ft=yes
else
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $FT2_CFLAGS"
LIBS="$FT2_LIBS $LIBS"
#
# Sanity checks for the results of freetype-config to some extent.
#
AC_RUN_IFELSE([
AC_LANG_SOURCE([[
#include <ft2build.h>
#include FT_FREETYPE_H
#include <stdio.h>
#include <stdlib.h>
int
main()
{
FT_Library library;
FT_Error error;
error = FT_Init_FreeType(&library);
if (error)
return 1;
else
{
FT_Done_FreeType(library);
return 0;
}
}
]])
],
[],
[no_ft=yes],
[echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi # test $ft_config_version -lt $ft_min_version
fi # test x$enable_fttest = xyes
fi # test "$FT2_CONFIG" = "no"
if test x$no_ft = x ; then
AC_MSG_RESULT([yes])
m4_if([$2], [], [:], [$2])
else
AC_MSG_RESULT([no])
if test "$FT2_CONFIG" = "no" ; then
AC_MSG_WARN([
The freetype-config script installed by FreeType 2 could not be found.
If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
your path, or set the FT2_CONFIG environment variable to the
full path to freetype-config.
])
else
if test x$ft_config_is_lt = xyes ; then
AC_MSG_WARN([
Your installed version of the FreeType 2 library is too old.
If you have different versions of FreeType 2, make sure that
correct values for --with-ft-prefix or --with-ft-exec-prefix
are used, or set the FT2_CONFIG environment variable to the
full path to freetype-config.
])
else
AC_MSG_WARN([
The FreeType test program failed to run. If your system uses
shared libraries and they are installed outside the normal
system library path, make sure the variable LD_LIBRARY_PATH
(or whatever is appropiate for your system) is correctly set.
])
fi
fi
FT2_CFLAGS=""
FT2_LIBS=""
m4_if([$3], [], [:], [$3])
fi
AC_SUBST([FT2_CFLAGS])
AC_SUBST([FT2_LIBS])])
# end of freetype2.m4
|