[TIVI-2848] Fix tethering configuration.
[profile/ivi/settings-daemon.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.68])
5
6 #todo Update with appropriate license after open-source approval.
7 AC_COPYRIGHT([
8 Copyright 2012, 2013 Intel Corporation All Rights Reserved.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation;
13 version 2.1 of the License.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA  02110-1301  USA
24 ])
25
26 AC_INIT([settingsd], [0.4.2], [ossama.othman@intel.com])
27 AM_INIT_AUTOMAKE([1.11.1 foreign -Wall -Werror -Wno-portability silent-rules])
28 LT_INIT([disable-static dlopen])
29
30 AC_CONFIG_SRCDIR([src/daemon.cpp])
31 AC_CONFIG_HEADERS([lib/config.hpp])
32
33 AC_CONFIG_MACRO_DIR([m4])
34
35 AH_TOP([
36 /**
37  * @file config.hpp
38  *
39  * @brief Tizen IVI Settings Daemon configuration header.
40  *
41  * @copyright @par
42  * Copyright 2013 Intel Corporation All Rights Reserved.
43  * @par
44  * This library is free software; you can redistribute it and/or
45  * modify it under the terms of the GNU Lesser General Public
46  * License as published by the Free Software Foundation;
47  * version 2.1 of the License.
48  * @par
49  * This library is distributed in the hope that it will be useful,
50  * but WITHOUT ANY WARRANTY; without even the implied warranty of
51  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
52  * Lesser General Public License for more details.
53  * @par
54  * You should have received a copy of the GNU Lesser General Public
55  * License along with this library; if not, write to the Free Software
56  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
57  * Boston, MA  02110-1301  USA
58  */
59 ])
60
61 # Checks for programs.
62 AC_PROG_CXX
63 AC_PROG_CC
64 AM_PROG_CC_C_O
65 AM_PROG_AR
66
67 # Check for Doxygen
68 DX_DOXYGEN_FEATURE(ON)
69 DX_DOT_FEATURE(ON)
70 DX_HTML_FEATURE(ON)
71 DX_CHM_FEATURE(OFF)
72 DX_CHI_FEATURE(OFF)
73 DX_MAN_FEATURE(OFF)
74 DX_RTF_FEATURE(OFF)
75 DX_XML_FEATURE(OFF)
76 DX_PDF_FEATURE(OFF)
77 DX_PS_FEATURE(OFF)
78 DX_INIT_DOXYGEN([settingsd], [Doxyfile], [doc/doxygen])
79
80 # Enable pkg-config
81 PKG_PROG_PKG_CONFIG
82
83 # Checks for libraries.
84 # Check for Boost libraries used by settingsd.
85 AX_BOOST_BASE([1.51.0])
86 AX_BOOST_FILESYSTEM
87 AX_BOOST_PROGRAM_OPTIONS
88
89 PKG_CHECK_MODULES([GIO], [gio-unix-2.0])
90 AC_SUBST([GIO_LIBS])
91 AC_SUBST([GIO_CFLAGS])
92
93 PKG_CHECK_MODULES([JSON_GLIB], [json-glib-1.0])
94 AC_SUBST([JSON_GLIB_LIBS])
95 AC_SUBST([JSON_GLIB_CFLAGS])
96
97 PKG_CHECK_MODULES([LIBWEBSOCKETS], [libwebsockets])
98 AC_SUBST([LIBWEBSOCKETS_LIBS])
99 AC_SUBST([LIBWEBSOCKETS_CFLAGS])
100
101 # Checks for header files.
102
103 # Checks for typedefs, structures, and compiler characteristics.
104 # Check for C++11 support.  (macro from autoconf-archive package)
105 AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
106
107 # Enable gcc symbol visibility support.
108 AC_LANG_PUSH([C++])
109 AC_CACHE_CHECK([for g++ symbol visibility support],
110                [settingsd_cv_prog_gcc_symbol_visibility],
111                [
112   AC_COMPILE_IFELSE([
113     AC_LANG_SOURCE([
114 #define FOO_EXPORT __attribute__ ((visibility ("default")))
115 #define FOO_LOCAL  __attribute__ ((visibility ("hidden")))
116
117 class FOO_EXPORT foo
118 {
119 public:
120   foo() : x(0) {}
121   int baz() { return bar(); }
122 private:
123   FOO_LOCAL int bar() { x += 10; return x; }
124 private:
125   int x;
126 };
127
128 extern "C" FOO_EXPORT int snafu() { foo tmp; return tmp.baz(); }
129     ])
130   ],
131   [settingsd_cv_prog_gcc_symbol_visibility=yes],
132   [settingsd_cv_prog_gcc_symbol_visibility=no])
133 ])
134 AC_LANG_POP([C++])
135
136 AM_CONDITIONAL([SETTINGS_USE_GCC_SYMBOL_VISIBILITY],
137                [test "x$settingsd_cv_prog_gcc_symbol_visibility" = "xyes"])
138
139
140 # Checks for library functions.
141
142 # Rather than check dlopen() again, just leverage values cached during
143 # LT_INIT().  This isn't a bit brittle since the cache variable name
144 # could potentially change.
145 AC_SUBST([IVI_SETTINGS_DLOPEN_LIBS],[$lt_cv_dlopen_libs])
146
147 # Do not use old Boost.filesystem features and functions.
148 AC_DEFINE([BOOST_FILESYSTEM_NO_DEPRECATED],
149           [],
150           [Do not use old Boost.filesystem features and functions.])
151
152 # IVI settingsd D-Bus name
153 IVI_SETTINGS_DBUS_NAME="org.tizen.$PACKAGE"
154 AC_SUBST([IVI_SETTINGS_DBUS_NAME],[$IVI_SETTINGS_DBUS_NAME])
155 AC_DEFINE_UNQUOTED([IVI_SETTINGS_DBUS_NAME],
156                    ["$IVI_SETTINGS_DBUS_NAME"],
157                    [The IVI settingsd D-Bus name.])
158
159 # Default IVI settingsd web socket server port
160 IVI_SETTINGS_DEFAULT_WEBSOCKET_PORT=16000
161 AC_SUBST([websocketport],
162          [$IVI_SETTINGS_DEFAULT_WEBSOCKET_PORT])
163 AC_DEFINE_UNQUOTED([IVI_SETTINGS_DEFAULT_WEBSOCKET_PORT],
164                    [$IVI_SETTINGS_DEFAULT_WEBSOCKET_PORT],
165                    [The default TCP/IP port on which the web socket
166                     server should listen.])
167
168 # Enable C++ compiler warnings if we're using gcc.  We do this after
169 # all autoconf tests have been run since not all autoconf macros are
170 # warning free.
171 IVI_SETTINGS_WARNING_FLAGS="-Wextra -Wall -Werror -Wformat=2 -pedantic"
172 AS_IF([test "x$GCC" = "xyes"],
173       [CXXFLAGS="$IVI_SETTINGS_WARNING_FLAGS $CXXFLAGS"],
174       [])
175
176 # Specify which files are to be generated by the `configure' script.
177 AC_CONFIG_FILES([
178   Makefile
179   doc/Makefile
180   etc/Makefile
181   include/Makefile
182   include/settingsd/Makefile
183   lib/Makefile
184   plugins/Makefile
185   plugins/connman/Makefile
186   src/Makefile
187   tests/Makefile
188 ])
189
190 AC_OUTPUT