-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathconfigure.ac
200 lines (182 loc) · 7.13 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
m4_define([onvifmgr_major_version], [0])
m4_define([onvifmgr_minor_version], [0])
...
m4_define([onvifmgr_version],[onvifmgr_major_version.onvifmgr_minor_version])
AC_INIT([onvifmgr], [onvifmgr_version], [maintainer@example.com])
AC_SUBST(APP_VERSION, [onvifmgr_version])
AC_SUBST(APP_VERSION_MAJ, [onvifmgr_major_version])
AC_SUBST(APP_VERSION_MIN, [onvifmgr_minor_version])
AC_CONFIG_MACRO_DIRS([m4])
AC_PROG_CC
AM_SILENT_RULES([yes])
# TODO handle missing package
# gtk+-3.0 #libgtk-3-dev
AC_SUBST(GSOAP_SRC_DIR, '$(abs_srcdir)/subprojects/gsoap-2.8')
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-256/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')
AC_SUBST(PKG_OPENSSL_PATH, '$(abs_srcdir)/subprojects/openssl/build/dist/lib/pkgconfig')
AC_SUBST(PKG_ONVIF_DISCO_PATH, '$(abs_srcdir)/subprojects/OnvifDiscoveryLib/build/dist/lib/pkgconfig')
AC_SUBST(PKG_ONVIF_SOAP_PATH, '$(abs_srcdir)/subprojects/OnvifSoapLib/build/dist/lib/pkgconfig')
AC_SUBST(PKG_CUTILS_PATH, '$(abs_srcdir)/subprojects/CUtils/build/dist/lib/pkgconfig')
AC_SUBST(PKG_DE265_PATH, '$(abs_srcdir)/subprojects/libde265/dist/lib/pkgconfig')
AC_SUBST(PKG_NTLM_PATH, '$(abs_srcdir)/subprojects/libntlm-1.8/build/dist/lib/pkgconfig')
AC_SUBST(PKG_LIBX11_PATH, '$(abs_srcdir)/subprojects/libX11-1.8.10/build/dist/lib/pkgconfig')
AC_SUBST(PKG_GTK_PATH, '$(abs_srcdir)/subprojects/gtk/dist/lib/pkgconfig')
AC_SUBST(GST_LIBS,m4_normalize('
gstreamer-1.0
gstreamer-video-1.0
alsa
'))
AC_DEFUN([SET_GST_PKG_PATH],[
#Declare additional plugins to link statically
AC_MSG_NOTICE([Setting static Gstreamer path])
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(GST_PLGS,m4_normalize('
gstopengl
gstgtk
gstinterlace
gstde265
gstjpeg
gstjpegformat
gstlevel
gstximagesink
gstoverlaycomposition
gstpulseaudio
gstopenh264
gstfdkaac
gstv4l2codecs
gstvideo4linux2
gstvideoparsersbad
gstvideoconvertscale
gstrtponvif
gstudp
gstcoreelements
gstrtsp
gstrtpmanager
gstrtp
gstalaw
gstmulaw
gstinterleave
gstautodetect
gstaudioparsers
gstalsa
gstvolume
gstvideorate
gsttypefindfunctions
gsttcp
gstrawparse
gstplayback
gstpbtypes
gstaudiotestsrc
gstaudioresample
gstaudioconvert
gstapp
'))
])
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_SUBST(EXT_PLGS_LIBAV, gstlibav)
AC_SUBST(EXT_PKG_LIBAV, "gstlibav >= 1.14.4")
AC_SUBST(EXT_CFLAGS_LIBAV, -DENABLELIBAV)
AC_MSG_RESULT([configure: checking libav enabled... yes])
],[
AC_MSG_RESULT([configure: checking libav enabled... no])
])
AC_ARG_ENABLE(nvcodec,
[AS_HELP_STRING([--enable-nvcodec],[Enable Nvidia codec gstreamer plugin. @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetnvcodec=yes ;;
no) targetnvcodec=no ;;
true) targetnvcodec=yes ;;
false) targetnvcodec=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-nvcodec]) ;;
esac],
[targetnvcodec="no"])
AM_CONDITIONAL([NVCODECCOND], [test x$targetnvcodec = xyes])
AM_COND_IF([NVCODECCOND],[
AC_SUBST(EXT_PLGS_NV, "gstnvcodec")
AC_SUBST(EXT_PKG_NV, "gstnvcodec >= 1.14.4")
AC_SUBST(EXT_CFLAGS_NV, -DENABLENVCODEC)
AC_MSG_RESULT([configure: checking NVIDIA codec enabled... yes])
],[
AC_MSG_RESULT([configure: checking NVIDIA codec enabled... no])
])
# "gstreamer-plugins-good-1.0 >= 1.14.4" apparently doesn't exist on MX Linux?
AC_SUBST(GST_PKG_CORE,m4_normalize(
"gstreamer-1.0 >= 1.14.4
gstreamer-video-1.0 >= 1.14.4
gstreamer-plugins-base-1.0 >= 1.14.4
gstreamer-plugins-bad-1.0 >= 1.14.4"
))
#Check for debug flag
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[Enable runtime debugging @<:@default=no@:>@.])],
[case "${enableval}" in
yes) targetdebug=yes ;;
no) targetdebug=no ;;
true) targetdebug=yes ;;
false) targetdebug=no ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[targetdebug="no"])
AM_CONDITIONAL([DEBUGCOND], [test x$targetdebug = xyes])
AM_COND_IF([DEBUGCOND],[
AC_MSG_NOTICE([DEBUGING MODE enabled])
AC_SUBST(DEBUG_FLAG, '-g -O0')
],[
AC_MSG_NOTICE([DEBUGING MODE disabled])
])
#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],
[targetgstbuild="no"])
AM_CONDITIONAL([GSTBUILDCOND], [test x$targetgstbuild = xyes])
AM_COND_IF([GSTBUILDCOND],[
AC_MSG_NOTICE([gstreamer forced - Using latest static libraries])
AC_SUBST(EXT_PLGS, '$(EXT_PLGS_LIBAV) $(EXT_PLGS_NV)')
SET_GST_PKG_PATH
], [
PKG_CHECK_MODULES(gstreamer,[${GST_PKG_CORE}], [
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])
#Apply extra defined plugin only when using static library
AC_SUBST(EXT_PLGS, '$(EXT_PLGS_LIBAV) $(EXT_PLGS_NV)')
SET_GST_PKG_PATH
])
])
AC_SUBST(EXT_CFLAGS, '$(EXT_CFLAGS_LIBAV) $(EXT_CFLAGS_NV)')
#Declare all path for pkg-config to search
AC_SUBST(PKG_FULL_PATH, '$(PKG_PATH):$(PKG_GST_PATH):$(PKG_FFMPEG_PATH):$(PKG_PULSE_PATH):$(PKG_ALSA_PATH):$(PKG_GUDEV_PATH):$(PKG_UDEV_PATH):$(PKG_GLIB_PATH):$(PKG_V4L2_PATH):$(PKG_ONVIF_DISCO_PATH):$(PKG_ONVIF_SOAP_PATH):$(PKG_CUTILS_PATH):$(PKG_OPENSSL_PATH):$(PKG_DE265_PATH):$(PKG_NTLM_PATH):$(PKG_LIBX11_PATH):$(PKG_GTK_PATH)')
AC_CONFIG_FILES([
Makefile
])
LT_INIT([shared])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_OUTPUT