forked from xiph/daala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
301 lines (259 loc) · 9.76 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
# autoconf source script for generating configure
dnl The package_version file will be automatically synced to the git revision
dnl by the update_version script when configured in the repository, but will
dnl remain constant in tarball releases unless it is manually edited.
m4_define([CURRENT_VERSION],
m4_esyscmd([ if test -e package_version || ./update_version; then
. ./package_version
printf "$PACKAGE_VERSION"
else
printf "unknown"
fi ]))
AC_INIT([daala],[CURRENT_VERSION],[[email protected]])
AC_CONFIG_SRCDIR([src/decode.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AM_INIT_AUTOMAKE([1.11 foreign no-define subdir-objects])
AM_MAINTAINER_MODE([enable])
LT_INIT
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl Library versioning for libtool.
dnl Please update these for releases.
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
OD_LT_CURRENT=0
OD_LT_REVISION=1
OD_LT_AGE=0
AC_SUBST(OD_LT_CURRENT)
AC_SUBST(OD_LT_REVISION)
AC_SUBST(OD_LT_AGE)
CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long -Wno-overlength-strings $CFLAGS"
# Platform-specific tweaks
case $host in
*-mingw*)
# -std=c89 causes some warnings under mingw.
CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
# We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
# It's okay to define this even when HTTP support is disabled, as it only
# affects header declarations, not linking (unless we actually use some
# XP-only functions).
AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
[We need at least WindowsXP for getaddrinfo/freaddrinfo])
host_mingw=true
;;
*-*-darwin*)
os_darwin=true
;;
esac
dnl These two are entirely unused at present.
dnl AM_CONDITIONAL(OD_WIN32, test "$host_mingw" = "true")
dnl AM_CONDITIONAL(OD_OS_DARWIN, test "$os_darwin" = "true")
AC_ARG_ENABLE([assertions],
AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
enable_assertions=no)
AM_CONDITIONAL([ENABLE_ASSERTIONS], [test "$enable_assertions" = "yes"])
AS_IF([test "$enable_assertions" = "yes"], [
AC_DEFINE([OD_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
])
AC_ARG_ENABLE([logging],
AS_HELP_STRING([--enable-logging], [Enable logging]),,
enable_logging=no)
AS_IF([test "$enable_logging" = "yes"], [
AC_DEFINE([OD_LOGGING_ENABLED], [1], [Enable logging])
])
AC_ARG_ENABLE([player],
AS_HELP_STRING([--disable-player], [Disable the example player]),,
enable_player=yes)
dnl Set LIBM to the math library if needed.
LT_LIB_M
AC_CHECK_FUNCS([gettimeofday ftime],[break])
AS_IF([test "$enable_player" = "yes"], [
PKG_CHECK_MODULES([SDL], [sdl])
])
AM_CONDITIONAL([ENABLE_PLAYER_EXAMPLE], [test "$enable_player" = "yes"])
PKG_CHECK_MODULES([OGG], [ogg >= 1.3])
#CC_ATTRIBUTE_VISIBILITY([default], [
# CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
#])
dnl Check for tools
AC_ARG_ENABLE([tools],
AC_HELP_STRING([--disable-tools], [Disable the tools]),,
[enable_tools=yes])
if test "$enable_tools" = "yes" ; then
AC_CHECK_LIB([jpeg],[jpeg_start_compress],[JPEG_LIBS="-ljpeg"],[AC_MSG_ERROR([libjpeg needed for building tools])])
AC_SUBST([JPEG_LIBS])
PKG_CHECK_MODULES([PNG], [libpng])
AC_OPENMP
fi
AM_CONDITIONAL(ENABLE_TOOLS, [test $enable_tools = "yes"])
dnl Check for check
AC_ARG_ENABLE([unit-tests],
AS_HELP_STRING([--disable-unit-tests], [Do not build unit tests]),,
[enable_unit_tests=yes]
)
if test "$enable_unit_tests" = "yes" ; then
PKG_CHECK_MODULES([CHECK], [check >= 0.9.8])
dnl As of version 0.9.10, check does not include -pthread in its Cflags or
dnl Libs even though it does depend on it. Assuming that check.pc may one day
dnl be fixed for that, only add it here if it's not there already. It really
dnl belongs in LDFLAGS here (since check is a static lib and doesn't expose
dnl pthread functions in its header), but it can't be added to CHECK_LIBS,
dnl since automake 1.13 will barf about adding -pthread to *_LDADD rather
dnl than *_LDFLAGS. However libtool does also include CFLAGS when linking.
case $CHECK_CFLAGS in
*-pthread*)
;;
*)
CHECK_CFLAGS="-pthread $CHECK_CFLAGS"
;;
esac
fi
AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test $enable_unit_tests = "yes"])
AC_ARG_ENABLE([doc],
AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
[enable_doc=yes]
)
AS_IF([test "$enable_doc" = "yes"], [
AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
AC_CHECK_PROG([HAVE_FIG2DEV], [fig2dev], [yes], [no])
],[
HAVE_DOXYGEN=no
HAVE_FIG2DEV=no
])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
AM_CONDITIONAL([HAVE_FIG2DEV], [test "$HAVE_FIG2DEV" = "yes"])
AC_ARG_ENABLE([asm],
AS_HELP_STRING([--disable-asm], [Do not compile assembly versions]),,
[enable_asm=yes]
)
case $host_cpu in
i[3456]86)
cpu_x86=true
;;
x86_64)
cpu_x86=true
;;
esac
AS_IF([test "$enable_asm" = "yes" -a "$cpu_x86" = "true"], [
AC_DEFINE([OD_X86ASM], [1], [Enable asm optimisations])
AC_TRY_LINK([
#include <xmmintrin.h>
], [
return _mm_cvtsi128_si32(_mm_setzero_si128());
], [
enable_sse2_intrinsics=yes
AC_DEFINE([OD_SSE2_INTRINSICS], [1],
[Enable SSE2 intrinsics optimisations])
AC_TRY_LINK([
#include <smmintrin.h>
], [
return _mm_cvtsi128_si32(_mm_mullo_epi32(_mm_setzero_si128(),
_mm_setzero_si128()));
], [
enable_sse41_intrinsics=yes
AC_DEFINE([OD_SSE41_INTRINSICS], [1],
[Enable SSE4.1 intrinsics optimisations])
AC_TRY_LINK([
#include <immintrin.h>
], [
return _mm_cvtsi128_si32(_mm_broadcastb_epi8(_mm_setzero_si128()));
], [
enable_avx2_intrinsics=yes
AC_DEFINE([OD_AVX2_INTRINSICS], [1],
[Enable AVX2 intrinsics optimisations])
], [enable_avx2_intrinsics=no]
)
], [enable_sse41_intrinsics=no]
)
], [enable_sse2_intrinsics=no]
)
])
AM_CONDITIONAL([ENABLE_X86ASM],
[test "$enable_asm" = "yes" -a "$cpu_x86" = "true"])
AM_CONDITIONAL([ENABLE_SSE2_INTRINSICS],
[test "$enable_asm" = "yes" -a "$cpu_x86" = "true" -a "$enable_sse2_intrinsics" = "yes"])
AM_CONDITIONAL([ENABLE_SSE41_INTRINSICS],
[test "$enable_asm" = "yes" -a "$cpu_x86" = "true" -a "$enable_sse41_intrinsics" = "yes"])
AM_CONDITIONAL([ENABLE_AVX2_INTRINSICS],
[test "$enable_asm" = "yes" -a "$cpu_x86" = "true" -a "$enable_avx2_intrinsics" = "yes"])
AC_ARG_ENABLE([encoder-check],
AS_HELP_STRING([--enable-encoder-check], [Compare reconstructed frames]),,
[enable_encoder_check=no])
AS_IF([test "$enable_encoder_check" = "yes"], [
AC_DEFINE([OD_ENCODER_CHECK], [1], [Enable comparison of reconstructed frames])
])
AM_CONDITIONAL([ENCODER_CHECK], [test "$enable_encoder_check" = "yes"])
AC_ARG_ENABLE([dump-images],
AS_HELP_STRING([--enable-dump-images], [Dump debugging images]),,
[enable_dump_images=no])
AS_IF([test "$enable_dump_images" = "yes"], [
AC_DEFINE([OD_DUMP_IMAGES], [1], [Enable image dumping])
if test "$enable_tools" != "yes" ; then
PKG_CHECK_MODULES([PNG], [libpng])
fi
PC_PNG_REQUIRES="libpng"
PC_PNG_LIBS="$PNG_LIBS"
])
AM_CONDITIONAL([DUMP_IMAGES], [test "$enable_dump_images" = "yes"])
AC_SUBST([PC_PNG_REQUIRES])
AC_SUBST([PC_PNG_LIBS])
AC_ARG_ENABLE([dump-recons],
AS_HELP_STRING([--enable-dump-recons], [Dump reconstructed video]),,
[enable_dump_recons=no])
AS_IF([test "$enable_dump_recons" = "yes"], [
AC_DEFINE([OD_DUMP_RECONS], [1], [Enable reconstructed video dumping])
])
AC_ARG_ENABLE([dump-coeffs],
AS_HELP_STRING([--enable-dump-coeffs], [Dump transform coefficients]),,
[enable_dump_coeffs=no])
AS_IF([test "$enable_dump_coeffs" = "yes"], [
AC_DEFINE([OD_DUMP_COEFFS], [1], [Enable transform coefficient dumping])
])
AC_ARG_ENABLE([accounting],
AS_HELP_STRING([--enable-accounting], [Enable bit accounting]),
[if test "$host_mingw" = "true"; then AC_MSG_ERROR([accounting not supported on Windows]); fi],
[enable_accounting=no])
AS_IF([test "$enable_accounting" = "yes"], [
AC_DEFINE([OD_ACCOUNTING], [1], [Enable bit accounting])])
AC_ARG_ENABLE([ec-accounting],
AS_HELP_STRING([--enable-ec-accounting], [Enable entropy coder accounting]),,
[enable_ec_accounting=no])
AS_IF([test "$enable_ec_accounting" = "yes"], [
AC_DEFINE([OD_EC_ACCOUNTING], [1], [Enable entropy coder accounting])])
AC_CONFIG_FILES([
Makefile
daalaenc.pc
daaladec.pc
daalaenc-uninstalled.pc
daaladec-uninstalled.pc
doc/Doxyfile
doc/Makefile
])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT
AC_MSG_NOTICE([
------------------------------------------------------------------------
$PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
Assertions ................... ${enable_assertions}
Logging ...................... ${enable_logging}
API documentation ............ ${enable_doc}
Assembly optimizations ....... ${enable_asm}
Image dumping ................ ${enable_dump_images}
Reconstructed video dumping .. ${enable_dump_recons}
Transform coeffs dumping ..... ${enable_dump_coeffs}
Check encoder ................ ${enable_encoder_check}
Bit accounting ............... ${enable_accounting}
Entropy coder accounting ..... ${enable_ec_accounting}
Tools ........................ ${enable_tools}
Unit tests ................... ${enable_unit_tests}
Example Player................ ${enable_player}
------------------------------------------------------------------------
Use "make tools" to compile the tools.
Use "make clean && make debug" to enable assertions and logging
without needing to reconfigure the source tree.
])