forked from catalinii/minisatip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·218 lines (170 loc) · 4.5 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.4])
AC_INIT(minisatip, 1.1, https://github.com/catalinii/minisatip)
AC_CONFIG_SRCDIR([src/minisatip.h])
#AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lrt':
AC_CHECK_LIB([rt], [main])
FM="\nminisatip configuration\n\n"
linux_dvb="Linux DVB:\t\t\t\t "
dvb_csa="DVBCSA (needs libdvbcsa):\t\t "
CI="Common Interface (CI)\t\t\t "
dvb_ca="Common Interface (needs DVBEN50221):\t "
emb="Embedded system:\t\t\t "
netcv="Netceiver support:\t\t\t "
satipc="SatIP Client:\t\t\t\t "
static="Static:\t\t\t\t\t "
dvbapi="dvbapi:\t\t\t\t\t "
axe="axe:\t\t\t\t\t "
enigma="enigma:\t\t\t\t\t "
LINUXDVB=0
DVBCA=0
DVBCSA=0
NETCVCLIENT=0
SATIPCLIENT=0
STATIC=0
AXE=0
DVBAPI=0
AC_ARG_ENABLE([linuxdvb],
[AS_HELP_STRING([--disable-linuxdvb],
[disable linux dvb support])])
AS_IF([test "x$enable_linuxdvb" != "xno"], [
AC_MSG_NOTICE([ == Checking LINUX DVB == ])
AC_CHECK_HEADERS([linux/dvb/frontend.h],[LINUXDVB=1],[LINUXDVB=0])
LINUXDVB=1
])
if test "$LINUXDVB" = "1"; then
FM="$FM\n$linux_dvb enabled"
else
FM="$FM\n$linux_dvb disabled"
fi
AC_ARG_ENABLE([dvbca],
[AS_HELP_STRING([--disable-dvbca],
[disable Common Interface (CI) support (relies on openssl)])])
AS_IF([test "x$enable_dvbca" != "xno"], [
AC_MSG_NOTICE([ == Checking OpenSSL == ])
AC_CHECK_HEADERS([openssl/aes.h],[DVBCA=1],[DVBCA=0])
])
if test "$DVBCA" = "1"; then
FM="$FM\n$CI enabled"
else
FM="$FM\n$CI disabled"
fi
AC_MSG_NOTICE([ == Checking Embedded == ])
AC_CHECK_FUNCS([backtrace],[EMBEDDED=0],[EMBEDDED=1])
if test "$EMBEDDED" = "1"; then
FM="$FM\n$emb enabled"
else
FM="$FM\n$emb disabled"
fi
AC_ARG_ENABLE([dvbcsa],
[AS_HELP_STRING([--disable-dvbcsa],
[disable dvbcsa support (decrypting with dvbcsa)])])
AS_IF([test "x$enable_dvbcsa" != "xno"], [
AC_MSG_NOTICE([ == Checking DVBCSA == ])
AC_CHECK_HEADERS([dvbcsa/dvbcsa.h],[DVBCSA=1],[DVBCSA=0])
])
if test "$DVBCSA" = "1"; then
FM="$FM\n$dvb_csa enabled"
else
FM="$FM\n$dvb_csa disabled"
fi
AC_ARG_ENABLE([netcv],
[AS_HELP_STRING([--disable-netcv],
[disable NETCEIVER support])])
AS_IF([test "x$enable_netcv" != "xno"], [
AC_MSG_NOTICE([ == Checking NETCVCLIENT == ])
xml2_dir="/usr/include/libxml2"
AC_ARG_WITH([xml2],
[AS_HELP_STRING([--with-xml2],
[specify libxml2 directory default=/usr/include/libxml2])],
[xml2_dir=$with_xml2])
CFLAGS="-I$xml2_dir"
cd src
AC_CHECK_HEADERS([libnetceiver/netcv/headers.h],[NETCVCLIENT=1],[NETCVCLIENT=0])
cd ..
])
if test "$NETCVCLIENT" = "1"; then
FM="$FM\n$netcv enabled"
else
FM="$FM\n$netcv disabled"
CFLAGS=
CPPFLAGS=
fi
AC_ARG_ENABLE([satipc],
[AS_HELP_STRING([--disable-satipc],
[disable satip client support])])
AS_IF([test "x$enable_satipc" != "xno"], [
SATIPCLIENT=1
])
if test "$SATIPCLIENT" = "1"; then
FM="$FM\n$satipc enabled"
else
FM="$FM\n$satipc disabled"
fi
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static],
[enable static compilation])])
AS_IF([test "x$enable_static" = "xyes"], [
STATIC=1
])
if test "$STATIC" = "1"; then
FM="$FM\n$static enabled"
else
FM="$FM\n$static disabled"
fi
AC_ARG_ENABLE([dvbapi],
[AS_HELP_STRING([--disable-dvbapi],
[disable dvbapi protocol support])])
AS_IF([test "x$enable_dvbapi" != "xno"], [
DVBAPI=1
])
if test "$DVBAPI" = "1"; then
FM="$FM\n$dvbapi enabled"
else
FM="$FM\n$dvbapi disabled"
fi
AC_ARG_ENABLE([axe],
[AS_HELP_STRING([--enable-axe],
[enable compilation for axe: Inverto IDL400])])
AS_IF([test "x$enable_axe" = "xyes"], [
AXE=1
])
if test "$AXE" = "1"; then
FM="$FM\n$axe enabled"
else
FM="$FM\n$axe disabled"
fi
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstrict-flex-arrays"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[int i = 1; (void) i;]])],
[enable_strict_flex_array=1], [enable_strict_flex_array=0])
AS_IF([test $enable_strict_flex_array -eq 0],
[CFLAGS="$ac_save_CFLAGS"])
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fsanitize=bounds -fsanitize-trap=all"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[int i = 1; (void) i;]])],
[enable_bounds_check=1], [enable_bounds_check=0])
AS_IF([test $enable_bounds_check -eq 0],
[CFLAGS="$ac_save_CFLAGS"])
FM="$FM\nCCFLAGS\t\t$CFLAGS"
AC_SUBST(LINUXDVB)
AC_SUBST(DVBCSA)
AC_SUBST(DVBCA)
AC_SUBST(EMBEDDED)
AC_SUBST(NETCVCLIENT)
AC_SUBST(SATIPCLIENT)
AC_SUBST(STATIC)
AC_SUBST(DVBAPI)
AC_SUBST(AXE)
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([tests/Makefile])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo -e "$FM\n"