File: glut.m4

package info (click to toggle)
mysql-query-browser 1.2.5beta-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 63,792 kB
  • ctags: 46,485
  • sloc: pascal: 249,299; ansic: 80,111; cpp: 72,467; sh: 25,271; objc: 20,015; yacc: 10,755; java: 9,917; xml: 4,580; php: 2,806; python: 1,566; sql: 1,563; makefile: 1,452; perl: 3
file content (100 lines) | stat: -rw-r--r-- 2,458 bytes parent folder | download | duplicates (8)
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
dnl FTGL_CHECK_GLUT()
dnl Check for GLUT development environment
dnl
AC_DEFUN([FTGL_CHECK_GLUT],
[dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PATH_X])dnl
AC_REQUIRE([AC_PATH_XTRA])dnl
AC_REQUIRE([FTGL_CHECK_GL])dnl

AC_ARG_WITH([--with-glut-inc],
    AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)]))
AC_ARG_WITH([--with-glut-lib],
    AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)]))

AC_LANG_SAVE
AC_LANG_C

GLUT_SAVE_CPPFLAGS="$CPPFLAGS"
GLUT_SAVE_LIBS="$LIBS"

if test "x$no_x" != xyes ; then
    GLUT_CFLAGS="$X_CFLAGS"
    GLUT_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
fi

if test "x$with_glut_inc" != "xnone" ; then
    if test -d "$with_glut_inc" ; then
        GLUT_CFLAGS="-I$with_glut_inc"
    else
        GLUT_CFLAGS="$with_glut_inc"
    fi
else
    GLUT_CFLAGS=
fi

CPPFLAGS="$GLUT_CFLAGS"
AC_CHECK_HEADER([GL/glut.h], [HAVE_GLUT=yes], [HAVE_GLUT=no])

if test "x$HAVE_GLUT" = xno ; then
    AC_MSG_WARN([GLUT headers not availabe, example program won't be compiled.])
else

# Check for GLUT libraries

    AC_MSG_CHECKING([for GLUT library])
    if test "x$with_glut_lib" != "x" ; then
        if test -d "$with_glut_lib" ; then
            LIBS="-L$with_glut_lib -lglut"
        else
            LIBS="$with_glut_lib"
        fi
    else
        LIBS="-lglut"
    fi
    AC_LINK_IFELSE(
        [AC_LANG_CALL([],[glutInit])],
        [HAVE_GLUT=yes],
        [HAVE_GLUT=no])

    if test "x$HAVE_GLUT" = xno ; then
        # Try again with the GL libs
        LIBS="-lglut $GL_LIBS"
        AC_LINK_IFELSE(
            [AC_LANG_CALL([],[glutInit])],
            [HAVE_GLUT=yes],
            [HAVE_GLUT=no])
    fi

    if test "x$HAVE_GLUT" = xno && test "x$GLUT_X_LIBS" != x ; then
        # Try again with the GL and X11 libs
        LIBS="-lglut $GL_LIBS $GLUT_X_LIBS"
        AC_LINK_IFELSE(
            [AC_LANG_CALL([],[glutInit])],
            [HAVE_GLUT=yes],
            [HAVE_GLUT=no])
    fi

    if test "x$HAVE_GLUT" = xyes ; then
        AC_MSG_RESULT([yes])
        GLUT_LIBS=$LIBS
    else
        AC_MSG_RESULT([no])
        AC_MSG_WARN([GLUT libraries not availabe, example program won't be compiled.])
    fi

# End check for GLUT libraries

fi

AC_SUBST(HAVE_GLUT)
AC_SUBST(GLUT_CFLAGS)
AC_SUBST(GLUT_LIBS)
AC_LANG_RESTORE

CPPFLAGS="$GLUT_SAVE_CPPFLAGS"
LIBS="$GLUT_SAVE_LIBS"
GLUT_X_CFLAGS=
GLUT_X_LIBS=
])