forked from antiprism/antiprism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
245 lines (210 loc) · 6.82 KB
/
configure.ac
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([antiprism],[0.31.99],[[email protected]])
AC_SUBST(RELEASE_DATE, ["5 August 2023"])
AC_CANONICAL_TARGET # For m4/fltk.m4
AM_INIT_AUTOMAKE([1.9 foreign])
AC_CONFIG_SRCDIR([base/antiprism.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_ARG_VAR([AR_FLAGS],[flags for ar command, default 'cr'])
if test x"$AR_FLAGS" = x ; then
ARFLAGS="cr"
fi
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX(14)
gl_LD_VERSION_SCRIPT
LT_INIT([win32-dll])
AC_CHECK_LIB([m], [acos])
dnl check if building for windows
AC_MSG_CHECKING([for timeGetTime in winmm (building for Windows))])
my_ac_save_LIBS="$LIBS"
LIBS="-lwinmm $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <windef.h>
#include <mmsystem.h>
]], [[timeGetTime();]])],[ dnl worked!
WIN_BUILD="yes"; AC_MSG_RESULT([yes])
],[ dnl failed, restore LIBS
WIN_BUILD="no"; AC_MSG_RESULT(no)])
LIBS=$my_ac_save_LIBS
AC_CHECK_FUNC([gettimeofday], [utimer=1], [utimer=0])
if test $utimer = 0 ; then
if test x"$WIN_BUILD" = x"yes" ; then
utimer=2; LIBS="-lwinmm $LIBS"; AC_MSG_RESULT([using timeGetTime])
else
AC_MSG_ERROR([no suitable subsecond time function found])
fi
fi
dnl Add windows libraries for GLUT even if not needed
AC_MSG_CHECKING([Add windows libraries for GLUT even if not needed])
if test x"$WIN_BUILD" = x"yes" ; then
GLUT_EXTRA_LIBS="-lwinmm -lgdi32"; AC_MSG_RESULT([yes])
else
GLUT_EXTRA_LIBS=""; AC_MSG_RESULT([no])
fi
AC_CHECK_LIB([m], [acos])
NO_GLUT=0
GLUT=1
OPENGLUT=2
FREEGLUT=3
FLTKGLUT=4
AC_PATH_X
if test x"$no_x" = x"yes" ; then
AC_CANONICAL_HOST
case $host_os in
*cygwin* ) CPPFLAGS="-I/usr/include/opengl $CPPFLAGS"
LDFLAGS="-L/usr/lib/w32api $LDFLAGS"
;;
esac
fi
glut_type=$NO_GLUT
AC_ARG_WITH(
[openglut],
[AS_HELP_STRING([--with-openglut], [build using OpenGLUT])],
[glut_type=$OPENGLUT],
[AC_ARG_WITH([freeglut],
[AS_HELP_STRING([--with-freeglut], [build using Freeglut])],
[glut_type=$FREEGLUT],
[AC_ARG_WITH([fltkglut],
[AS_HELP_STRING([--with-fltkglut], [build using FLTK GLUT])],
[glut_type=$FLTKGLUT])]
)]
)
FOUND_GLU=0
AX_CHECK_GL
if test ! x"$no_gl" = x"yes" ; then
AX_CHECK_GLU
if test ! x"$no_glu" = x"yes" ; then
FOUND_GLU=1
GLPROG_LIBS="$GLU_LIBS $GL_LIBS $LIBS"
GLPROG_CXXFLAGS="$GLU_CFLAGS"
if test $glut_type = $NO_GLUT ; then
AX_CHECK_GLUT
if test ! x"$no_glut" = x"yes" ; then
glut_type=$GLUT
fi
else
if test $glut_type = $OPENGLUT ; then
glut_type=$NO_GLUT
AC_CHECK_HEADER([GL/openglut.h], # must be in GL directory
[AC_CHECK_LIB([openglut], [main],
[GLUT_LIBS="-lopenglut"; glut_type=$OPENGLUT]) ])
else
if test $glut_type = $FREEGLUT ; then
glut_type=$NO_GLUT
AC_CHECK_HEADER([GL/freeglut.h], # must be in GL directory
[AC_CHECK_LIB([freeglut], [main],
[GLUT_LIBS="-lfreeglut"; glut_type=$FREEGLUT]) ])
else
if test $glut_type = $FLTKGLUT ; then
AM_PATH_FLTK(1.3)
glut_type=$NO_GLUT
if test ! CXXFLAGS = "" ; then
GLUT_CXXFLAGS="$FLTK_CXXFLAGS"
GLUT_LDFLAGS= "$FLTK_LDFLAGS"
GLUT_LIBS="$FLTK_LIBS"
glut_type=$FLTKGLUT
fi
fi
fi
fi
fi
fi
fi
if test $FOUND_GLU = 0 ; then
echo
echo "*********************************************"
echo " missing some OpenGL or GLU library or header"
echo " check OpenGL and GLU development packages are installed"
echo "*********************************************"
echo
fi
AH_TEMPLATE([FOUND_GLU], [The GL and GLU libraries and headers were found])
AC_DEFINE_UNQUOTED([FOUND_GLU], [$FOUND_GLU])
AC_SUBST(FOUND_GLU)
AC_SUBST(GLPROG_LIBS)
AC_SUBST(GLPROG_CXXFLAGS)
AC_SUBST(HAVE_OPENGL_GL_H)
AC_SUBST(HAVE_GL_GL_H)
AC_SUBST(HAVE_OPENGL_GLU_H)
AC_SUBST(HAVE_GL_GLU_H)
AC_SUBST(HAVE_GLUT_GLUT_H)
AC_SUBST(HAVE_GL_GLUT_H)
if test $glut_type = $NO_GLUT ; then
echo
echo "*********************************************"
echo " missing GLUT library or header"
echo " check GLUT development package is installed"
echo "*********************************************"
echo
fi
if test ! $FOUND_GLU = 0 && test ! $glut_type = 0 ; then
AM_CONDITIONAL(BUILD_ANTIVIEW, true)
echo "OpenGL/GLUT found, antiview will be built"
else
AM_CONDITIONAL(BUILD_ANTIVIEW, false)
echo
echo "*********************************************"
echo " antiview will not be built"
echo " missing OpenGL or GLUT components (details above)"
echo "*********************************************"
echo
fi
GLUT_LIBS="$GLUT_LIBS $GLUT_EXTRA_LIBS"
AC_SUBST(GLUT_LIBS)
AC_SUBST(GLUT_CFLAGS)
AC_SUBST(GLUT_CXXFLAGS)
AC_SUBST(GLUT_LDLAGS)
AH_TEMPLATE([GLUT_TYPE], [The GLUT library that will used 1=GLUT, 2=OpenGLUT])
AC_DEFINE_UNQUOTED([GLUT_TYPE], [$glut_type])
# Timer
AH_TEMPLATE([UTIMER], [usec timer to use 1=gettimeofday, 2=timeGetTime])
AC_DEFINE_UNQUOTED([UTIMER], [$utimer])
UTIMER=$utimer
AC_SUBST(UTIMER)
AC_CHECK_FUNC([usleep], [usleep=1],
[AC_CHECK_HEADER([winbase.h], [usleep=2],
[AC_MSG_ERROR([no suitable subsecond sleep function found])], [#include <windows.h>])
])
AH_TEMPLATE([USLEEP], [usec sleep function to use 1=usleep, 2=Sleep])
AC_DEFINE_UNQUOTED([USLEEP], [$usleep])
USLEEP=$usleep
AC_SUBST(USLEEP)
# Install type, neded for Debian package
AC_ARG_ENABLE(debian,
[ --enable-debian Install compatible with debian packaging],
[case "${enableval}" in
yes) debian=true ;;
no) debian=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[debian=false])
AM_CONDITIONAL(DEBIAN_INSTALL, test x$debian = xtrue)
# Checks for header files.
AC_CHECK_HEADERS([float.h limits.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor memset modf pow sqrt strcasecmp strchr strcspn strncasecmp strpbrk strrchr strspn strstr strtol])
AC_CONFIG_FILES([Makefile
Doxyfile
aview/Makefile
base/muparser/Makefile
base/tesselator/Makefile
base/qhull/Makefile
base/Makefile
src/Makefile
src_extra/Makefile
doc_src/common_defs.inc
])
AC_OUTPUT