forked from strukturag/libde265
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
218 lines (170 loc) · 6.58 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([libde265], [0.7], [[email protected]])
AC_CONFIG_SRCDIR([libde265/de265.cc])
AC_CONFIG_HEADERS([config.h])
NUMERIC_VERSION=0x00070000 # Numeric representation of the version
AC_SUBST(NUMERIC_VERSION)
LIBDE265_CURRENT=0
LIBDE265_REVISION=6
LIBDE265_AGE=0
# ---------------------------------------------------------------------------
AC_CANONICAL_SYSTEM
AC_SUBST(LIBDE265_CURRENT)
AC_SUBST(LIBDE265_REVISION)
AC_SUBST(LIBDE265_AGE)
dnl Initialize libtool
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
# Initialize automake stuff
AM_INIT_AUTOMAKE
CFLAGS+=" -std=c99"
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
# Checks for header files.
AC_CHECK_HEADERS([stdint.h stdlib.h string.h malloc.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([malloc memmove memset __malloc_hook memalign posix_memalign __mingw_aligned_malloc __mingw_aligned_free])
AC_SEARCH_LIBS([sqrt], [m])
AC_SEARCH_LIBS([pthread_create], [pthread])
AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1)
# --- machine dependent optimizations ---
#AX_EXT
AC_ARG_ENABLE(sse,
[AS_HELP_STRING([--disable-sse],
[disable SSE optimizations (default=no)])],
[disable_sse=yes],
[disable_sse=no])
if eval "test x$disable_sse != xyes"; then
case $target_cpu in
powerpc*)
;;
i[[3456]]86*|x86_64*|amd64*)
AX_CHECK_COMPILE_FLAG(-msse4.1, ax_cv_support_sse41_ext=yes, [])
if test x"$ax_cv_support_sse41_ext" = x"yes"; then
# SIMD_FLAGS="$SIMD_FLAGS -msse4.1"
AC_DEFINE(HAVE_SSE4_1,1,[Support SSSE4.1 (Streaming SIMD Extensions 4.1) instructions])
else
AC_MSG_WARN([Your compiler does not support SSE4.1 instructions, can you try another compiler?])
fi
;;
esac
fi
AM_CONDITIONAL([ENABLE_SSE_OPT], [test x"$ax_cv_support_sse41_ext" = x"yes"])
# CFLAGS+=$SIMD_FLAGS
# CFLAGS+=" -march=x86-64"
# --- additional logging ---
AC_ARG_ENABLE(log-error,
[AS_HELP_STRING([--enable-log-error],
[turn on logging at error level (default=yes)])],
[enable_log_error=$enableval],
[enable_log_error=yes])
if eval "test $enable_log_error = yes"; then
CXXFLAGS+=" -DDE265_LOG_ERROR"
fi
AC_ARG_ENABLE(log-info,
[AS_HELP_STRING([--enable-log-info],
[turn on logging at info level (default=no)])],
[enable_log_info=$enableval],
[enable_log_info=no])
if eval "test $enable_log_info = yes"; then
CXXFLAGS+=" -DDE265_LOG_INFO"
fi
AC_ARG_ENABLE(log-debug,
[AS_HELP_STRING([--enable-log-debug],
[turn on logging at debug level (default=no)])],
[enable_log_debug=$enableval],
[enable_log_debug=no])
if eval "test $enable_log_debug = yes"; then
CXXFLAGS+=" -DDE265_LOG_DEBUG"
fi
AC_ARG_ENABLE(log-trace,
[AS_HELP_STRING([--enable-log-trace],
[turn on logging at trace level (default=no)])],
[enable_log_trace=$enableval],
[enable_log_trace=no])
if eval "test $enable_log_trace = yes"; then
CXXFLAGS+=" -DDE265_LOG_TRACE"
fi
# --- enable example programs ---
AC_ARG_ENABLE([dec265], AS_HELP_STRING([--disable-dec265], [Do not build dec265 decoder program.]))
AC_ARG_ENABLE([sherlock265], AS_HELP_STRING([--disable-sherlock265], [Do not build sherlock265 visual inspection program.]))
if eval "test x$enable_dec265 = x" ; then enable_dec265=yes ; fi
if eval "test x$enable_sherlock265 = x" ; then enable_sherlock265=yes ; fi
if eval "test x$enable_dec265 = xyes" || eval "test x$enable_sherlock265 = xyes" ; then
PKG_CHECK_MODULES([VIDEOGFX], [libvideogfx],
[AC_DEFINE([HAVE_VIDEOGFX], [1], [Whether libvideogfx was found.])
AC_SUBST(VIDEOGFX_CFLAGS)
AC_SUBST(VIDEOGFX_LIBS)
have_videogfx="yes"],
[have_videogfx="no"]
)
fi
if eval "test x$enable_dec265 = xyes" ; then
PKG_CHECK_MODULES([SDL], [sdl],
[AC_DEFINE([HAVE_SDL], [1], [Whether libsdl was found.])
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
have_sdl="yes"],
[have_sdl="no"]
)
fi
if eval "test x$enable_sherlock265 = xyes" && eval "test x$have_videogfx != xyes" ; then
PKG_CHECK_MODULES([SWSCALE], [libswscale],
[AC_DEFINE([HAVE_SWSCALE], [1], [Whether libswscale was found.])
AC_SUBST(SWSCALE_CFLAGS)
AC_SUBST(SWSCALE_LIBS)
have_swscale="yes"],
[have_swscale="no"]
)
fi
AM_CONDITIONAL([HAVE_VIDEOGFX], [test "x$have_videogfx" = "xyes"])
AM_CONDITIONAL([HAVE_SWSCALE], [test "x$have_swscale" = "xyes"])
AM_CONDITIONAL([HAVE_SDL], [test "x$have_sdl" = "xyes"])
if eval "test $enable_dec265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_sdl != yes" ; then
AC_MSG_WARN([Did not find libvideogfx or libsdl, video output of dec265 will be disabled.])
fi
if eval "test $enable_sherlock265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_swscale != yes" ; then
AC_MSG_WARN([Did not find libvideogfx or libswscale, compilation of sherlock265 will be disabled.])
enable_sherlock265="no"
fi
if eval "test $enable_sherlock265 = yes" ; then
PKG_CHECK_MODULES([QT], [QtCore QtGui])
fi
AM_CONDITIONAL([ENABLE_DEC265], [test "x$enable_dec265" != "xno"])
AM_CONDITIONAL([ENABLE_SHERLOCK265], [test "x$enable_sherlock265" != "xno"])
# --- output configuration results ---
AC_MSG_NOTICE([---------------------------------------])
AC_MSG_NOTICE([Building dec265 example: $enable_dec265])
AC_MSG_NOTICE([Building sherlock265 example: $enable_sherlock265])
AC_MSG_NOTICE([---------------------------------------])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([libde265/Makefile])
AC_CONFIG_FILES([libde265/x86/Makefile])
AC_CONFIG_FILES([libde265/de265-version.h])
AC_CONFIG_FILES([dec265/Makefile])
AC_CONFIG_FILES([sherlock265/Makefile])
AC_CONFIG_FILES([libde265.pc])
AC_OUTPUT