Changed configure/makefile to work with v8 package config
[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 PKG_CHECK_MODULES(FRIBIDI, fribidi)
34
35 DALI_TOOLKIT_CFLAGS=-DPLATFORM_TIZEN
36
37 AC_ARG_ENABLE(exportall,
38               [AC_HELP_STRING([--enable-exportall],
39                               [enables the exporting of all the symbols in the library])],
40               [enable_exportall=yes],
41               [enable_exportall=no])
42
43 AC_ARG_ENABLE([debug],
44               [AC_HELP_STRING([--enable-debug],
45                               [Turns on debugging])],
46               [enable_debug=$enableval],
47               [enable_debug=no])
48
49 # option to build JavaScript plugin
50 # configure settings and output
51 # --enable-javascript        // enable_javascript = yes
52 # --enable-javascript=yes    // enable_javascript = yes
53 # --enable-javascript=no     // enable_javascript = no
54 # --disable-javascript       // enable_javascript = no
55 #  no setting                // enable_javascript = automatic ( enable if v8 present)
56 AC_ARG_ENABLE([javascript],
57               [AC_HELP_STRING([--enable-javascript],
58                [Enable JavaScript plugin])] ,
59                [enable_javascript=$enableval],
60                [enable_javascript=automatic])
61
62
63 if test "x$enable_debug" = "xyes"; then
64   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
65 fi
66
67 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
68   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
69 fi
70
71
72
73
74 # Tizen Profile options
75 AC_ARG_ENABLE([profile],
76               [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV],
77                             [Select the variant of tizen])],
78               [dali_profile=$enableval],
79               [dali_profile=COMMON])
80
81 if test x$DALI_DATA_RW_DIR != x; then
82   dataReadWriteDir=${DALI_DATA_RW_DIR}/
83 else
84   dataReadWriteDir=${prefix}/share/dali/
85 fi
86
87 if test x$DALI_DATA_RO_DIR != x; then
88   dataReadOnlyDir=${DALI_DATA_RO_DIR}/
89 else
90   dataReadOnlyDir=${prefix}/share/dali/
91 fi
92
93 # v8 version 4+ requires c++11
94 PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ],  [ pkg_check_v8=no  ] )
95
96 # Rules for building JavaScript plugin
97 # If enable_javascript=yes and v8 installed = build javascript
98 # If enable_javascript=automatic and v8 installed = build javascript
99 # If enable_javascript=yes and v8 not installed = throw an error
100 build_javascript_plugin=no
101 if test x$enable_javascript = xyes; then
102   if test x$pkg_check_v8 = xno; then
103     [build_javascript_plugin=no]
104     AC_MSG_ERROR("V8 not found or incorrect version installed")
105     AC_MSG_NOTICE("To disable building of JavaScript plugin use --disable-javascript")
106   else
107     [build_javascript_plugin=yes]
108     AC_MSG_NOTICE(V8 library found. Building DALi JavaScript plugin)
109   fi
110 fi
111 if test x$enable_javascript = xautomatic && test x$pkg_check_v8 = xyes; then
112   [build_javascript_plugin=yes]
113   AC_MSG_NOTICE( V8 library found. Automatic building of JavaScript plugin. Use  use --disable-javascript to disable)
114 fi
115
116
117 #set a variable for the makefile to force compile the JAvaSplugin
118 AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$build_javascript_plugin = xyes])
119
120 AC_SUBST(dataReadWriteDir)
121 AC_SUBST(dataReadOnlyDir)
122 AC_SUBST(DALI_TOOLKIT_CFLAGS)
123
124
125 # Specify the include directory for development headers
126 #devincludepath=${includedir}/dali/internal
127 devincludepath=${includedir}
128 AC_SUBST(devincludepath)
129
130 # Doxygen paths
131 DOXYGEN_DOCS_DIR=../../../docs
132 DOXYGEN_ROOT_DIR=../../..
133 AC_SUBST(DOXYGEN_DOCS_DIR)
134 AC_SUBST(DOXYGEN_ROOT_DIR)
135
136 AC_CONFIG_FILES([
137  Makefile
138  dali-toolkit/Makefile
139  plugins/Makefile
140  dali-toolkit.pc
141  docs/Makefile
142  docs/dali.doxy
143 ])
144
145 AC_OUTPUT
146
147 echo "
148 Configuration
149 -------------
150   Prefix:                           $prefix
151   Debug Build:                      $enable_debug
152   JavaScript support (V8 required)  $build_javascript_plugin
153   Profile:                          $dali_profile
154   Data Dir (Read/Write):            $dataReadWriteDir
155   Data Dir (Read Only):             $dataReadOnlyDir
156 "