forked from AravisProject/aravis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
310 lines (252 loc) · 10 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
AC_PREREQ(2.63.0)
m4_define([aravis_version_major], [0])
m4_define([aravis_version_minor], [5])
m4_define([aravis_version_micro], [8])
m4_define([aravis_version], [aravis_version_major.aravis_version_minor.aravis_version_micro])
AC_INIT([aravis],[aravis_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=aravis],[aravis])
AM_INIT_AUTOMAKE([-Wno-portability dist-bzip2 dist-xz foreign])
AM_MAINTAINER_MODE
AC_CONFIG_HEADERS([src/arvconfig.h])
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_SUBST([ARAVIS_API_VERSION], [0.6])
AC_SUBST([ARAVIS_API_VERSION_U],[AS_TR_SH([$ARAVIS_API_VERSION])])
ARAVIS_MAJOR_VERSION=aravis_version_major
ARAVIS_MINOR_VERSION=aravis_version_minor
ARAVIS_MICRO_VERSION=aravis_version_micro
ARAVIS_VERSION=aravis_version
AC_SUBST(ARAVIS_MAJOR_VERSION)
AC_SUBST(ARAVIS_MINOR_VERSION)
AC_SUBST(ARAVIS_MICRO_VERSION)
AC_SUBST(ARAVIS_VERSION)
AC_SEARCH_LIBS([strerror],[cposix])
AC_PROG_CC
AC_PROG_CXX
AC_HEADER_STDC
AC_SUBST(GETTEXT_PACKAGE, aravis-${ARAVIS_API_VERSION})
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.31.2])
LT_INIT()
AX_VALGRIND_CHECK()
AX_CODE_COVERAGE()
AC_ARG_ENABLE(usb,
[AS_HELP_STRING([--enable-usb],
[build with USB support [default=auto]])],
[enable_usb=$enableval],
[enable_usb=auto])
AC_ARG_ENABLE(packet_socket,
[AS_HELP_STRING([--enable-packet-socket],
[build with packet socket support [default=auto]])],
[enable_packet_socket=$enableval],
[enable_packet_socket=auto])
AC_ARG_ENABLE(viewer,
[AS_HELP_STRING([--enable-viewer],
[build viewer [default=auto]])],
[enable_viewer=$enableval],
[enable_viewer=auto])
AC_ARG_ENABLE(gst_plugin,
[AS_HELP_STRING([--enable-gst-plugin],
[build gstreamer plugin [default=auto]])],
[enable_gst_plugin=$enableval],
[enable_gst_plugin=auto])
AC_ARG_ENABLE(gst_0_10_plugin,
[AS_HELP_STRING([--enable-gst-0.10-plugin],
[build gstreamer-0.10 plugin [default=auto]])],
[enable_gst_0_10_plugin=$enableval],
[enable_gst_0_10_plugin=auto])
AC_ARG_ENABLE(cpp_test,
[AS_HELP_STRING([--enable-cpp-test],
[build c++ test [default=no]])],
[enable_cpp_test=$enableval],
[enable_cpp_test=no])
AC_ARG_ENABLE(zlib_pc,
[AS_HELP_STRING([--enable-zlib-pc],
[use pkg-config for zlib dependency [default=yes]])],
[enable_zlib_pc=$enableval],
[enable_zlib_pc=yes])
AC_ARG_ENABLE(fast_heartbeat,
[AS_HELP_STRING([--enable-fast-heartbeat],
[build with extremely fast heartbeat [default=no]])],
[enable_fast_heartbeat=$enableval],
[enable_fast_heartbeat=no])
AC_ARG_ENABLE(asan,
[AC_HELP_STRING([--enable-asan],
[build with address sanitizer [default=no]])],
[enable_asan=$enableval],
[enable_asan=no])
PKG_PROG_PKG_CONFIG([0.14])
ARAVIS_REQUIREMENTS="glib-2.0 >= 2.26 gobject-2.0 gio-2.0 libxml-2.0 gthread-2.0"
ARAVIS_USB_REQUIREMENTS="libusb-1.0"
ARAVIS_PACKET_SOCKET_REQUIREMENTS="audit libcap-ng"
ARAVIS_GSTREAMER_REQUIREMENTS="gstreamer-base-1.0 gstreamer-app-1.0"
ARAVIS_GSTREAMER_0_10_REQUIREMENTS="gstreamer-base-0.10 gstreamer-app-0.10"
ARAVIS_VIEWER_REQUIREMENTS="$ARAVIS_GSTREAMER_REQUIREMENTS gstreamer-video-1.0 gtk+-3.0 >= 3.12 libnotify"
# Conditional use of zlib.pc, as it doesn't exist on old setup
if test "x$enable_zlib_pc" = "xyes"; then
ARAVIS_REQUIREMENTS="${ARAVIS_REQUIREMENTS} zlib"
ARAVIS_ADDITIONAL_LIBS="-lm"
else
ARAVIS_ADDITIONAL_LIBS="-lm -lz"
fi
# USB support
# ===========
build_usb=no
if test "x$enable_usb" = "xyes" || test "x$enable_usb" = "xauto"; then
PKG_CHECK_MODULES([ARAVIS_USB], [$ARAVIS_USB_REQUIREMENTS],
[AC_DEFINE([ARAVIS_BUILD_USB], [1], [Build USB support]) build_usb=yes],
[AS_IF([test "x$enable_usb" = "xyes"],
AC_MSG_ERROR([${ARAVIS_USB_PKG_ERRORS} - Can not build USB support]))]);
fi
AM_CONDITIONAL(ARAVIS_BUILD_USB, test "x$build_usb" = "xyes")
if test "x$build_usb" = "xyes"; then
ARAVIS_REQUIREMENTS="${ARAVIS_REQUIREMENTS} ${ARAVIS_USB_REQUIREMENTS}"
AC_SUBST([ARAVIS_HAS_USB],[1])
else
AC_SUBST([ARAVIS_HAS_USB],[0])
fi
# Packet socket support
# ===================
build_packet_socket=no
if test "x$enable_packet_socket" = "xyes" || test "x$enable_packet_socket" = "xauto"; then
PKG_CHECK_MODULES([ARAVIS_PACKET_SOCKET], [$ARAVIS_PACKET_SOCKET_REQUIREMENTS],
[AC_DEFINE([ARAVIS_BUILD_PACKET_SOCKET], [1], [Build packet socket support]) build_packet_socket=yes],
[AS_IF([test "x$enable_packet_socket" = "xyes"],
AC_MSG_ERROR([${ARAVIS_PACKET_SOCKET_PKG_ERRORS} - Can not build packet socket support]))]);
fi
AM_CONDITIONAL(ARAVIS_BUILD_PACKET_SOCKET, test "x$build_packet_socket" = "xyes")
if test "x$build_packet_socket" = "xyes"; then
ARAVIS_REQUIREMENTS="${ARAVIS_REQUIREMENTS} ${ARAVIS_PACKET_SOCKET_REQUIREMENTS}"
AC_SUBST([ARAVIS_HAS_PACKET_SOCKET],[1])
else
AC_SUBST([ARAVIS_HAS_PACKET_SOCKET],[0])
fi
PKG_CHECK_MODULES(ARAVIS, [$ARAVIS_REQUIREMENTS])
# Standard math library doesn't come with a pkgconfig file.
ARAVIS_LIBS="${ARAVIS_ADDITIONAL_LIBS} ${ARAVIS_LIBS}"
AC_SUBST(ARAVIS_CFLAGS)
AC_SUBST(ARAVIS_LIBS)
AC_SUBST(aravis_datadir, '$(datadir)/aravis-$(ARAVIS_API_VERSION)')
# Viewer
# ======
build_viewer=no
if test "x$enable_viewer" = "xyes" || test "x$enable_viewer" = "xauto"; then
PKG_CHECK_MODULES([ARAVIS_VIEWER], [$ARAVIS_VIEWER_REQUIREMENTS],
[AC_DEFINE([ARAVIS_BUILD_VIEWER], [1], [Build viewer]) build_viewer=yes],
[AS_IF([test "x$enable_viewer" = "xyes"],
AC_MSG_ERROR([${ARAVIS_VIEWER_PKG_ERRORS} - Can not build viewer]))]);
fi
AM_CONDITIONAL(ARAVIS_BUILD_VIEWER, test "x$build_viewer" = "xyes")
# Standard math library doesn't come with a pkgconfig file.
ARAVIS_VIEWER_LIBS="${ARAVIS_ADDITIONAL_LIBS} ${ARAVIS_VIEWER_LIBS}"
AC_SUBST(ARAVIS_VIEWER_CFLAGS)
AC_SUBST(ARAVIS_VIEWER_LIBS)
# GStreamer plugin
# ================
build_gst_plugin=no
if test "x$enable_gst_plugin" = "xyes" || test "x$enable_gst_plugin" = "xauto"; then
PKG_CHECK_MODULES([ARAVIS_GST_PLUGIN], [$ARAVIS_GSTREAMER_REQUIREMENTS],
[AC_DEFINE([ARAVIS_BUILD_GST_PLUGIN], [1], [Build gstreamer plugin]) build_gst_plugin=yes],
[AS_IF([test "x$enable_gst_plugin" = "xyes"],
AC_MSG_ERROR([${ARAVIS_GST_PLUGIN_PKG_ERRORS} - Can not build gstreamer plugin]))]);
fi
AM_CONDITIONAL(ARAVIS_BUILD_GST_PLUGIN, test "x$build_gst_plugin" = "xyes")
# Standard math library doesn't come with a pkgconfig file.
ARAVIS_GST_PLUGIN_LIBS="${ARAVIS_ADDITIONAL_LIBS} ${ARAVIS_GST_PLUGIN_LIBS}"
AC_SUBST(ARAVIS_GST_PLUGIN_CFLAGS)
AC_SUBST(ARAVIS_GST_PLUGIN_LIBS)
if test "x${prefix}" = "x$HOME"; then
gstplugindir="$HOME/.gstreamer-1.0/plugins"
else
gstplugindir="\$(libdir)/gstreamer-1.0"
fi
AC_SUBST(gstplugindir)
GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_PLUGIN_LDFLAGS)
# GStreamer-0.10 plugin
# =====================
build_gst_0_10_plugin=no
if test "x$enable_gst_0_10_plugin" = "xyes" || test "x$enable_gst_0_10_plugin" = "xauto"; then
PKG_CHECK_MODULES([ARAVIS_GST_0_10_PLUGIN], [$ARAVIS_GSTREAMER_0_10_REQUIREMENTS],
[AC_DEFINE([ARAVIS_BUILD_GST_0_10_PLUGIN], [1], [Build gstreamer-0.10 plugin]) build_gst_0_10_plugin=yes],
[AS_IF([test "x$enable_gst_0_10_plugin" = "xyes"],
AC_MSG_ERROR([${ARAVIS_GST_0_10_PLUGIN_PKG_ERRORS} - Can not build gstreamer plugin]))]);
fi
AM_CONDITIONAL(ARAVIS_BUILD_GST_0_10_PLUGIN, test "x$build_gst_0_10_plugin" = "xyes")
# Standard math library doesn't come with a pkgconfig file.
ARAVIS_GST_0_10_PLUGIN_LIBS="${ARAVIS_ADDITIONAL_LIBS} ${ARAVIS_GST_0_10_PLUGIN_LIBS}"
AC_SUBST(ARAVIS_GST_0_10_PLUGIN_CFLAGS)
AC_SUBST(ARAVIS_GST_0_10_PLUGIN_LIBS)
if test "x${prefix}" = "x$HOME"; then
gst010plugindir="$HOME/.gstreamer-0.10/plugins"
else
gst010plugindir="\$(libdir)/gstreamer-0.10"
fi
AC_SUBST(gst010plugindir)
GST_0_10_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_0_10_PLUGIN_LDFLAGS)
# Fast heartbeat
# =============
build_fast_heartbeat=no
if test "x$enable_fast_heartbeat" = "xyes" ; then
build_fast_heartbeat=yes
AC_DEFINE([ARAVIS_FAST_HEARTBEAT], [], [Build with a much fast heartbeat rate])
fi
AM_CONDITIONAL(ARAVIS_FAST_HEARTBEAT, test "x$build_fast_heartbeat" = "xyes")
# C++ test
# ========
AM_CONDITIONAL(ARAVIS_BUILD_CPP_TEST, test "x$enable_cpp_test" = "xyes")
# Address sanatizer
# =================
AC_MSG_CHECKING([for asan flags])
if test "x$enable_asan" = "xyes"; then
CFLAGS="$CFLAGS -fsanitize=address -O1 -fno-omit-frame-pointer -g"
build_with_asan="yes"
else
build_with_asan="no"
fi
AM_CONDITIONAL(ARAVIS_WITH_ASAN, test "x$enable_asan" = "xyes")
AC_MSG_RESULT($build_with_asan)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([0.10.0])
], [
AM_CONDITIONAL([HAVE_INTROSPECTION], [false])
enable_introspection=no])
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
APPSTREAM_XML
AC_CONFIG_FILES([
Makefile
src/Makefile
src/arvfeatures.h
src/arvversion.h
viewer/Makefile
viewer/data/Makefile
viewer/data/arv-viewer.desktop.in
viewer/data/arv-viewer.appdata.xml
gst/Makefile
gst-0.10/Makefile
tests/Makefile
po/Makefile.in
docs/Makefile
docs/reference/Makefile
docs/reference/aravis/Makefile
aravis.pc
])
AC_OUTPUT
echo ""
echo "Configuration:"
echo ""
echo " Compiler: ${CC}"
echo " Compiler flags: ${ARAVIS_CFLAGS}"
echo " Linker flags: ${ARAVIS_LIBS}"
echo ""
echo " Build USB support: $build_usb"
echo " Build packet socket support: $build_packet_socket"
echo " Build viewer: $build_viewer"
echo " Build gstreamer plugin: $build_gst_plugin"
echo " Build gstreamer-0.10 plugin: $build_gst_0_10_plugin"
echo " Build with fast heartbeat: $build_fast_heartbeat"
echo " Build with address sanatizer: $build_with_asan"
echo ""