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