26be3497ff9b7899229c134b1c9e3e5bc38a4ec5
[platform/core/uifw/dali-toolkit.git] / build / tizen / configure.ac
1 #
2 # Copyright (c) 2016 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_PROG_CXX
22 AC_PROG_LIBTOOL
23
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26 LT_INIT
27
28 DALI_TOOLKIT_VERSION=dali_version
29 AC_SUBST(DALI_TOOLKIT_VERSION)
30
31
32 DALI_TOOLKIT_CFLAGS=-DPLATFORM_TIZEN
33
34 AC_ARG_ENABLE(exportall,
35               [AC_HELP_STRING([--enable-exportall],
36                               [enables the exporting of all the symbols in the library])],
37               [enable_exportall=yes],
38               [enable_exportall=no])
39
40 AC_ARG_ENABLE([debug],
41               [AC_HELP_STRING([--enable-debug],
42                               [Turns on debugging])],
43               [enable_debug=$enableval],
44               [enable_debug=no])
45
46 AC_ARG_ENABLE([i18n],
47               [AC_HELP_STRING([--enable-i18n],
48                               [Turns on internationalisation])],
49               [enable_i18n=$enableval],
50               [enable_i18n=no])
51
52 # option to build JavaScript plugin
53 # configure settings and output
54 # --enable-javascript        // enable_javascript = yes
55 # --enable-javascript=yes    // enable_javascript = yes
56 # --enable-javascript=no     // enable_javascript = no
57 # --disable-javascript       // enable_javascript = no
58 #  no setting                // enable_javascript = automatic ( enable if v8 present)
59 AC_ARG_ENABLE([javascript],
60               [AC_HELP_STRING([--enable-javascript],
61                 [Enable JavaScript plugin])],
62               [enable_javascript=$enableval],
63               [enable_javascript=automatic])
64
65 # option to build C# plugin
66 # configure settings and output
67 # --enable-csharp        // enable_csharp = yes
68 # --enable-csharp=yes    // enable_csharp = yes
69 # --enable-csharp=no     // enable_csharp = no
70 #  no setting            // enable_csharp = no
71 AC_ARG_ENABLE([csharp],
72               [AC_HELP_STRING([--enable-csharp],
73                 [Enable csharp plugin])],
74               [enable_csharp=$enableval],
75               [enable_csharp=automatic])
76
77 AC_ARG_ENABLE([cxx03_abi],
78               [AC_HELP_STRING([--enable-cxx03-abi],
79                               [Specify abi for the build])],
80               [enable_cxx03_abi=$enableval],
81               [enable_cxx03_abi=no])
82
83 AC_ARG_ENABLE([rename_so],
84               [AC_HELP_STRING([--enable-rename-so],
85                               [Specify whether so file is renamed or not])],
86               [enable_rename_so=$enableval],
87               [enable_rename_so=yes])
88
89 AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
90 AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
91
92 if test "x$enable_cxx03_abi" = "xyes"; then
93   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
94 fi
95
96 if test "x$enable_debug" = "xyes"; then
97   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
98 fi
99
100 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
101   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
102 fi
103
104 if test "x$enable_i18n" = "xyes"; then
105   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDGETTEXT_ENABLED "
106 fi
107
108 # Tizen Profile options
109 AC_ARG_ENABLE([profile],
110               [AC_HELP_STRING([--enable-profile=UBUNTU,TIZEN],
111                             [Select the variant of tizen])],
112               [dali_profile=$enableval],
113               [dali_profile=UBUNTU])
114
115 # Tizen Style Folder
116 AC_ARG_WITH(style,
117               [AC_HELP_STRING([--with-style],
118                             [Select the style folder to use])],
119               [dali_style=$withval],
120               [dali_style=480x800])
121
122 # Ensure valid profile selected
123 if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xTIZEN"; then
124   AC_MSG_ERROR([$enable_profile is an invalid profile])
125 fi
126
127 if test x$DALI_DATA_RW_DIR != x; then
128   dataReadWriteDir=${DALI_DATA_RW_DIR}/
129 else
130   dataReadWriteDir=${prefix}/share/dali/
131 fi
132
133 if test x$DALI_DATA_RO_DIR != x; then
134   dataReadOnlyDir=${DALI_DATA_RO_DIR}/
135 else
136   dataReadOnlyDir=${prefix}/share/dali/
137 fi
138
139 DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDALI_PROFILE_${dali_profile}"
140
141 # Style folder
142 STYLE_BASE_DIR=../../../dali-toolkit/styles
143 STYLE_DIR=$STYLE_BASE_DIR/$dali_style
144
145 AC_SUBST(STYLE_BASE_DIR)
146 AC_SUBST(STYLE_DIR)
147
148 # v8 version 4+ requires c++11
149 PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ],  [ pkg_check_v8=no  ] )
150
151 # Rules for building JavaScript plugin
152 # If enable_javascript=yes and v8 installed = build javascript
153 # If enable_javascript=automatic and v8 installed = build javascript
154 # If enable_javascript=yes and v8 not installed = throw an error
155 build_javascript_plugin=no
156 if test x$enable_javascript = xyes; then
157   if test x$pkg_check_v8 = xno; then
158     [build_javascript_plugin=no]
159     AC_MSG_ERROR("V8 not found or incorrect version installed")
160     AC_MSG_NOTICE("To disable building of JavaScript plugin use --disable-javascript")
161   else
162     [build_javascript_plugin=yes]
163     AC_MSG_NOTICE(V8 library found. Building DALi JavaScript plugin)
164   fi
165 fi
166 if test x$enable_javascript = xautomatic && test x$pkg_check_v8 = xyes; then
167   [build_javascript_plugin=yes]
168   AC_MSG_NOTICE( V8 library found. Automatic building of JavaScript plugin. Use  use --disable-javascript to disable)
169 fi
170
171
172 #set a variable for the makefile to force compile the JAvaSplugin
173 AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$build_javascript_plugin = xyes])
174
175 # Platforms with highp shader support can use vector based text
176 AM_CONDITIONAL([ENABLE_VECTOR_BASED_TEXT_RENDERING], [test x$dali_profile = xUBUNTU])
177
178 AC_SUBST(dataReadWriteDir)
179 AC_SUBST(dataReadOnlyDir)
180 AC_SUBST(DALI_TOOLKIT_CFLAGS)
181
182
183 # Specify the include directory for development headers
184 #devincludepath=${includedir}/dali/internal
185 devincludepath=${includedir}
186 AC_SUBST(devincludepath)
187
188 # Doxygen paths
189 DOXYGEN_DOCS_DIR=../../../docs
190 DOXYGEN_ROOT_DIR=../../..
191 AC_SUBST(DOXYGEN_DOCS_DIR)
192 AC_SUBST(DOXYGEN_ROOT_DIR)
193
194 # Enable csharp plugin
195 build_csharp_plugin=no
196 build_ruby_flag=no
197 if test x$enable_csharp = xyes; then
198   [build_csharp_plugin=yes]
199   AC_MSG_NOTICE(Building DALi csharp plugin ...)
200
201   PKG_CHECK_MODULES(DALIADAPTOR, dali-adaptor)
202   AC_PATH_PROG([SWIG], [swig])
203
204   # if gbs enable, then only use swig, without ruby or mcs
205   if test "x$dali_profile" = "xUBUNTU"; then
206     [build_ruby_flag=yes]
207     AC_PATH_PROG([RUBY], [ruby])
208     AC_PATH_PROGS([MCS], [mcs gmcs gmcs2])
209     AC_MSG_NOTICE(swig ruby mcs working ...)
210   else
211     [build_ruby_flag=no]
212     AC_PATH_PROG([RUBY], [ruby])
213     #AC_PATH_PROGS([MCS], [mcs gmcs gmcs2])
214     #AC_MSG_NOTICE(swig only working ...)
215   fi
216
217   # Set varaibles for dali-toolkit
218   DALITOOLKIT_CFLAGS="-I${prefix}/include -I${prefix}/include/dali-toolkit"
219   DALITOOLKIT_LIBS="-L${prefix}/lib -ldali-toolkit -ldali-core"
220   AC_SUBST(DALITOOLKIT_CFLAGS)
221   AC_SUBST(DALITOOLKIT_LIBS)
222 fi
223
224 if test "x$enable_cxx03_abi" = "xyes"; then
225 PKG_CHECK_MODULES(DALICORE, dali-core-cxx03)
226 else
227 PKG_CHECK_MODULES(DALICORE, dali-core)
228 fi
229
230 #set a variable for the makefile to force compile the csharp plugin
231 AM_CONDITIONAL([ENABLE_CSHARP_PLUGIN], [test x$build_csharp_plugin = xyes])
232 AM_CONDITIONAL([ENABLE_RUBY_FLAG], [test x$build_ruby_flag = xyes])
233
234 AC_CONFIG_FILES([
235  Makefile
236  dali-toolkit/Makefile
237  plugins/javascript/Makefile
238  plugins/csharp/Makefile
239  docs/Makefile
240  docs/dali.doxy
241  docs-internal/dali-internal.doxy
242  ../../automated-tests/CMakeLists.txt
243 ])
244
245 if test "x$enable_cxx03_abi" = "xno"; then
246 AC_CONFIG_FILES([dali-toolkit.pc])
247 fi
248
249 AC_OUTPUT
250
251 echo "
252 Configuration
253 -------------
254   Prefix:                           $prefix
255   Debug Build:                      $enable_debug
256   JavaScript support (V8 required)  $build_javascript_plugin
257   CSharp support                    $build_csharp_plugin
258   Profile:                          $dali_profile
259   Data Dir (Read/Write):            $dataReadWriteDir
260   Data Dir (Read Only):             $dataReadOnlyDir
261   Style Dir:                        $STYLE_DIR
262   Style:                            $dali_style
263   i18n:                             $enable_i18n
264 "