12
12
dnl This script requires the pkg.m4 file
14
#This is broken without pkg-config!!
15
# Allow user to pass a manual dir for FTGL
17
AC_ARG_WITH([ftgl-prefix], [--with-ftgl-prefix : specify prefix dir for FTGL],
18
ftgl_prefix="$withval", ftgl_config_prefix="")
20
# allow for disabling the pkg-config check
21
AC_ARG_WITH([ftgl-no-pkg],
22
[--with-ftgl-no-pkg : don't use pkg-config to check for ftgl])
14
24
AC_DEFUN([AX_CHECK_FTGL], [
15
25
dnl AC_REQUIRE([PKG_CHECK_MODULES]) - I had to take this out, with it in it messes up confgure
16
26
dnl as the PKG_CHECK_MODULES is expanded with no arguments. I dont want to expand it, I just
17
27
dnl want to ensure that it is defined. never mind.
20
# Allow user to pass a manual dir for FTGL
22
AC_ARG_WITH([ftgl-prefix], [AC_HELP_STRING([--with-ftgl-prefix=PFX]),
23
Manually specify the FTGL location (optional)],
24
ftgl_prefix="$withval", ftgl_config_prefix="")
26
# allow for disabling the pkg-config check
27
# FIXME: THIS DOESN'T work "unrecognised option"
28
AC_ARG_WITH([ftgl-dont-use-pkg],
29
[ AC_HELP_STRING([--ftgl-dont-use-pkg], [ don't use pkg-config to check for ftgl]) ])
31
30
AC_MSG_CHECKING([for ftgl])
38
37
FTGL_CFLAGS="-I$ftgl_prefix/include/ -L$ftgl_prefix/lib/"
41
if test "x$ftgl_dont_use_pkg" = "xyes" ; then
41
HAVE_PKG=$(basename $(which pkg-config))
44
if test $HAVE_PKG != x"pkg-config" ; then
49
if test "x$with_ftgl_no_pkg" = "xyes" ; then
42
50
AC_DEFINE([FTGL_NO_PKG_CONFIG], [1], [Dont use pkg-config to locate ftgl])
43
51
#well the user doesn't want us to use pkg-config so dont.
47
#Use PKG_CONFIG to do the heavy lifting, must be greater than 2.0.0
49
PKG_CHECK_MODULES([FTGL], ftgl >= 2.0.0, [libftgl="yes"], [libftgl="no"])
54
if ! test x"$manual_ftgl" == x"yes" ; then
56
#Use PKG_CONFIG to do the heavy lifting, must be greater than 2.0.0
58
PKG_CHECK_MODULES([FTGL], ftgl >= 2.0.0, [libftgl="yes"], [libftgl="no"])
51
#Check to see if pkg-config did the job
52
if test "x$libftgl" = "xno" ; then
53
#dang, looks like we have to try a manual approach
60
#Check to see if pkg-config did the job
61
if test "x$libftgl" = "xno" ; then
62
#dang, looks like we have to try a manual approach
61
#TODO: see if we can put in some manual tests for a few common locations for ftgl?
62
71
if test "x$manual_ftgl" = "xyes" ; then
63
AC_MSG_ERROR([*** Couldn't find FTGL, either provide the path to the base dir, i e if you libs are in /usr/lib and your includes are in /usr/include or /usr/include/FTGL then use the --with-ftgl-prefix=/usr/ to tell configure where to look, or alternately install pkg-config and ensure pkg-config outputs the correct path for ftgl ***])
74
LIBS="$LIBS $FTGL_LIBS $LDFLAGS"
76
if test x$FTGL_LIBS == x"" ; then
80
#TODO: see if we can put in some more manual tests for a few common locations for ftgl?
81
AC_CHECK_LIB(ftgl, ftglCreateSimpleLayout,
82
[], AC_MSG_ERROR([Couldnt find ftgl -- provide base dir or install pkg_config]),-lm)