~ubuntu-branches/ubuntu/trusty/3depict/trusty-proposed

« back to all changes in this revision

Viewing changes to m4/ftgl.m4

  • Committer: Package Import Robot
  • Author(s): D Haley
  • Date: 2013-05-17 00:52:39 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130517005239-7bl4mnhkvrhc2ba6
Tags: 0.0.13-1
Upload to unstable 

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
dnl
12
12
dnl This script requires the pkg.m4 file
13
13
 
 
14
#This is broken without pkg-config!!
 
15
# Allow user to pass a manual dir for FTGL
 
16
#
 
17
AC_ARG_WITH([ftgl-prefix], [--with-ftgl-prefix : specify prefix dir for FTGL],
 
18
                ftgl_prefix="$withval", ftgl_config_prefix="")
 
19
#
 
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])
 
23
 
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. 
18
28
 
19
 
#
20
 
# Allow user to pass a manual dir for FTGL
21
 
#
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="")
25
 
#
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]) ])
30
29
 
31
30
AC_MSG_CHECKING([for ftgl])
32
31
 
38
37
        FTGL_CFLAGS="-I$ftgl_prefix/include/ -L$ftgl_prefix/lib/"
39
38
        FTGL_LIBS="-lFTGL"
40
39
else
41
 
        if test "x$ftgl_dont_use_pkg" = "xyes" ; then
 
40
        
 
41
        HAVE_PKG=$(basename $(which pkg-config))
 
42
 
 
43
 
 
44
        if test $HAVE_PKG != x"pkg-config"  ; then
 
45
                manual_ftgl="yes" ;
 
46
        fi
 
47
                
 
48
 
 
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.
44
52
                manual_ftgl=yes
45
 
        else
46
 
                #
47
 
                #Use PKG_CONFIG to do the heavy lifting, must be greater than 2.0.0
48
 
                #
49
 
                PKG_CHECK_MODULES([FTGL], ftgl >= 2.0.0, [libftgl="yes"], [libftgl="no"])
 
53
        else 
 
54
                if  ! test x"$manual_ftgl" == x"yes"  ; then
 
55
                        #
 
56
                        #Use PKG_CONFIG to do the heavy lifting, must be greater than 2.0.0
 
57
                        #
 
58
                        PKG_CHECK_MODULES([FTGL], ftgl >= 2.0.0, [libftgl="yes"], [libftgl="no"])
50
59
 
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
54
 
                        manual_ftgl=yes
 
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
 
63
                                manual_ftgl=yes ;
 
64
                        fi
55
65
                fi
56
66
        fi
57
67
        
58
68
fi
59
69
 
60
70
 
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 ***]) 
 
72
        CFLAGS_ORIG="$CFLAGS"
 
73
        LIBS_ORIG="$LIBS"
 
74
        LIBS="$LIBS $FTGL_LIBS $LDFLAGS"
 
75
 
 
76
        if test x$FTGL_LIBS == x""  ; then
 
77
                FTGL_LIBS="-lftgl"
 
78
        fi
 
79
 
 
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)
 
83
        
 
84
        CFLAGS="$CFLAGS_ORIG"
 
85
        LIBS="$LIBS_ORIG"
64
86
fi
65
87
 
66
88
#