This repository has been archived by the owner on Apr 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
326 lines (264 loc) · 9.63 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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
dnl-----------------------------------------------------------------------------
dnl -- Extract package info
dnl-----------------------------------------------------------------------------
dnl extract package name and version from Version.h
m4_define([m4_BMX_LIBRARY_NAME],
m4_esyscmd([(sed -n 's/^.*BMX_LIBRARY_NAME[^\"]*\"\([^\"]*\)\"/\1/p' include/bmx/Version.h | tr -d '\n')]))
m4_define([m4_BMX_VERSION_MAJOR],
m4_esyscmd([(sed -n 's/^.*BMX_VERSION_MAJOR\ *\([0-9][0-9]*\)/\1/p' include/bmx/Version.h | tr -d '\n')]))
m4_define([m4_BMX_VERSION_MINOR],
m4_esyscmd([(sed -n 's/^.*BMX_VERSION_MINOR\ *\([0-9][0-9]*\)/\1/p' include/bmx/Version.h | tr -d '\n')]))
m4_define([m4_BMX_VERSION_MICRO],
m4_esyscmd([(sed -n 's/^.*BMX_VERSION_MICRO\ *\([0-9][0-9]*\)/\1/p' include/bmx/Version.h | tr -d '\n')]))
m4_define([m4_BMX_VERSION],
m4_defn([m4_BMX_VERSION_MAJOR]).m4_defn([m4_BMX_VERSION_MINOR]).m4_defn([m4_BMX_VERSION_MICRO]))
dnl-----------------------------------------------------------------------------
dnl -- Init
dnl-----------------------------------------------------------------------------
AC_INIT(m4_defn([m4_BMX_LIBRARY_NAME]), m4_defn([m4_BMX_VERSION]))
AC_CONFIG_SRCDIR([src/common/BMXException.cpp])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 -Wall parallel-tests])
AM_SILENT_RULES([yes])
dnl define for automake 1.12 to avoid warnings
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
dnl-----------------------------------------------------------------------------
dnl -- Version
dnl-----------------------------------------------------------------------------
dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
BMX_LIBVERSION="4:0:0"
AC_SUBST(BMX_LIBVERSION)
BMX_MAJORMINOR=m4_defn([m4_BMX_VERSION_MAJOR]).m4_defn([m4_BMX_VERSION_MINOR])
AC_SUBST(BMX_MAJORMINOR)
dnl-----------------------------------------------------------------------------
dnl -- Checks for programs.
dnl-----------------------------------------------------------------------------
AC_PROG_LIBTOOL
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
dnl-----------------------------------------------------------------------------
dnl -- Checks for libraries.
dnl-----------------------------------------------------------------------------
ORIGCFLAGS=$CFLAGS
if test x"$prefix" != x"NONE"; then
CFLAGS="${CFLAGS} -L${prefix}/lib -I${prefix}/include"
fi
dnl check for clock_gettime
AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
if test x$have_clock_gettime = xyes ; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define to 1 if you have librt and the `clock_gettime' function])
RT_LIB=-lrt
fi
dnl Check for UUID generation library
case "$host" in
*-*-*mingw*) os=win ;;
*-*-darwin*) os=mac ;;
esac
if test x"$os" = xwin; then
AC_CHECK_HEADER([windows.h],
[UUIDLIB="-lole32"],
AC_MSG_ERROR(No windows uuid generation function))
elif test x"$os" = xmac; then
UUIDLIB=""
else
AC_CHECK_LIB([uuid], [uuid_generate],
[UUIDLIB="-luuid"],
AC_MSG_ERROR(No uuid generation function))
fi
AC_SUBST(UUIDLIB)
AC_CHECK_LIB(uriparser,uriParseUriA,,
[AC_MSG_ERROR([liburiparser not found])])
if test x"$prefix" = x"NONE"; then
LIBURIPARSER_CFLAGS=""
LIBURIPARSER_LIBS="-luriparser"
else
LIBURIPARSER_CFLAGS="-I${prefix}/include"
LIBURIPARSER_LIBS="-L${prefix}/lib -luriparser"
fi
AC_SUBST(LIBURIPARSER_CFLAGS)
AC_SUBST(LIBURIPARSER_LIBS)
dnl version 0.7.2 has been tested
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <uriparser/Uri.h>
#if (defined(URI_VER_MAJOR) && defined(URI_VER_MINOR) && defined(URI_VER_RELEASE) \
&& ((URI_VER_MAJOR > 0) \
|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 7)) \
|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 7) && (URI_VER_RELEASE >= 2)) \
))
/* FINE */
#else
# error uriparser not recent enough
#endif
])],,[AC_MSG_ERROR([uriparser 0.7.2 or later is required, your copy is too old])])
AC_CHECK_LIB(expat, XML_GetFeatureList,
EXPAT_LIBS="-lexpat",
AC_MSG_ERROR([Require expat library]))
AC_CHECK_HEADERS(expat.h,
EXPAT_CFLAGS="",
AC_MSG_ERROR([Require expat development header files]))
AC_SUBST(EXPAT_CFLAGS)
AC_SUBST(EXPAT_LIBS)
CFLAGS=$ORIGCFLAGS
dnl-----------------------------------------------------------------------------
dnl -- Check for modules
dnl-----------------------------------------------------------------------------
LIBMXF_MAJORMINOR=1.0
LIBMXFPP_MAJORMINOR=${LIBMXF_MAJORMINOR}
AC_SUBST(LIBMXF_MAJORMINOR)
AC_SUBST(LIBMXFPP_MAJORMINOR)
PKG_CHECK_MODULES(LIBMXF, libMXF-${LIBMXF_MAJORMINOR} >= 1.0.3)
AC_SUBST(LIBMXF_CFLAGS)
AC_SUBST(LIBMXF_LIBS)
PKG_CHECK_MODULES(LIBMXFPP, libMXF++-${LIBMXFPP_MAJORMINOR} >= 1.0.3)
AC_SUBST(LIBMXFPP_CFLAGS)
AC_SUBST(LIBMXFPP_LIBS)
AC_ARG_WITH(curl,
AC_HELP_STRING([--with-curl],
[support HTTP file access using libcurl [default=check]]),
with_curl=no,
with_curl=check)
if test x"$with_curl" == xcheck; then
LIBCURL_VER="7.22.0"
PKG_CHECK_MODULES(LIBCURL, libcurl >= $LIBCURL_VER, HAVE_LIBCURL=yes, HAVE_LIBCURL=no)
if test "x${HAVE_LIBCURL}" == xyes; then
AC_DEFINE([HAVE_LIBCURL], [1], [Define if you have the libcurl library])
else
AC_MSG_WARN([Disabled HTTP file access because libcurl >= $LIBCURL_VER not found])
fi
fi
AC_ARG_ENABLE(bbcarch_check,
AC_HELP_STRING([--enable-bbcarch-check],
[enable checking BBC archive MXF [[default=no]]]),
enable_bbcarch_check=$enableval,
enable_bbcarch_check="no")
if test x"$enable_bbcarch_check" = xyes; then
AC_CHECK_LIB(writearchivemxf-${LIBMXF_MAJORMINOR},prepare_archive_mxf_file,,
[AC_MSG_ERROR([writearchivemxf-${LIBMXF_MAJORMINOR} not found])])
fi
AM_CONDITIONAL(ENABLE_BBCARCH_CHECK, test x"$enable_bbcarch_check" = xyes)
dnl-----------------------------------------------------------------------------
dnl -- Checks for header files.
dnl-----------------------------------------------------------------------------
AC_CHECK_HEADERS([inttypes.h sys/time.h sys/timeb.h unistd.h])
dnl-----------------------------------------------------------------------------
dnl -- Checks for typedefs, structures, and compiler characteristics.
dnl-----------------------------------------------------------------------------
AC_HEADER_STDBOOL
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
dnl mingw doesn't support the 'z' printf format length modifier for size_t
case "$host" in
*-*-*mingw32) AC_DEFINE([PRIszt], ["u"], [Define printf size_t format specifier]) ;;
*) AC_DEFINE([PRIszt], ["zu"], [Define printf size_t format specifier])
esac
dnl-----------------------------------------------------------------------------
dnl -- Checks for library functions
dnl-----------------------------------------------------------------------------
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNCS([getcwd gettimeofday memmove memset mkdir strerror strerror_r nanosleep gmtime_r])
dnl-----------------------------------------------------------------------------
dnl -- Compiler flags etc.
dnl-----------------------------------------------------------------------------
WARN_CFLAGS=
AC_APPEND_SUPPORTED_CFLAGS(WARN_CFLAGS, [-W -Wall])
AC_SUBST(WARN_CFLAGS)
BMX_CFLAGS="${WARN_CFLAGS} ${LIBMXF_CFLAGS} ${LIBMXFPP_CFLAGS} \
${LIBURIPARSER_CFLAGS} ${EXPAT_CFLAGS} ${LIBCURL_CFLAGS} -I\$(top_srcdir)/include"
AC_SUBST(BMX_CFLAGS)
BMX_LIBADDLIBS="-lm ${RT_LIB} ${UUIDLIB} ${LIBURIPARSER_LIBS} ${LIBMXF_LIBS} \
${LIBMXFPP_LIBS} ${EXPAT_LIBS} ${LIBCURL_LIBS}"
AC_SUBST(BMX_LIBADDLIBS)
BMX_LDADDLIBS="${BMX_LIBADDLIBS} \
\$(top_builddir)/src/libbmx-${BMX_MAJORMINOR}.la"
AC_SUBST(BMX_LDADDLIBS)
BMX_LDFLAGS=
AC_APPEND_SUPPORTED_LDFLAGS(BMX_LDFLAGS, [-Wl,--no-undefined])
AC_SUBST(BMX_LDFLAGS)
dnl-----------------------------------------------------------------------------
dnl -- Package Config
dnl-----------------------------------------------------------------------------
pkgconfigdir="\$(libdir)/pkgconfig"
AC_SUBST(pkgconfigdir)
dnl add libraries to pkg config "Libs:" for static-only builds
if test x"$enable_shared" = xyes; then
PC_ADD_LIBS=
PC_ADD_PRIVATE_LIBS="-lm ${RT_LIB} ${UUIDLIB} ${LIBURIPARSER_LIBS} ${EXPAT_LIBS}"
else
PC_ADD_LIBS="-lm ${RT_LIB} ${UUIDLIB} ${LIBURIPARSER_LIBS} ${EXPAT_LIBS}"
PC_ADD_PRIVATE_LIBS=
fi
AC_SUBST(PC_ADD_LIBS)
AC_SUBST(PC_ADD_PRIVATE_LIBS)
dnl-----------------------------------------------------------------------------
dnl -- Config files
dnl-----------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
include/Makefile
src/Makefile
src/apps/Makefile
src/common/Makefile
src/frame/Makefile
src/essence_parser/Makefile
src/writer_helper/Makefile
src/mxf_helper/Makefile
src/mxf_reader/Makefile
src/as02/Makefile
src/mxf_op1a/Makefile
src/avid_mxf/Makefile
src/d10_mxf/Makefile
src/as11/Makefile
src/as10/Makefile
src/rdd9_mxf/Makefile
src/wave/Makefile
src/clip_writer/Makefile
src/st436/Makefile
test/Makefile
test/ard_zdf_hdf/Makefile
test/as02/Makefile
test/as10/Makefile
test/as11/Makefile
test/bmxtranswrap/Makefile
test/mca/Makefile
test/misc/Makefile
test/mxf_op1a/Makefile
test/avid_mxf/Makefile
test/mxf_reader/Makefile
test/d10_mxf/Makefile
test/rdd9_mxf/Makefile
test/wave/Makefile
test/growing_file/Makefile
test/rdd6/Makefile
test/text_object/Makefile
test/bbcarchive/Makefile
apps/Makefile
apps/mxf2raw/Makefile
apps/writers/Makefile
apps/raw2bmx/Makefile
apps/bmxtranswrap/Makefile
apps/bmxparse/Makefile
tools/Makefile
msvc_build/Makefile
msvc_build/vs10/Makefile
meta/Makefile
meta/as10/Makefile
meta/as11/Makefile
meta/mxf2raw/Makefile
meta/rdd6/Makefile
bmx.pc])
AC_OUTPUT