Merge "DALi Version 1.0.38" into tizen
[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 PKG_CHECK_MODULES(TTRACE,  ttrace, AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]),
51                   [ AC_MSG_NOTICE([Tizen Trace not avaiable]) ]
52                   )
53
54 # Check for availability of BulletPhysics
55 PKG_CHECK_EXISTS(bullet, [
56   BULLET_CFLAGS=`pkg-config --cflags bullet`
57   BULLET_LIBS=`pkg-config --libs bullet`
58   BULLET=yes
59 ], [
60   AC_MSG_WARN([BulletPhysics development files not found, not building bullet plugin])
61   BULLET_CFLAGS=
62   BULLET_LIBS=
63   BULLET=no
64 ])
65
66 AC_SUBST(BULLET_CFLAGS)
67 AC_SUBST(BULLET_LIBS)
68
69 AC_ARG_ENABLE([bullet],
70               [AC_HELP_STRING([ --enable-bullet],
71                               [Enable bullet plugin])],
72               [enable_bullet=yes],
73               [enable_bullet=no])
74
75
76 AC_ARG_ENABLE([feedback],
77               [AC_HELP_STRING([ --enable-feedback],
78                               [Enable feedback plugin])],
79               [enable_feedback=yes],
80               [enable_feedback=no])
81
82 AM_CONDITIONAL([USE_BULLET], [test x$BULLET = xyes && test x$enable_bullet = xyes])
83 AM_CONDITIONAL([USE_FEEDBACK], [test x$enable_feedback = xyes])
84
85 DALI_ADAPTOR_CFLAGS=-DPLATFORM_TIZEN
86
87 AC_ARG_ENABLE(exportall,
88               [AC_HELP_STRING([--enable-exportall],
89                               [enables the exporting of all the symbols in the library])],
90               [enable_exportall=yes],
91               [enable_exportall=no])
92
93 AC_ARG_ENABLE([debug],
94               [AC_HELP_STRING([--enable-debug],
95                               [Turns on debugging])],
96               [enable_debug=$enableval],
97               [enable_debug=no])
98
99 AC_ARG_ENABLE(shaderbincache,
100               [AC_HELP_STRING([--enable-shaderbincache],
101                               [enables shader binary cache])],
102               [enable_shaderbincache=$enableval],
103               [enable_shaderbincache=DISABLE])
104
105 if test "x$enable_debug" = "xyes"; then
106   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDEBUG_ENABLED"
107 fi
108
109 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
110   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
111 fi
112
113 if test "x$enable_shaderbincache" = "xENABLE"; then
114   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DSHADERBIN_CACHE_ENABLED"
115 fi
116
117 AC_ARG_ENABLE([assimp],
118               [AC_HELP_STRING([--enable-assimp],
119                               [Enable assimp plugin, overriding platform defaults])],
120               [enable_assimp=yes],
121               [enable_assimp=no])
122
123 AC_ARG_ENABLE([gles],
124               [AC_HELP_STRING([--enable-gles],
125                               [Specify the OpenGL ES version for backwards compatibility])],
126               [enable_gles=$enableval],
127               [enable_gles=30])
128
129 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
130
131 AC_ARG_WITH([jpeg-turbo],
132             [AC_HELP_STRING([--with-jpeg-turbo],
133                             [Use the JPEG Turbo library])],
134             [with_jpeg_turbo=$withval],
135             [with_jpeg_turbo=yes])
136
137 AM_CONDITIONAL(TURBO_JPEG_IS_ON, test $with_jpeg_turbo = yes)
138
139 AC_ARG_WITH([over-tizen_2_2],
140             [AC_HELP_STRING([--with-over-tizen_2_2],
141                             [Use tizen API over ver. 2.2])],
142             [with_over_tizen_2_2=yes],
143             [with_over_tizen_2_2=no])
144
145 # Tizen Profile options
146 AC_ARG_ENABLE([profile],
147               [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
148                             [Select the variant of tizen])],
149               [enable_profile=$enableval],
150               [enable_profile=COMMON])
151
152 # Ensure valid profile selected
153 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
154   AC_MSG_ERROR([$enable_profile is an invalid profile])
155 fi
156
157 AC_ARG_ENABLE(wayland,
158               [  --enable-wayland       Build on Wayland],
159               enable_wayland=yes,
160               enable_wayland=no)
161
162 DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DDALI_PROFILE_${enable_profile}"
163 DALI_PROFILE_CFLAGS=" -DDALI_PROFILE_${enable_profile}"
164 AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
165 AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
166 AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
167 AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
168 AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
169 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
170
171 # Platforms should either enable features or remove them, they
172 # should not disable features. This allows the developer to override
173 # features through the command line.
174
175 PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
176
177 if test "x$enable_profile" != "xUBUNTU"; then
178 PKG_CHECK_MODULES(CAPI_APPFW_APPLICATION, capi-appfw-application)
179 PKG_CHECK_MODULES(DLOG, dlog)
180 PKG_CHECK_MODULES(SENSOR, sensor)
181 PKG_CHECK_MODULES(TTS, tts)
182 PKG_CHECK_MODULES(VCONF, vconf)
183 PKG_CHECK_MODULES(CAPI_SYSTEM_SYSTEM_SETTINGS, capi-system-system-settings)
184
185 if test "x$with_over_tizen_2_2" = "xyes"; then
186 PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, capi-system-info)
187 fi
188
189 fi # ubuntu profile test
190
191 if test "x$enable_wayland" = "xyes"; then
192 PKG_CHECK_MODULES(WAYLAND, [ecore-wayland egl wayland-egl wayland-client >= 1.2.0 xkbcommon],
193                   [DALI_HAS_ECOREWL=yes],
194                   [DALI_HAS_ECOREWL=no])
195 else
196 PKG_CHECK_MODULES(ECORE_X, [ecore-x],
197                   [DALI_HAS_ECOREX=yes],
198                   [DALI_HAS_ECOREX=no])
199 PKG_CHECK_MODULES(X11, [x11],
200                   [DALI_HAS_X11=yes],
201                   [DALI_HAS_X11=no])
202 fi
203
204 if test "x$enable_feedback" = "xyes"; then
205
206 if test "x$enable_profile" = "xCOMMON" || test "x$enable_profile" = "xTV"; then
207 PKG_CHECK_MODULES(HAPTIC, haptic)
208 fi
209
210 if test "x$enable_profile" = "xMOBILE"; then
211 PKG_CHECK_MODULES(DEVICED, deviced)
212 fi
213
214 PKG_CHECK_MODULES(FEEDBACK, feedback)
215 PKG_CHECK_MODULES(MMFSOUND, mm-sound)
216 fi
217
218 if test "x$enable_assimp" = "xyes" ; then
219   PKG_CHECK_MODULES(ASSIMP, assimp)
220   ASSIMP_CFLAGS+=-DASSIMP_ENABLED
221 fi
222
223 # Don't move this - it depends on the platform defaults above
224 AM_CONDITIONAL([ASSIMP_ENABLED], [test x$enable_assimp = xyes])
225
226 if test x$DALI_DATA_RW_DIR != x; then
227   dataReadWriteDir=$DALI_DATA_RW_DIR
228 else
229   dataReadWriteDir=${prefix}/share/dali/
230 fi
231
232 if test x$DALI_DATA_RO_DIR != x; then
233   dataReadOnlyDir=$DALI_DATA_RO_DIR
234 else
235   dataReadOnlyDir=${prefix}/share/dali/
236 fi
237
238 AC_SUBST(dataReadWriteDir)
239 AC_SUBST(dataReadOnlyDir)
240 AC_SUBST(DALI_ADAPTOR_CFLAGS)
241 AC_SUBST(DALI_PROFILE_CFLAGS)
242
243 # Specify the include directory for development headers
244 #devincludepath=${includedir}/dali/internal
245 devincludepath=${includedir}
246 AC_SUBST(devincludepath)
247
248 AC_CONFIG_FILES([
249  Makefile
250  adaptor/Makefile
251  dali.pc
252  adaptor/dali-adaptor-integration.pc
253 ])
254
255 AM_CONDITIONAL([USE_PLUGIN], [test x$enable_feedback = xyes || test x$enable_bullet = xyes])
256
257 if test "x$enable_feedback" = "xyes" || test "x$enable_bullet" = "xyes"; then
258 AC_CONFIG_FILES([
259  plugins/Makefile
260 ])
261 fi
262
263 AC_OUTPUT
264
265
266 echo "
267 Configuration
268 -------------
269   Prefix:                           $prefix
270   Debug Build:                      $enable_debug
271   Compile flags                     $DALI_ADAPTOR_CFLAGS
272   Using Assimp Library:             $enable_assimp
273   Using JPEG Turbo Library:         $with_jpeg_turbo
274   Profile:                          $enable_profile
275   Data Dir (Read/Write):            $dataReadWriteDir
276   Data Dir (Read Only):             $dataReadOnlyDir
277   OVERTIZEN2.2:                     $with_over_tizen_2_2
278 "