-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
executable file
·302 lines (248 loc) · 7.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
293
294
295
296
297
298
299
300
301
302
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(HoNeS, 1.0)
AM_CONFIG_HEADER(honesconfig.h)
AM_MAINTAINER_MODE
###################################
# Large files support.
###################################
AC_TYPE_SIZE_T
AC_TYPE_OFF_T
AC_DEFINE([_FILE_OFFSET_BITS], [64], [file offset size])
AC_DEFINE(_LARGEFILE_SOURCE, 1, [large file support.])
AC_DEFINE(_LARGE_FILE_SOURCE, 1, [large file support.])
AC_DEFINE(_LARGEFILE64_SOURCE, 1, [large file support.])
AC_DEFINE(__USE_LARGEFILE64, 1, [large file support.])
##############################
# Maximum buffer length.
##############################
AC_DEFINE(MAX_BUFFER, [4*1024*1024], [maximum internal buffer length])
##############################
# Checks for programs.
##############################
AC_LANG_CPLUSPLUS
AC_PROG_CXX([g++])
AC_PROG_LIBTOOL
CXXFLAGS="-fPIC $CXXFLAGS"
CFLAGS="-fPIC $CFLAGS"
# Bring additional directories where things might be found into our
# search path. I don't know why autoconf doesn't do this by default
for spfx in /usr/lib/ /usr/local/lib/ /usr/local/lib/ginga/ /usr/local/lib/ginga/iocontents; do
if test -d ${spfx}; then
LDFLAGS="-L${spfx} $LDFLAGS"
fi
done
for spfx in /usr/include/ /usr/local/include/ /usr/local/include/ginga/ /usr/local/include/directfb/; do
if test -d ${spfx}; then
CPPFLAGS="-I${spfx} $CPPFLAGS"
fi
done
##############################
# Building paths
##############################
CPATH="/usr/include:/usr/local/include:/usr/local/include/directfb:/usr/local/include/ginga:$CPATH"
LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib:/usr/local/lib/ginga:/usr/local/lib/ginga/iocontents:$LIBRARY_PATH"
LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib:/usr/local/lib/ginga:/usr/local/lib/ginga/iocontents:$LD_LIBRARY_PATH"
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPATH LIBRARY_PATH LD_LIBRARY_PATH PKG_CONFIG_PAT
##############################
# Checks for header files.
##############################
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h net/if.h sys/socket.h sys/ioctl.h time.h stdio.h dirent.h fcntl.h ctype.h])
##############################
# Dynamic libraries
##############################
HONES_LIBS=""
##############################
# Checks for LinceUtil
##############################
AC_CHECK_HEADERS([ginga/linceutil/LoggerUtil.h],
AC_CHECK_LIB([linceutil],[main],
[
LINCEUTIL_LIBS='-llinceutil'
AC_DEFINE(HAVE_LINCEUTIL, 1, [Define to 1 if you have LinceUtil support.])
],
AC_ERROR([Couldn't find LinceUtil library. Please install LinceUtil.])
)
)
HONES_LIBS="$HONES_LIBS $LINCEUTIL_LIBS"
##############################
# Checks for DirectFB
##############################
AC_CHECK_HEADERS([directfb.h],
AC_CHECK_LIB([directfb],[main],
[
DFB_LIBS='-ldirectfb'
AC_DEFINE(HAVE_DIRECTFB, 1, [Define to 1 if you have DirectFB support.])
],
AC_ERROR([Couldn't find DirectFB library. Please install DirectFB.])
)
)
HONES_LIBS="$HONES_LIBS $DFB_LIBS"
##############################
# Checks for libupnp
##############################
AC_HAVE_LIBRARY(upnp,
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <upnp/upnpconfig.h>
]],
[[
#if UPNP_VERSION < ((1*100 + 8)*100 + 0)
#error LibUPnP 1.8.0 not found.
#endif
]]
)],
[
AC_MSG_RESULT([checking for LibUPnP >= 1.8.0... yes])
UPNP180_LIBS='-lupnp'
],
[
AC_MSG_RESULT([checking for LibUPnP >= 1.8.0... no])
]
),
AC_MSG_RESULT([checking for LibUPnP... no])
)
AM_CONDITIONAL(COMPILE_UPNP180, [test x"$UPNP180_LIBS" = x""])
##############################
# Checks for libdlna
##############################
AC_HAVE_LIBRARY(dlna,
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#define class _class
#include <dlna.h>
#undef class
]],
[[
#if LIBDLNA_VERSION_INT < ((0<<16)+(2<<8)+3)
#error LibDLNA 0.2.3 not found.
#endif
]]
)],
[
AC_MSG_RESULT([checking for LibDLNA >= 0.2.3... yes])
DLNA023_LIBS='-ldlna'
],
[
AC_MSG_RESULT([checking for LibDLNA >= 0.2.3... no])
]
),
AC_MSG_RESULT([checking for LibDLNA... no])
)
HONES_LIBS="$HONES_LIBS $DLNA023_LIBS"
# Checking for libavformat
AC_CHECK_HEADERS([libavformat/avformat.h],
AC_CHECK_LIB([avformat],[main],
[
AVFORMAT_LIBS='-lavformat'
AC_DEFINE(HAVE_AVFORMAT, 1, [Define to 1 if you have avformat support.])
AC_DEFINE(__STDC_CONSTANT_MACROS, 1, [avformat support.])
AC_DEFINE(INT64_C, 1, [avformat support.])
]
)
)
HONES_LIBS="$HONES_LIBS $AVFORMAT_LIBS"
# Checking for libavcodec
AC_CHECK_HEADERS([libavcodec/avcodec.h],
AC_CHECK_LIB([avcodec],[main],
[
AVCODEC_LIBS='-lavcodec'
AC_DEFINE(HAVE_AVCODEC, 1, [Define to 1 if you have avcodec support.])
]
)
)
HONES_LIBS="$HONES_LIBS $AVCODEC_LIBS"
# HAVE_DLNA
if test x"$DLNA023_LIBS" != x""; then
AC_DEFINE(HAVE_DLNA, 1, [Define to 1 if you have dlna support.])
AM_CONDITIONAL(COMPILE_DLNA023, [test x"$DLNA023_LIBS" = x""])
else
if test x"$AVFORMAT_LIBS" != x"" && test x"$AVCODEC_LIBS" != x""; then
AC_DEFINE(HAVE_DLNA, 1, [Define to 1 if you have dlna support.])
AM_CONDITIONAL(COMPILE_DLNA023, [test x"$DLNA023_LIBS" = x""])
else
AM_CONDITIONAL(COMPILE_DLNA023, [test x"$DLNA023_LIBS" != x""])
fi
fi
########################################
# Checks for Ginga-CC Component Manager
########################################
AC_CHECK_HEADERS([ginga/cm/IComponentManager.h],
AC_CHECK_LIB([gingacccm],[main],
[
GINGACCCM_LIBS='-lgingacccm -lgingaccsystemio -lgingaccsystemiocodemap'
AC_DEFINE(HAVE_GINGACCCM, 1, [Define to 1 if you have Ginga Common Core Component Manager support.])
]
)
)
HONES_LIBS="$HONES_LIBS $GINGACCCM_LIBS"
##############################
# Checks for BlueZ.
##############################
AC_CHECK_HEADERS([bluetooth/bluetooth.h],
AC_CHECK_LIB([bluetooth],[main],
[
BLUEZ_LIBS='-lbluetooth'
AC_DEFINE(HAVE_BLUETOOTH, 1, [Define to 1 if you have BlueZ.])
]
)
)
HONES_LIBS="$HONES_LIBS $BLUEZ_LIBS"
##############################
# Checks for FFMpeg-Ginga
##############################
AC_CHECK_HEADERS([ffmpeg_ginga.h],
AC_CHECK_LIB([ffmpegginga],[main],
[
FFMPEG_GINGA_LIBS='-lffmpegginga'
],
AC_ERROR([Couldn't find FFMpeg-Ginga library. Please install FFMpeg-Ginga.])
)
)
HONES_LIBS="$HONES_LIBS $FFMPEG_GINGA_LIBS"
##############################
# Dynamic libraries
##############################
AC_SUBST(HONES_LIBS)
##############################
# Checks for pthread
##############################
AC_CHECK_HEADERS([pthread.h],,[AC_MSG_ERROR(HoNeS needs POSIX thread library)])
AC_CHECK_LIB([pthread],[main])
##############################
# Checks for Alsa.
##############################
AC_CHECK_HEADERS([alsa/asoundlib.h],
AC_CHECK_LIB([asound],[main],
[
AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H, 1, [Define to 1 if you have Alsa.])
]
)
)
##############################
# Checks for typedefs, structures, and compiler characteristics.
##############################
AC_C_CONST
AC_C_INLINE
AC_STRUCT_TM
##############################
# Checks for Network functions
##############################
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([inet_ntop])
AC_CHECK_FUNCS([inet_pton])
##############################
# Checks for C++ stream.
##############################
AC_CHECK_HEADERS([sstream])
##############################
# Makefiles
##############################
AC_OUTPUT([
Makefile
bin/Makefile
test/Makefile
])