forked from VincentWei/mgplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·301 lines (245 loc) · 8.4 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libmgplus, 1.4.0)
AC_CONFIG_SRCDIR(src/agg/agg_platform_support.cpp)
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.
#
MGPLUS_MAJOR_VERSION=1
MGPLUS_MINOR_VERSION=4
MGPLUS_MICRO_VERSION=0
MGPLUS_INTERFACE_AGE=0
MGPLUS_BINARY_AGE=0
MGPLUS_VERSION=$MGPLUS_MAJOR_VERSION.$MGPLUS_MINOR_VERSION.$MGPLUS_MICRO_VERSION
AC_SUBST(MGPLUS_MAJOR_VERSION)
AC_SUBST(MGPLUS_MINOR_VERSION)
AC_SUBST(MGPLUS_MICRO_VERSION)
AC_SUBST(MGPLUS_INTERFACE_AGE)
AC_SUBST(MGPLUS_BINARY_AGE)
AC_SUBST(MGPLUS_VERSION)
# libtool versioning
LT_RELEASE=$MGPLUS_MAJOR_VERSION.$MGPLUS_MINOR_VERSION
LT_CURRENT=`expr $MGPLUS_MICRO_VERSION - $MGPLUS_INTERFACE_AGE`
LT_REVISION=$MGPLUS_INTERFACE_AGE
LT_AGE=`expr $MGPLUS_BINARY_AGE - $MGPLUS_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_DEFINE_UNQUOTED(MGPLUS_MAJOR_VERSION, $MGPLUS_MAJOR_VERSION,
[Major version of mGPlus])
AC_DEFINE_UNQUOTED(MGPLUS_MINOR_VERSION, $MGPLUS_MINOR_VERSION,
[Minor version of mGPlus])
AC_DEFINE_UNQUOTED(MGPLUS_MICRO_VERSION, $MGPLUS_MICRO_VERSION,
[Micro version of mGPlus])
AC_DEFINE_UNQUOTED(MGPLUS_INTERFACE_AGE, $MGPLUS_INTERFACE_AGE,
[Interface age of mGPlus])
AC_DEFINE_UNQUOTED(MGPLUS_BINARY_AGE, $MGPLUS_BINARY_AGE,
[Binary age of mGPlus])
dnl ========================================================================
dnl Need for cross-compiling
AC_CANONICAL_SYSTEM
dnl ========================================================================
dnl Init automake
AM_INIT_AUTOMAKE
dnl ========================================================================
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
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([fcntl.h stdlib.h string.h sys/ioctl.h sys/time.h termio.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
#AC_FUNC_MALLOC
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([bzero dup2 getcwd memmove memset putenv strchr strdup strerror strstr])
devel_mode="no"
detail_debug="no"
build_fashion_lfrdr="yes"
build_colorcomposite_support="yes"
build_gradientfill_support="yes"
build_ft2_support="yes"
#pixfmt_argb32_support="yes"
pixfmt_rgba32_support="yes"
pixfmt_abgr32_support="yes"
pixfmt_bgra32_support="yes"
pixfmt_bgr24_support="yes"
pixfmt_rgb24_support="yes"
pixfmt_rgb555_support="yes"
pixfmt_rgb565_support="yes"
AC_ARG_ENABLE(develmode,
[ --enable-develmode developer mode <default=no>],
devel_mode=$enableval)
AC_ARG_ENABLE(detail_debug,
[ --enable-detaildebug detailed debug information <default=no>],
detail_debug=$enableval)
AC_ARG_ENABLE(fashionlf,
[ --enable-fashionlf build Fashion LFRDR <default=yes>],
build_fashion_lfrdr=$enableval)
AC_ARG_ENABLE(colorcomposite,
[ --enable-colorcomposite build support for color composite <default=yes>],
build_colorcomposite_support=$enableval)
AC_ARG_ENABLE(gradientfill,
[ --enable-gradientfill build support for gradient fill <default=yes>],
build_gradientfill_support=$enableval)
AC_ARG_ENABLE(ft2support,
[ --enable-ft2support build support for FreeType2 library <default=no>],
build_ft2_support=$enableval)
#AC_ARG_ENABLE(argb32,
#[ --enable-argb32 build support for pixfmt argb32 <default=yes>],
#pixfmt_argb32_support=$enableval)
AC_ARG_ENABLE(rgba32,
[ --enable-rgba32 build support for pixfmt rgba32 <default=yes>],
pixfmt_rgba32_support=$enableval)
AC_ARG_ENABLE(abgr32,
[ --enable-abgr32 build support for pixfmt abgr32 <default=yes>],
pixfmt_abgr32_support=$enableval)
AC_ARG_ENABLE(bgra32,
[ --enable-bgra32 build support for pixfmt bgra32 <default=yes>],
pixfmt_bgra32_support=$enableval)
AC_ARG_ENABLE(bgr24,
[ --enable-bgr24 build support for pixfmt bgr24 <default=yes>],
pixfmt_bgr24_support=$enableval)
AC_ARG_ENABLE(rgb24,
[ --enable-rgb24 build support for pixfmt rgb24 <default=yes>],
pixfmt_rgb24_support=$enableval)
AC_ARG_ENABLE(rgb555,
[ --enable-rgb555 build support for pixfmt rgb555 <default=yes>],
pixfmt_rgb555_support=$enableval)
AC_ARG_ENABLE(rgb565,
[ --enable-rgb565 build support for pixfmt rgb565 <default=yes>],
pixfmt_rgb565_support=$enableval)
AC_ARG_WITH(libsuffix,
[ --with-libsuffix=ARG configure the suffix of the library name.])
AM_CONFIG_HEADER(mgplusconfig.h)
if test "x$build_fashion_lfrdr" = "xyes"; then
AC_DEFINE(_MGPLUS_LFRDR_FASHION, 1,
[Define if include Fashion LFRDR])
build_gradientfill_support="yes"
build_colorcomposite_support="yes"
fi
if test "x$build_colorcomposite_support" = "xyes"; then
AC_DEFINE(_MGPLUS_COLORCOMPOSITE, 1,
[Define if support color composite])
fi
if test "x$build_gradientfill_support" = "xyes"; then
AC_DEFINE(_MGPLUS_GRADIENTFILL, 1,
[Define if support gradient fill])
fi
if test "x$build_ft2_support" == "xyes"; then
AC_DEFINE(_MGPLUS_FONT_FT2, 1,
[Define if support TrueType font based on FreeType2])
fi
#if test "x$pixfmt_argb32_support" == "xyes"; then
# AC_DEFINE(_MGPLUS_PIXFMT_ARGB32, 1,
# [Define if support pixel format ARGB32])
#fi
if test "x$pixfmt_rgba32_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_RGBA32, 1,
[Define if support pixel format RGBA32])
fi
if test "x$pixfmt_abgr32_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_ABGR32, 1,
[Define if support pixel format ABGR32])
fi
if test "x$pixfmt_bgra32_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_BGRA32, 1,
[Define if support pixel format BGRA32])
fi
if test "x$pixfmt_bgr24_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_BGR24, 1,
[Define if support pixel format BGR24])
fi
if test "x$pixfmt_rgb24_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_RGB24, 1,
[Define if support pixel format RGB24])
fi
if test "x$pixfmt_rgb555_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_RGB555, 1,
[Define if support pixel format RGB555])
fi
if test "x$pixfmt_rgb565_support" == "xyes"; then
AC_DEFINE(_MGPLUS_PIXFMT_RGB565, 1,
[Define if support pixel format RGB565])
fi
if test "x$with_libsuffix" = "x"; then
LIB_SUFFIX=""
else
LIB_SUFFIX="_$with_libsuffix"
fi
AC_SUBST(LIB_SUFFIX)
AM_CONDITIONAL(MGPLUS_NOSUFFIX, test "x$with_libsuffix" = "x")
DEP_LIBS=
dnl Check for FreeType library
if test "x$build_ft2_support" != "xno"; then
AC_CHECK_LIB(freetype, FT_Library_Version,
foo=bar,
build_ft2_support=no)
# FT2_CFLAGS="`freetype-config --cflags`"
# FT2_LIBS="`freetype-config --libs`"
fi
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
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
DEP_LIBS="$DEP_LIBS $MINIGUI_LIBS $FT2_LIBS -lstdc++"
AM_CONDITIONAL(MGPLUS_FONT_FT2, test "x$build_ft2_support" = "xyes")
dnl ========================================================================
dnl check the installation of MiniGUI
dnl ========================================================================
PKG_CHECK_MODULES([MINIGUI], [minigui >= 3.2.0])
APP_LIBS="$APP_LIBS -lmgplus$LIB_SUFFIX $DEP_LIBS"
AC_SUBST(APP_LIBS)
AC_SUBST(DEP_LIBS)
dnl AC_CONFIG_FILES
AC_OUTPUT([
mgplus.pc
Makefile
m4/Makefile
cmake/Makefile
include/Makefile
src/Makefile
src/agg/Makefile
src/api/Makefile
])