2
# Process this file with autoconf to produce a configure script.
5
AC_INIT([libde265], [1.0.2], [farin@struktur.de])
6
AC_CONFIG_SRCDIR([libde265/de265.cc])
7
AC_CONFIG_HEADERS([config.h])
9
NUMERIC_VERSION=0x01000200 # Numeric representation of the version (A.B.C[.D] = 0xAABBCCDD)
10
AC_SUBST(NUMERIC_VERSION)
16
# ---------------------------------------------------------------------------
20
AC_SUBST(LIBDE265_CURRENT)
21
AC_SUBST(LIBDE265_REVISION)
22
AC_SUBST(LIBDE265_AGE)
24
dnl Initialize libtool
26
AC_CONFIG_MACRO_DIR([m4])
28
# Checks for programs.
36
# Initialize automake stuff
40
CXXFLAGS+=" -Werror=return-type -Werror=unused-result -Werror=reorder"
41
AX_CXX_COMPILE_STDCXX_11()
43
dnl Use -Wall if we have gcc.
45
if test "x$GCC" = "xyes"; then
47
*[\ \ ]-Wall[\ \ ]*) ;;
48
*) CFLAGS="$CFLAGS -Wall" ;;
54
dnl : In encoder branch, we still export all library symbols :
56
AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"])
58
# Checks for header files.
59
AC_CHECK_HEADERS([stdint.h stdlib.h string.h malloc.h signal.h setjmp.h stddef.h sys/time.h])
61
# Checks for typedefs, structures, and compiler characteristics.
72
AC_CHECK_TYPES([ptrdiff_t])
75
# Checks for library functions.
76
AC_CHECK_FUNCS([malloc memmove memset __malloc_hook memalign posix_memalign __mingw_aligned_malloc __mingw_aligned_free])
78
AC_SEARCH_LIBS([pow], [m])
79
AC_SEARCH_LIBS([sqrt], [m])
80
AC_SEARCH_LIBS([pthread_create], [pthread])
82
AC_CHECK_FUNCS([gettimeofday])
83
AC_CHECK_FUNCS([pow sqrt])
84
AC_CHECK_FUNCS([strchr strrchr])
88
# Checking for malloc breaks building on ARM for us. A similar issue is described
89
# here: http://nerdland.net/unstumping-the-internet/malloc-has-not-been-declared/
94
AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1)
96
# Check if "__STRICT_ANSI__" is required.
97
AC_MSG_CHECKING([if __STRICT_ANSI__ is required])
101
],[],[need_strict_ansi=no],[need_strict_ansi=yes]);
103
if eval "test x$need_strict_ansi = xyes"; then
104
CFLAGS+=" -D__STRICT_ANSI__"
105
CXXFLAGS+=" -D__STRICT_ANSI__"
107
AC_MSG_RESULT([$need_strict_ansi])
109
# --- machine dependent optimizations ---
114
[AS_HELP_STRING([--disable-sse],
115
[disable SSE optimizations (default=no)])],
119
if eval "test x$disable_sse != xyes"; then
124
i[[3456]]86*|x86_64*|amd64*)
126
AX_CHECK_COMPILE_FLAG(-msse4.1, ax_cv_support_sse41_ext=yes, [])
127
if test x"$ax_cv_support_sse41_ext" = x"yes"; then
128
# SIMD_FLAGS="$SIMD_FLAGS -msse4.1"
129
AC_DEFINE(HAVE_SSE4_1,1,[Support SSSE4.1 (Streaming SIMD Extensions 4.1) instructions])
131
AC_MSG_WARN([Your compiler does not support SSE4.1 instructions, can you try another compiler?])
137
AM_CONDITIONAL([ENABLE_SSE_OPT], [test x"$ax_cv_support_sse41_ext" = x"yes"])
139
# CFLAGS+=$SIMD_FLAGS
140
# CFLAGS+=" -march=x86-64"
145
[AS_HELP_STRING([--disable-arm],
146
[disable ARM optimizations (default=no)])],
150
if test x"$disable_arm" != x"yes"; then
151
AC_DEFINE(HAVE_ARM, 1, [Support ARM instructions])
153
AX_CHECK_COMPILE_FLAG(-mfpu=neon, [
154
AC_DEFINE(HAVE_NEON, 1, [Support ARM NEON instructions])
155
ax_cv_support_neon_ext=yes], [])
158
[AS_HELP_STRING([--enable-thumb],
159
[disable ARM THUMB instructions (default=no)])],
171
AM_CONDITIONAL([ENABLE_ARM_OPT], [test x"$disable_arm" != x"yes"])
172
AM_CONDITIONAL([ENABLE_NEON_OPT], [test x"$ax_cv_support_neon_ext" = x"yes"])
173
AM_CONDITIONAL([ENABLE_ARM_THUMB], [test x"$enable_thumb" != x"no"])
175
# --- additional logging ---
177
AC_ARG_ENABLE(log-error,
178
[AS_HELP_STRING([--enable-log-error],
179
[turn on logging at error level (default=yes)])],
180
[enable_log_error=$enableval],
181
[enable_log_error=yes])
182
if eval "test $enable_log_error = yes"; then
183
CXXFLAGS+=" -DDE265_LOG_ERROR"
186
AC_ARG_ENABLE(log-info,
187
[AS_HELP_STRING([--enable-log-info],
188
[turn on logging at info level (default=no)])],
189
[enable_log_info=$enableval],
190
[enable_log_info=no])
191
if eval "test $enable_log_info = yes"; then
192
CXXFLAGS+=" -DDE265_LOG_INFO"
195
AC_ARG_ENABLE(log-debug,
196
[AS_HELP_STRING([--enable-log-debug],
197
[turn on logging at debug level (default=no)])],
198
[enable_log_debug=$enableval],
199
[enable_log_debug=no])
200
if eval "test $enable_log_debug = yes"; then
201
CXXFLAGS+=" -DDE265_LOG_DEBUG"
204
AC_ARG_ENABLE(log-trace,
205
[AS_HELP_STRING([--enable-log-trace],
206
[turn on logging at trace level (default=no)])],
207
[enable_log_trace=$enableval],
208
[enable_log_trace=no])
209
if eval "test $enable_log_trace = yes"; then
210
CXXFLAGS+=" -DDE265_LOG_TRACE"
214
# --- enable example programs ---
216
AC_ARG_ENABLE([dec265], AS_HELP_STRING([--disable-dec265], [Do not build dec265 decoder program.]))
217
AC_ARG_ENABLE([sherlock265], AS_HELP_STRING([--disable-sherlock265], [Do not build sherlock265 visual inspection program.]))
219
if eval "test x$enable_dec265 = x" ; then enable_dec265=yes ; fi
220
if eval "test x$enable_sherlock265 = x" ; then enable_sherlock265=yes ; fi
222
if eval "test x$enable_dec265 = xyes" || eval "test x$enable_sherlock265 = xyes" ; then
223
PKG_CHECK_MODULES([VIDEOGFX], [libvideogfx],
224
[AC_DEFINE([HAVE_VIDEOGFX], [1], [Whether libvideogfx was found.])
225
AC_SUBST(VIDEOGFX_CFLAGS)
226
AC_SUBST(VIDEOGFX_LIBS)
227
have_videogfx="yes"],
232
if eval "test x$enable_dec265 = xyes" ; then
233
PKG_CHECK_MODULES([SDL], [sdl],
234
[AC_DEFINE([HAVE_SDL], [1], [Whether libsdl was found.])
242
if eval "test x$enable_sherlock265 = xyes" && eval "test x$have_videogfx != xyes" ; then
243
PKG_CHECK_MODULES([SWSCALE], [libswscale],
244
[AC_DEFINE([HAVE_SWSCALE], [1], [Whether libswscale was found.])
245
AC_SUBST(SWSCALE_CFLAGS)
246
AC_SUBST(SWSCALE_LIBS)
252
AM_CONDITIONAL([HAVE_VIDEOGFX], [test "x$have_videogfx" = "xyes"])
253
AM_CONDITIONAL([HAVE_SWSCALE], [test "x$have_swscale" = "xyes"])
254
AM_CONDITIONAL([HAVE_SDL], [test "x$have_sdl" = "xyes"])
256
if eval "test $enable_dec265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_sdl != yes" ; then
257
AC_MSG_WARN([Did not find libvideogfx or libsdl, video output of dec265 will be disabled.])
260
if eval "test $enable_sherlock265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_swscale != yes" ; then
261
AC_MSG_WARN([Did not find libvideogfx or libswscale, compilation of sherlock265 will be disabled.])
262
enable_sherlock265="no"
265
if eval "test $enable_sherlock265 = yes" ; then
266
PKG_CHECK_MODULES([QT], [Qt5Core Qt5Gui Qt5Widgets], [found_qt=5], [found_qt=no])
267
if eval "test $found_qt = no" ; then
268
PKG_CHECK_MODULES([QT], [QtCore QtGui], [found_qt=4])
270
AC_PATH_PROGS([QTCHOOSER],[qtchooser])
271
if eval "test x$QTCHOOSER = x" ; then
272
AC_PATH_PROGS([QTMOC],[moc-qt$found_qt moc])
273
if eval "test x$QTMOC = x" ; then
274
AC_MSG_ERROR([Need the "moc" commandline tool which is required to generate the Qt files required for sherlock265.])
277
QTMOC="$QTCHOOSER -run-tool=moc -qt=$found_qt"
279
AC_MSG_CHECKING([for version of $QTMOC])
280
QTMOC_VERSION=`$QTMOC -v 2>&1 | $GREP -o '[[0-9]]\+.[[0-9]]\+.[[0-9]]\+'`
281
AC_MSG_RESULT([$QTMOC_VERSION])
282
AX_COMPARE_VERSION([$QTMOC_VERSION], [lt], [$found_qt],
283
[AC_MSG_ERROR([Please install "moc" for Qt$found_qt (found $QTMOC_VERSION).])])
287
AM_CONDITIONAL([ENABLE_DEC265], [test "x$enable_dec265" != "xno"])
288
AM_CONDITIONAL([ENABLE_SHERLOCK265], [test "x$enable_sherlock265" != "xno"])
291
# --- output configuration results ---
293
AC_MSG_NOTICE([---------------------------------------])
294
AC_MSG_NOTICE([Building dec265 example: $enable_dec265])
295
AC_MSG_NOTICE([Building sherlock265 example: $enable_sherlock265])
296
AC_MSG_NOTICE([---------------------------------------])
298
AC_CONFIG_FILES([Makefile])
299
AC_CONFIG_FILES([libde265/Makefile])
300
AC_CONFIG_FILES([libde265/arm/Makefile])
301
AC_CONFIG_FILES([libde265/x86/Makefile])
302
AC_CONFIG_FILES([libde265/encoder/Makefile])
303
AC_CONFIG_FILES([libde265/encoder/algo/Makefile])
304
AC_CONFIG_FILES([libde265/de265-version.h])
305
AC_CONFIG_FILES([dec265/Makefile])
306
AC_CONFIG_FILES([enc265/Makefile])
307
AC_CONFIG_FILES([sherlock265/Makefile])
308
AC_CONFIG_FILES([tools/Makefile])
309
AC_CONFIG_FILES([libde265.pc])