Merge "LLVM/Emscripten fixes" into devel/master
[platform/core/uifw/dali-core.git] / build / tizen / configure.ac
1 # Copyright (c) 2014 Samsung Electronics Co., Ltd.
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6
7 # http://www.apache.org/licenses/LICENSE-2.0
8
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 m4_define([dali_version],[0.1.1])
17 AC_INIT([dali], [dali_version])
18 AM_INIT_AUTOMAKE([-Wall foreign])
19
20 AC_PROG_CXX
21 AC_PROG_LIBTOOL
22 AC_PROG_MKDIR_P
23
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26 LT_INIT
27
28 DALI_VERSION=dali_version
29 AC_SUBST(DALI_VERSION)
30
31 DALI_CFLAGS=-DPLATFORM_TIZEN
32
33 AC_ARG_ENABLE(exportall,
34               [AC_HELP_STRING([--enable-exportall],
35                               [enables the exporting of all the symbols in the library])],
36               [enable_exportall=yes],
37               [enable_exportall=no])
38
39 AC_ARG_ENABLE([debug],
40               [AC_HELP_STRING([--enable-debug],
41                               [Turns on debugging])],
42               [enable_debug=$enableval],
43               [enable_debug=no])
44
45 AC_ARG_ENABLE([emscripten],
46               [AC_HELP_STRING([--enable-emscripten],
47                               [Emscripten builds])],
48               [enable_emscripten=$enableval],
49               [enable_emscripten=no])
50
51 AC_ARG_ENABLE([backtrace],
52               [AC_HELP_STRING([--enable-backtrace],
53                               [Backtrace for exceptions])],
54               [enable_backtrace=$enableval],
55               [enable_backtrace=yes])
56
57 AC_ARG_ENABLE([lock_backtrace],
58               [AC_HELP_STRING([--enable-lock-backtrace],
59                               [Backtrace for when more than 1 lock is held on the same thread])],
60               [enable_lock_backtrace=$enableval],
61               [enable_lock_backtrace=no])
62
63 AC_ARG_ENABLE([gles],
64               [AC_HELP_STRING([--enable-gles],
65                               [Specify the OpenGL ES version for backwards compatibility])],
66               [enable_gles=$enableval],
67               [enable_gles=20])
68
69 DALI_CFLAGS="$DALI_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
70
71 if test "x$enable_debug" = "xyes"; then
72   DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
73 fi
74
75 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
76   DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
77 fi
78
79 if test "x$enable_emscripten" = "xyes"; then
80   DALI_CFLAGS="$DALI_CFLAGS -DEMSCRIPTEN -std=c++11"
81   # Automatically turn off backtrace support and mutex locks
82   enable_backtrace="no"
83   enable_lock_backtrace="no"
84 fi
85
86 # Must come after Emscripten feature test
87 if test "x$enable_lock_backtrace" = "xyes"; then
88   DALI_CFLAGS="$DALI_CFLAGS -DLOCK_BACKTRACE_ENABLED"
89   enable_backtrace="yes"
90 fi
91
92 # Must come after Emscripten & locks backtrace feature test
93 if test "x$enable_backtrace" = "xyes"; then
94   DALI_CFLAGS="$DALI_CFLAGS -DBACKTRACE_ENABLED"
95 fi
96
97 if test x$DALI_DATA_RW_DIR != x; then
98   dataReadWriteDir=$DALI_DATA_RW_DIR
99 else
100   dataReadWriteDir=${prefix}/share/dali/
101 fi
102
103 if test x$DALI_DATA_RO_DIR != x; then
104   dataReadOnlyDir=$DALI_DATA_RO_DIR
105 else
106   dataReadOnlyDir=${prefix}/share/dali/
107 fi
108
109 DALI_CFLAGS="$DALI_CFLAGS -I${includedir}"
110 DALI_LDFLAGS="-L${libdir}"
111
112 AC_SUBST(dataReadWriteDir)
113 AC_SUBST(dataReadOnlyDir)
114 AC_SUBST(DALI_CFLAGS)
115 AC_SUBST(DALI_LDFLAGS)
116
117 # Specify the include directory for development headers
118 devincludepath=${includedir}
119 AC_SUBST(devincludepath)
120
121 AC_CONFIG_FILES([
122  Makefile
123  dali-core/Makefile
124  dali-core.pc
125 ])
126
127 AC_OUTPUT
128
129 echo "
130 Configuration
131 -------------
132   Prefix:                           $prefix
133   Debug Build:                      $enable_debug
134   Data Dir (Read/Write):            $dataReadWriteDir
135   Data Dir (Read Only):             $dataReadOnlyDir
136   Emscripten:                       $enable_emscripten
137   Backtrace:                        $enable_backtrace
138   ScopedLock Backtrace:             $enable_lock_backtrace
139 "