Fix memory leak issue - RQ161111-00886
[platform/upstream/edbus.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [7])
5 m4_define([v_mic], [9])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##--   When released, remove the dnl on the below line
9 m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15 [m4_define([v_ver], [v_maj.v_min.v_mic])])
16 m4_define([lt_cur], m4_eval(v_maj + v_min))
17 m4_define([lt_rev], v_mic)
18 m4_define([lt_age], v_min)
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22 AC_INIT([e_dbus], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_PREREQ([2.52])
24 AC_CONFIG_SRCDIR([configure.ac])
25 AC_CONFIG_MACRO_DIR([m4])
26
27 AC_CONFIG_HEADERS([config.h])
28 AH_TOP([
29 #ifndef EFL_CONFIG_H__
30 #define EFL_CONFIG_H__
31 ])
32 AH_BOTTOM([
33 #endif /* EFL_CONFIG_H__ */
34 ])
35
36 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
37 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
38
39 AC_LIBTOOL_WIN32_DLL
40 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
41 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
42 AC_PROG_LIBTOOL
43
44 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
45 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
46 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
47 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
48 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
49 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
50 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
51 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
52 version_info="lt_cur:lt_rev:lt_age"
53 release_info="v_rel"
54 AC_SUBST(version_info)
55 AC_SUBST(release_info)
56 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
57 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
58 VMAJ=v_maj
59 AC_SUBST(VMAJ)
60
61 ### Needed information
62
63 AC_CANONICAL_BUILD
64 AC_CANONICAL_HOST
65
66 want_ebluez="yes"
67 want_econnman0_7x="yes"
68 want_ehal="yes"
69 want_enotify="yes"
70 want_eofono="yes"
71 want_eukit="yes"
72
73 case "$host_os" in
74    mingw*)
75       want_ebluez="no"
76       want_econnman0_7x="no"
77       want_ehal="no"
78       want_enotify="no"
79       want_eofono="no"
80       want_eukit="no"
81       ;;
82 esac
83
84 requirement_ebluez="edbus >= 1.7.9"
85 requirement_econnman0_7x="edbus >= 1.7.9"
86 requirement_edbus="ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62"
87 requirement_ehal="edbus >= 1.7.9"
88 requirement_enotify="edbus >= 1.7.9"
89 requirement_eofono="edbus >= 1.7.9"
90 requirement_eukit="edbus >= 1.7.9"
91
92 ### Additional options to configure
93
94 dnl Check enabled modules to build
95
96 AC_ARG_ENABLE([ebluez],
97    [AC_HELP_STRING([--enable-ebluez], [Enable ebluez build])],
98    [enable_ebluez=$enableval],
99    [enable_ebluez="${want_ebluez}"])
100
101 AC_ARG_ENABLE([econnman0_7x],
102    [AC_HELP_STRING([--enable-econnman0_7x], [Enable econnman 0.7x build])],
103    [enable_econnman0_7x=$enableval],
104    [enable_econnman0_7x="${want_econnman0_7x}"])
105
106 AC_ARG_ENABLE([ehal],
107    [AC_HELP_STRING([--disable-ehal], [Disable ehal build])],
108    [enable_ehal=$enableval],
109    [enable_ehal="${want_ehal}"])
110
111 AC_ARG_ENABLE([enotify],
112    [AC_HELP_STRING([--disable-enotify], [Disable enotify build])],
113    [enable_enotify=$enableval],
114    [enable_enotify="${want_enotify}"])
115
116 AC_ARG_ENABLE([eofono],
117    [AC_HELP_STRING([--enable-eofono], [Enable eofono build])],
118    [enable_eofono=$enableval],
119    [enable_eofono="${want_eofono}"])
120
121 AC_ARG_ENABLE([eukit],
122    [AC_HELP_STRING([--disable-eukit], [Disable eukit build])],
123    [enable_eukit=$enableval],
124    [enable_eukit="${want_eukit}"])
125
126 ### Checks for programs
127
128 AC_PROG_CC
129 AM_PROG_CC_C_O
130
131 # pkg-config
132 PKG_PROG_PKG_CONFIG
133
134 # Check whether pkg-config supports Requires.private
135 if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
136    pkgconfig_requires_private="Requires.private"
137 else
138    pkgconfig_requires_private="Requires"
139 fi
140 AC_SUBST(pkgconfig_requires_private)
141
142 # doxygen program for documentation building
143 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
144
145
146 ### Checks for libraries
147
148 # Evil library for compilation on Windows
149
150 case "$host_os" in
151    mingw*)
152       PKG_CHECK_EXISTS([evil >= 1.7.9])
153       AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
154       requirement_edbus="${requirement_edbus} evil >= 1.7.9"
155    ;;
156 esac
157
158 PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.62])
159
160 PKG_CHECK_MODULES([EDBUS], [${requirement_edbus}])
161
162 # Find out the version of DBUS we're using
163 dbus_version=`pkg-config --modversion dbus-1`
164 DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
165 DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
166 DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
167
168 if test "z$DBUS_VERSION_MAJOR" = "z" ; then
169    DBUS_VERSION_MAJOR="0"
170 fi
171
172 if test "z$DBUS_VERSION_MINOR" = "z" ; then
173    DBUS_VERSION_MINOR="0"
174 fi
175
176 if test "z$DBUS_VERSION_MICRO" = "z" ; then
177    DBUS_VERSION_MICRO="0"
178 fi
179
180 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
181 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
182 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
183 AC_SUBST(DBUS_VERSION_CFLAGS)
184
185 # Dependencies for the libraries
186 if test "x${enable_enotify}" = "xyes" ; then
187    PKG_CHECK_MODULES([EVAS],
188       [evas >= 1.7.9],
189       [requirement_enotify="evas >= 1.7.9 ${requirement_enotify}"],
190       [enable_enotify="no"])
191 fi
192
193 AM_CONDITIONAL([BUILD_EBLUEZ],   [test "x${enable_ebluez}"   = "xyes"])
194 AM_CONDITIONAL([BUILD_ECONNMAN0_7X], [test "x${enable_econnman0_7x}" = "xyes"])
195 AM_CONDITIONAL([BUILD_EHAL],     [test "x${enable_ehal}"     = "xyes"])
196 AM_CONDITIONAL([BUILD_ENOTIFY],  [test "x${enable_enotify}"  = "xyes"])
197 AM_CONDITIONAL([BUILD_EOFONO],   [test "x${enable_eofono}"   = "xyes"])
198 AM_CONDITIONAL([BUILD_EUKIT],    [test "x${enable_eukit}"    = "xyes"])
199
200 # Dependencies for the binaries
201
202 EFL_ENABLE_BIN([edbus-test], ["yes"])
203 EFL_ENABLE_BIN([edbus-test-client], ["yes"])
204 EFL_ENABLE_BIN([edbus-bluez-test], [${enable_ebluez}])
205 EFL_ENABLE_BIN([edbus-connman0_7x-test], [${enable_econnman0_7x}])
206 EFL_ENABLE_BIN([edbus-notification-daemon-test], [${enable_enotify}])
207 EFL_ENABLE_BIN([edbus-notify-send], [${enable_enotify}])
208 EFL_ENABLE_BIN([edbus-notify-test], [${enable_enotify}])
209 EFL_ENABLE_BIN([edbus-ofono-test], [${enable_eofono}])
210 EFL_ENABLE_BIN([edbus-ukit-test], [${enable_eukit}])
211 EFL_ENABLE_BIN([edbus-performance-test], ["no"])
212 EFL_ENABLE_BIN([edbus-async-test], ["yes"])
213
214 if test "x${have_edbus_test}" = "xyes" ; then
215    PKG_CHECK_MODULES([EDBUS_TEST],
216       [ecore >= 1.7.9 dbus-1 >= 0.62],
217       [have_edbus_test="yes"],
218       [have_edbus_test="no"])
219 fi
220
221 if test "x${have_edbus_test_client}" = "xyes" ; then
222    PKG_CHECK_MODULES([EDBUS_TEST_CLIENT],
223       [ecore >= 1.7.9 dbus-1 >= 0.62],
224       [have_edbus_test_client="yes"],
225       [have_edbus_test_client="no"])
226 fi
227
228 if test "x${have_edbus_bluez_test}" = "xyes" ; then
229    PKG_CHECK_MODULES([EDBUS_BLUEZ_TEST],
230       [ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
231       [have_edbus_bluez_test="yes"],
232       [have_edbus_bluez_test="no"])
233 fi
234
235 if test "x${have_edbus_connman0_7x_test}" = "xyes" ; then
236    PKG_CHECK_MODULES([EDBUS_CONNMAN0_7X_TEST],
237       [ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
238       [have_edbus_connman0_7x_test="yes"],
239       [have_edbus_connman0_7x_test="no"])
240 fi
241
242 if test "x${have_edbus_notification_daemon_test}" = "xyes" ; then
243    PKG_CHECK_MODULES([EDBUS_NOTIFICATION_DAEMON_TEST],
244       [ecore >= 1.7.9 evas >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
245       [have_edbus_notification_daemon_test="yes"],
246       [have_edbus_notification_daemon_test="no"])
247 fi
248
249 if test "x${have_edbus_notify_send}" = "xyes" ; then
250    PKG_CHECK_MODULES([EDBUS_NOTIFY_SEND],
251       [ecore >= 1.7.9 evas >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
252       [have_edbus_notify_send="yes"],
253       [have_edbus_notify_send="no"])
254 fi
255
256 if test "x${have_edbus_notify_test}" = "xyes" ; then
257    PKG_CHECK_MODULES([EDBUS_NOTIFY_TEST],
258       [ecore >= 1.7.9 ecore-evas >= 1.7.9 evas >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
259       [have_edbus_notify_test="yes"],
260       [have_edbus_notify_test="no"])
261 fi
262
263 if test "x${have_edbus_ofono_test}" = "xyes" ; then
264    PKG_CHECK_MODULES([EDBUS_OFONO_TEST],
265       [ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
266       [have_edbus_ofono_test="yes"],
267       [have_edbus_ofono_test="no"])
268 fi
269
270 if test "x${have_edbus_ukit_test}" = "xyes" ; then
271    PKG_CHECK_MODULES([EDBUS_UKIT_TEST],
272       [ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62],
273       [have_edbus_ukit_test="yes"],
274       [have_edbus_ukit_test="no"])
275 fi
276
277 if test "x${have_edbus_performance_test}" = "xyes" ; then
278    PKG_CHECK_MODULES([EDBUS_PERFORMANCE_TEST],
279       [ecore >= 1.7.9 eina >= 1.7.9 dbus-1 >= 0.62 ecore-evas >= 1.7.9 elementary >= 1.7.9 evas >= 1.7.9],
280       [have_edbus_performance_test="yes"],
281       [have_edbus_performance_test="no"])
282 fi
283
284 AM_CONDITIONAL([BUILD_EDBUS_PERFORMANCE_TEST], [test "x${have_edbus_performance_test}" = "xyes"])
285
286 if test "x${have_edbus_async_test}" = "xyes" ; then
287    PKG_CHECK_MODULES([EDBUS_ASYNC_TEST],
288       [ecore >= 1.7.9 dbus-1 >= 0.62],
289       [have_edbus_async_test="yes"],
290       [have_edbus_async_test="no"])
291 fi
292
293 ### Checks for header files
294
295
296 ### Checks for types
297
298
299 ### Checks for structures
300
301
302 ### Checks for compiler characteristics
303
304 EFL_EDBUS_BUILD=""
305 case "$host_os" in
306    mingw*)
307       EFL_EDBUS_BUILD="-DEFL_EDBUS_BUILD"
308    ;;
309 esac
310 AC_SUBST(EFL_EDBUS_BUILD)
311
312 AC_HEADER_STDC
313 AC_C___ATTRIBUTE__
314
315 if ! test "x${VMIC}" = "x" ; then
316    EFL_COMPILER_FLAG([-Wall])
317    EFL_COMPILER_FLAG([-W])
318 fi
319
320 EFL_COMPILER_FLAG([-Wshadow])
321
322
323 ### Checks for linker characteristics
324
325 lt_enable_auto_import=""
326 case "$host_os" in
327    mingw*)
328       lt_enable_auto_import="-Wl,--enable-auto-import"
329    ;;
330 esac
331 AC_SUBST(lt_enable_auto_import)
332
333
334 ### Checks for library functions
335
336 AC_FUNC_ALLOCA
337
338
339 AC_SUBST(requirement_ebluez)
340 AC_SUBST(requirement_econnman0_7x)
341 AC_SUBST(requirement_edbus)
342 AC_SUBST(requirement_ehal)
343 AC_SUBST(requirement_enotify)
344 AC_SUBST(requirement_eofono)
345 AC_SUBST(requirement_eukit)
346
347 AC_OUTPUT([
348 e_dbus.spec
349 Makefile
350 doc/Makefile
351 doc/Doxyfile
352 src/Makefile
353 src/lib/Makefile
354 src/lib/bluez/Makefile
355 src/lib/connman0_7x/Makefile
356 src/lib/dbus/Makefile
357 src/lib/hal/Makefile
358 src/lib/notification/Makefile
359 src/lib/ofono/Makefile
360 src/lib/ukit/Makefile
361 src/bin/Makefile
362 ebluez.pc
363 econnman-0.7x.pc
364 edbus.pc
365 ehal.pc
366 enotify.pc
367 eofono.pc
368 eukit.pc
369 ])
370
371
372 #####################################################################
373 ## Info
374
375 echo
376 echo
377 echo
378 echo "------------------------------------------------------------------------"
379 echo "$PACKAGE $VERSION"
380 echo "------------------------------------------------------------------------"
381 echo
382 echo "Configuration Options Summary:"
383 echo
384 echo "  Modules:"
385 echo
386 echo "    EBluez.............: $enable_ebluez"
387 echo "    EConnman (0.7x)....: $enable_econnman0_7x"
388 echo "    EHal...............: $enable_ehal"
389 echo "    ENotify............: $enable_enotify"
390 echo "    EOfono.............: $enable_eofono"
391 echo "    EUkit..............: $enable_eukit"
392 echo
393 echo "  Binaries:"
394 echo
395 echo "    EDbus test.........: $have_edbus_test"
396 echo "    EDbus client test..: $have_edbus_test_client"
397 echo "    EDbus async test...: $have_edbus_async_test"
398 echo "    EDbus performance..: $have_edbus_performance_test"
399 echo "    EBluez test........: $have_edbus_bluez_test"
400 echo "    EConnman (0.7x)test: $have_edbus_connman0_7x_test"
401 echo "    ENotify Daemon test: $have_edbus_notification_daemon_test"
402 echo "    ENotify send.......: $have_edbus_notify_send"
403 echo "    ENotify test.......: $have_edbus_notify_test"
404 echo "    EOfono test........: $have_edbus_ofono_test"
405 echo "    EUkit test.........: $have_edbus_ukit_test"
406 echo
407 echo "Documentation..........: ${build_doc}"
408 if test "x${build_doc}" = "xyes" ; then
409 echo "    Installation.......: make install-doc"
410 fi
411 echo
412 echo "Compilation............: make (or gmake)"
413 echo "  CPPFLAGS.............: $CPPFLAGS"
414 echo "  CFLAGS...............: $CFLAGS"
415 echo "  LDFLAGS..............: $LDFLAGS"
416 echo
417 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
418 echo "  prefix...............: $prefix"
419 echo