~ubuntu-branches/ubuntu/wily/libde265/wily

« back to all changes in this revision

Viewing changes to .pc/only_export_decoder_api.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Joachim Bauch
  • Date: 2015-07-16 11:07:46 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150716110746-76vsv24j3yux7tnu
Tags: 1.0.2-1
* Imported Upstream version 1.0.2
* Added new files to copyright information.
* Only export decoder API and update symbols for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ([2.68])
 
5
AC_INIT([libde265], [1.0.2], [farin@struktur.de])
 
6
AC_CONFIG_SRCDIR([libde265/de265.cc])
 
7
AC_CONFIG_HEADERS([config.h])
 
8
 
 
9
NUMERIC_VERSION=0x01000200 # Numeric representation of the version (A.B.C[.D] = 0xAABBCCDD)
 
10
AC_SUBST(NUMERIC_VERSION)
 
11
 
 
12
LIBDE265_CURRENT=0
 
13
LIBDE265_REVISION=10
 
14
LIBDE265_AGE=0
 
15
 
 
16
# ---------------------------------------------------------------------------
 
17
 
 
18
AC_CANONICAL_SYSTEM
 
19
 
 
20
AC_SUBST(LIBDE265_CURRENT)
 
21
AC_SUBST(LIBDE265_REVISION)
 
22
AC_SUBST(LIBDE265_AGE)
 
23
 
 
24
dnl Initialize libtool
 
25
LT_INIT
 
26
AC_CONFIG_MACRO_DIR([m4])
 
27
 
 
28
# Checks for programs.
 
29
AM_PROG_AS
 
30
AC_PROG_CXX
 
31
AC_PROG_CC
 
32
AC_PROG_INSTALL
 
33
AC_PROG_LN_S
 
34
AC_PROG_GREP
 
35
 
 
36
# Initialize automake stuff
 
37
AM_INIT_AUTOMAKE
 
38
 
 
39
CFLAGS+=" -std=c99"
 
40
CXXFLAGS+=" -Werror=return-type -Werror=unused-result -Werror=reorder"
 
41
AX_CXX_COMPILE_STDCXX_11()
 
42
 
 
43
dnl Use -Wall if we have gcc.
 
44
changequote(,)dnl
 
45
if test "x$GCC" = "xyes"; then
 
46
  case " $CFLAGS " in
 
47
  *[\ \ ]-Wall[\ \      ]*) ;;
 
48
  *) CFLAGS="$CFLAGS -Wall" ;;
 
49
  esac
 
50
fi
 
51
changequote([,])dnl
 
52
 
 
53
dnl gl_VISIBILITY
 
54
dnl : In encoder branch, we still export all library symbols :
 
55
HAVE_VISIBILITY=0
 
56
AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"])
 
57
 
 
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])
 
60
 
 
61
# Checks for typedefs, structures, and compiler characteristics.
 
62
AC_HEADER_STDBOOL
 
63
AC_TYPE_SIZE_T
 
64
AC_TYPE_INT8_T
 
65
AC_TYPE_INT16_T
 
66
AC_TYPE_INT32_T
 
67
AC_TYPE_INT64_T
 
68
AC_TYPE_UINT8_T
 
69
AC_TYPE_UINT16_T
 
70
AC_TYPE_UINT32_T
 
71
AC_TYPE_UINT64_T
 
72
AC_CHECK_TYPES([ptrdiff_t])
 
73
AC_C_INLINE
 
74
 
 
75
# Checks for library functions.
 
76
AC_CHECK_FUNCS([malloc memmove memset __malloc_hook memalign posix_memalign __mingw_aligned_malloc __mingw_aligned_free])
 
77
 
 
78
AC_SEARCH_LIBS([pow], [m])
 
79
AC_SEARCH_LIBS([sqrt], [m])
 
80
AC_SEARCH_LIBS([pthread_create], [pthread])
 
81
 
 
82
AC_CHECK_FUNCS([gettimeofday])
 
83
AC_CHECK_FUNCS([pow sqrt])
 
84
AC_CHECK_FUNCS([strchr strrchr])
 
85
 
 
86
AC_FUNC_ALLOCA
 
87
AC_FUNC_ERROR_AT_LINE
 
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/
 
90
# AC_FUNC_MALLOC
 
91
# AC_FUNC_REALLOC
 
92
AC_FUNC_MKTIME
 
93
 
 
94
AM_CONDITIONAL(MINGW, expr $host : '.*-mingw' >/dev/null 2>&1)
 
95
 
 
96
# Check if "__STRICT_ANSI__" is required.
 
97
AC_MSG_CHECKING([if __STRICT_ANSI__ is required])
 
98
AC_LANG_PUSH(C++)
 
