Revert "[3.0] NativeImageSource with tbm_surface for tizen 3.0 wayland"
[platform/core/uifw/dali-adaptor.git] / build / tizen / configure.ac
1 #
2 # Copyright (c) 2015 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 # 17.1.11 = Freetype version 2.5.2
36 FREETYPE_BITMAP_SUPPORT_VERSION=17.1.11
37
38 PKG_CHECK_MODULES(DALICORE, dali-core)
39 PKG_CHECK_MODULES(EXIF, libexif)
40 PKG_CHECK_MODULES(FREETYPE, [freetype2 >= $FREETYPE_REQUIRED])
41 PKG_CHECK_MODULES(FREETYPE_BITMAP_SUPPORT, [freetype2 >= $FREETYPE_BITMAP_SUPPORT_VERSION], [ freetype_bitmap_support=yes  ], [ freetype_bitmap_support=no ] )
42 PKG_CHECK_MODULES(FONTCONFIG, fontconfig)
43 PKG_CHECK_MODULES(PNG, libpng)
44 PKG_CHECK_MODULES(LIBEXIF, libexif)
45 PKG_CHECK_MODULES(LIBDRM, libdrm)
46 PKG_CHECK_MODULES(LIBCURL, libcurl)
47 PKG_CHECK_MODULES(HARFBUZZ, harfbuzz)
48 PKG_CHECK_MODULES(FRIBIDI, fribidi)
49 PKG_CHECK_MODULES(TTRACE,  ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]),
50                   [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ]
51                   )
52
53
54 AC_ARG_ENABLE([efl],
55               [AC_HELP_STRING([--enable-efl],
56                               [Builds with EFL libraries, On by default])],
57               [enable_efl=$enableval],
58               [enable_efl=yes])
59
60
61
62 # Check if we need EFL Libraries ( on by default, disabled with --use-efl=no )
63 # When running on Node.JS with Wayland no EFL libraries are required.
64 if test "x$enable_efl" = "xyes"; then
65 PKG_CHECK_MODULES(ECORE, ecore)
66 PKG_CHECK_MODULES(ECORE_IPC, ecore-ipc)
67 PKG_CHECK_MODULES(ECORE_IMF, [ecore-imf >= 1.13], [ecore_imf_1_13=yes], [ecore_imf_1_13=no])
68 PKG_CHECK_MODULES(ELEMENTARY, elementary)
69 # Check for EldBus.h in ECore
70 PKG_CHECK_MODULES(ELDBUS, eldbus, [ eldbus_available=yes ],  [ eldbus_available=no ] )
71 fi
72
73
74 DALI_ELDBUS_AVAILABLE=
75 if test "x$eldbus_available" = "xyes"; then
76   DALI_ELDBUS_AVAILABLE=true
77   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_ELDBUS_AVAILABLE "
78 fi
79 AC_SUBST(DALI_ELDBUS_AVAILABLE)
80
81 PKG_CHECK_MODULES(TPKP_CURL, tpkp-curl, [ tpkp_curl_available=yes ], [ tpkp_curl_available=no ] )
82
83 if test "x$tpkp_curl_available" = "xyes"; then
84   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DTPK_CURL_ENABLED "
85 fi
86
87 AC_ARG_ENABLE([feedback],
88               [AC_HELP_STRING([ --enable-feedback],
89                               [Enable feedback plugin])],
90               [enable_feedback=yes],
91               [enable_feedback=no])
92
93 AM_CONDITIONAL([USE_FEEDBACK], [test x$enable_feedback = xyes])
94
95 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DPLATFORM_TIZEN"
96
97 AC_ARG_ENABLE(exportall,
98               [AC_HELP_STRING([--enable-exportall],
99                               [enables the exporting of all the symbols in the library])],
100               [enable_exportall=yes],
101               [enable_exportall=no])
102
103 AC_ARG_ENABLE([debug],
104               [AC_HELP_STRING([--enable-debug],
105                               [Turns on debugging])],
106               [enable_debug=$enableval],
107               [enable_debug=no])
108
109 AC_ARG_ENABLE(shaderbincache,
110               [AC_HELP_STRING([--enable-shaderbincache],
111                               [enables shader binary cache])],
112               [enable_shaderbincache=$enableval],
113               [enable_shaderbincache=DISABLE])
114
115 AC_ARG_ENABLE(networklogging,
116               [AC_HELP_STRING([--enable-networklogging],
117                               [enables network for debug tool])],
118               [enable_networklogging=$enableval],
119               [enable_networklogging=no])
120
121
122 if test "x$enable_debug" = "xyes"; then
123   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED"
124 fi
125
126 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
127   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
128 fi
129
130 if test "x$enable_shaderbincache" = "xENABLE"; then
131   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED"
132 fi
133
134 if test "x$enable_networklogging" = "xyes"; then
135   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNETWORK_LOGGING_ENABLED"
136 fi
137
138 # If Ecore IMF version is greater than 1.13, then some structures are different
139 if test "x$ecore_imf_1_13" = "xyes"; then
140   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DECORE_IMF_1_13"
141 fi
142
143 AC_ARG_ENABLE([gles],
144               [AC_HELP_STRING([--enable-gles],
145                               [Specify the OpenGL ES version for backwards compatibility])],
146               [enable_gles=$enableval],
147               [enable_gles=30])
148
149 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
150
151 # node.js by default statically links against libuv, so it doesn't need to install
152 # a libuv headers/ shared library. So we can't use pkg-config to access any headers.
153 # As a work around we pass the node deps path so we can access the libuv headers inside nodes
154 # directory
155 AC_ARG_WITH([libuv],
156               [AC_HELP_STRING([--with-libuv],
157                               [Path that contains libuv headers. Setting this configures DALi to work with LibUV mainloop used in Node.JS.
158                               For example /usr/tmp/downloads/node/deps/uv/include/ ])],
159               [with_libuv=$withval],
160               [with_libuv=no])
161
162 # Node.JS already has a libuv main loop running,so we have to integrate with it
163 AM_CONDITIONAL(LIB_UV_EVENT_LOOP, test x$with_libuv != xno)
164
165
166 build_for_libuv=no
167 if test "x$with_libuv" != "xno"; then
168   AC_MSG_NOTICE("build with libuv mainloop (Node.JS support) == yes");
169   [build_for_libuv=yes]
170   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DNODE_JS_SUPPORT  -I${with_libuv}"
171 else
172  #not using libuv build
173   AC_MSG_NOTICE("build with libuv mainloop == no (Node.JS not supported)");
174 fi
175
176 AC_ARG_ENABLE([appfw],
177               [AC_HELP_STRING([--enable-appfw],
178                               [Builds with Tizen App framework libraries, off by default])],
179               [enable_appfw=$enableval],
180               [enable_appfw=no])
181
182 # Option to allow building with Tizen SDK 2.2
183 AC_ARG_WITH([tizen-2-2-compatibility],
184             [AC_HELP_STRING([--with-tizen-2-2-compatibility],
185                             [Use Tizen SDK 2.2 compatibility])],
186             [with_tizen_2_2_compatibility=$withval],
187             [with_tizen_2_2_compatibility=no])
188
189 # Tizen Profile options
190 AC_ARG_ENABLE([profile],
191               [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
192                             [Select the variant of tizen])],
193               [enable_profile=$enableval],
194               [enable_profile=COMMON])
195
196 # Ensure valid profile selected
197 if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
198   AC_MSG_ERROR([$enable_profile is an invalid profile])
199 fi
200
201 AC_ARG_ENABLE(wayland,
202               [  --enable-wayland       Build on Wayland],
203               enable_wayland=yes,
204               enable_wayland=no)
205
206 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}"
207 DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}"
208 AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
209 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
210 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
211 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
212 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
213 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
214 AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
215 AM_CONDITIONAL([USE_APPFW], [test x$enable_appfw = xyes])
216
217 AM_CONDITIONAL([ENABLE_NETWORK_LOGGING], [test x$enable_networklogging = xyes])
218
219 # Platforms should either enable features or remove them, they
220 # should not disable features. This allows the developer to override
221 # features through the command line.
222
223 if test "x$enable_profile" = "xCOMMON"; then
224 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
225 fi
226
227 if test "x$enable_profile" = "xMOBILE"; then
228 PKG_CHECK_MODULES(OPENGLES20, gles20)
229 enable_assimp=no
230 fi
231
232 if test "x$enable_profile" = "xLITE"; then
233 PKG_CHECK_MODULES(OPENGLES20, gles20)
234 fi
235
236 if test "x$enable_profile" = "xWEARABLE"; then
237 PKG_CHECK_MODULES(OPENGLES20, glesv2)
238 fi
239
240 if test "x$enable_profile" = "xTV"; then
241 PKG_CHECK_MODULES(OPENGLES20, glesv2)
242 fi
243
244 if test "x$enable_profile" = "xUBUNTU"; then
245 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
246 else
247
248
249
250 PKG_CHECK_MODULES(DLOG, dlog)
251 PKG_CHECK_MODULES(SENSOR, sensor)
252 PKG_CHECK_MODULES(TTS, tts)
253 PKG_CHECK_MODULES(VCONF, vconf)
254 if test "x$enable_efl" = "xyes"; then
255 if test "x$with_tizen_2_2_compatibility" = "xno"; then
256 PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info)
257 fi
258 fi
259
260 fi # ubuntu profile test
261
262 if test "x$enable_appfw" = "xyes"; then
263 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
264 PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
265 fi
266
267 # Using EFL api's for  WAYLAND AND X11 to run on ecore mainloop
268 if test "x$enable_efl" = "xyes"; then
269 if test "x$enable_wayland" = "xyes"; then
270 PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon],
271                   [DALI_USE_ECORE_WAYLAND=1],
272                   [DALI_USE_ECORE_WAYLAND=0])
273
274 else
275 PKG_CHECK_MODULES(ECORE_X, [ecore-x],
276                   [DALI_USE_ECORE_X11=1],
277                   [DALI_USE_ECORE_X11=0])
278 PKG_CHECK_MODULES(X11, [x11],
279                   [DALI_USE_X11=1],
280                   [DALI_USE_X11=0])
281 PKG_CHECK_MODULES(UTILX, utilX)
282 fi
283 fi
284 # Using Wayland API directly  ( main loop agnostic, typically for running on libuv)
285 #  wayland-extension-client include xdg-shell-client
286 if test "x$enable_efl" = "xno"; then
287 if test "x$enable_wayland" = "xyes"; then
288 PKG_CHECK_MODULES(WAYLAND, [ egl wayland-egl wayland-client >= 1.2.0 xkbcommon],
289                   [DALI_USE_WAYLAND=1],
290                   [DALI_USE_WAYLAND=0])
291 fi
292 fi
293
294 # remove this when we update common repos
295 # common profile currently does not have wayland extensions like xdg-shell
296 if test "x$enable_wayland" = "xyes"; then
297 if test "x$enable_profile" != "xCOMMON"; then
298 PKG_CHECK_MODULES(WAYLAND_EXTENSION, xdg-shell-client)
299 fi
300 fi
301 AM_CONDITIONAL([USE_ECORE_WAYLAND], [test "$DALI_USE_ECORE_WAYLAND" -eq 1])
302
303 if test "x$enable_feedback" = "xyes"; then
304
305 if test "x$enable_profile" = "xCOMMON" || test "x$enable_profile" = "xTV"; then
306 PKG_CHECK_MODULES(HAPTIC, haptic)
307 fi
308
309 if test "x$enable_profile" = "xMOBILE"; then
310 PKG_CHECK_MODULES(DEVICED, deviced)
311 fi
312
313 PKG_CHECK_MODULES(FEEDBACK, feedback)
314 PKG_CHECK_MODULES(MMFSOUND, mm-sound)
315 fi
316
317 if test x$DALI_DATA_RW_DIR != x; then
318   dataReadWriteDir=$DALI_DATA_RW_DIR
319 else
320   dataReadWriteDir=${prefix}/share/dali/
321 fi
322
323 if test x$DALI_DATA_RO_DIR != x; then
324   dataReadOnlyDir=$DALI_DATA_RO_DIR
325 else
326   dataReadOnlyDir=${prefix}/share/dali/
327 fi
328
329 if test x$FONT_CONFIGURATION_FILE != x; then
330   fontConfigurationFile=$FONT_CONFIGURATION_FILE
331 fi
332
333 AC_SUBST(dataReadWriteDir)
334 AC_SUBST(dataReadOnlyDir)
335 AC_SUBST(DALI_ADAPTOR_CFLAGS)
336 AC_SUBST(DALI_PROFILE_CFLAGS)
337 AC_SUBST(fontConfigurationFile)
338
339
340 # Specify the include directory for development headers
341 #devincludepath=${includedir}/dali/internal
342 devincludepath=${includedir}
343 AC_SUBST(devincludepath)
344
345 AC_CONFIG_FILES([
346  Makefile
347  adaptor/Makefile
348  dali.pc
349  adaptor/dali-adaptor-integration.pc
350 ])
351
352 AM_CONDITIONAL([USE_PLUGIN], [test x$enable_feedback = xyes])
353
354 if test "x$enable_feedback" = "xyes"; then
355 AC_CONFIG_FILES([
356  plugins/Makefile
357 ])
358 fi
359
360 if test "x$freetype_bitmap_support" = "xyes"; then
361 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DFREETYPE_BITMAP_SUPPORT"
362 fi
363
364 AC_OUTPUT
365
366
367 echo "
368 Configuration
369 -------------
370   Prefix:                           $prefix
371   Debug Build:                      $enable_debug
372   Compile flags                     $DALI_ADAPTOR_CFLAGS
373   Freetype bitmap support (Emoji):  $freetype_bitmap_support
374   Profile:                          $enable_profile
375   Data Dir (Read/Write):            $dataReadWriteDir
376   Data Dir (Read Only):             $dataReadOnlyDir
377   Tizen SDK 2.2 compatibility:      $with_tizen_2_2_compatibility
378   EldBus:                           $eldbus_available
379   Shader Binary Cache:              $enable_shaderbincache
380   Using LibUV mainloop (Node.JS)    $build_for_libuv
381   Ecore Version At Least 1.13.0     $ecore_imf_1_13
382   Network logging enabled:          $enable_networklogging
383   Font config file:                 $fontConfigurationFile
384   Building with EFL Libraries       $enable_efl
385   Using Tizen APP FW libraries      $enable_appfw
386 "
387 # optional output of node.js source path if we're building with libuv
388 if test "x$build_for_libuv" != "xno"; then
389 echo "  LibUV header path         $with_libuv"
390 fi