fix: support automake 1.14
[platform/core/location/libslp-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 subdir-objects])
9
10 # Check programs for making executable
11 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 AC_PROG_INSTALL
15
16 # Check programs for making libraries.
17 AM_PROG_LIBTOOL
18 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
19
20 # Add default build options to CFLAGS, LDFLAGS
21 if test "x$GCC" = "xyes"; then
22         CFLAGS="$CFLAGS -Wall" # -Werror
23         LDFLAGS="$LDFLAGS -Wl,-z,defs -Wl,--as-needed -Wl,--hash-style=both"
24 fi
25
26 # Add -g option to CFLAGS
27 AC_ARG_ENABLE([debug],
28         [AC_HELP_STRING([--enable-debug],[turn on debugging [default=no]])],
29         [case "${enableval}" in
30          yes) enable_dbg=yes ;;
31          no) enable_dbg=no ;;
32          *) AC_MSG_ERROR([Bad value ${enableval} for --enable-debug]) ;;
33        esac],[enable_dbg=no])
34 if ([test "x$enable_dbg" = xyes]); then
35         CFLAGS="$CFLAGS -g"
36 fi
37
38 # Check GCC EFL visibility
39 AC_MSG_CHECKING(for ELF visibility)
40 AC_COMPILE_IFELSE(
41         [AC_LANG_PROGRAM([[
42                 __attribute__((visibility("default")))
43                 int var=10;
44         ]])],
45         [has_visibility=yes
46         AC_DEFINE([EXPORT_API], [__attribute__((visibility("default")))], [Symbol visibility prefix])
47         CFLAGS="$CFLAGS -fvisibility=hidden"],
48         [has_visibility=no
49         AC_DEFINE([EXPORT_API], [], [Symbol visibility prefix]) ]
50 )
51 AC_MSG_RESULT($has_visibility)
52
53 # Check dependencies
54 PKG_CHECK_MODULES(LOCATION, [glib-2.0 gobject-2.0 dbus-glib-1 gmodule-2.0 vconf vconf-internal-keys])
55 AC_SUBST(LOCATION_LIBS)
56 AC_SUBST(LOCATION_CFLAGS)
57
58 #PKG_CHECK_MODULES(TEST, [glib-2.0 gconf-2.0 json-glib-1.0])
59 #AC_SUBST(TEST_LIBS)
60 #AC_SUBST(TEST_CFLAGS)
61
62 # Check dlog libraries
63 AC_ARG_ENABLE([dlog],
64         [AC_HELP_STRING([--enable-dlog],[show dlog message [default=no]])],
65         [case "${enableval}" in
66          yes) enable_dlog=yes ;;
67          no) enable_dlog=no ;;
68          *) AC_MSG_ERROR([Bad value ${enableval} for --enable-dlog]) ;;
69        esac],[enable_dlog=no])
70 if ([test "x$enable_dlog" = xyes]); then
71         PKG_CHECK_MODULES(DLOG, [dlog], have_dlog="yes", have_dlog="no")
72         AC_SUBST(DLOG_LIBS)
73         AC_SUBST(DLOG_CFLAGS)
74         if test "x$have_dlog" = "xyes"; then
75                 LOCATION_CFLAGS="$LOCATION_CFLAGS -DLOCATION_DLOG_DEBUG $DLOG_CFLAGS"
76                 LOCATION_LIBS="$LOCATION_LIBS $DLOG_LIBS"
77         fi
78 fi
79 LOCATION_CFLAGS="$LOCATION_CFLAGS -DLIBPATH=\\\"$libdir\\\""
80 # Generate files
81 AC_CONFIG_FILES([
82 location.pc
83 Makefile
84 location/Makefile
85 location/manager/Makefile
86 location/map-service/Makefile
87 location/module/Makefile
88 ])
89
90 AC_OUTPUT