~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/unix/m4/glut.m4

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl FTGL_CHECK_GLUT()
 
2
dnl Check for GLUT development environment
 
3
dnl
 
4
AC_DEFUN([FTGL_CHECK_GLUT],
 
5
[dnl
 
6
AC_REQUIRE([AC_PROG_CC])dnl
 
7
AC_REQUIRE([AC_PATH_X])dnl
 
8
AC_REQUIRE([AC_PATH_XTRA])dnl
 
9
AC_REQUIRE([FTGL_CHECK_GL])dnl
 
10
 
 
11
AC_ARG_WITH([--with-glut-inc],
 
12
    AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)]))
 
13
AC_ARG_WITH([--with-glut-lib],
 
14
    AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)]))
 
15
 
 
16
AC_LANG_SAVE
 
17
AC_LANG_C
 
18
 
 
19
GLUT_SAVE_CPPFLAGS="$CPPFLAGS"
 
20
GLUT_SAVE_LIBS="$LIBS"
 
21
 
 
22
if test "x$no_x" != xyes ; then
 
23
    GLUT_CFLAGS="$X_CFLAGS"
 
24
    GLUT_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
 
25
fi
 
26
 
 
27
if test "x$with_glut_inc" != "xnone" ; then
 
28
    if test -d "$with_glut_inc" ; then
 
29
        GLUT_CFLAGS="-I$with_glut_inc"
 
30
    else
 
31
        GLUT_CFLAGS="$with_glut_inc"
 
32
    fi
 
33
else
 
34
    GLUT_CFLAGS=
 
35
fi
 
36
 
 
37
CPPFLAGS="$GLUT_CFLAGS"
 
38
AC_CHECK_HEADER([GL/glut.h], [HAVE_GLUT=yes], [HAVE_GLUT=no])
 
39
 
 
40
if test "x$HAVE_GLUT" = xno ; then
 
41
    AC_MSG_WARN([GLUT headers not availabe, example program won't be compiled.])
 
42
else
 
43
 
 
44
# Check for GLUT libraries
 
45
 
 
46
    AC_MSG_CHECKING([for GLUT library])
 
47
    if test "x$with_glut_lib" != "x" ; then
 
48
        if test -d "$with_glut_lib" ; then
 
49
            LIBS="-L$with_glut_lib -lglut"
 
50
        else
 
51
            LIBS="$with_glut_lib"
 
52
        fi
 
53
    else
 
54
        LIBS="-lglut"
 
55
    fi
 
56
    AC_LINK_IFELSE(
 
57
        [AC_LANG_CALL([],[glutInit])],
 
58
        [HAVE_GLUT=yes],
 
59
        [HAVE_GLUT=no])
 
60
 
 
61
    if test "x$HAVE_GLUT" = xno ; then
 
62
        # Try again with the GL libs
 
63
        LIBS="-lglut $GL_LIBS"
 
64
        AC_LINK_IFELSE(
 
65
            [AC_LANG_CALL([],[glutInit])],
 
66
            [HAVE_GLUT=yes],
 
67
            [HAVE_GLUT=no])
 
68
    fi
 
69
 
 
70
    if test "x$HAVE_GLUT" = xno && test "x$GLUT_X_LIBS" != x ; then
 
71
        # Try again with the GL and X11 libs
 
72
        LIBS="-lglut $GL_LIBS $GLUT_X_LIBS"
 
73
        AC_LINK_IFELSE(
 
74
            [AC_LANG_CALL([],[glutInit])],
 
75
            [HAVE_GLUT=yes],
 
76
            [HAVE_GLUT=no])
 
77
    fi
 
78
 
 
79
    if test "x$HAVE_GLUT" = xyes ; then
 
80
        AC_MSG_RESULT([yes])
 
81
        GLUT_LIBS=$LIBS
 
82
    else
 
83
        AC_MSG_RESULT([no])
 
84
        AC_MSG_WARN([GLUT libraries not availabe, example program won't be compiled.])
 
85
    fi
 
86
 
 
87
# End check for GLUT libraries
 
88
 
 
89
fi
 
90
 
 
91
AC_SUBST(HAVE_GLUT)
 
92
AC_SUBST(GLUT_CFLAGS)
 
93
AC_SUBST(GLUT_LIBS)
 
94
AC_LANG_RESTORE
 
95
 
 
96
CPPFLAGS="$GLUT_SAVE_CPPFLAGS"
 
97
LIBS="$GLUT_SAVE_LIBS"
 
98
GLUT_X_CFLAGS=
 
99
GLUT_X_LIBS=
 
100
])