Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-adaptor.git] / build / tizen / configure.ac
1 #
2 # Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 m4_define([dali_version],[0.1.0])
18 AC_INIT([dali], [dali_version])
19 AM_INIT_AUTOMAKE([-Wall foreign])
20
21 AC_CONFIG_MACRO_DIR([m4])
22
23 AC_PROG_CXX
24 AC_PROG_LIBTOOL
25 AC_PROG_MKDIR_P
26
27 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
28
29 LT_INIT
30
31 DALI_ADAPTOR_VERSION=dali_version
32 AC_SUBST(DALI_ADAPTOR_VERSION)
33
34 FREETYPE_REQUIRED=9.16.3
35
36 PKG_CHECK_MODULES(DALICORE, dali-core)
37 PKG_CHECK_MODULES(ELEMENTARY, elementary)
38 PKG_CHECK_MODULES(ECORE, ecore)
39 PKG_CHECK_MODULES(ECORE_IPC, ecore-ipc)
40 PKG_CHECK_MODULES(EXIF, libexif)
41 PKG_CHECK_MODULES(FREETYPE, [freetype2 >= $FREETYPE_REQUIRED])
42 PKG_CHECK_MODULES(FONTCONFIG, fontconfig)
43 PKG_CHECK_MODULES(PNG, libpng)
44 PKG_CHECK_MODULES(XML, libxml-2.0)
45 PKG_CHECK_MODULES(LIBEXIF, libexif)
46 PKG_CHECK_MODULES(LIBDRM, libdrm)
47 PKG_CHECK_MODULES(LIBCURL, libcurl)
48 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz)
49 PKG_CHECK_MODULES(FRIBIDI, fribidi)
50
51 # Check for availability of BulletPhysics
52 PKG_CHECK_EXISTS(bullet, [
53   BULLET_CFLAGS=`pkg-config --cflags bullet`
54   BULLET_LIBS=`pkg-config --libs bullet`
55   BULLET=yes
56 ], [
57   AC_MSG_WARN([BulletPhysics development files not found, not building bullet plugin])
58   BULLET_CFLAGS=
59   BULLET_LIBS=
60   BULLET=no
61 ])
62
63 AC_SUBST(BULLET_CFLAGS)
64 AC_SUBST(BULLET_LIBS)
65
66 AC_ARG_ENABLE([bullet],
67               [AC_HELP_STRING([ --enable-bullet],
68                               [Enable bullet plugin])],
69               [enable_bullet=yes],
70               [enable_bullet=no])
71
72
73 AC_ARG_ENABLE([feedback],
74               [AC_HELP_STRING([ --enable-feedback],
75                               [Enable feedback plugin])],
76               [enable_feedback=yes],
77               [enable_feedback=no])
78
79 AM_CONDITIONAL([USE_BULLET], [test x$BULLET = xyes && test x$enable_bullet = xyes])
80 AM_CONDITIONAL([USE_FEEDBACK], [test x$enable_feedback = xyes])
81
82 DALI_ADAPTOR_CFLAGS=-DPLATFORM_SLP
83
84 AC_ARG_ENABLE(exportall,
85               [AC_HELP_STRING([--enable-exportall],
86                               [enables the exporting of all the symbols in the library])],
87               [enable_exportall=yes],
88               [enable_exportall=no])
89
90 AC_ARG_ENABLE([debug],
91               [AC_HELP_STRING([--enable-debug],
92                               [Turns on debugging])],
93               [enable_debug=$enableval],
94               [enable_debug=no])
95
96 if test "x$enable_debug" = "xyes"; then
97   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED"
98 fi
99
100 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
101   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
102 fi
103
104 AC_ARG_ENABLE([assimp],
105               [AC_HELP_STRING([--enable-assimp],
106                               [Enable assimp plugin, overriding platform defaults])],
107               [enable_assimp=yes],
108               [enable_assimp=no])
109
110 AC_ARG_ENABLE([gles],
111               [AC_HELP_STRING([--enable-gles],
112                               [Specify the OpenGL ES version for backwards compatibility])],
113               [enable_gles=$enableval],
114               [enable_gles=30])
115
116 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
117
118 AC_ARG_WITH([jpeg-turbo],
119             [AC_HELP_STRING([--with-jpeg-turbo],
120                             [Use the JPEG Turbo library])],
121             [with_jpeg_turbo=$withval],
122             [with_jpeg_turbo=yes])
123
124 AM_CONDITIONAL(TURBO_JPEG_IS_ON, test $with_jpeg_turbo = yes)
125
126 # Tizen Profile options
127 AC_ARG_ENABLE([profile],
128               [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,LITE,WEARABLE,TV,UBUNTU],
129                             [Select the variant of tizen])],
130               [enable_profile=$enableval],
131               [enable_profile=COMMON])
132
133 # Ensure valid profile selected
134 if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xLITE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
135   AC_MSG_ERROR([$enable_profile is an invalid profile])
136 fi
137
138 AC_ARG_ENABLE(wayland,
139               [  --enable-wayland       Build on Wayland],
140               enable_wayland=yes,
141               enable_wayland=no)
142
143 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}"
144 DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}"
145 AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
146 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
147 AM_CONDITIONAL([LITE_PROFILE], [test x$enable_profile = xLITE])
148 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
149 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
150 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
151 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
152
153 # Platforms should either enable features or remove them, they
154 # should not disable features. This allows the developer to override
155 # features through the command line.
156
157 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
158
159 if test "x$enable_profile" != "xUBUNTU"; then
160 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
161 PKG_CHECK_MODULES(DLOG, dlog)
162 PKG_CHECK_MODULES(SENSOR, sensor)
163 PKG_CHECK_MODULES(TTS, tts)
164 PKG_CHECK_MODULES(VCONF, vconf)
165 PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
166 fi
167
168 if test "x$enable_wayland" = "xyes"; then
169 PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon],
170                   [DALI_HAS_ECOREWL=yes],
171                   [DALI_HAS_ECOREWL=no])
172 else
173 PKG_CHECK_MODULES(ECORE_X, [ecore-x],
174                   [DALI_HAS_ECOREX=yes],
175                   [DALI_HAS_ECOREX=no])
176 PKG_CHECK_MODULES(X11, [x11],
177                   [DALI_HAS_X11=yes],
178                   [DALI_HAS_X11=no])
179 fi
180
181 if test "x$enable_feedback" = "xyes"; then
182
183 if test "x$enable_profile" = "xCOMMON" || test "x$enable_profile" = "xTV"; then
184 PKG_CHECK_MODULES(HAPTIC, haptic)
185 fi
186
187 if test "x$enable_profile" = "xMOBILE"; then
188 PKG_CHECK_MODULES(DEVICED, deviced)
189 fi
190
191 PKG_CHECK_MODULES(FEEDBACK, feedback)
192 PKG_CHECK_MODULES(MMFSOUND, mm-sound)
193 fi
194
195 if test "x$enable_assimp" = "xyes" ; then
196   PKG_CHECK_MODULES(ASSIMP, assimp)
197   ASSIMP_CFLAGS+=-DASSIMP_ENABLED
198 fi
199
200 # Don't move this - it depends on the platform defaults above
201 AM_CONDITIONAL([ASSIMP_ENABLED], [test x$enable_assimp = xyes])
202
203 if test x$DALI_DATA_RW_DIR != x; then
204   dataReadWriteDir=$DALI_DATA_RW_DIR
205 else
206   dataReadWriteDir=${prefix}/share/dali/
207 fi
208
209 if test x$DALI_DATA_RO_DIR != x; then
210   dataReadOnlyDir=$DALI_DATA_RO_DIR
211 else
212   dataReadOnlyDir=${prefix}/share/dali/
213 fi
214
215 if test x$FONT_PRELOADED_PATH != x; then
216   fontPreloadedPath=$FONT_PRELOADED_PATH
217 else
218   fontPreloadedPath=/usr/share/fonts/
219 fi
220
221 if test x$FONT_DOWNLOADED_PATH != x; then
222   fontDownloadedPath=$FONT_DOWNLOADED_PATH
223 else
224   fontDownloadedPath=/opt/share/fonts/
225 fi
226
227 if test x$FONT_APPLICATION_PATH != x; then
228   fontApplicationPath=$FONT_APPLICATION_PATH
229 else
230   fontApplicationPath=~/.fonts/
231 fi
232
233 if test x$FONT_CONFIGURATION_FILE != x; then
234   fontConfigurationFilePath=$FONT_CONFIGURATION_FILE
235 fi
236
237 AC_SUBST(dataReadWriteDir)
238 AC_SUBST(dataReadOnlyDir)
239 AC_SUBST(fontPreloadedPath)
240 AC_SUBST(fontDownloadedPath)
241 AC_SUBST(fontApplicationPath)
242 AC_SUBST(fontConfigurationFilePath)
243 AC_SUBST(DALI_ADAPTOR_CFLAGS)
244 AC_SUBST(DALI_PROFILE_CFLAGS)
245
246 # Specify the include directory for development headers
247 #devincludepath=${includedir}/dali/internal
248 devincludepath=${includedir}
249 AC_SUBST(devincludepath)
250
251 AC_CONFIG_FILES([
252  Makefile
253  adaptor/Makefile
254  dali.pc
255 ])
256
257 AM_CONDITIONAL([USE_PLUGIN], [test x$enable_feedback = xyes || test x$enable_bullet = xyes])
258
259 if test "x$enable_feedback" = "xyes" || test "x$enable_bullet" = "xyes"; then
260 AC_CONFIG_FILES([
261  plugins/Makefile
262 ])
263 fi
264
265 AC_OUTPUT
266
267
268 echo "
269 Configuration
270 -------------
271   Prefix:                           $prefix
272   Debug Build:                      $enable_debug
273   Compile flags                     $DALI_ADAPTOR_CFLAGS
274   Using Assimp Library:             $enable_assimp
275   Using JPEG Turbo Library:         $with_jpeg_turbo
276   Profile:                          $enable_profile
277   Data Dir (Read/Write):            $dataReadWriteDir
278   Data Dir (Read Only):             $dataReadOnlyDir
279   Font Path (Preloaded):            $fontPreloadedPath
280   Font Path (Downloaded):           $fontDownloadedPath
281   Font Path (Application):          $fontApplicationPath
282   Font Configuration File:          $fontConfigurationFilePath
283 "