99
AC_TRY_COMPILE([
 
100
#include <vector>
 
101
],[],[need_strict_ansi=no],[need_strict_ansi=yes]);
 
102
AC_LANG_POP(C++)
 
103
if eval "test x$need_strict_ansi = xyes"; then
 
104
  CFLAGS+=" -D__STRICT_ANSI__"
 
105
  CXXFLAGS+=" -D__STRICT_ANSI__"
 
106
fi
 
107
AC_MSG_RESULT([$need_strict_ansi])
 
108
 
 
109
# --- machine dependent optimizations ---
 
110
 
 
111
#AX_EXT
 
112
 
 
113
AC_ARG_ENABLE(sse,
 
114
              [AS_HELP_STRING([--disable-sse],
 
115
                              [disable SSE optimizations (default=no)])],
 
116
  [disable_sse=yes],
 
117
  [disable_sse=no])
 
118
 
 
119
if eval "test x$disable_sse != xyes"; then
 
120
    case $target_cpu in
 
121
      powerpc*)
 
122
        ;;
 
123
 
 
124
      i[[3456]]86*|x86_64*|amd64*)
 
125
 
 
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])
 
130
        else
 
131
          AC_MSG_WARN([Your compiler does not support SSE4.1 instructions, can you try another compiler?])
 
132
        fi
 
133
        ;;
 
134
 
 
135
    esac
 
136
fi
 
137
AM_CONDITIONAL([ENABLE_SSE_OPT], [test x"$ax_cv_support_sse41_ext" = x"yes"])
 
138
 
 
139
# CFLAGS+=$SIMD_FLAGS
 
140
# CFLAGS+=" -march=x86-64"
 
141
 
 
142
case $target_cpu in
 
143
  arm*)
 
144
    AC_ARG_ENABLE(arm,
 
145
                  [AS_HELP_STRING([--disable-arm],
 
146
                                  [disable ARM optimizations (default=no)])],
 
147
      [disable_arm=yes],
 
148
      [disable_arm=no])
 
149
 
 
150
    if test x"$disable_arm" != x"yes"; then
 
151
      AC_DEFINE(HAVE_ARM, 1, [Support ARM instructions])
 
152
 
 
153
      AX_CHECK_COMPILE_FLAG(-mfpu=neon, [
 
154
          AC_DEFINE(HAVE_NEON, 1, [Support ARM NEON instructions])
 
155
          ax_cv_support_neon_ext=yes], [])
 
156
 
 
157
      AC_ARG_ENABLE(thumb,
 
158
                    [AS_HELP_STRING([--enable-thumb],
 
159
                                    [disable ARM THUMB instructions (default=no)])],
 
160
        [enable_thumb=yes],
 
161
        [enable_thumb=no])
 
162
    fi
 
163
    ;;
 
164
 
 
165
  *)
 
166
    disable_arm=yes
 
167
    ;;
 
168
 
 
169
esac
 
170
 
 
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"])
 
174
 
 
175
# --- additional logging ---
 
176
 
 
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"
 
184
fi
 
185
 
 
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"
 
193
fi
 
194
 
 
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"
 
202
fi
 
203
 
 
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"
 
211
fi
 
212
 
 
213
 
 
214
# --- enable example programs ---
 
215
 
 
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.]))
 
218
 
 
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
 
221
 
 
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"],
 
228
                     [have_videogfx="no"]
 
229
                     )
 
230
fi
 
231
 
 
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.])
 
235
                      AC_SUBST(SDL_CFLAGS)
 
236
                      AC_SUBST(SDL_LIBS)
 
237
                      have_sdl="yes"],
 
238
                     [have_sdl="no"]
 
239
                     )
 
240
fi
 
241
 
 
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)
 
247
                      have_swscale="yes"],
 
248
                     [have_swscale="no"]
 
249
                     )
 
250
fi
 
251
 
 
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"])
 
255
 
 
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.])
 
258
fi
 
259
 
 
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"
 
263
fi
 
264
 
 
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])
 
269
  fi
 
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.])
 
275
    fi
 
276
  else
 
277
    QTMOC="$QTCHOOSER -run-tool=moc -qt=$found_qt"
 
278
  fi
 
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).])])
 
284
  AC_SUBST(QTMOC)
 
285
fi
 
286
 
 
287
AM_CONDITIONAL([ENABLE_DEC265], [test "x$enable_dec265" != "xno"])
 
288
AM_CONDITIONAL([ENABLE_SHERLOCK265], [test "x$enable_sherlock265" != "xno"])
 
289
 
 
290
 
 
291
# --- output configuration results ---
 
292
 
 
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([---------------------------------------])
 
297
 
 
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])
 
310
AC_OUTPUT