This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
248 lines (201 loc) · 6.77 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([com.kizos.libbus], [1.4.1])
AC_CANONICAL_HOST
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall subdir-objects])
# Checks for programs.
AM_PROG_AR
AC_PROG_CXX
LT_INIT
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stdint.h string.h])
AC_HEADER_STDBOOL
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([getpagesize memset])
# Add trailling spaces
test -n "${CPPFLAGS}" && CPPFLAGS+=" "
test -n "${CXXFLAGS}" && CXXFLAGS+=" "
test -n "${LIBS}" && LIBS+=" "
test -n "${LDFLAGS}" && LDFLAGS+=" "
#
# Kizbox framework
#
# The following variables set up some preprocessor macros you may use into you c/c++ source code or
# into the .in files.
#
FRAMEWORK_NAME='Bus'
FRAMEWORK_LT_VERSION_INFO='4:1:0'
APPLICATION_NAME="Test/${FRAMEWORK_NAME}"
APPLICATION_NAME_LC="$(echo ${APPLICATION_NAME} | sed 's/.*/\L&/')"
KIZBOX_FRAMEWORK_HOST_PREFIX='com.kizbox.Framework'
KIZBOX_FRAMEWORK_PATH_PREFIX='/com/kizbox/Framework'
FRAMEWORK_HOST="${KIZBOX_FRAMEWORK_HOST_PREFIX}.${FRAMEWORK_NAME}"
FRAMEWORK_PATH="${KIZBOX_FRAMEWORK_PATH_PREFIX}/${FRAMEWORK_NAME}"
OVERKIZ_APPLICATION_HOST_PREFIX="com.overkiz.Application"
OVERKIZ_APPLICATION_PATH_PREFIX="/com/overkiz/Application"
APPLICATION_HOST="${OVERKIZ_APPLICATION_HOST_PREFIX}.${APPLICATION_NAME}"
APPLICATION_PATH="${OVERKIZ_APPLICATION_PATH_PREFIX}/${APPLICATION_NAME}"
# Variables you may use as @MY_VAR@ into .in files:
AC_SUBST([FRAMEWORK_NAME])
AC_SUBST([FRAMEWORK_LT_VERSION_INFO])
AC_SUBST([KIZBOX_FRAMEWORK_HOST_PREFIX])
AC_SUBST([KIZBOX_FRAMEWORK_PATH_PREFIX])
AC_SUBST([FRAMEWORK_HOST])
AC_SUBST([FRAMEWORK_PATH])
AC_SUBST([APPLICATION_NAME])
AC_SUBST([APPLICATION_NAME_LC])
AC_SUBST([OVERKIZ_APPLICATION_HOST_PREFIX])
AC_SUBST([OVERKIZ_APPLICATION_PATH_PREFIX])
AC_SUBST([APPLICATION_HOST])
AC_SUBST([APPLICATION_PATH])
# C/C++ macros you may use into your source code:
AC_DEFINE_UNQUOTED([FRAMEWORK_NAME], ["${FRAMEWORK_NAME}"], [Defines framework name])
AC_DEFINE_UNQUOTED([KIZBOX_FRAMEWORK_HOST_PREFIX], ["${KIZBOX_FRAMEWORK_HOST_PREFIX}"], [Defines the host kizbox framework prefix])
AC_DEFINE_UNQUOTED([KIZBOX_FRAMEWORK_PATH_PREFIX], ["${KIZBOX_FRAMEWORK_PATH_PREFIX}"], [Defines the path kizbox framework prefix])
AC_DEFINE_UNQUOTED([FRAMEWORK_HOST], ["${FRAMEWORK_HOST}"], [Defines the host framework])
AC_DEFINE_UNQUOTED([FRAMEWORK_PATH], ["${FRAMEWORK_PATH}"], [Defines the path framework])
AC_DEFINE_UNQUOTED([APPLICATION_NAME], ["${APPLICATION_NAME}"], [Defines application name])
AC_DEFINE_UNQUOTED([APPLICATION_NAME_LC], ["${APPLICATION_NAME_LC}"], [Defines application name in lower case for log])
AC_DEFINE_UNQUOTED([OVERKIZ_APPLICATION_HOST_PREFIX], ["${OVERKIZ_APPLICATION_HOST_PREFIX}"], [Defines the host overkiz application prefix])
AC_DEFINE_UNQUOTED([OVERKIZ_APPLICATION_PATH_PREFIX], ["${OVERKIZ_APPLICATION_PATH_PREFIX}"], [Defines the path overkiz application prefix])
AC_DEFINE_UNQUOTED([APPLICATION_HOST], ["${APPLICATION_HOST}"], [Defines the host application])
AC_DEFINE_UNQUOTED([APPLICATION_PATH], ["${APPLICATION_PATH}"], [Defines the path application])
# Here you may add some application constants
# ...
#
# Pkg-config
#
# The following variables set up the pkg-config file.
#
PKGCONFIG_DESCRIPTION="Framework ${FRAMEWORK_NAME}"
PKGCONFIG_URL="https://github.com/Overkiz/libbus"
PKGCONFIG_REQUIRES=
PKGCONFIG_PRIVATE_REQUIRES=
PKGCONFIG_CONFLICTS=
PKGCONFIG_LIBDIRS="-L\${libdir}"
PKGCONFIG_LIBS="-l${FRAMEWORK_NAME}"
PKGCONFIG_PRIVATE_LIBS=
PKGCONFIG_INCDIRS="-I\${includedir}"
PKGCONFIG_DEFS=
AC_SUBST([PKGCONFIG_DESCRIPTION])
AC_SUBST([PKGCONFIG_URL])
AC_SUBST([PKGCONFIG_REQUIRES])
AC_SUBST([PKGCONFIG_PRIVATE_REQUIRES])
AC_SUBST([PKGCONFIG_CONFLICTS])
AC_SUBST([PKGCONFIG_LIBDIRS])
AC_SUBST([PKGCONFIG_LIBS])
AC_SUBST([PKGCONFIG_PRIVATE_LIBS])
AC_SUBST([PKGCONFIG_INCDIRS])
AC_SUBST([PKGCONFIG_DEFS])
# Checks for packages.
AC_ARG_ENABLE(
[pkg-config],
[AS_HELP_STRING([--disable-pkg-config], [Disable pkg-config [default=no]])],
[
case "${enableval}" in
yes) pkgconfig='true';;
no) pkgconfig='false';;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-pkg-config]);;
esac
],
[
pkgconfig='true'
]
)
AM_CONDITIONAL([PKGCONFIG], [test x${pkgconfig} = xtrue])
AC_ARG_ENABLE(
[pkg-config-check],
[AS_HELP_STRING([--disable-pkg-config-check], [Disable pkg-config check [default=no]])],
[
case "${enableval}" in
yes) pkgconfigcheck='true';;
no) pkgconfigcheck='false';;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-pkg-config-check]);;
esac
],
[
pkgconfigcheck='true'
]
)
if test "${pkgconfigcheck}" = 'true' ; then
PKG_CHECK_MODULES(
[libcore],
[com.kizos.libcore >= 1.6],
[
test -n "${PKGCONFIG_REQUIRES}" && PKGCONFIG_REQUIRES+=", "
PKGCONFIG_REQUIRES+="com.kizos.libcore >= 1.6"
CPPFLAGS+=" $(pkg-config --cflags-only-other com.kizos.libcore) "
]
)
PKG_CHECK_MODULES(
[libdbus_1],
[dbus-1],
[
test -n "${PKGCONFIG_REQUIRES}" && PKGCONFIG_REQUIRES+=", "
PKGCONFIG_REQUIRES+="dbus-1"
CXXFLAGS+=" $(pkg-config --cflags-only-I dbus-1) "
]
)
fi
AC_MSG_CHECKING([whether system bus])
AC_ARG_ENABLE(
[system-bus],
AS_HELP_STRING([--disable-system-bus], [Disable system bus as default bus [default=no]]),
[
case "${enableval}" in
yes) systembus='true';;
no) systembus='false';;
*) AC_MSG_ERROR([bad value ${withval} for --disable-system-bus]);;
esac
],
[
systembus='true'
]
)
AC_MSG_RESULT([${systembus}])
SYSTEM_BUS=${systembus}
AC_SUBST([SYSTEM_BUS])
AC_MSG_CHECKING([whether assertions are enabled])
AC_ARG_ENABLE(
[assertions],
[AC_HELP_STRING([--enable-assertions], [Enable assertions [default=no]])],
[
case "${enableval}" in
yes) assert='true';;
no) assert='false';;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-assertions]);;
esac
],
[
assert='false'
]
)
if test "${assert}" = 'true'; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_DEFINE([NDEBUG], [], [Disable assertions])
fi
AC_CONFIG_FILES(
[
Makefile
include/Makefile
include/kizbox/framework/bus/Connection.h
include/kizbox/framework/bus/Object.h
src/Makefile
pkg-config.pc
]
)
AC_OUTPUT