forked from VincentWei/mgeff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
325 lines (274 loc) · 9.12 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libmgeff, 1.2.0)
AC_CONFIG_SRCDIR(src/animation.c)
AM_CONFIG_HEADER(mgeffconfig.h)
MGEFF_NAME="mgeff"
dnl Set various version strings
#
# Making releases:
# Change the version, then:
# _MICRO_VERSION += 1;
# _INTERFACE_AGE += 1;
# _BINARY_AGE += 1;
# if any functions have been added, set _INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set _BINARY_AGE and _INTERFACE_AGE to 0.
#
MGEFF_MAJOR_VERSION=1
MGEFF_MINOR_VERSION=2
MGEFF_MICRO_VERSION=0
MGEFF_INTERFACE_AGE=0
MGEFF_BINARY_AGE=0
MGEFF_VERSION=$MGEFF_MAJOR_VERSION.$MGEFF_MINOR_VERSION.$MGEFF_MICRO_VERSION
AC_SUBST(MGEFF_MAJOR_VERSION)
AC_SUBST(MGEFF_MINOR_VERSION)
AC_SUBST(MGEFF_MICRO_VERSION)
AC_SUBST(MGEFF_INTERFACE_AGE)
AC_SUBST(MGEFF_BINARY_AGE)
AC_SUBST(MGEFF_VERSION)
# libtool versioning
LT_RELEASE=$MGEFF_MAJOR_VERSION.$MGEFF_MINOR_VERSION
LT_CURRENT=`expr $MGEFF_MICRO_VERSION - $MGEFF_INTERFACE_AGE`
LT_REVISION=$MGEFF_INTERFACE_AGE
LT_AGE=`expr $MGEFF_BINARY_AGE - $MGEFF_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
dnl ========================================================================
# Checks for programs.
AC_PROG_CC
AC_PROG_LD
AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl ========================================================================
dnl Put the name and version of the package here
# Checks for libraries.
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([stdint.h stdlib.h string.h fcntl.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero dup2 getcwd memmove memset putenv strchr strdup strerror strstr])
devel_mode="no"
AC_ARG_ENABLE(develmode,
[ --enable-develmode developer mode <default=no>],
devel_mode=$enableval)
detail_debug="no"
AC_ARG_ENABLE(detail_debug,
[ --enable-detaildebug detailed debug information <default=no>],
detail_debug=$enableval)
use_mgmesa="no"
AC_ARG_ENABLE(mgmesa,
[ --enable-mgmesa enable Mesa for MiniGUI<default=no>],
use_mgmesa=$enableval)
use_mgegl="no"
AC_ARG_ENABLE(mgegl,
[ --enable-mgegl enable eGL for MiniGUI<default=no>],
use_mgegl=$enableval)
use_opengles2="no"
AC_ARG_ENABLE(opengles2,
[ --enable-opengles2 enable OpenGL ES 2.0 <default=yes>],
use_opengles2=$enableval)
have_effectors="yes"
AC_ARG_ENABLE(effectors,
[ --enable-effectors include effectors <default=yes>],
have_effectors=$enableval)
effector_fastmode="yes"
AC_ARG_ENABLE(fastmode,
[ --enable-fastmode enable fastmode <default=yes>],
effector_fastmode=$enableval)
effector_fivepointedstar="yes"
AC_ARG_ENABLE(efffivepointedstar,
[ --enable-efffivepointedstar include five-pointed-star effector <default=yes>],
effector_fivepointedstar=$enableval)
effector_rotate="yes"
AC_ARG_ENABLE(effrotate,
[ --enable-effrotate include rotate effector <default=yes>],
effector_rotate=$enableval)
effector_cubicrotate="yes"
AC_ARG_ENABLE(effcubicrotate,
[ --enable-effcubicrotate include cubic-rotate effector <default=yes>],
effector_cubicrotate=$enableval)
effector_radarscan="yes"
AC_ARG_ENABLE(effradarscan,
[ --enable-effradarscan include radar-scan effector <default=yes>],
effector_radarscan=$enableval)
effector_scroll="yes"
AC_ARG_ENABLE(effscroll,
[ --enable-effscroll include scroll effector <default=yes>],
effector_scroll=$enableval)
effector_leafwindow="yes"
AC_ARG_ENABLE(effleafwindow,
[ --enable-effleafwindow include leafwindow effector <default=yes>],
effector_leafwindow=$enableval)
effector_zoom="yes"
AC_ARG_ENABLE(effzoom,
[ --enable-effzoom include zoom effector <default=yes>],
effector_zoom=$enableval)
effector_centersplit="yes"
AC_ARG_ENABLE(effcentersplit,
[ --enable-effcentersplit include centersplit effector <default=yes>],
effector_centersplit=$enableval)
effector_flip="yes"
AC_ARG_ENABLE(effflip,
[ --enable-effflip include flip effector <default=yes>],
effector_flip=$enableval)
effector_alpha="yes"
AC_ARG_ENABLE(effalpha,
[ --enable-effalpha include alpha effector <default=yes>],
effector_alpha=$enableval)
effector_zip="yes"
AC_ARG_ENABLE(effzip,
[ --enable-effzip include zip effector <default=yes>],
effector_zip=$enableval)
effector_clear="yes"
AC_ARG_ENABLE(effclear,
[ --enable-effclear include clear effector <default=yes>],
effector_clear=$enableval)
effector_push="yes"
AC_ARG_ENABLE(effpush,
[ --enable-effpush include push effector <default=yes>],
effector_push=$enableval)
effector_windowanimation="yes"
AC_ARG_ENABLE(windowanimation,
[ --enable-windowanimation support for window-animation <default=yes>],
effector_windowanimation=$enableval)
AC_ARG_WITH(libsuffix,
[ --with-libsuffix=ARG configure the suffix of the library name.])
if test "x$with_libsuffix" = "x"; then
LIB_SUFFIX=""
else
LIB_SUFFIX="_$with_libsuffix"
fi
MGEFF_LIBNAME="${MGEFF_NAME}${LIB_SUFFIX}"
dnl ========================================================================
dnl check for installation of MiniGUI
dnl ========================================================================
PKG_CHECK_MODULES([MINIGUI], [minigui >= 3.2.0])
if test "x$devel_mode" = "xyes"; then
have_effectors="yes"
effector_fastmode="yes"
fi
if test "x$have_effectors" = "xyes"; then
PKG_CHECK_MODULES([MGPLUS], [mgplus >= 1.4.0])
fi
if test "x$use_mgmesa" = "xyes"; then
AC_DEFINE(HAVE_MESA_MINIGUI, 1, [Define if have Mesa for MiniGUI])
fi
if test "x$use_mgegl" = "xyes"; then
AC_DEFINE(HAVE_EGL_SUPPORT, 1, [Define if have eGL for MiniGUI])
fi
if test "x$use_opengles2" = "xyes"; then
AC_DEFINE(HAVE_GLES2_SUPPORT, 1, [Define if have OpenGL ES 2.0])
fi
if test "x$have_effectors" = "xyes"; then
AC_DEFINE(_MGEFF_EFFECTOR, 1, [Define if include effectors])
fi
if test "x$effector_fastmode" = "xyes"; then
AC_DEFINE(_MGEFF_FASTMODE, 1, [Define if enable fast mode of effectors])
fi
if test "x$effector_fivepointedstar" = "xyes"; then
AC_DEFINE(_MGEFF_FIVEPOINTEDSTAREFFECTOR, 1, [Define if include five-pointed-star effector])
fi
if test "x$effector_rotate" = "xyes"; then
AC_DEFINE(_MGEFF_ROTATEEFFECTOR, 1, [Define if include rotate effector])
fi
if test "x$effector_cubicrotate" = "xyes"; then
AC_DEFINE(_MGEFF_CUBICROTATEEFFECTOR, 1, [Define if include cubic-rotate effector])
fi
if test "x$effector_radarscan" = "xyes"; then
AC_DEFINE(_MGEFF_RADARSCANEFFECTOR, 1, [Define if include radar scan effector])
fi
if test "x$effector_scroll" = "xyes"; then
AC_DEFINE(_MGEFF_SCROLLEFFECTOR, 1, [Define if include scroll effector])
fi
if test "x$effector_leafwindow" = "xyes"; then
AC_DEFINE(_MGEFF_LEAFWINDOWEFFECTOR, 1, [Define if include leaf window effector])
fi
if test "x$effector_zoom" = "xyes"; then
AC_DEFINE(_MGEFF_ZOOMEFFECTOR, 1, [Define if include zoom effector])
fi
if test "x$effector_centersplit" = "xyes"; then
AC_DEFINE(_MGEFF_CENTERSPLITEFFECTOR, 1, [Define if include split effector])
fi
if test "x$effector_flip" = "xyes"; then
AC_DEFINE(_MGEFF_FLIPEFFECTOR, 1, [Define if include flip effector])
fi
if test "x$effector_alpha" = "xyes"; then
AC_DEFINE(_MGEFF_ALPHAEFFECTOR, 1, [Define if include alpha effector])
fi
if test "x$effector_zip" = "xyes"; then
AC_DEFINE(_MGEFF_ZIPEFFECTOR, 1, [Define if include zip effector])
fi
if test "x$effector_clear" = "xyes"; then
AC_DEFINE(_MGEFF_CLEAREFFECTOR, 1, [Define if include clear effector])
fi
if test "x$effector_push" = "xyes"; then
AC_DEFINE(_MGEFF_PUSHEFFECTOR, 1, [Define if include push effector])
fi
if test "x$effector_windowanimation" = "xyes"; then
AC_DEFINE(_MGEFF_WINDOWANIMATION, 1, [Define if include window animation])
fi
DEP_LIBS="$DEP_LIBS $MINIGUI_LIBS $MGPLUS_LIBS"
APP_LIBS="-l${MGEFF_LIBNAME} $DEP_LIBS"
PC_LIBS="$APP_LIBS"
PC_CFLAGS=""
dnl Check sqlite3 and xml2 for samples
AC_CHECK_LIB(sqlite3, sqlite3_open_v2, APP_LIBS="$APP_LIBS -lsqlite3", foo=bar)
AC_CHECK_LIB(xml2, xmlFree, APP_LIBS="$APP_LIBS -lxml2", foo=bar)
CFLAGS="$CFLAGS -D__MGEFF_LIB__"
if test "x$devel_mode" = "xyes"; then
CPPFLAGS="$CPPFLAGS -D_DEBUG"
if test "x$detail_debug" = "xyes"; then
CPPFLAGS="$CPPFLAGS -DDEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CPPFLAGS="$CPPFLAGS -Wall -Werror"
fi
else
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -Wstrict-prototypes -pipe"
fi
AM_CONDITIONAL(MGEFF_NOSUFFIX, test "x$with_libsuffix" = "x")
AC_SUBST(LIB_SUFFIX)
AC_SUBST(DEP_LIBS)
AC_SUBST(APP_LIBS)
AC_SUBST(PC_LIBS)
AC_SUBST(PC_CFLAGS)
AC_OUTPUT([
mgeff.pc
Makefile
m4/Makefile
include/Makefile
src/Makefile
src/include/Makefile
src/effector/Makefile
])
dnl samples/easing/Makefile
dnl samples/easing/src/Makefile
echo
echo "Creating include directory for samples"
cd samples/
if test ! -h mgeff; then
ln -s ../include mgeff
fi
cd ..
echo "Done."