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