-
Notifications
You must be signed in to change notification settings - Fork 55
/
configure.ac
326 lines (266 loc) · 8.88 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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
dnl required version of autoconf
AC_PREREQ([2.53])
dnl Gstreamer's daemon package name and version
AC_INIT([gstd],[0.15.2])
dnl required version of gstreamer and gst-plugins-base
GST_REQUIRED=1.0.0
dnl required version of gio
GIO_REQUIRED=2.44.1
dnl required version of gio-unix
GIO_UNIX_REQUIRED=2.44.1
dnl required version of gjson
GJSON_REQUIRED=0.16.2
dnl required version of libdaemon
LIBD_REQUIRED=0.14
dnl required version of jansson
JANSSON_REQUIRED=2.7
dnl required version of libedit
LIBEDIT_REQUIRED=3.0
dnl required version of systemd
SYSTEMD_REQUIRED=232
AC_CONFIG_SRCDIR([gstd/gstd.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
dnl required version of automake
AM_INIT_AUTOMAKE([1.10 subdir-objects])
dnl enable mainainer mode by default
AM_MAINTAINER_MODE([enable])
AC_WARNING([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
AC_WARNING([Autotools will be deprecated in the next Gstd release! Please migrate to Meson])
AC_WARNING([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
AC_MSG_WARN([Autotools will be deprecated in the next Gstd release! Please migrate to Meson])
AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
dnl check for tools (compiler etc.)
AM_PROG_CC_C_O
dnl required version of libtool
LT_PREREQ([2.2.6])
LT_INIT
GSTD_API_VERSION=1.0
AC_SUBST(GSTD_API_VERSION)
dnl error out if we can't find pkg-config
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [
AC_MSG_ERROR([You need to have pkg-config installed or set the PATH.])
])
PKG_CHECK_MODULES(GST, [
gstreamer-1.0 >= $GST_REQUIRED
gstreamer-base-1.0 >= $GST_REQUIRED
gstreamer-check-1.0 >= $GST_REQUIRED
], [
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
], [
AC_MSG_ERROR([
Can't find the following GStreamer development packages:
gstreamer-1.0 >= $GST_REQUIRED
gstreamer-base-1.0 >= $GST_REQUIRED
Please make sure you have the necessary GStreamer-1.0
development headers installed.
On debian/Ubuntu systems you will probably need to install the
'libgstreamer1.0-dev' and 'libgstreamer-plugins-base1.0-dev' packages.
On RPM-based systems you will probably need to install the
'gstreamer-devel-1.0' package.
])
])
PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.32])
AC_SUBST(LIBSOUP_CFLAGS)
AC_SUBST(LIBSOUP_LIBS)
PKG_CHECK_MODULES(GIO, [
gio-2.0 >= $GST_REQUIRED
], [
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
], [
AC_MSG_ERROR([
Can't find the following GIO development packages:
gio-2.0 >= $GIO_REQUIRED
Please make sure you have the necessary GIO-2.0
development headers installed.
])
])
PKG_CHECK_MODULES(GIO_UNIX, [
gio-unix-2.0 >= $GIO_UNIX_REQUIRED
], [
AC_SUBST(GIO_UNIX_CFLAGS)
AC_SUBST(GIO_UNIX_LIBS)
], [
AC_MSG_ERROR([
Can't find the following GIO-UNIX development packages:
gio-unix-2.0 >= $GIO_UNIX_REQUIRED
Please make sure you have the necessary GIO-UNIX-2.0
development headers installed.
On debian/Ubuntu systems you will probably need to install the
'libglib2.0-dev' package.
])
])
PKG_CHECK_MODULES(GJSON, [
json-glib-1.0 >= $GJSON_REQUIRED
], [
AC_SUBST(GJSON_CFLAGS)
AC_SUBST(GJSON_LIBS)
], [
AC_MSG_ERROR([
Can't find the following GIO development packages:
json-glib-1.0 >= $GJSON_REQUIRED
Please make sure you have the necessary json-glib-1.0
development headers installed.
])
])
dnl check for gtk-doc
GTK_DOC_CHECK([1.14])
PKG_CHECK_MODULES(LIBEDIT, [
libedit >= $LIBEDIT_REQUIRED
], [
AC_SUBST(LIBEDIT_CFLAGS)
AC_SUBST(LIBEDIT_LIBS)
], [
AC_MSG_ERROR([
Can't find libedit development packages:
libedit-dev >= $LIBEDIT_REQUIRED
Please make sure you have the necessary libdedit-dev
development files installed.
])
])
PKG_CHECK_MODULES(LIBD, [
libdaemon >= $LIBD_REQUIRED
], [
AC_SUBST(LIBD_CFLAGS)
AC_SUBST(LIBD_LIBS)
], [
AC_MSG_ERROR([
Can't find libdaemon development packages:
libdaemon-dev >= $LIBD_REQUIRED
Please make sure you have the necessary libdaemon-dev
development headers installed.
])
])
PKG_CHECK_MODULES(JANSSON, [
jansson >= $JANSSON_REQUIRED
], [
AC_SUBST(JANSSON_CFLAGS)
AC_SUBST(JANSSON_LIBS)
], [
AC_MSG_ERROR([
Can't find janssonaemon development packages:
libjansson-dev >= $JANSSON_REQUIRED
Please make sure you have the necessary libjansson-dev
development headers installed.
])
])
dnl allow the user to specify the location of the PID files
default=${localstatedir}/run/gstd/
AC_ARG_WITH([gstd-runstatedir],
[AS_HELP_STRING([--with-gstd-runstatedir],
[Specify the location of the gstd's PID file @<:@default=${default}@:>@])],
[AC_SUBST(GSTD_RUN_STATE_DIR, [$with_gstd_runstatedir])],
[AC_SUBST(GSTD_RUN_STATE_DIR, [$default])])
dnl allow the user to specify the location of the log files
default=${localstatedir}/log/gstd/
AC_ARG_WITH([gstd-logstatedir],
[AS_HELP_STRING([--with-gstd-logstatedir],
[Specify the location of gstd's log files @<:@default=${default}@:>@])],
[AC_SUBST([GSTD_LOG_STATE_DIR], [$with_gstd_logstatedir/])],
[AC_SUBST([GSTD_LOG_STATE_DIR], [$default])])
dnl allow the user to disable systemd gstd.service install
systemd=true
systemd_required=true
AC_ARG_ENABLE(systemd,
AS_HELP_STRING([--enable-systemd], [Enable/disable install of systemd gstd.service]),
[ if test "x$enable_systemd" = "xno" ; then
systemd=false
systemd_required=false
fi
],
[
systemd_required=false
])
dnl check for systemd dependency
if test "$systemd" = true; then
PKG_CHECK_MODULES(SYSTEMD, [
systemd >= $SYSTEMD_REQUIRED
], [
AC_SUBST([GSTD_SYSTEMD_CONF_DIR], [$(pkg-config systemd --variable=tmpfilesdir)])
AC_SUBST([GSTD_SYSTEMD_DIR], [$(pkg-config systemd --variable=systemduserunitdir)])
], [
systemd=false
if test "$systemd_required" = true; then
AC_MSG_ERROR([
Can't find systemd development packages:
systemd >= $SYSTEMD_REQUIRED
Please make sure you have the necessary systemd
development headers installed.
])
else
AC_MSG_WARN([
Can't find systemd development packages:
gstd.service will not be installed
])
fi
])
fi
AM_CONDITIONAL(WITH_SYSTEMD, test "$systemd" = true)
dnl allow the user to specify systemd gstd.service file location
AC_ARG_WITH([gstd-systemddir],
AS_HELP_STRING([--with-gstd-systemddir@<:@=DIR@:>@],
[Install systemd gstd.service @<:@to DIR if specified@:>@, otherwise defaults to systemd variable systemduserunitdir]),
[AC_SUBST([GSTD_SYSTEMD_DIR], [$with_gstd_systemddir])], [])
dnl allow the user to enable init script install
AC_ARG_ENABLE(initd,
AS_HELP_STRING([--enable-initd], [Enable install of init.d script]),
[ initd=true ],
[ initd=false ])
AM_CONDITIONAL(WITH_INITD, test "$initd" = true)
dnl allow the user to specify init script location
default=${sysconfdir}/init.d/
AC_ARG_WITH([gstd-initddir],
AS_HELP_STRING([--with-gstd-initddir@<:@=DIR@:>@],
[Install init script @<:@to DIR if specified@:>@, otherwise defaults to ${sysconfdir}/init.d/]),
[AC_SUBST([GSTD_INITD_DIR], [$with_gstd_initddir])],
[AC_SUBST([GSTD_INITD_DIR], [$default])])
dnl allow the user to specify the owner of the state dirs
AC_ARG_WITH([statedir-owner],
AS_HELP_STRING([--with-statedir-owner@<:@=USERNAME@:>@],
[Set the state initd created dirs ownership to @<:@USERNAME@:>@, @<:@default=root@:>@]),
[AC_SUBST([GSTD_STATE_DIRS_OWNER], [$with_statedir_owner])],
[AC_SUBST([GSTD_STATE_DIRS_OWNER], ["root"])])
dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
AC_MSG_CHECKING([to see if compiler understands -Wall])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
GST_CFLAGS="$GST_CFLAGS -Wall"
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
dnl extra flags passed to all modules
AC_SUBST([GSTD_CFLAGS], ["-std=c11 -D_GNU_SOURCE"])
AC_SUBST([GSTD_LIBS], [])
dnl =======================================================================
dnl Finally, create Makefiles in all directories
dnl =======================================================================
AC_CONFIG_FILES([
Makefile
gstd/Makefile
gst_client/Makefile
libgstc/Makefile
libgstc/c/Makefile
libgstc/javascript/Makefile
libgstc/python/Makefile
libgstd/Makefile
examples/Makefile
examples/libgstc/Makefile
tests/Makefile
tests/gstd/Makefile
tests/libgstc/Makefile
tests/libgstc/c/Makefile
tests/libgstc/python/Makefile
tests/libgstd/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/gstd/Makefile
init/Makefile
init/gstd
init/gstd.service
])
AC_OUTPUT