Fix a crash after changes that velocity is updated before position
[platform/core/location/lbs-location.git] / configure.ac
1 # Initialize
2 AC_PREREQ(2.61)
3 AC_INIT(Location, 0.1, [sena06.kim@samsung.com])
4 AC_CONFIG_AUX_DIR([build-aux])
5 AC_CONFIG_MACRO_DIR([m4])
6 AC_CONFIG_HEADER([config.h])
7 AC_CONFIG_SRCDIR([location])
8 AM_INIT_AUTOMAKE([1.10.2 foreign -Wall -Werror])
9
10 # Check programs for making executable
11 AC_PROG_CC
12 AM_PROG_CC_C_O
13 AC_PROG_INSTALL
14
15 # Check programs for making libraries.
16 AM_PROG_LIBTOOL
17 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
18
19 # Add default build options to CFLAGS, LDFLAGS
20 if test "x$GCC" = "xyes"; then
21         CFLAGS="$CFLAGS -Wall" # -Werror
22         LDFLAGS="$LDFLAGS -Wl,-z,defs -Wl,--as-needed -Wl,--hash-style=both"
23 fi
24
25 # Add -g option to CFLAGS
26 AC_ARG_ENABLE([debug],
27         [AC_HELP_STRING([--enable-debug],[turn on debugging [default=no]])],
28         [case "${enableval}" in
29          yes) enable_dbg=yes ;;
30          no) enable_dbg=no ;;
31          *) AC_MSG_ERROR([Bad value ${enableval} for --enable-debug]) ;;
32        esac],[enable_dbg=no])
33 if ([test "x$enable_dbg" = xyes]); then
34         CFLAGS="$CFLAGS -g"
35 fi
36
37 # Check GCC EFL visibility
38 AC_MSG_CHECKING(for ELF visibility)
39 AC_COMPILE_IFELSE(
40         [AC_LANG_PROGRAM([[
41                 __attribute__((visibility("default")))
42                 int var=10;
43         ]])],
44         [has_visibility=yes
45         AC_DEFINE([EXPORT_API], [__attribute__((visibility("default")))], [Symbol visibility prefix])
46         CFLAGS="$CFLAGS -fvisibility=hidden"],
47         [has_visibility=no
48         AC_DEFINE([EXPORT_API], [], [Symbol visibility prefix]) ]
49 )
50 AC_MSG_RESULT($has_visibility)
51
52 # Check dependencies
53 PKG_CHECK_MODULES(LOCATION, [glib-2.0 gobject-2.0 dbus-glib-1 gmodule-2.0 vconf vconf-internal-keys location-appman])
54 AC_SUBST(LOCATION_LIBS)
55 AC_SUBST(LOCATION_CFLAGS)
56
57 #PKG_CHECK_MODULES(TEST, [glib-2.0 gconf-2.0 json-glib-1.0])
58 #AC_SUBST(TEST_LIBS)
59 #AC_SUBST(TEST_CFLAGS)
60
61 # Check dlog libraries
62 AC_ARG_ENABLE([dlog],
63         [AC_HELP_STRING([--enable-dlog],[show dlog message [default=no]])],
64         [case "${enableval}" in
65          yes) enable_dlog=yes ;;
66          no) enable_dlog=no ;;
67          *) AC_MSG_ERROR([Bad value ${enableval} for --enable-dlog]) ;;
68        esac],[enable_dlog=no])
69 if ([test "x$enable_dlog" = xyes]); then
70         PKG_CHECK_MODULES(DLOG, [dlog], have_dlog="yes", have_dlog="no")
71         AC_SUBST(DLOG_LIBS)
72         AC_SUBST(DLOG_CFLAGS)
73         if test "x$have_dlog" = "xyes"; then
74                 LOCATION_CFLAGS="$LOCATION_CFLAGS -DLOCATION_DLOG_DEBUG $DLOG_CFLAGS"
75                 LOCATION_LIBS="$LOCATION_LIBS $DLOG_LIBS"
76         fi
77 fi
78
79 # Generate files
80 AC_CONFIG_FILES([
81 location.pc
82 Makefile
83 location/Makefile
84 location/manager/Makefile
85 location/map-service/Makefile
86 location/module/Makefile
87 ])
88
89 AC_OUTPUT