-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathconfigure.ac
309 lines (251 loc) · 9.84 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
AC_PREREQ(2.59)
AC_INIT([cdpfgl], [0.0.12], [Olivier DELHOMME <[email protected]>])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_INTLTOOL([0.23])
dnl ***********************************************************************
dnl * Put the preprocessor macros in a header file *
dnl * instead of command line *
dnl ***********************************************************************
AC_CONFIG_HEADER([config.h])
AC_CONFIG_SRCDIR([client/client.c])
dnl ***********************************************************************
dnl * Libraries requirements *
dnl ***********************************************************************
PKG_PROG_PKG_CONFIG([0.23])
GLIB_VERSION=2.30.0
GIO_VERSION=2.30.0
SQLITE_VERSION=3.6.20
JANSSON_VERSION=2.5
MHD_VERSION=0.9.5
CURL_VERSION=7.22.0
ZLIB_VERSION=1.2.8
AC_SUBST(GLIB_VERSION)
AC_SUBST(GIO_VERSION)
AC_SUBST(SQLITE_VERSION)
AC_SUBST(JANSSON_VERSION)
AC_SUBST(MHD_VERSION)
AC_SUBST(CURL_VERSION)
AC_SUBST(ZLIB_VERSION)
dnl ***********************************************************************
dnl * Build time sanity check *
dnl ***********************************************************************
AM_SANITY_CHECK
dnl ***********************************************************************
dnl * Initialize maintainer mode *
dnl ***********************************************************************
AM_MAINTAINER_MODE
dnl ***********************************************************************
dnl * Checks for headers *
dnl ***********************************************************************
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS( \
signal.h \
sys/signalfd.h \
sys/fanotify.h \
math.h
)
dnl ***********************************************************************
dnl * Checks dynamic libraries capabilities *
dnl ***********************************************************************
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl ***********************************************************************
dnl * languages *
dnl ***********************************************************************
ALL_LINGUAS="fr"
dnl ***********************************************************************
dnl * triggers gettext *
dnl ***********************************************************************
GETTEXT_PACKAGE=cdpfgl
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package used])
AM_GLIB_GNU_GETTEXT
dnl ***********************************************************************
dnl * checking for modules (glib, gio, sqlite, mhd, curl...) *
dnl ***********************************************************************
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= $GLIB_VERSION])
PKG_CHECK_MODULES(GIO, [gio-2.0 >= $GIO_VERSION])
PKG_CHECK_MODULES(SQLITE, [sqlite3 >= $SQLITE_VERSION])
PKG_CHECK_MODULES(JANSSON, [jansson >= $JANSSON_VERSION])
PKG_CHECK_MODULES(MHD, [libmicrohttpd >= $MHD_VERSION])
PKG_CHECK_MODULES(CURL, [libcurl >= $CURL_VERSION])
PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_VERSION])
AC_PROG_INSTALL
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-declarations \
-Wbad-function-cast -Wcast-align -Wnested-externs -Wunused \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-DGSEAL_ENABLE -DG_DISABLE_DEPRECATED"
dnl ***********************************************************************
dnl * checking OS *
dnl ***********************************************************************
case $build_os in
*linux*)
AC_DEFINE_UNQUOTED(SYS_LINUX, 1, [This is a Linux system])
LDFLAGS="$LDFLAGS -export-dynamic -no-undefined -module"
;;
*mingw*)
AC_DEFINE_UNQUOTED(SYS_MINGW, 1, [This is a Windows system using MinGW])
LDFLAGS="$LDFLAGS -export-dynamic -no-undefined -module -Wl,--export-all-symbols"
CFLAGS="$CFLAGS -mms-bitfields -mwindows -mno-cygwin"
;;
esac
dnl ***********************************************************************
dnl * directories definitions *
dnl ***********************************************************************
LOCALE_DIR="$prefix/share/locale"
AC_DEFINE_UNQUOTED(LOCALE_DIR, "$prefix/share/locale", [Locale Directory])
dnl ***********************************************************************
dnl * ./configure options *
dnl ***********************************************************************
dnl ***********************************************************************
dnl * debug option *
dnl ***********************************************************************
AC_ARG_ENABLE([debug],
[ --enable-debug Turn on debugging],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=false])
if test x$debug = xtrue
then
AC_DEFINE_UNQUOTED(ENABLE_DEBUG, TRUE, [Debug mode On])
CFLAGS="$CFLAGS -ggdb"
else
AC_DEFINE_UNQUOTED(ENABLE_DEBUG, FALSE, [Debug mode Off])
CFLAGS="$CFLAGS -ggdb"
fi
dnl ***********************************************************************
dnl * If we are running automake >= 1.11, we can *
dnl * have nicer compilation output. silent option *
dnl ***********************************************************************
AC_ARG_ENABLE([silent],
[ --disable-silent Disable quiet compilation],
[case "${enableval}" in
yes) silent=false ;;
no) silent=true ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-silent]) ;;
esac],[silent=false])
if test x$silent = xtrue
then
AM_SILENT_RULES([no])
else
AM_SILENT_RULES([yes])
fi
dnl ***********************************************************************
dnl * gcov option *
dnl ***********************************************************************
AC_ARG_ENABLE([gcov],
[ --enable-gcov Enables gcov coverage tests],
[case "${enableval}" in
yes) gcov=true ;;
no) gcov=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-gcov]) ;;
esac],[gcov=false])
if test x$gcov = xtrue
then
CFLAGS="--coverage -g -fprofile-arcs -ftest-coverage $CFLAGS "
LDFLAGS="--coverage -g -fprofile-arcs -ftest-coverage $CFLAGS "
else
CFLAGS="$CFLAGS"
fi
dnl ***********************************************************************
dnl * gprof option *
dnl ***********************************************************************
AC_ARG_ENABLE([gprof],
[ --enable-gprof Enables gprof profiling],
[case "${enableval}" in
yes) gprof=true ;;
no) gprof=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-gprof]) ;;
esac],[gprof=false])
if test x$gprof = xtrue
then
CFLAGS="-pg -lc $CFLAGS"
LDFLAGS="-pg -lc $LDFLAGS"
else
CFLAGS="$CFLAGS"
fi
REVISION=`git rev-parse --short --revs-only HEAD 2>/dev/null || echo 0`
AC_DEFINE_UNQUOTED(REVISION, "$REVISION", [git revision hash])
dnl ***********************************************************************
dnl * exporting variables *
dnl ***********************************************************************
AC_SUBST(LDFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
AC_SUBST(JANSSON_CFLAGS)
AC_SUBST(JANSSON_LIBS)
AC_SUBST(MHD_CFLAGS)
AC_SUBST(MHD_LIBS)
AC_SUBST(CURL_CFLAGS)
AC_SUBST(CURL_LIBS)
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
AC_CONFIG_FILES([
Makefile
libcdpfgl/Makefile
client/Makefile
server/Makefile
restore/Makefile
po/Makefile.in
man/Makefile
libcdpfgl/libcdpfgl.pc
pixmaps/Makefile
pixmaps/hicolor/Makefile
pixmaps/hicolor/16x16/Makefile
pixmaps/hicolor/16x16/apps/Makefile
pixmaps/hicolor/32x32/Makefile
pixmaps/hicolor/32x32/apps/Makefile
pixmaps/hicolor/48x48/Makefile
pixmaps/hicolor/48x48/apps/Makefile
pixmaps/hicolor/64x64/Makefile
pixmaps/hicolor/64x64/apps/Makefile
pixmaps/hicolor/128x128/Makefile
pixmaps/hicolor/128x128/apps/Makefile
pixmaps/hicolor/256x256/Makefile
pixmaps/hicolor/256x256/apps/Makefile
pixmaps/hicolor/512x512/Makefile
pixmaps/hicolor/512x512/apps/Makefile
])
AC_OUTPUT
AC_MSG_NOTICE([
*** Flags that will be used to compile cdpfgl ***
CFLAGS : ${CFLAGS}
LDFLAGS : ${LDFLAGS}
GLIB CFLAGS : ${GLIB_CFLAGS}
GLIB LIBS : ${GLIB_LIBS}
GIO CFLAGS : ${GIO_CFLAGS}
GIO LIBS : ${GIO_LIBS}
SQLITE CFLAGS : ${SQLITE_CFLAGS}
SQLITE LIBS : ${SQLITE_LIBS}
JANSSON CFLAGS : ${JANSSON_CFLAGS}
JANSSON LIBS : ${JANSSON_LIBS}
MHD CFLAGS : ${MHD_CFLAGS}
MHD LIBS : ${MHD_LIBS}
CURL CFLAGS : ${CURL_CFLAGS}
CURL LIBS : ${CURL_LIBS}
ZLIB_CFLAGS : ${ZLIB_CFLAGS}
ZLIB_LIBS : ${ZLIB_LIBS}
*** Dumping configuration ***
- Build For OS : $build_os
- Compiler : ${CC}
- Prefix : $prefix
- Exec prefix : ${exec_prefix}
- Locale dir : ${LOCALE_DIR}
- git revision : ${REVISION}
- Options
. is code profiling on ? : $gprof
. Code coverage is on ? : $gcov
. debbuging is on ? : $debug
. Disabled quiet compilation ? : $silent
You can now run 'make' to compile cdpfgl.
])