svn goes to x.x.999.svnrev now. :)
[framework/uifw/edbus.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [0])
5 m4_define([v_mic], [999])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v exported || 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 dnl 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_rev], m4_eval(v_maj + v_min))
17 m4_define([lt_cur], 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_rev:lt_cur: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_econnman="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_econnman="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.0.0"
85 requirement_econnman="edbus >= 1.0.0"
86 requirement_edbus="ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62"
87 requirement_ehal="edbus >= 1.0.0"
88 requirement_enotify="edbus >= 1.0.0"
89 requirement_eofono="edbus >= 1.0.0"
90 requirement_eukit="edbus >= 1.0.0"
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([econnman],
103    [AC_HELP_STRING([--enable-econnman], [Enable econnman build])],
104    [enable_econnman=$enableval],
105    [enable_econnman="${want_econnman}"])
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
128 ### Checks for programs
129
130 AC_PROG_CC
131 AM_PROG_CC_C_O
132
133 # pkg-config
134 PKG_PROG_PKG_CONFIG
135
136 # Check whether pkg-config supports Requires.private
137 if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
138    pkgconfig_requires_private="Requires.private"
139 else
140    pkgconfig_requires_private="Requires"
141 fi
142 AC_SUBST(pkgconfig_requires_private)
143
144 # doxygen program for documentation building
145 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
146
147
148 ### Checks for libraries
149
150 PKG_CHECK_MODULES([EDBUS], [ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62])
151
152 # Find out the version of DBUS we're using
153 dbus_version=`pkg-config --modversion dbus-1`
154 DBUS_VERSION_MAJOR=`echo $dbus_version | awk -F. '{print $1}'`
155 DBUS_VERSION_MINOR=`echo $dbus_version | awk -F. '{print $2}'`
156 DBUS_VERSION_MICRO=`echo $dbus_version | awk -F. '{print $3}'`
157
158 if test "z$DBUS_VERSION_MAJOR" = "z" ; then
159    DBUS_VERSION_MAJOR="0"
160 fi
161
162 if test "z$DBUS_VERSION_MINOR" = "z" ; then
163    DBUS_VERSION_MINOR="0"
164 fi
165
166 if test "z$DBUS_VERSION_MICRO" = "z" ; then
167    DBUS_VERSION_MICRO="0"
168 fi
169
170 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MAJOR=$DBUS_VERSION_MAJOR"
171 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MINOR=$DBUS_VERSION_MINOR"
172 DBUS_VERSION_CFLAGS="$DBUS_VERSION_CFLAGS -DDBUS_VERSION_MICRO=$DBUS_VERSION_MICRO"
173 AC_SUBST(DBUS_VERSION_CFLAGS)
174
175 # Dependencies for the libraries
176 if test "x${enable_enotify}" = "xyes" ; then
177    PKG_CHECK_MODULES([EVAS],
178       [evas >= 1.0.0],
179       [requirement_enotify="evas >= 1.0.0 ${requirement_enotify}"],
180       [enable_enotify="no"])
181 fi
182
183 AM_CONDITIONAL([BUILD_EBLUEZ],   [test "x${enable_ebluez}"   = "xyes"])
184 AM_CONDITIONAL([BUILD_ECONNMAN], [test "x${enable_econnman}" = "xyes"])
185 AM_CONDITIONAL([BUILD_EHAL],     [test "x${enable_ehal}"     = "xyes"])
186 AM_CONDITIONAL([BUILD_ENOTIFY],  [test "x${enable_enotify}"  = "xyes"])
187 AM_CONDITIONAL([BUILD_EOFONO],   [test "x${enable_eofono}"   = "xyes"])
188 AM_CONDITIONAL([BUILD_EUKIT],    [test "x${enable_eukit}"    = "xyes"])
189
190 # Dependencies for the binaries
191
192 EFL_ENABLE_BIN([edbus-test], ["yes"])
193 EFL_ENABLE_BIN([edbus-test-client], ["yes"])
194 EFL_ENABLE_BIN([edbus-bluez-test], [${enable_ebluez}])
195 EFL_ENABLE_BIN([edbus-connman-test], [${enable_econnman}])
196 EFL_ENABLE_BIN([edbus-notification-daemon-test], [${enable_enotify}])
197 EFL_ENABLE_BIN([edbus-notify-send], [${enable_enotify}])
198 EFL_ENABLE_BIN([edbus-notify-test], [${enable_enotify}])
199 EFL_ENABLE_BIN([edbus-ofono-test], [${enable_eofono}])
200 EFL_ENABLE_BIN([edbus-ukit-test], [${enable_eukit}])
201
202 if test "x${have_edbus_test}" = "xyes" ; then
203    PKG_CHECK_MODULES([EDBUS_TEST],
204       [ecore >= 1.0.0 dbus-1 >= 0.62],
205       [have_edbus_test="yes"],
206       [have_edbus_test="no"])
207 fi
208
209 if test "x${have_edbus_test_client}" = "xyes" ; then
210    PKG_CHECK_MODULES([EDBUS_TEST_CLIENT],
211       [ecore >= 1.0.0 dbus-1 >= 0.62],
212       [have_edbus_test_client="yes"],
213       [have_edbus_test_client="no"])
214 fi
215
216 if test "x${have_edbus_bluez_test}" = "xyes" ; then
217    PKG_CHECK_MODULES([EDBUS_BLUEZ_TEST],
218       [ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62],
219       [have_edbus_bluez_test="yes"],
220       [have_edbus_bluez_test="no"])
221 fi
222
223 if test "x${have_edbus_connman_test}" = "xyes" ; then
224    PKG_CHECK_MODULES([EDBUS_CONNMAN_TEST],
225       [ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62],
226       [have_edbus_connman_test="yes"],
227       [have_edbus_connman_test="no"])
228 fi
229
230 if test "x${have_edbus_notification_daemon_test}" = "xyes" ; then
231    PKG_CHECK_MODULES([EDBUS_NOTIFICATION_DAEMON_TEST],
232       [ecore >= 1.0.0 evas >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62],
233       [have_edbus_notification_daemon_test="yes"],
234       [have_edbus_notification_daemon_test="no"])
235 fi
236
237 if test "x${have_edbus_notify_send}" = "xyes" ; then
238    PKG_CHECK_MODULES([EDBUS_NOTIFY_SEND],
239       [ecore >= 1.0.0 evas >= 1.0.0 dbus-1 >= 0.62],
240       [have_edbus_notify_send="yes"],
241       [have_edbus_notify_send="no"])
242 fi
243
244 if test "x${have_edbus_notify_test}" = "xyes" ; then
245    PKG_CHECK_MODULES([EDBUS_NOTIFY_TEST],
246       [ecore >= 1.0.0 evas >= 1.0.0 dbus-1 >= 0.62],
247       [have_edbus_notify_test="yes"],
248       [have_edbus_notify_test="no"])
249 fi
250
251 if test "x${have_edbus_ofono_test}" = "xyes" ; then
252    PKG_CHECK_MODULES([EDBUS_OFONO_TEST],
253       [ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62],
254       [have_edbus_ofono_test="yes"],
255       [have_edbus_ofono_test="no"])
256 fi
257
258 if test "x${have_edbus_ukit_test}" = "xyes" ; then
259    PKG_CHECK_MODULES([EDBUS_UKIT_TEST],
260       [ecore >= 1.0.0 eina >= 1.0.0 dbus-1 >= 0.62],
261       [have_edbus_ukit_test="yes"],
262       [have_edbus_ukit_test="no"])
263 fi
264
265
266 ### Checks for header files
267
268
269 ### Checks for types
270
271
272 ### Checks for structures
273
274
275 ### Checks for compiler characteristics
276
277 EFL_EDBUS_BUILD=""
278 case "$host_os" in
279    mingw*)
280       EFL_EDBUS_BUILD="-DEFL_EDBUS_BUILD"
281    ;;
282 esac
283 AC_SUBST(EFL_EDBUS_BUILD)
284
285 AC_HEADER_STDC
286 AC_C___ATTRIBUTE__
287
288 if ! test "x${VMIC}" = "x" ; then
289    EFL_COMPILER_FLAG([-Wall])
290    EFL_COMPILER_FLAG([-W])
291 fi
292
293 EFL_COMPILER_FLAG([-Wshadow])
294
295
296 ### Checks for linker characteristics
297
298 lt_enable_auto_import=""
299 case "$host_os" in
300    mingw*)
301       lt_enable_auto_import="-Wl,--enable-auto-import"
302    ;;
303 esac
304 AC_SUBST(lt_enable_auto_import)
305
306
307 ### Checks for library functions
308
309 AC_FUNC_ALLOCA
310
311
312 AC_SUBST(requirement_ebluez)
313 AC_SUBST(requirement_econnman)
314 AC_SUBST(requirement_edbus)
315 AC_SUBST(requirement_ehal)
316 AC_SUBST(requirement_enotify)
317 AC_SUBST(requirement_eofono)
318 AC_SUBST(requirement_eukit)
319 AC_SUBST(requirement_dbus)
320
321 AC_OUTPUT([
322 e_dbus.spec
323 Makefile
324 doc/Makefile
325 src/Makefile
326 src/lib/Makefile
327 src/lib/bluez/Makefile
328 src/lib/connman/Makefile
329 src/lib/dbus/Makefile
330 src/lib/hal/Makefile
331 src/lib/notification/Makefile
332 src/lib/ofono/Makefile
333 src/lib/ukit/Makefile
334 src/bin/Makefile
335 ebluez.pc
336 econnman.pc
337 edbus.pc
338 ehal.pc
339 enotify.pc
340 eofono.pc
341 eukit.pc
342 ])
343
344
345 #####################################################################
346 ## Info
347
348 echo
349 echo
350 echo
351 echo "------------------------------------------------------------------------"
352 echo "$PACKAGE $VERSION"
353 echo "------------------------------------------------------------------------"
354 echo
355 echo "Configuration Options Summary:"
356 echo
357 echo "  Modules:"
358 echo
359 echo "    EBluez.............: $enable_ebluez"
360 echo "    EConnman...........: $enable_econnman"
361 echo "    EHal...............: $enable_ehal"
362 echo "    ENotify............: $enable_enotify"
363 echo "    EOfono.............: $enable_eofono"
364 echo "    EUkit..............: $enable_eukit"
365 echo
366 echo "  Binaries:"
367 echo
368 echo "    EDbus test.........: $have_edbus_test"
369 echo "    EDbus client test..: $have_edbus_test_client"
370 echo "    EBluez test........: $have_edbus_bluez_test"
371 echo "    EConnman test......: $have_edbus_connman_test"
372 echo "    ENotify Daemon test: $have_edbus_notification_daemon_test"
373 echo "    ENotify send.......: $have_edbus_notify_send"
374 echo "    ENotify test.......: $have_edbus_notify_test"
375 echo "    EOfono test........: $have_edbus_ofono_test"
376 echo "    EUkit test.........: $have_edbus_ukit_test"
377 echo
378 echo "Documentation..........: ${build_doc}"
379 echo
380 echo "Compilation............: make (or gmake)"
381 echo "  CPPFLAGS.............: $CPPFLAGS"
382 echo "  CFLAGS...............: $CFLAGS"
383 echo "  LDFLAGS..............: $LDFLAGS"
384 echo
385 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
386 echo "  prefix...............: $prefix"
387 echo