Merge "Ability to build from different Style folders" into devel/master
[platform/core/uifw/dali-toolkit.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_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 PKG_CHECK_MODULES(DALI, dali)
33
34 DALI_TOOLKIT_CFLAGS=-DPLATFORM_TIZEN
35
36 AC_ARG_ENABLE(exportall,
37               [AC_HELP_STRING([--enable-exportall],
38                               [enables the exporting of all the symbols in the library])],
39               [enable_exportall=yes],
40               [enable_exportall=no])
41
42 AC_ARG_ENABLE([debug],
43               [AC_HELP_STRING([--enable-debug],
44                               [Turns on debugging])],
45               [enable_debug=$enableval],
46               [enable_debug=no])
47
48 AC_ARG_ENABLE([i18n],
49               [AC_HELP_STRING([--enable-i18n],
50                               [Turns on internationalisation])],
51               [enable_i18n=$enableval],
52               [enable_i18n=no])
53
54 # option to build JavaScript plugin
55 # configure settings and output
56 # --enable-javascript        // enable_javascript = yes
57 # --enable-javascript=yes    // enable_javascript = yes
58 # --enable-javascript=no     // enable_javascript = no
59 # --disable-javascript       // enable_javascript = no
60 #  no setting                // enable_javascript = automatic ( enable if v8 present)
61 AC_ARG_ENABLE([javascript],
62               [AC_HELP_STRING([--enable-javascript],
63                [Enable JavaScript plugin])] ,
64                [enable_javascript=$enableval],
65                [enable_javascript=automatic])
66
67
68 if test "x$enable_debug" = "xyes"; then
69   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
70 fi
71
72 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
73   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
74 fi
75
76 if test "x$enable_i18n" = "xyes"; then
77   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDGETTEXT_ENABLED "
78 fi
79
80 # Tizen Profile options
81 AC_ARG_ENABLE([profile],
82               [AC_HELP_STRING([--enable-profile=UBUNTU,MOBILE,WEARABLE,TV],
83                             [Select the variant of tizen])],
84               [dali_profile=$enableval],
85               [dali_profile=UBUNTU])
86
87 # Tizen Style Folder
88 AC_ARG_WITH(style,
89               [AC_HELP_STRING([--with-style],
90                             [Select the style folder to use])],
91               [dali_style=$withval],
92               [dali_style=480x800])
93
94 # Ensure valid profile selected
95 if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xMOBILE" -a "x$dali_profile" != "xWEARABLE" -a "x$dali_profile" != "xTV" ; then
96   AC_MSG_ERROR([$enable_profile is an invalid profile])
97 fi
98
99 if test x$DALI_DATA_RW_DIR != x; then
100   dataReadWriteDir=${DALI_DATA_RW_DIR}/
101 else
102   dataReadWriteDir=${prefix}/share/dali/
103 fi
104
105 if test x$DALI_DATA_RO_DIR != x; then
106   dataReadOnlyDir=${DALI_DATA_RO_DIR}/
107 else
108   dataReadOnlyDir=${prefix}/share/dali/
109 fi
110
111 DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDALI_PROFILE_${dali_profile}"
112
113 # Style folder
114 STYLE_DIR=../../../dali-toolkit/styles
115 STYLE_DIR=$STYLE_DIR/$dali_style
116
117 AC_SUBST(STYLE_DIR)
118
119 # v8 version 4+ requires c++11
120 PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ],  [ pkg_check_v8=no  ] )
121
122 # Rules for building JavaScript plugin
123 # If enable_javascript=yes and v8 installed = build javascript
124 # If enable_javascript=automatic and v8 installed = build javascript
125 # If enable_javascript=yes and v8 not installed = throw an error
126 build_javascript_plugin=no
127 if test x$enable_javascript = xyes; then
128   if test x$pkg_check_v8 = xno; then
129     [build_javascript_plugin=no]
130     AC_MSG_ERROR("V8 not found or incorrect version installed")
131     AC_MSG_NOTICE("To disable building of JavaScript plugin use --disable-javascript")
132   else
133     [build_javascript_plugin=yes]
134     AC_MSG_NOTICE(V8 library found. Building DALi JavaScript plugin)
135   fi
136 fi
137 if test x$enable_javascript = xautomatic && test x$pkg_check_v8 = xyes; then
138   [build_javascript_plugin=yes]
139   AC_MSG_NOTICE( V8 library found. Automatic building of JavaScript plugin. Use  use --disable-javascript to disable)
140 fi
141
142
143 #set a variable for the makefile to force compile the JAvaSplugin
144 AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$build_javascript_plugin = xyes])
145
146 AC_SUBST(dataReadWriteDir)
147 AC_SUBST(dataReadOnlyDir)
148 AC_SUBST(DALI_TOOLKIT_CFLAGS)
149
150
151 # Specify the include directory for development headers
152 #devincludepath=${includedir}/dali/internal
153 devincludepath=${includedir}
154 AC_SUBST(devincludepath)
155
156 # Doxygen paths
157 DOXYGEN_DOCS_DIR=../../../docs
158 DOXYGEN_ROOT_DIR=../../..
159 AC_SUBST(DOXYGEN_DOCS_DIR)
160 AC_SUBST(DOXYGEN_ROOT_DIR)
161
162 AC_CONFIG_FILES([
163  Makefile
164  dali-toolkit/Makefile
165  plugins/Makefile
166  dali-toolkit.pc
167  docs/Makefile
168  docs/dali.doxy
169 ])
170
171 AC_OUTPUT
172
173 echo "
174 Configuration
175 -------------
176   Prefix:                           $prefix
177   Debug Build:                      $enable_debug
178   JavaScript support (V8 required)  $build_javascript_plugin
179   Profile:                          $dali_profile
180   Data Dir (Read/Write):            $dataReadWriteDir
181   Data Dir (Read Only):             $dataReadOnlyDir
182   Style Dir                         $STYLE_DIR
183   Style                             $dali_style
184 "