File: configure.in

package info (click to toggle)
gtkglarea 1.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,340 kB
  • ctags: 292
  • sloc: sh: 6,878; ansic: 2,724; makefile: 96
file content (125 lines) | stat: -rw-r--r-- 3,275 bytes parent folder | download | duplicates (4)
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(gtkgl/gtkglarea.h)

VERSION=1.2.3
PACKAGE=gtkglarea

#shared library versioning
GTKGL_LIBRARY_VERSION=5:0:0
#                     | | |
#              +------+ | +---+
#              |        |     |
#           current:revision:age
#              |        |     |
#              |        |     +- increment if interfaces have been added
#              |        |        set to zero if interfaces have been removed or changed
#              |        +- increment if source code has changed
#              |           set to zero if current is incremented
#              +- increment if interfaces have been added, removed or changed
# 

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AC_SUBST(GTKGL_LIBRARY_VERSION)
AC_SUBST(VERSION)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AM_MAINTAINER_MODE

dnl Check for GTK libraries
AM_PATH_GTK(,,AC_MSG_ERROR([Cannot find proper gtk version]))

dnl Check for GL/MesaGL libraries
AC_ARG_WITH(GL-prefix,  [  --with-GL-prefix=DIR    Prefix where GL/MesaGL is installed])
AC_ARG_WITH(lib-GL,     [  --with-lib-GL           use '-lGL'])
AC_ARG_WITH(lib-MesaGL, [  --with-lib-MesaGL       use '-lMesaGL'])

if test "x$with_GL_prefix" = "x" ; then
 GL_LDOPTS=""
 GL_CFLAGS=""
else
 GL_LDOPTS="-L$with_GL_prefix/lib"
 GL_CFLAGS="-I$with_GL_prefix/include"
fi

saved_LIBS="$LIBS"

AC_MSG_CHECKING([OpenGL])
LIBS="$saved_LIBS $GTK_LIBS $GL_LDOPTS -lGL"
AC_TRY_LINK( ,[ char glBegin(); glBegin(); ], have_GL=yes, have_GL=no)
AC_MSG_RESULT($have_GL)

AC_MSG_CHECKING([Mesa])
LIBS="$saved_LIBS $GTK_LIBS $GL_LDOPTS -lMesaGL"
AC_TRY_LINK( ,[ char glBegin(); glBegin(); ], have_MesaGL=yes, have_MesaGL=no)
AC_MSG_RESULT($have_MesaGL)

if test "x$have_MesaGL" = "xno"; then
 AC_MSG_CHECKING([Mesa with pthreads])
 LIBS="$saved_LIBS $GTK_LIBS $GL_LDOPTS -lMesaGL -lpthread"
 AC_TRY_LINK( ,[ char glBegin(); glBegin(); ], have_MesaGL_pthread=yes, have_MesaGL_pthread=no)
 AC_MSG_RESULT($have_MesaGL_pthread)
fi

LIBS="$saved_LIBS"


if test "x$with_lib_GL" = "xyes"; then

 if test "x$have_GL" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lGLU -lGL"
 else
  AC_MSG_ERROR([Missing GL library])
 fi

elif test "x$with_lib_MesaGL" = "xyes"; then

 if test "x$have_MesaGL" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lMesaGLU -lMesaGL"
 elif test "x$have_MesaGL_pthread" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lMesaGLU -lMesaGL -lpthread"
 else
  AC_MSG_ERROR([Missing MesaGL library])
 fi

else

 if test "x$have_GL" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lGLU -lGL"
 elif test "x$have_MesaGL" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lMesaGLU -lMesaGL"
 elif test "x$have_MesaGL_pthread" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lMesaGLU -lMesaGL -lpthread"
 else
  AC_MSG_ERROR([You need GL or MesaGL libraries])
 fi

fi

AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS)


CFLAGS="$CFLAGS $GTK_CFLAGS $GL_CFLAGS"

dnl Checks for header files.
AC_HEADER_STDC


dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.


AC_OUTPUT(Makefile
          gtkglarea.spec
          gtkgl/Makefile
          docs/Makefile
          examples/Makefile
          build/Makefile
          build/win32/Makefile)