-
Notifications
You must be signed in to change notification settings - Fork 0
/
acinclude.m4
216 lines (161 loc) · 5.09 KB
/
acinclude.m4
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
AC_DEFUN([CARVE_CHECK_OPENGL],[
have_GL=no
have_GLU=no
have_glut=no
case "$host" in
*darwin*)
if test x"${with_x}" != xyes; then
AC_MSG_NOTICE([Using OSX frameworks for GL])
GL_CFLAGS=""
GL_LIBS="-framework OpenGL"
GLUT_CFLAGS=""
GLUT_LIBS="-framework GLUT"
have_GL=yes
have_GLU=yes
have_glut=yes
else
AC_MSG_NOTICE([Not using OSX frameworks for GL])
fi
;;
esac
if test x"$have_GL" = xno; then
AC_PATH_XTRA
AC_LANG_SAVE
AC_LANG_C
GL_CFLAGS=""
GL_LIBS=""
GLUT_CFLAGS=""
GLUT_LIBS=""
GL_X_LIBS=""
if test x"$no_x" != xyes; then
GL_CFLAGS="$X_CFLAGS"
GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS"
fi
GL_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$GL_CFLAGS"
GL_save_LIBS="$LIBS"
LIBS="$GL_X_LIBS"
AC_CHECK_LIB([GL], [glAccum], have_GL=yes, have_GL=no)
AC_CHECK_LIB([GLU], [gluBeginCurve], have_GLU=yes, have_GLU=no)
AC_CHECK_LIB([glut], [glutInit], have_glut=yes, have_glut=no)
if test x"$have_GL" = xno; then
GL_LIBS="-lGL"
fi
if test x"$have_GLU" = xyes; then
GL_LIBS="$GL_LIBS -lGLU"
fi
if test x"$have_glut" = xyes; then
GLUT_LIBS="-lglut"
fi
GL_X_LIBS=""
LIBS="$GL_save_LIBS"
CPPFLAGS="$GL_save_CPPFLAGS"
AC_LANG_RESTORE
fi
])
AC_DEFUN([CARVE_CHECK_GLUI],[
AC_ARG_WITH(glui-prefix, [ --with-glui-prefix=PFX Prefix where GLUI is installed (optional)],
glui_prefix="$withval", glui_prefix="")
AC_ARG_WITH(glui-includes,[ --with-glui-includes=PATH Path to GLUI includes (optional)],
glui_includes="$withval", glui_includes="")
AC_ARG_WITH(glui-libs, [ --with-glui-libs=PATH Path to GLUI libs (optional)],
glui_libs="$withval", glui_libs="")
if test x"$glui_prefix" != x""; then
glui_libs="$glui_prefix/lib"
glui_includes="$glui_prefix/include"
fi
GLUI_CFLAGS=""
if test x"$glui_includes" != x""; then
GLUI_CFLAGS="-I$glui_includes"
fi
GLUI_LDFLAGS=""
if test x"$glui_libs" != x""; then
GLUI_LDFLAGS="-L$glui_libs"
fi
GLUI_LIBS="-lglui"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
GLUI_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GLUI_CFLAGS"
GLUI_save_LIBS="$LIBS"
LIBS="$LIBS $GLUI_LIBS"
GLUI_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $GLUI_LDFLAGS"
have_GLUI=no
AC_CHECK_LIB(glui, main, [AC_CHECK_HEADER(GL/glui.h, [have_GLUI=yes])])
LDFLAGS="$GLUI_save_LDFLAGS"
LIBS="$GLUI_save_LIBS"
CPPFLAGS="$GLUI_save_CPPFLAGS"
AC_LANG_RESTORE
])
AC_DEFUN([CARVE_CHECK_GLEW],[
AC_ARG_WITH(glew-prefix, [ --with-glew-prefix=PFX Prefix where GLEW is installed (optional)],
glew_prefix="$withval", glew_prefix="")
AC_ARG_WITH(glew-includes,[ --with-glew-includes=PATH Path to GLEW includes (optional)],
glew_includes="$withval", glew_includes="")
AC_ARG_WITH(glew-libs, [ --with-glew-libs=PATH Path to GLEW libs (optional)],
glew_libs="$withval", glew_libs="")
if test x"$glew_prefix" != x""; then
glew_libs="$glew_prefix/lib"
glew_includes="$glew_prefix/include"
fi
GLEW_CFLAGS=""
if test x"$glew_includes" != x""; then
GLEW_CFLAGS="-I$glew_includes"
fi
GLEW_LDFLAGS=""
if test x"$glew_libs" != x""; then
GLEW_LDFLAGS="-L$glew_libs"
fi
GLEW_LIBS="-lglew"
AC_LANG_SAVE
AC_LANG_C
GLEW_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GLEW_CFLAGS"
GLEW_save_LIBS="$LIBS"
LIBS="$LIBS $GLEW_LIBS"
GLEW_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $GLEW_LDFLAGS"
have_GLEW=no
AC_CHECK_LIB(glew, glewInit, [AC_CHECK_HEADER(GL/glew.h, [have_GLEW=yes])])
LDFLAGS="$GLEW_save_LDFLAGS"
LIBS="$GLEW_save_LIBS"
CPPFLAGS="$GLEW_save_CPPFLAGS"
AC_LANG_RESTORE
])
AC_DEFUN([CARVE_CHECK_GLOOP],[
AC_ARG_WITH(gloop-prefix, [ --with-gloop-prefix=PFX Prefix where GLOOP is installed (optional)],
gloop_prefix="$withval", gloop_prefix="")
AC_ARG_WITH(gloop-includes,[ --with-gloop-includes=PATH Path to GLOOP includes (optional)],
gloop_includes="$withval", gloop_includes="")
AC_ARG_WITH(gloop-libs, [ --with-gloop-libs=PATH Path to GLOOP libs (optional)],
gloop_libs="$withval", gloop_libs="")
if test x"$gloop_prefix" != x""; then
gloop_libs="$gloop_prefix/lib"
gloop_includes="$gloop_prefix/include"
fi
GLOOP_CFLAGS=""
if test x"$gloop_includes" != x""; then
GLOOP_CFLAGS="-I$gloop_includes"
fi
GLOOP_LDFLAGS=""
if test x"$gloop_libs" != x""; then
GLOOP_LDFLAGS="-L$gloop_libs"
fi
GLOOP_LIBS="-lgloop"
GLOOP_MODEL_LIBS="-lgloop-model"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
GLOOP_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GLOOP_CFLAGS"
GLOOP_save_LIBS="$LIBS"
LIBS="$LIBS $GLOOP_LIBS $GLOOP_MODEL_LIBS"
GLOOP_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $GLOOP_LDFLAGS"
have_gloop=no
AC_CHECK_HEADERS(gloop/gloop.hpp, [AC_CHECK_LIB(gloop, main, have_gloop=yes)])
LDFLAGS="$GLOOP_save_LDFLAGS"
LIBS="$GLOOP_save_LIBS"
CPPFLAGS="$GLOOP_save_CPPFLAGS"
AC_LANG_RESTORE
])