-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac.gst010
269 lines (224 loc) · 6.92 KB
/
configure.ac.gst010
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
AC_INIT([libmoldeo], [1.0.0.160], [[email protected]], [libmoldeo])
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER(config.h)
AC_LIBTOOL_CONFIG
AC_PROG_CC
AC_PROG_CC_STDC
AC_C_CONST
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CXX_C_O
dnl Set install paths.
if test "x$prefix" = "xNONE" ; then
prefix="/usr/local"
fi
if test "x$exec_prefix" = "xNONE" ; then
exec_prefix=$prefix
fi
case "$host" in
*-*-mingw*|*-*-cygwin*)
AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
PLATFORM_STRING="Win32"
;;
*-*-linux*)
AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
PLATFORM_STRING="Linux"
;;
*-*-darwin*)
AC_MSG_WARN([Hello])
AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
PLATFORM_STRING="Apple"
;;
*)
AC_MSG_WARN([*** Please add $host to configure.ac checks!])
;;
esac
case "$host" in
i?86-* | k?-* | athlon-* | pentium*-)
AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
ARCH_SPECIFIC_CFLAGS=""
ARCH_STRING="X86"
;;
x86_64-*)
AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
ARCH_STRING="X86-64"
with_boost_libdir="/usr/lib/x86_64-linux-gnu"
libdir=$prefix"/lib"
;;
ppc-* | powerpc-*)
AC_MSG_WARN([HI THERE!])
AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
ARCH_SPECIFIC_CFLAGS=""
ARCH_STRING="PowerPC"
;;
*)
AC_MSG_ERROR([Unknown Architecture])
;;
esac
dnl check for muParser
PKG_CHECK_MODULES([MUPARSER], [muparser] ,has_muparser=yes)
dnl check tinyxml
PKG_CHECK_MODULES([TINYXML], [tinyxml] ,has_tinyxml=yes)
dnl check for gtk+-2.0
PKG_CHECK_MODULES([GTK2], [gtk+-2.0], has_gtk2=yes )
dnl check for sdl
PKG_CHECK_MODULES([SDL], [sdl] ,has_sdl=yes)
dnl check for opengl
AC_ARG_WITH( [gles],
AS_HELP_STRING([--with-gles],
[use open gl es 2, default: no]),
[with_gles=yes])
host_name="default"
AC_ARG_ENABLE(host,
[--enable-host[=host name] Specify the host os name:
64: 64 bit linux os [default]
86: 32 bits linux os
raspbian: RASPBIAN/debian 8 32 bits
xosx: Mac OSX with mac ports],
[ if test "x$enableval" = "x86" ; then
host_name="86"
elif test "x$enableval" = "x64" ; then
host_name="64"
elif test "x$enableval" = "xraspbian" ; then
host_name="raspbian"
host_cflags="-I/opt/vc/include -DOPENGLESV2"
host_ldflags="-L/opt/vc/lib"
elif test "x$enableval" = "xosx" ; then
host_name="osx"
host_cflags="-I/opt/local/include "
host_ldflags="-L/opt/local/lib -framework GLUT -framework OpenGL -framework Cocoa"
else
echo
echo "Error!"
echo "Unknown host name"
exit -1
fi
])
AC_SUBST([HOSTCFLAGS],$host_cflags)
AC_SUBST([HOSTLDFLAGS],$host_ldflags)
if test "x$host_name" = "xosx" ; then
PKG_CHECK_MODULES([LUA51], [lua-5.1] ,has_lua51=yes)
AC_SUBST([GLUT_LIBS], [])
AC_SUBST([GL_LIBS], [])
AC_SUBST([GLE_LIBS], [])
dnl check for glew
AC_CHECK_HEADER(GL/glew.h, , AC_MSG_ERROR([glew header not found.]))
AC_CHECK_LIB(GLEW, glewInit, AC_SUBST([GL_LIBS], [-lGLEW]), AC_MSG_ERROR([glew not found.]) )
else
PKG_CHECK_MODULES([LUA51], [lua5.1] ,has_lua51=yes)
AS_IF([test "x$with_gles" = "xyes"],
[PKG_CHECK_MODULES([GL], [glesv2, egl] ,has_glesv2=yes)],
[PKG_CHECK_MODULES([GL], [gl, glew] ,has_gl=yes)])
dnl check for glut
AC_CHECK_HEADER(GL/glut.h, , AC_MSG_ERROR([glut header not found.]))
AC_CHECK_LIB(glut, glutMainLoop, AC_SUBST([GLUT_LIBS], [-lglut]), AC_MSG_ERROR([glut not found.]), )
fi
dnl check for freeimage
AC_CHECK_HEADER(FreeImage.h, , AC_MSG_ERROR([FreeImage header not found.]))
AC_CHECK_LIB(freeimage, FreeImage_GetVersion, AC_SUBST([FREEIMAGE_LIBS], [-lfreeimage]), AC_MSG_ERROR([FreeImage not found.]), )
#dnl check for openal
#PKG_CHECK_MODULES([OPENAL], [openal] ,has_openal=yes)
dnl check for glu
#PKG_CHECK_MODULES([GLU], [glu] ,has_glu=yes)
dnl check for gle
#AC_CHECK_HEADER(GL/gle.h, , AC_MSG_ERROR([gle header not found.]))
#AC_CHECK_LIB(gle, gleDestroyGC, AC_SUBST([GLE_LIBS], [-lgle]), AC_MSG_ERROR([gle not found.]), )
dnl check for ftgl
PKG_CHECK_MODULES([FTGL], [ftgl], has_ftgl=yes )
dnl check for alut
#PKG_CHECK_MODULES([FREEALUT], [freealut] ,has_freealut=yes)
dnl check for gstreamer
GST_VERSION_MAJOR=0
GST_VERSION_MINOR=10
GST_VERSION_RELEASE=19
GSTPLUG_VERSION_RELEASE=7
GSTREAMER_REQ=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_RELEASE
GSTPLUGINS_REQ=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GSTPLUG_VERSION_RELEASE
GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GSTREAMER_REQ,
HAVE_GSTREAMER=yes)
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
PKG_CHECK_MODULES(GST_INTERFACES, gstreamer-interfaces-$GST_MAJORMINOR >= $GSTREAMER_REQ,
HAVE_GSTREAMER_INTERFACES=yes)
AC_SUBST(GST_INTERFACES_CFLAGS)
AC_SUBST(GST_INTERFACES_LIBS)
dnl check for truetype
AC_CHECK_FT2
dnl check for check test suite
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
dnl check boost libraries
AX_BOOST_BASE
AX_BOOST_ASIO
AX_BOOST_THREAD
AX_BOOST_FILESYSTEM
AX_BOOST_SYSTEM
dnl autoscan results
AC_CHECK_FUNCS([floor])
AC_CHECK_FUNCS([getcwd])
AC_CHECK_FUNCS([memmove])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([pow])
AC_CHECK_FUNCS([rint])
AC_CHECK_FUNCS([sqrt])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strstr])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([float.h])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([stddef.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_TYPES([ptrdiff_t])
AC_C_INLINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_PREREQ
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
LT_INIT
AC_STRUCT_TM
AC_TYPE_SIZE_T
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug=false])
AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
dnl Additional arguments (and substitutions)
dnl Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir,
AC_HELP_STRING([--with-pkgconfigdir],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
echo "GLES: $with_gles"
echo "HOST: $host_name"
echo "HOSTCFLAGS: $host_cflags"
echo "HOSTLDFLAGS: $host_ldflags"
echo "DEBUG: $debug"
dnl Makefile outputs
AC_OUTPUT([
Makefile
data/Makefile
libmoldeo/Makefile
libmoldeotest/Makefile
libmoldeo.pc
libmoldeotest.pc
test-suite/Makefile
])