-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
293 lines (243 loc) · 11.3 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------------------------------------
dnl Versioning Information:
dnl Increment Major more radical changes (ie re-writes)
dnl Increment Minor more additional features which don't break things
dnl Increment Micro when changes are only to fix bugs/build breaks no new features.
dnl
dnl Exception to this rule is the Major version 0, minor version will be
dnl incremented until we are ready to say DVBStreamer is no longer alpha.
dnl ---------------------------------------------------------------------------
AC_INIT(dvbstreamer, 2.1.0)
DVBSTREAMER_MAJOR=2
DVBSTREAMER_MINOR=1
DVBSTREAMER_MICRO=0
AC_SUBST(DVBSTREAMER_MAJOR)
AC_SUBST(DVBSTREAMER_MINOR)
AC_SUBST(DVBSTREAMER_MICRO)
AC_DEFINE_UNQUOTED(DVBSTREAMER_MAJOR, $DVBSTREAMER_MAJOR, [DVBStreamer Major version number])
AC_DEFINE_UNQUOTED(DVBSTREAMER_MINOR, $DVBSTREAMER_MINOR, [DVBStreamer Minor version number])
AC_DEFINE_UNQUOTED(DVBSTREAMER_MICRO, $DVBSTREAMER_MINOR, [DVBStreamer Micro version number])
AC_DEFINE_UNQUOTED(DVBSTREAMER_VERSION, ((DVBSTREAMER_MAJOR<<24) | (DVBSTREAMER_MINOR<<16) | DVBSTREAMER_MICRO ), [DVBStreamer combined version number as an int])
SPEC_VERSION=$DVBSTREAMER_MAJOR.$DVBSTREAMER_MINOR.$DVBSTREAMER_MICRO
AM_INIT_AUTOMAKE("dvbstreamer", $SPEC_VERSION)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_PROG_CC_C_O
dnl ---------------------------------------------------------------------------
dnl Disable strict aliasing
dnl ---------------------------------------------------------------------------
CFLAGS="$CFLAGS -fno-strict-aliasing"
dnl ---------------------------------------------------------------------------
dnl Libltdl setup
dnl ---------------------------------------------------------------------------
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])
dnl ---------------------------------------------------------------------------
dnl Work out the libdir name (copied from xine-lib configure.ac)
dnl ---------------------------------------------------------------------------
AC_MSG_CHECKING([libdir name])
case $host in
*-*-linux*)
# Test if the compiler is 64bit
echo 'int i;' > conftest.$ac_ext
DVBSTREAMER_cv_cc_64bit_output=no
if AC_TRY_EVAL(ac_compile); then
case `"$MAGIC_CMD" conftest.$ac_objext` in
*"ELF 64"*)
DVBSTREAMER_cv_cc_64bit_output=yes
;;
esac
fi
rm -rf conftest*
;;
esac
case $host_cpu:$DVBSTREAMER_cv_cc_64bit_output in
powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
DVBSTREAMER_LIBNAME="lib64"
;;
*:*)
DVBSTREAMER_LIBNAME="lib"
;;
esac
AC_MSG_RESULT([$DVBSTREAMER_LIBNAME])
dnl ---------------------------------------------------------------------------
dnl ATSC/DVB Support
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([atsc],
AS_HELP_STRING([--disable-atsc], [ Disable ATSC support, only use this if you know you don't need ATSC (most DVB users) this will make the complied application a bit smaller, but won't make a big difference.]),
[case "${enableval}" in
yes) enable_atsc=true ;;
no) enable_atsc=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-atsc]) ;;
esac],[enable_atsc=true])
AC_ARG_ENABLE([dvb],
AS_HELP_STRING([--disable-dvb], [ Disable DVB support, only use this if you know you don't need DVB (most ATSC users) this will make the complied application a bit smaller, but won't make a big difference.]),
[case "${enableval}" in
yes) enable_dvb=true ;;
no) enable_dvb=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-dvb]) ;;
esac],[enable_dvb=true])
if test "${enable_dvb}" == "false"; then
if test "${enable_atsc}" == "false"; then
AC_MSG_ERROR([Either ATSC or DVB needs to be enabled!])
fi
fi
AM_CONDITIONAL([ENABLE_ATSC], [test x$enable_atsc = xtrue])
if test "${enable_atsc}" != "false"; then
AC_DEFINE(ENABLE_ATSC, 1, Enable ATSC support)
fi
AM_CONDITIONAL([ENABLE_DVB], [test x$enable_dvb = xtrue])
if test "${enable_dvb}" != "false"; then
AC_DEFINE(ENABLE_DVB, 1, Enable DVB support)
fi
dnl ---------------------------------------------------------------------------
dnl Misc. Enable args
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([getaddrinfo],
AS_HELP_STRING([--disable-getaddrinfo], [ Disable use of the getaddrinfo function, this is needed for IPv6 support but some C libraries don't support it fully.]),
[case "${enableval}" in
yes) use_getaddrinfo=true ;;
no) use_getaddrinfo=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-getaddrinfo]) ;;
esac],[use_getaddrinfo=true])
if test "${use_getaddrinfo}" != "false"; then
AC_DEFINE(USE_GETADDRINFO, 1, Use getaddrinfo for address resolution)
fi
AC_ARG_ENABLE([file-streamer],
AS_HELP_STRING([--enable-file-streamer], [ Enable building fdvbstreamer to allow play back of captured TS files.]),
[case "${enableval}" in
yes) enable_fstreamer=true ;;
no) enable_fstreamer=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-file-streamer]) ;;
esac],[enable_fstreamer=false])
AM_CONDITIONAL([ENABLE_FSTREAMER], [test x$enable_fstreamer = xtrue])
dnl ---------------------------------------------------------------------------
dnl Check for sqlite 3
dnl ---------------------------------------------------------------------------
AC_CHECK_LIB([sqlite3], [sqlite3_libversion], [], [AC_MSG_FAILURE([sqlite3 not found])])
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check for libreadline
dnl ---------------------------------------------------------------------------
AC_CHECK_HEADER([readline/readline.h], [], [AC_MSG_FAILURE([readline header file not found])])
AC_CHECK_LIB([readline], [readline], [], [])
AC_SUBST(READLINE_TERMCAP)
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check whether librt is needed.
dnl ---------------------------------------------------------------------------
AC_SEARCH_LIBS(clock_gettime, [rt], [GETTIME_LIB=$LIBS], [AC_MSG_FAILURE([Failed to find a library defining clock_gettime])])
AC_SUBST(GETTIME_LIB)
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check whether libiconv is needed.
dnl ---------------------------------------------------------------------------
AC_SEARCH_LIBS(iconv_open, [iconv], [ICONV_LIB=$LIBS],
AC_SEARCH_LIBS(libiconv_open, [iconv], [ICONV_LIB=$LIBS], [AC_MSG_FAILURE([Failed to find a library defining iconv_open])]))
AC_SUBST(ICONV_LIB)
if test "x${ICONV_LIB}" == "x"; then
AC_DEFINE(ICONV_INPUT_CAST, [char **], [Glibc's prototype doesn't take a const char *])
else
AC_DEFINE(ICONV_INPUT_CAST, [const char **], [libiconv's prototype takes a const char *])
fi
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check for libev
dnl ---------------------------------------------------------------------------
AC_CHECK_HEADER([ev.h], [], [AC_MSG_FAILURE([libev header file not found])])
AC_CHECK_DECL([ev_loop], [], [AC_MSG_FAILURE([libev doesn't provide ev_loop])], [[#include <ev.h>]])
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check for yaml
dnl ---------------------------------------------------------------------------
AC_CHECK_HEADER([yaml.h], [], [AC_MSG_FAILURE([libyaml header file not found])])
AC_CHECK_LIB([yaml], [yaml_get_version_string], [], [AC_MSG_FAILURE([libyaml not found])])
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check for ltdl
dnl ---------------------------------------------------------------------------
AC_CHECK_HEADER([ltdl.h], [], [AC_MSG_FAILURE([libltdl (libtool) header file not found])])
AC_CHECK_LIB([ltdl], [lt_dlinit], [], [AC_MSG_FAILURE([libltdl (libtool) not found])])
LIBS=""
dnl ---------------------------------------------------------------------------
dnl Check for variadic macros
dnl ---------------------------------------------------------------------------
AC_CACHE_CHECK([for variadic cpp macros],
[ac_cv_cpp_variadic_macros],
[AC_TRY_COMPILE(
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");],
ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)])
if test "${ac_cv_cpp_variadic_macros}" != "no"; then
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
fi
dnl ---------------------------------------------------------------------------
dnl Check for FE_CAN_2G_MODULATION
dnl ---------------------------------------------------------------------------
AC_CACHE_CHECK([for FE_CAN_2G_MODULATION],
[ac_cv_fe_can_2g_modulation],
[AC_TRY_COMPILE(
[#include <linux/dvb/frontend.h>],
[int a = FE_CAN_2G_MODULATION;],
ac_cv_fe_can_2g_modulation=yes,
ac_cv_fe_can_2g_modulation=no)])
if test "${ac_cv_fe_can_2g_modulation}" != "no"; then
AC_DEFINE(HAVE_FE_CAN_2G_MODULATION, 1, Frontend enum exists for 2G modulation)
fi
dnl ---------------------------------------------------------------------------
dnl Setup package directories
dnl ---------------------------------------------------------------------------
dnl Set PACKAGE SOURCE DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
dnl Set PACKAGE PREFIX
if test "x${prefix}" = "xNONE"; then
packageprefix=${ac_default_prefix}
else
packageprefix=${prefix}
fi
dnl Set PACKAGE DATA & DOC DIR
packagedatadir=share
packagedocdir=doc/${PACKAGE}
dnl Subst PACKAGE_DATA_DIR.
NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
AC_SUBST(PACKAGE_DATA_DIR)
dnl Subst PACKAGE_DOC_DIR.
NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
AC_SUBST(PACKAGE_DOC_DIR)
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}", [Define this to data directory location])
AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}", [Define this to Docs directory location])
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Define this to source directory location])
dnl ---------------------------------------------------------------------------
dnl Work out the Plugins path (Copied from xine-lib configure.ac)
dnl ---------------------------------------------------------------------------
if test "x$prefix" = xNONE; then
prefix="${ac_default_prefix}"
fi
if test "x$exec_prefix" = xNONE; then
exec_prefix='${prefix}'
fi
DVBSTREAMER_PLUGINDIR="$libdir/dvbstreamer/plugins"
eval DVBSTREAMER_REL_PLUGINDIR="$DVBSTREAMER_PLUGINDIR"
DVBSTREAMER_REL_PLUGINDIR=`eval echo "$DVBSTREAMER_REL_PLUGINDIR" | sed -e "s,^${prefix}/,,"`
eval DVBSTREAMER_PLUGINPATH=`eval echo "$DVBSTREAMER_PLUGINDIR"`
AC_DEFINE_UNQUOTED(DVBSTREAMER_PLUGINDIR,"$DVBSTREAMER_PLUGINPATH",[Define this to plugins directory location])
AC_DEFINE_UNQUOTED(DVBSTREAMER_REL_PLUGINDIR,"$DVBSTREAMER_REL_PLUGINDIR",[Define this to plugin directory relative to execution prefix])
AC_SUBST(DVBSTREAMER_PLUGINDIR)
AC_OUTPUT([
Makefile
include/Makefile
include/dvbpsi/Makefile
src/dvbpsi/Makefile
src/Makefile
src/plugins/Makefile
])