Added Trace Functionality using Performance Server.
[platform/core/uifw/dali-core.git] / build / tizen / configure.ac
1 # Copyright (c) 2018 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 # Use C++ 11
34 DALI_CFLAGS="$DALI_CFLAGS -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal"
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([backtrace],
49               [AC_HELP_STRING([--enable-backtrace],
50                               [Backtrace for exceptions])],
51               [enable_backtrace=$enableval],
52               [enable_backtrace=yes])
53
54 AC_ARG_ENABLE([lock_backtrace],
55               [AC_HELP_STRING([--enable-lock-backtrace],
56                               [Backtrace for when more than 1 lock is held on the same thread])],
57               [enable_lock_backtrace=$enableval],
58               [enable_lock_backtrace=no])
59
60 AC_ARG_ENABLE([gles],
61               [AC_HELP_STRING([--enable-gles],
62                               [Specify the OpenGL ES version for backwards compatibility])],
63               [enable_gles=$enableval],
64               [enable_gles=20])
65
66 AC_ARG_ENABLE([cxx03_abi],
67               [AC_HELP_STRING([--enable-cxx03-abi],
68                               [Specify abi for the build])],
69               [enable_cxx03_abi=$enableval],
70               [enable_cxx03_abi=no])
71
72 AC_ARG_ENABLE([rename_so],
73               [AC_HELP_STRING([--enable-rename-so],
74                               [Specify whether so file is renamed or not])],
75               [enable_rename_so=$enableval],
76               [enable_rename_so=yes])
77
78 AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
79 AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
80
81 if test "x$enable_cxx03_abi" = "xyes"; then
82   DALI_CFLAGS="$DALI_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
83 fi
84
85 DALI_CFLAGS="$DALI_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
86
87 if test "x$enable_debug" = "xyes"; then
88   DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
89 fi
90
91 if test "x$enable_trace" = "xyes"; then
92   DALI_CFLAGS="$DALI_CFLAGS -DTRACE_ENABLED"
93 fi
94
95 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
96   DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
97 fi
98
99 if test "x$enable_lock_backtrace" = "xyes"; then
100   DALI_CFLAGS="$DALI_CFLAGS -DLOCK_BACKTRACE_ENABLED"
101   enable_backtrace="yes"
102 fi
103
104 # Must come after locks backtrace feature test
105 if test "x$enable_backtrace" = "xyes"; then
106   DALI_CFLAGS="$DALI_CFLAGS -DBACKTRACE_ENABLED"
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_CFLAGS="$DALI_CFLAGS -I${includedir}"
122 DALI_LDFLAGS="-L${libdir}"
123
124 AC_SUBST(dataReadWriteDir)
125 AC_SUBST(dataReadOnlyDir)
126 AC_SUBST(DALI_CFLAGS)
127 AC_SUBST(DALI_LDFLAGS)
128
129 # Specify the include directory for development headers
130 devincludepath=${includedir}
131 AC_SUBST(devincludepath)
132
133 AC_CONFIG_FILES([Makefile dali-core/Makefile])
134
135 if test "x$enable_cxx03_abi" = "xyes"; then
136 AC_CONFIG_FILES([dali-core-cxx03.pc])
137 fi
138
139 if test "x$enable_cxx03_abi" != "xyes"; then
140 AC_CONFIG_FILES([dali-core.pc])
141 fi
142
143 AC_OUTPUT
144
145 echo "
146 Configuration
147 -------------
148   Prefix:                           $prefix
149   Debug Build:                      $enable_debug
150   Trace Build:                      $enable_trace
151   Data Dir (Read/Write):            $dataReadWriteDir
152   Data Dir (Read Only):             $dataReadOnlyDir
153   Backtrace:                        $enable_backtrace
154   ScopedLock Backtrace:             $enable_lock_backtrace
155   OpenGL ES version:                $enable_gles
156   C++03 ABI:                        $enable_cxx03_abi
157   Rename so file:                   $enable_rename_so
158 "