-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
210 lines (196 loc) · 7.23 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
AC_INIT([onvifrtspserver], [0.1], [maintainer@example.com])
AC_CONFIG_MACRO_DIRS([m4])
AC_PROG_CC
AM_SILENT_RULES([yes])
# Example of feature input for customized build
# E.g. nvcodec that fails as primary encoder on my laptop
AC_ARG_ENABLE(rpi,
[AS_HELP_STRING([--enable-rpi],[Enable omx and rpicamsrc. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetrpi=yes ;;
no) targetrpi=no ;;
true) targetrpi=yes ;;
false) targetrpi=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-rpi]) ;;
esac],
[targetrpi="no"])
AM_CONDITIONAL([RPICOND], [test x$targetrpi = xyes])
AM_COND_IF([RPICOND],[
AC_MSG_NOTICE(Enabled OMX and RPI Camera support)
AC_SUBST(PKG_OMX_PATH, '$(abs_srcdir)/subprojects/gstreamer/build_omx/dist/lib/gstreamer-1.0/pkgconfig')
AC_SUBST(OMX_PKG, gstrpicamsrc)
AC_SUBST(OMX_LIBS, -lgstomx)
AC_SUBST(OMX_DYN_LIBS, `PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig pkg-config --libs mmal`)
AC_SUBST(OMX_CFLAGS, -DENABLERPI)
],[
AC_MSG_NOTICE(Disabled OMX and RPI Camera support)
AC_SUBST(PKG_OMX_PATH)
AC_SUBST(OMX_PKG)
AC_SUBST(OMX_LIBS)
AC_SUBST(OMX_DYN_LIBS)
AC_SUBST(OMX_CFLAGS)
])
AC_ARG_ENABLE(libav,
[AS_HELP_STRING([--enable-libav],[Enable libav gstreamer plugin. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetlibav=yes ;;
no) targetlibav=no ;;
true) targetlibav=yes ;;
false) targetlibav=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-libav]) ;;
esac],
[targetlibav="no"])
AM_CONDITIONAL([LIBAVCOND], [test x$targetlibav = xyes])
AM_COND_IF([LIBAVCOND],[
AC_MSG_NOTICE(Enabled Libav FFmpeg support.)
AC_SUBST(LIBAV_LIB, gstlibav)
AC_SUBST(LIBAV_CFLAGS, -DENABLELIBAV)
],[
AC_MSG_NOTICE(Disabled Libav FFmpeg support.)
AC_SUBST(LIBAV_LIB)
AC_SUBST(LIBAV_CFLAGS)
])
AC_ARG_ENABLE(libcam,
[AS_HELP_STRING([--enable-libcam],[Enable libcamera gstreamer plugin. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetlibcam=yes ;;
no) targetlibcam=no ;;
true) targetlibcam=yes ;;
false) targetlibcam=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-libcam]) ;;
esac],
[targetlibcam="no"])
AM_CONDITIONAL([LIBCAMCOND], [test x$targetlibcam = xyes])
AM_COND_IF([LIBCAMCOND],[
AC_MSG_NOTICE(Enabled libcamera support.)
AC_SUBST(LIBCAM_LIB, libcamera)
AC_SUBST(LIBCAM_STC_LIB, '-L$(abs_srcdir)/subprojects/libcamera/build/dist/lib/gstreamer-1.0 -lgstlibcamera')
AC_SUBST(LIBCAM_CFLAGS, -DENABLELIBCAM)
AC_SUBST(LIBCAM_PKG,'$(abs_srcdir)/subprojects/libcamera/build/dist/lib/pkgconfig')
],[
AC_MSG_NOTICE(Disabled libcamera support.)
AC_SUBST(LIBCAM_LIB)
AC_SUBST(LIBCAM_CFLAGS)
AC_SUBST(LIBCAM_PKG)
])
AC_ARG_ENABLE(client,
[AS_HELP_STRING([--enable-client],[Enable ONVIF client tool. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetclient=yes ;;
no) targetclient=no ;;
true) targetclient=yes ;;
false) targetclient=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-client]) ;;
esac],
[targetclient="no"])
AM_CONDITIONAL([CLIENTCOND], [test x$targetclient = xyes])
AM_COND_IF([CLIENTCOND],[
AC_MSG_NOTICE(Enabled Client Tool.)
AC_SUBST(CLIENT_PROG, onvifclient)
AC_SUBST(CLIENT_FLAG, [-DENABLECLIENT])
AC_SUBST(CLIENT_LIB, "gstximagesink gstxvimagesink")
AC_SUBST(PKG_CLIENT_PATH, '$(abs_srcdir)/subprojects/libxv/build/dist/lib/pkgconfig')
],[
AC_MSG_NOTICE(Disabled Client Tool.)
AC_SUBST(CLIENT_PROG)
])
AC_ARG_VAR(PKG_CONFIG_PATH, 'pkg-config search path.')
AC_SUBST(PKG_GLIB_PATH, '$(abs_srcdir)/subprojects/glib-2.74.1/dist/lib/pkgconfig')
AC_SUBST(PKG_PULSE_PATH, '$(abs_srcdir)/subprojects/pulseaudio/build/dist/lib/pkgconfig')
AC_SUBST(PKG_ALSA_PATH, '$(abs_srcdir)/subprojects/alsa-lib/build/dist/lib/pkgconfig')
AC_SUBST(PKG_GUDEV_PATH, '$(abs_srcdir)/subprojects/libgudev/build/dist/lib/pkgconfig')
AC_SUBST(PKG_UDEV_PATH, '$(abs_srcdir)/subprojects/systemd-255/build/dist/lib/pkgconfig')
AC_SUBST(PKG_FFMPEG_PATH, '$(abs_srcdir)/subprojects/FFmpeg/dist/lib/pkgconfig')
AC_SUBST(PKG_V4L2_PATH, '$(abs_srcdir)/subprojects/v4l-utils/dist/lib/pkgconfig')
#Declare shared and static packages
AC_SUBST(GST_LIBS,m4_normalize('
gstreamer-1.0
gstreamer-rtsp-server-1.0
alsa
'))
#m4_define(
# [SET_GST_PKG_PATH],
# [{ AS_MESSAGE([error: $1], [2]) exit m4_default([$2], [1]); }]
#)
AC_DEFUN([SET_GST_PKG_PATH],[
#Declare additional plugins to link statically
AC_MSG_NOTICE([gstreamer >= 1.14.4 not found. Using static under ./subproject/gstreamer])
AC_SUBST(GST_LINK_TYPE, [-Wl,-Bstatic])
AC_SUBST(GST_STATIC_FLAG,[-DSTATIC_BUILD])
AC_SUBST(PKG_PATH, '$(abs_srcdir)/subprojects/gstreamer/build/dist/lib/pkgconfig')
AC_SUBST(PKG_GST_PATH, '$(abs_srcdir)/subprojects/gstreamer/build/dist/lib/gstreamer-1.0/pkgconfig')
AC_SUBST(PKG_GSTLIBAV_PATH, '$(abs_srcdir)/subprojects/gstreamer/libav_build/dist/lib/gstreamer-1.0/pkgconfig:$(abs_srcdir)/subprojects/gstreamer/libav_build/dist/lib/pkgconfig')
AC_SUBST(GST_PLGS,m4_normalize('
gstjpegformat
gstjpeg
gstx264
gstnvcodec
gstpulseaudio
gstopenh264
gstfdkaac
gstv4l2codecs
gstvideo4linux2
gstvideoparsersbad
gstvideoconvertscale
gstrtponvif
gstudp
gstcoreelements
gstrtsp
gstrtpmanager
gstrtp
gstpng
gstmulaw
gstinterleave
gstdebug
gstautodetect
gstaudioparsers
gstalsa
gstvolume
gstvideotestsrc
gstvideorate
gsttypefindfunctions
gsttcp
gstrawparse
gstplayback
gstpbtypes
gstaudiotestsrc
gstaudioresample
gstaudioconvert
gstapp
'))
])
#Check if gstreamer is installed
AC_ARG_ENABLE(latest,
[AS_HELP_STRING([--enable-latest],[Force the usage or build gstreamer 1.21.90. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetgstbuild=yes ;;
no) targetgstbuild=no ;;
true) targetgstbuild=yes ;;
false) targetgstbuild=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-latest]) ;;
esac],
[targetclient="no"])
AM_CONDITIONAL([GSTBUILDCOND], [test x$targetgstbuild = xno])
AM_COND_IF([GSTBUILDCOND],[
PKG_CHECK_MODULES(gstreamer, [
gstreamer-1.0 >= 1.14.4
gstreamer-rtsp-server-1.0 >= 1.14.4
], [
AC_MSG_NOTICE([gstreamer >= 1.14.4 found - Using shared libraries])
AC_SUBST(GST_LINK_TYPE, [-Wl,-Bdynamic])
], [
AC_MSG_NOTICE([gstreamer >= 1.14.4 not found. - Using latest static libraries].)
SET_GST_PKG_PATH
])
],[
AC_MSG_NOTICE([gstreamer forced - Using latest static libraries].)
SET_GST_PKG_PATH
])
#Declare all path for pkg-config to search
AC_SUBST(PKG_FULL_PATH, '$(PKG_PATH):$(PKG_GST_PATH):$(PKG_OMX_PATH):$(PKG_FFMPEG_PATH):$(PKG_GSTLIBAV_PATH):$(PKG_PULSE_PATH):$(PKG_ALSA_PATH):$(PKG_GUDEV_PATH):$(PKG_UDEV_PATH):$(PKG_GLIB_PATH):$(PKG_V4L2_PATH):$(PKG_CLIENT_PATH):$(LIBCAM_PKG)')
AC_CONFIG_FILES([
Makefile
])
LT_INIT([shared])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_OUTPUT