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