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 AC_ARG_ENABLE(shaderbincache,
97               [AC_HELP_STRING([--enable-shaderbincache],
98                               [enables shader binary cache])],
99               [enable_shaderbincache=$enableval],
100               [enable_shaderbincache=DISABLE])
101
102 if test "x$enable_debug" = "xyes"; then
103   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED"
104 fi
105
106 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
107   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
108 fi
109
110 if test "x$enable_shaderbincache" = "xENABLE"; then
111   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED"
112 fi
113
114 AC_ARG_ENABLE([assimp],
115               [AC_HELP_STRING([--enable-assimp],
116                               [Enable assimp plugin, overriding platform defaults])],
117               [enable_assimp=yes],
118               [enable_assimp=no])
119
120 AC_ARG_ENABLE([gles],
121               [AC_HELP_STRING([--enable-gles],
122                               [Specify the OpenGL ES version for backwards compatibility])],
123               [enable_gles=$enableval],
124               [enable_gles=30])
125
126 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
127
128 AC_ARG_WITH([jpeg-turbo],
129             [AC_HELP_STRING([--with-jpeg-turbo],
130                             [Use the JPEG Turbo library])],
131             [with_jpeg_turbo=$withval],
132             [with_jpeg_turbo=yes])
133
134 AM_CONDITIONAL(TURBO_JPEG_IS_ON, test $with_jpeg_turbo = yes)
135
136 # Tizen Profile options
137 AC_ARG_ENABLE([profile],
138               [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,LITE,WEARABLE,TV,UBUNTU],
139                             [Select the variant of tizen])],
140               [enable_profile=$enableval],
141               [enable_profile=COMMON])
142
143 # Ensure valid profile selected
144 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
145   AC_MSG_ERROR([$enable_profile is an invalid profile])
146 fi
147
148 AC_ARG_ENABLE(wayland,
149               [  --enable-wayland       Build on Wayland],
150               enable_wayland=yes,
151               enable_wayland=no)
152
153 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}"
154 DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}"
155 AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
156 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
157 AM_CONDITIONAL([LITE_PROFILE], [test x$enable_profile = xLITE])
158 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
159 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
160 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
161 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
162
163 # Platforms should either enable features or remove them, they
164 # should not disable features. This allows the developer to override
165 # features through the command line.
166
167 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
168
169 if test "x$enable_profile" != "xUBUNTU"; then
170 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
171 PKG_CHECK_MODULES(DLOG, dlog)
172 PKG_CHECK_MODULES(SENSOR, sensor)
173 PKG_CHECK_MODULES(TTS, tts)
174 PKG_CHECK_MODULES(VCONF, vconf)
175 PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
176 fi
177
178 if test "x$enable_wayland" = "xyes"; then
179 PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon],
180                   [DALI_HAS_ECOREWL=yes],
181                   [DALI_HAS_ECOREWL=no])
182 else
183 PKG_CHECK_MODULES(ECORE_X, [ecore-x],
184                   [DALI_HAS_ECOREX=yes],
185                   [DALI_HAS_ECOREX=no])
186 PKG_CHECK_MODULES(X11, [x11],
187                   [DALI_HAS_X11=yes],
188                   [DALI_HAS_X11=no])
189 fi
190
191 if test "x$enable_feedback" = "xyes"; then
192
193 if test "x$enable_profile" = "xCOMMON" || test "x$enable_profile" = "xTV"; then
194 PKG_CHECK_MODULES(HAPTIC, haptic)
195 fi
196
197 if test "x$enable_profile" = "xMOBILE"; then
198 PKG_CHECK_MODULES(DEVICED, deviced)
199 fi
200
201 PKG_CHECK_MODULES(FEEDBACK, feedback)
202 PKG_CHECK_MODULES(MMFSOUND, mm-sound)
203 fi
204
205 if test "x$enable_assimp" = "xyes" ; then
206   PKG_CHECK_MODULES(ASSIMP, assimp)
207   ASSIMP_CFLAGS+=-DASSIMP_ENABLED
208 fi
209
210 # Don't move this - it depends on the platform defaults above
211 AM_CONDITIONAL([ASSIMP_ENABLED], [test x$enable_assimp = xyes])
212
213 if test x$DALI_DATA_RW_DIR != x; then
214   dataReadWriteDir=$DALI_DATA_RW_DIR
215 else
216   dataReadWriteDir=${prefix}/share/dali/
217 fi
218
219 if test x$DALI_DATA_RO_DIR != x; then
220   dataReadOnlyDir=$DALI_DATA_RO_DIR
221 else
222   dataReadOnlyDir=${prefix}/share/dali/
223 fi
224
225 if test x$FONT_PRELOADED_PATH != x; then
226   fontPreloadedPath=$FONT_PRELOADED_PATH
227 else
228   fontPreloadedPath=/usr/share/fonts/
229 fi
230
231 if test x$FONT_DOWNLOADED_PATH != x; then
232   fontDownloadedPath=$FONT_DOWNLOADED_PATH
233 else
234   fontDownloadedPath=/opt/share/fonts/
235 fi
236
237 if test x$FONT_APPLICATION_PATH != x; then
238   fontApplicationPath=$FONT_APPLICATION_PATH
239 else
240   fontApplicationPath=~/.fonts/
241 fi
242
243 if test x$FONT_CONFIGURATION_FILE != x; then
244   fontConfigurationFilePath=$FONT_CONFIGURATION_FILE
245 fi
246
247 AC_SUBST(dataReadWriteDir)
248 AC_SUBST(dataReadOnlyDir)
249 AC_SUBST(fontPreloadedPath)
250 AC_SUBST(fontDownloadedPath)
251 AC_SUBST(fontApplicationPath)
252 AC_SUBST(fontConfigurationFilePath)
253 AC_SUBST(DALI_ADAPTOR_CFLAGS)
254 AC_SUBST(DALI_PROFILE_CFLAGS)
255
256 # Specify the include directory for development headers
257 #devincludepath=${includedir}/dali/internal
258 devincludepath=${includedir}
259 AC_SUBST(devincludepath)
260
261 AC_CONFIG_FILES([
262  Makefile
263  adaptor/Makefile
264  dali.pc
265 ])
266
267 AM_CONDITIONAL([USE_PLUGIN], [test x$enable_feedback = xyes || test x$enable_bullet = xyes])
268
269 if test "x$enable_feedback" = "xyes" || test "x$enable_bullet" = "xyes"; then
270 AC_CONFIG_FILES([
271  plugins/Makefile
272 ])
273 fi
274
275 AC_OUTPUT
276
277
278 echo "
279 Configuration
280 -------------
281   Prefix:                           $prefix
282   Debug Build:                      $enable_debug
283   Compile flags                     $DALI_ADAPTOR_CFLAGS
284   Using Assimp Library:             $enable_assimp
285   Using JPEG Turbo Library:         $with_jpeg_turbo
286   Profile:                          $enable_profile
287   Data Dir (Read/Write):            $dataReadWriteDir
288   Data Dir (Read Only):             $dataReadOnlyDir
289   Font Path (Preloaded):            $fontPreloadedPath
290   Font Path (Downloaded):           $fontDownloadedPath
291   Font Path (Application):          $fontApplicationPath
292   Font Configuration File:          $fontConfigurationFilePath
293 "