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