[encoder] Improved motion estimation.
[schroedinger/research-port.git] / configure.ac
blob1ffc2d8492a388e4ae37cdbeede7587b1e23b6ab
1 AC_PREREQ([2.58])
2 dnl PLEASE remove the nano when doing a release
3 AC_INIT(schroedinger,1.0.5.1)
5 AS_VERSION
7 AS_NANO(SCHRO_CVS=no,SCHRO_CVS=yes)
9 AC_CANONICAL_HOST([])
10 AM_INIT_AUTOMAKE(1.6)
12 SCHRO_MAJORMINOR=1.0
13 AC_SUBST(SCHRO_MAJORMINOR)
15 AM_CONFIG_HEADER(config.h)
17 dnl CURRENT, REVISION, AGE
18 dnl - library source changed -> increment REVISION
19 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
20 dnl - interfaces added -> increment AGE
21 dnl - interfaces removed -> AGE = 0
22 SCHRO_LIBVERSION="1:0:1"
23 AC_SUBST(SCHRO_LIBVERSION)
24 AC_LIBTOOL_WIN32_DLL
25 AC_PROG_LIBTOOL
26 AC_PROG_CXX
27 AM_PROG_AS
28 AM_PROG_CC_C_O
29 AC_SYS_LARGEFILE
31 dnl allow for different autotools
32 AS_AUTOTOOLS_ALTERNATE
34 AC_CONFIG_SRCDIR([schroedinger/schro.h])
36 AC_CONFIG_MACRO_DIR([m4])
37 ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
38 AC_SUBST(ACLOCAL_AMFLAGS)
40 dnl set up gettext
41 dnl the version check needs to stay here because autopoint greps for it
42 #AM_GNU_GETTEXT_VERSION([0.11.5])
43 #AM_GNU_GETTEXT([external])
45 AC_CHECK_LIBM
46 AC_SUBST(LIBM)
48 dnl liboil is required
49 OIL_VER="0.3.13"
50 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= $OIL_VER, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
51 if test "x${HAVE_LIBOIL}" != xyes ; then
52   AC_ERROR([liboil-0.3 >= $OIL_VER is required])
54 SCHRO_PKG_DEPS="liboil-0.3 >= $OIL_VER"
56 AC_ARG_ENABLE(orc, AC_HELP_STRING([--enable-orc],
57               [enable orc support (default=disabled)]))
58 if test "x$enable_orc" = xyes
59 then
60   ORC_VER="0.3.13"
61   PKG_CHECK_MODULES(ORC, orc-0.3 >= $ORC_VER, HAVE_ORC=yes, HAVE_ORC=no)
62 else
63   HAVE_ORC=no
65 if test "x${HAVE_ORC}" = xyes ; then
66   AC_DEFINE(HAVE_ORC, 1, [Whether or not orc is enabled])
67   SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS orc-0.3 >= $ORC_VER"
69 AM_CONDITIONAL(HAVE_ORC, test "x$HAVE_ORC" = "xyes")
71 AC_ARG_WITH([thread],
72     AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]),
73     [],
74     [with_thread=auto])
76 AC_MSG_CHECKING([threading implementation to use])
77 if test "x${with_thread}" = "xauto" ; then
78   case $host_os in
79     mingw* | pw32*)
80       with_thread=win32
81       ;;
82     *)
83       with_thread=pthread
84       ;;
85   esac
87 AC_MSG_RESULT([$with_thread])
89 THREAD_IMPL=${with_thread}
90 AC_SUBST(THREAD_IMPL)
92 if test "x${with_thread}" = "xpthread" ; then
93   case "$host_os" in 
94     *)
95       PTHREAD_CFLAGS=
96       PTHREAD_LIBS=-lpthread
97       ;;
98   esac
99   AC_SUBST(PTHREAD_CFLAGS)
100   AC_SUBST(PTHREAD_LIBS)
103 if test "x${with_thread}" = "xgthread" ; then
104   PKG_CHECK_MODULES(GTHREAD, gthread-2.0, HAVE_GTHREAD=yes, HAVE_GTHREAD=no)
105   AC_SUBST(GTHREAD_LIBS)
106   AC_SUBST(GTHREAD_CFLAGS)
107   SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS gthread-2.0"
110 AC_ARG_WITH([opengl],
111     AS_HELP_STRING([--with-opengl=PATH],[prefix where OpenGL is installed [[default=no]]]),
112     [],
113     [with_opengl=no])
115 AC_ARG_ENABLE(encoder, AC_HELP_STRING([--disable-encoder],
116               [disable encoder (default=enabled)]))
117 AM_CONDITIONAL(ENABLE_ENCODER, test "x$enable_encoder" != "xno")
118 if [ test "x$enable_encoder" != "xno" ] ; then
119   AC_DEFINE(ENABLE_ENCODER, 1, [Enable encoder])
121 AC_ARG_ENABLE(motion-ref, AC_HELP_STRING([--disable-motion-ref],
122               [disable motion reference code (default=enabled)]))
123 AM_CONDITIONAL(ENABLE_MOTION_REF, test "x$enable_motion_ref" != "xno")
124 if [ test "x$enable_motion_ref" != "xno" ] ; then
125   AC_DEFINE(ENABLE_MOTION_REF, 1, [Enable motion reference code])
128 ##################################################
129 # Check for gtk-doc.
130 ##################################################
132 if test "x$cross_compiling" = "xyes" ; then
133   enable_gtk_doc=no
135 GTK_DOC_CHECK([1.0])
137 AS_COMPILER_FLAG(-Wall, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall")
138 if test "x$SCHRO_CVS" = "xyes"
139 then
140   AS_COMPILER_FLAG(-Werror, SCHRO_CFLAGS="$SCHRO_CFLAGS -Werror")
143 AS_COMPILER_FLAG(-O3, CFLAGS=`echo $CFLAGS | sed s/O2/O3/`)
145 # Enable severe pain
146 #AS_COMPILER_FLAGS(COMPANY_CFLAGS,"-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default")
147 #COMPANY_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default"
148 #SCHRO_CFLAGS="$SCHRO_CFLAGS $COMPANY_CFLAGS"
150 SCHRO_CFLAGS="$SCHRO_CFLAGS -I\$(top_srcdir)"
151 AC_SUBST(SCHRO_CFLAGS)
153 ########################
154 # GStreamer stuff
155 ########################
157 GST_MAJORMINOR=0.10
159 dnl *** check for arguments to configure ***
161 if test "x$with_opengl" = xyes; then
162   GST_GL_DEP="gst-plugins-gl-0.10"
165 AC_ARG_ENABLE(gstreamer, AC_HELP_STRING([--disable-gstreamer],
166               [disable gstreamer support (default=enabled)]))
167 if test "x$enable_gstreamer" != xno
168 then
169   PKG_CHECK_MODULES(GST, gstreamer-0.10 >= 0.10.19 gstreamer-base-0.10 >= 0.10.19 gstreamer-video-0.10 >= 0.10.19 ${GST_GL_DEP},
170       HAVE_GST=yes, HAVE_GST=no)
171 else
172   HAVE_GST=no
175 AM_CONDITIONAL(HAVE_GST, test "x$HAVE_GST" = "xyes")
176 AC_SUBST(GST_CFLAGS)
177 AC_SUBST(GST_LIBS)
179 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
180 AC_SUBST(plugindir)
182 GST_ALL_LDFLAGS="-no-undefined"
183 AC_SUBST(GST_ALL_LDFLAGS)
185 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
186 AC_SUBST(GST_PLUGIN_LDFLAGS)
188 AC_DEFINE(GST_PACKAGE_ORIGIN, "unknown", [Package origin in GStreamer plugin])
190 ########################
191 # Check for CUDA
192 ########################
193 AC_ARG_WITH([cuda],
194     AS_HELP_STRING([--with-cuda=PATH],[prefix where cuda is installed [[default=no]]]),
195     [],
196     [with_cuda=no])
197 if test "x$with_cuda" = xyes; then
198   AC_PATH_PROG([NVCC], [nvcc], no, [$PATH:/usr/local/cuda/bin])
199   if test "x$NVCC" = xno ; then
200     AC_MSG_FAILURE(["--with-cuda was give, but nvcc was not found"])
201   fi
202   with_cuda=`echo $NVCC|sed 's,bin/nvcc,,'`
205 if test "x$with_cuda" != xno; then
206   CUDA_CFLAGS="-I$with_cuda/include"
207   CUDA_LIBS="-L$with_cuda/lib -lcudart"
208   NVCC="$with_cuda/bin/nvcc"
209   NVCCFLAGS="-O2 -use_fast_math"
210   HAVE_CUDA=yes
211   AC_DEFINE(HAVE_CUDA, 1, [Compile in CUDA rendering backend])
212 else
213   CUDA_CFLAGS=
214   CUDA_LIBS=
215   NVCC=
216   NVCCFLAGS=
217   HAVE_CUDA=no
219 AC_SUBST(CUDA_CFLAGS)
220 AC_SUBST(CUDA_LIBS)
221 AC_SUBST(NVCC)
222 AC_SUBST(NVCCFLAGS)
223 AM_CONDITIONAL(HAVE_CUDA, test "x$HAVE_CUDA" = "xyes")
225 ########################
226 # Check for OpenGL/GLEW
227 ########################
228 if test "x$with_opengl" = xyes; then
229   save_CPPFLAGS="$CPPFLAGS"
230   save_LIBS="$LIBS"
231   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
232   LIBS="$LIBS $X_LIBS"
233   AC_CHECK_LIB(GL, glTexImage2D, [
234     OPENGL_CFLAGS=
235     OPENGL_LIBS=-lGL
236     HAVE_OPENGL=yes
237     AC_DEFINE(HAVE_OPENGL, 1, [Compile in OpenGL rendering backend])
238   ], [HAVE_OPENGL=no])
239   if test "x${HAVE_OPENGL}" = xyes ; then
240     AC_CHECK_LIB(GLEW, glewInit, [
241       OPENGL_CFLAGS=
242       OPENGL_LIBS="-lGL -lGLEW"
243       HAVE_LIBGLEW=yes
244     ], [HAVE_LIBGLEW=no])
245     if test "x${HAVE_LIBGLEW}" != xyes ; then
246       AC_ERROR([libglew1.5 is required])
247     fi
248   fi
249   CPPFLAGS="$save_CPPFLAGS"
250   LIBS="$save_LIBS"
252 AC_SUBST(OPENGL_CFLAGS)
253 AC_SUBST(OPENGL_LIBS)
254 AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = "xyes")
257 AM_CONDITIONAL(BUILD_BROKEN_TESTS, false)
259 SCHRO_LIBS="\$(top_builddir)/schroedinger/libschroedinger-$SCHRO_MAJORMINOR.la"
260 # hack around ld bug
261 SCHRO_LIBS="$SCHRO_LIBS $LIBOIL_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM"
262 #SCHRO_LIBS="$SCHRO_LIBS -lprofiler"
263 AC_SUBST(SCHRO_LIBS)
265 AC_SUBST(SCHRO_PKG_DEPS)
266 AS_HOST_DEFINES()
267         
268 pkgconfigdir="\$(libdir)/pkgconfig"
269 AC_SUBST(pkgconfigdir)
271 AC_CONFIG_FILES([
272 Makefile 
273 doc/Makefile
274 schroedinger/Makefile
275 schroedinger/cuda/Makefile
276 schroedinger/opengl/Makefile
277 gst/Makefile
278 testsuite/Makefile
279 testsuite/cache/Makefile
280 testsuite/cuda/Makefile
281 testsuite/perf/Makefile
282 testsuite/coder/Makefile
283 testsuite/dirac/Makefile
284 testsuite/installation/Makefile
285 testsuite/manual/Makefile
286 testsuite/opengl/Makefile
287 testsuite/prototype/Makefile
288 testsuite/streams/Makefile
289 testsuite/tables2/Makefile
290 tools/Makefile
291 schroedinger/schroversion.h
292 schroedinger-uninstalled.pc
293 schroedinger.pc
294 schroedinger.spec
296 AC_OUTPUT