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