File: configure.in

package info (click to toggle)
gtkgl2 1.99.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,104 kB
  • ctags: 330
  • sloc: sh: 6,744; ansic: 3,173; makefile: 125
file content (169 lines) | stat: -rw-r--r-- 4,397 bytes parent folder | download | duplicates (2)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
dnl Process this file with autoconf to produce a configure script.
AC_INIT(gtkgl/gtkglarea.h)

VERSION=1.99.0
PACKAGE=gtkglarea

#shared library versioning
GTKGL_LIBRARY_VERSION=1: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
# 
# Value of current - age. Used by libtool in Win32 DLL names. We need
# to know the DLL name to build MSVC import libraries.
LT_CURRENT_MINUS_AGE=1

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

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AM_MAINTAINER_MODE

AC_MSG_CHECKING([for Win32])
case "$host" in
  *-*-mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")

if test "$native_win32" = "yes"; then
  AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)

dnl Check for GTK libraries
AM_PATH_GTK_2_0(2.0.0)

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'])
AC_ARG_WITH(lib-opengl32,[ --with-lib-opengl32     use '-lopengl32'])

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, 
  LIBS="$saved_LIBS $GTK_LIBS $GL_LDOPTS -lopengl32"
  [AC_TRY_LINK([ #include <windows.h>
                 #include <GL/gl.h>], 
               [ glBegin(GL_TRIANGLES); ], 
    [have_opengl32=yes
     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

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

 if test "x$have_opengl32" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lglu32 -lopengl32"
 else
  AC_MSG_ERROR([Missing OpenGL32 library])
 fi

else

 if test "x$have_opengl32" = "xyes"; then
  GL_LIBS="$GL_LDOPTS -lglu32 -lopengl32"
 elif 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
  gtkgl-2.0.pc
  gtkglarea.spec
  gtkgl/Makefile
  gtkgl/makefile.mingw
  docs/Makefile
  examples/Makefile
  examples/makefile.mingw
  build/Makefile
  build/win32/Makefile
  build/win32/dirent/Makefile
)