Imported Upstream version 1.7.2
[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], [2])
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.6.99"
85 requirement_econnman0_7x="edbus >= 1.6.99"
86 requirement_edbus="ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62"
87 requirement_ehal="edbus >= 1.6.99"
88 requirement_enotify="edbus >= 1.6.99"
89 requirement_eofono="edbus >= 1.6.99"
90 requirement_eukit="edbus >= 1.6.99"
91 requirement_dbus="dbus-1 >= 0.62"
92
93 ### Additional options to configure
94
95 dnl Check enabled modules to build
96
97 AC_ARG_ENABLE([ebluez],
98    [AC_HELP_STRING([--enable-ebluez], [Enable ebluez build])],
99    [enable_ebluez=$enableval],
100    [enable_ebluez="${want_ebluez}"])
101
102 AC_ARG_ENABLE([econnman0_7x],
103    [AC_HELP_STRING([--enable-econnman0_7x], [Enable econnman 0.7x build])],
104    [enable_econnman0_7x=$enableval],
105    [enable_econnman0_7x="${want_econnman0_7x}"])
106
107 AC_ARG_ENABLE([ehal],
108    [AC_HELP_STRING([--disable-ehal], [Disable ehal build])],
109    [enable_ehal=$enableval],
110    [enable_ehal="${want_ehal}"])
111
112 AC_ARG_ENABLE([enotify],
113    [AC_HELP_STRING([--disable-enotify], [Disable enotify build])],
114    [enable_enotify=$enableval],
115    [enable_enotify="${want_enotify}"])
116
117 AC_ARG_ENABLE([eofono],
118    [AC_HELP_STRING([--enable-eofono], [Enable eofono build])],
119    [enable_eofono=$enableval],
120    [enable_eofono="${want_eofono}"])
121
122 AC_ARG_ENABLE([eukit],
123    [AC_HELP_STRING([--disable-eukit], [Disable eukit build])],
124    [enable_eukit=$enableval],
125    [enable_eukit="${want_eukit}"])
126
127 ### Checks for programs
128
129 AC_PROG_CC
130 AM_PROG_CC_C_O
131
132 # pkg-config
133 PKG_PROG_PKG_CONFIG
134
135 # Check whether pkg-config supports Requires.private
136 if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
137    pkgconfig_requires_private="Requires.private"
138 else
139    pkgconfig_requires_private="Requires"
140 fi
141 AC_SUBST(pkgconfig_requires_private)
142
143 # doxygen program for documentation building
144 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
145
146
147 ### Checks for libraries
148
149 PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.62])
150 dbus_libs="$DBUS_LIBS"
151 dbus_cflags="$DBUS_CFLAGS"
152 AC_SUBST(dbus_libs)
153 AC_SUBST(dbus_cflags)
154 PKG_CHECK_MODULES([EDBUS], [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62])
155
156 # Find out the version of DBUS we're using
157 dbus_version=`pkg-config --modversion dbus-1`
158 DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
159 DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
160 DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
161
162 if test "z$DBUS_VERSION_MAJOR" = "z" ; then
163    DBUS_VERSION_MAJOR="0"
164 fi
165
166 if test "z$DBUS_VERSION_MINOR" = "z" ; then
167    DBUS_VERSION_MINOR="0"
168 fi
169
170 if test "z$DBUS_VERSION_MICRO" = "z" ; then
171    DBUS_VERSION_MICRO="0"
172 fi
173
174 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
175 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
176 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
177 AC_SUBST(DBUS_VERSION_CFLAGS)
178
179 # Dependencies for the libraries
180 if test "x${enable_enotify}" = "xyes" ; then
181    PKG_CHECK_MODULES([EVAS],
182       [evas >= 1.6.99],
183       [requirement_enotify="evas >= 1.6.99 ${requirement_enotify}"],
184       [enable_enotify="no"])
185 fi
186
187 AM_CONDITIONAL([BUILD_EBLUEZ],   [test "x${enable_ebluez}"   = "xyes"])
188 AM_CONDITIONAL([BUILD_ECONNMAN0_7X], [test "x${enable_econnman0_7x}" = "xyes"])
189 AM_CONDITIONAL([BUILD_EHAL],     [test "x${enable_ehal}"     = "xyes"])
190 AM_CONDITIONAL([BUILD_ENOTIFY],  [test "x${enable_enotify}"  = "xyes"])
191 AM_CONDITIONAL([BUILD_EOFONO],   [test "x${enable_eofono}"   = "xyes"])
192 AM_CONDITIONAL([BUILD_EUKIT],    [test "x${enable_eukit}"    = "xyes"])
193
194 # Dependencies for the binaries
195
196 EFL_ENABLE_BIN([edbus-test], ["yes"])
197 EFL_ENABLE_BIN([edbus-test-client], ["yes"])
198 EFL_ENABLE_BIN([edbus-bluez-test], [${enable_ebluez}])
199 EFL_ENABLE_BIN([edbus-connman0_7x-test], [${enable_econnman0_7x}])
200 EFL_ENABLE_BIN([edbus-notification-daemon-test], [${enable_enotify}])
201 EFL_ENABLE_BIN([edbus-notify-send], [${enable_enotify}])
202 EFL_ENABLE_BIN([edbus-notify-test], [${enable_enotify}])
203 EFL_ENABLE_BIN([edbus-ofono-test], [${enable_eofono}])
204 EFL_ENABLE_BIN([edbus-ukit-test], [${enable_eukit}])
205 EFL_ENABLE_BIN([edbus-performance-test], ["no"])
206 EFL_ENABLE_BIN([edbus-async-test], ["yes"])
207
208 if test "x${have_edbus_test}" = "xyes" ; then
209    PKG_CHECK_MODULES([EDBUS_TEST],
210       [ecore >= 1.6.99 dbus-1 >= 0.62],
211       [have_edbus_test="yes"],
212       [have_edbus_test="no"])
213 fi
214
215 if test "x${have_edbus_test_client}" = "xyes" ; then
216    PKG_CHECK_MODULES([EDBUS_TEST_CLIENT],
217       [ecore >= 1.6.99 dbus-1 >= 0.62],
218       [have_edbus_test_client="yes"],
219       [have_edbus_test_client="no"])
220 fi
221
222 if test "x${have_edbus_bluez_test}" = "xyes" ; then
223    PKG_CHECK_MODULES([EDBUS_BLUEZ_TEST],
224       [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
225       [have_edbus_bluez_test="yes"],
226       [have_edbus_bluez_test="no"])
227 fi
228
229 if test "x${have_edbus_connman0_7x_test}" = "xyes" ; then
230    PKG_CHECK_MODULES([EDBUS_CONNMAN0_7X_TEST],
231       [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
232       [have_edbus_connman0_7x_test="yes"],
233       [have_edbus_connman0_7x_test="no"])
234 fi
235
236 if test "x${have_edbus_notification_daemon_test}" = "xyes" ; then
237    PKG_CHECK_MODULES([EDBUS_NOTIFICATION_DAEMON_TEST],
238       [ecore >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
239       [have_edbus_notification_daemon_test="yes"],
240       [have_edbus_notification_daemon_test="no"])
241 fi
242
243 if test "x${have_edbus_notify_send}" = "xyes" ; then
244    PKG_CHECK_MODULES([EDBUS_NOTIFY_SEND],
245       [ecore >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
246       [have_edbus_notify_send="yes"],
247       [have_edbus_notify_send="no"])
248 fi
249
250 if test "x${have_edbus_notify_test}" = "xyes" ; then
251    PKG_CHECK_MODULES([EDBUS_NOTIFY_TEST],
252       [ecore >= 1.6.99 ecore-evas >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
253       [have_edbus_notify_test="yes"],
254       [have_edbus_notify_test="no"])
255 fi
256
257 if test "x${have_edbus_ofono_test}" = "xyes" ; then
258    PKG_CHECK_MODULES([EDBUS_OFONO_TEST],
259       [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
260       [have_edbus_ofono_test="yes"],
261       [have_edbus_ofono_test="no"])
262 fi
263
264 if test "x${have_edbus_ukit_test}" = "xyes" ; then
265    PKG_CHECK_MODULES([EDBUS_UKIT_TEST],
266       [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62],
267       [have_edbus_ukit_test="yes"],
268       [have_edbus_ukit_test="no"])
269 fi
270
271 if test "x${have_edbus_performance_test}" = "xyes" ; then
272    PKG_CHECK_MODULES([EDBUS_PERFORMANCE_TEST],
273       [ecore >= 1.6.99 eina >= 1.6.99 dbus-1 >= 0.62 ecore-evas >= 1.6.99 elementary >= 1.6.99 evas >= 1.6.99],
274       [have_edbus_performance_test="yes"],
275       [have_edbus_performance_test="no"])
276 fi
277
278 AM_CONDITIONAL([BUILD_EDBUS_PERFORMANCE_TEST], [test "x${have_edbus_performance_test}" = "xyes"])
279
280 if test "x${have_edbus_async_test}" = "xyes" ; then
281    PKG_CHECK_MODULES([EDBUS_ASYNC_TEST],
282       [ecore >= 1.6.99 dbus-1 >= 0.62],
283       [have_edbus_async_test="yes"],
284       [have_edbus_async_test="no"])
285 fi
286
287 ### Checks for header files
288
289
290 ### Checks for types
291
292
293 ### Checks for structures
294
295
296 ### Checks for compiler characteristics
297
298 EFL_EDBUS_BUILD=""
299 case "$host_os" in
300    mingw*)
301       EFL_EDBUS_BUILD="-DEFL_EDBUS_BUILD"
302    ;;
303 esac
304 AC_SUBST(EFL_EDBUS_BUILD)
305
306 AC_HEADER_STDC
307 AC_C___ATTRIBUTE__
308
309 if ! test "x${VMIC}" = "x" ; then
310    EFL_COMPILER_FLAG([-Wall])
311    EFL_COMPILER_FLAG([-W])
312 fi
313
314 EFL_COMPILER_FLAG([-Wshadow])
315
316
317 ### Checks for linker characteristics
318
319 lt_enable_auto_import=""
320 case "$host_os" in
321    mingw*)
322       lt_enable_auto_import="-Wl,--enable-auto-import"
323    ;;
324 esac
325 AC_SUBST(lt_enable_auto_import)
326
327
328 ### Checks for library functions
329
330 AC_FUNC_ALLOCA
331
332
333 AC_SUBST(requirement_ebluez)
334 AC_SUBST(requirement_econnman0_7x)
335 AC_SUBST(requirement_edbus)
336 AC_SUBST(requirement_ehal)
337 AC_SUBST(requirement_enotify)
338 AC_SUBST(requirement_eofono)
339 AC_SUBST(requirement_eukit)
340 AC_SUBST(requirement_dbus)
341
342 AC_OUTPUT([
343 e_dbus.spec
344 Makefile
345 doc/Makefile
346 doc/Doxyfile
347 src/Makefile
348 src/lib/Makefile
349 src/lib/bluez/Makefile
350 src/lib/connman0_7x/Makefile
351 src/lib/dbus/Makefile
352 src/lib/hal/Makefile
353 src/lib/notification/Makefile
354 src/lib/ofono/Makefile
355 src/lib/ukit/Makefile
356 src/bin/Makefile
357 ebluez.pc
358 econnman-0.7x.pc
359 edbus.pc
360 ehal.pc
361 enotify.pc
362 eofono.pc
363 eukit.pc
364 ])
365
366
367 #####################################################################
368 ## Info
369
370 echo
371 echo
372 echo
373 echo "------------------------------------------------------------------------"
374 echo "$PACKAGE $VERSION"
375 echo "------------------------------------------------------------------------"
376 echo
377 echo "Configuration Options Summary:"
378 echo
379 echo "  Modules:"
380 echo
381 echo "    EBluez.............: $enable_ebluez"
382 echo "    EConnman (0.7x)....: $enable_econnman0_7x"
383 echo "    EHal...............: $enable_ehal"
384 echo "    ENotify............: $enable_enotify"
385 echo "    EOfono.............: $enable_eofono"
386 echo "    EUkit..............: $enable_eukit"
387 echo
388 echo "  Binaries:"
389 echo
390 echo "    EDbus test.........: $have_edbus_test"
391 echo "    EDbus client test..: $have_edbus_test_client"
392 echo "    EDbus async test...: $have_edbus_async_test"
393 echo "    EDbus performance..: $have_edbus_performance_test"
394 echo "    EBluez test........: $have_edbus_bluez_test"
395 echo "    EConnman (0.7x)test: $have_edbus_connman0_7x_test"
396 echo "    ENotify Daemon test: $have_edbus_notification_daemon_test"
397 echo "    ENotify send.......: $have_edbus_notify_send"
398 echo "    ENotify test.......: $have_edbus_notify_test"
399 echo "    EOfono test........: $have_edbus_ofono_test"
400 echo "    EUkit test.........: $have_edbus_ukit_test"
401 echo
402 echo "Documentation..........: ${build_doc}"
403 echo
404 echo "Compilation............: make (or gmake)"
405 echo "  CPPFLAGS.............: $CPPFLAGS"
406 echo "  CFLAGS...............: $CFLAGS"
407 echo "  LDFLAGS..............: $LDFLAGS"
408 echo
409 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
410 echo "  prefix...............: $prefix"
411 echo