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