2 dnl PLEASE remove the nano when doing a release
3 AC_INIT(schroedinger,1.0.5.1)
7 AS_NANO(SCHRO_CVS=no,SCHRO_CVS=yes)
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)
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)
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])
48 dnl liboil is required
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
61 PKG_CHECK_MODULES(ORC, orc-0.3 >= $ORC_VER, HAVE_ORC=yes, 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")
72 AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]),
76 AC_MSG_CHECKING([threading implementation to use])
77 if test "x${with_thread}" = "xauto" ; then
87 AC_MSG_RESULT([$with_thread])
89 THREAD_IMPL=${with_thread}
92 if test "x${with_thread}" = "xpthread" ; then
96 PTHREAD_LIBS=-lpthread
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]]]),
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 ##################################################
130 ##################################################
132 if test "x$cross_compiling" = "xyes" ; then
137 AS_COMPILER_FLAG(-Wall, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall")
138 if test "x$SCHRO_CVS" = "xyes"
140 AS_COMPILER_FLAG(-Werror, SCHRO_CFLAGS="$SCHRO_CFLAGS -Werror")
143 AS_COMPILER_FLAG(-O3, CFLAGS=`echo $CFLAGS | sed s/O2/O3/`)
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 ########################
155 ########################
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
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)
175 AM_CONDITIONAL(HAVE_GST, test "x$HAVE_GST" = "xyes")
179 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
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 ########################
192 ########################
194 AS_HELP_STRING([--with-cuda=PATH],[prefix where cuda is installed [[default=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"])
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"
211 AC_DEFINE(HAVE_CUDA, 1, [Compile in CUDA rendering backend])
219 AC_SUBST(CUDA_CFLAGS)
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"
231 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
233 AC_CHECK_LIB(GL, glTexImage2D, [
237 AC_DEFINE(HAVE_OPENGL, 1, [Compile in OpenGL rendering backend])
239 if test "x${HAVE_OPENGL}" = xyes ; then
240 AC_CHECK_LIB(GLEW, glewInit, [
242 OPENGL_LIBS="-lGL -lGLEW"
244 ], [HAVE_LIBGLEW=no])
245 if test "x${HAVE_LIBGLEW}" != xyes ; then
246 AC_ERROR([libglew1.5 is required])
249 CPPFLAGS="$save_CPPFLAGS"
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"
261 SCHRO_LIBS="$SCHRO_LIBS $LIBOIL_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM"
262 #SCHRO_LIBS="$SCHRO_LIBS -lprofiler"
265 AC_SUBST(SCHRO_PKG_DEPS)
268 pkgconfigdir="\$(libdir)/pkgconfig"
269 AC_SUBST(pkgconfigdir)
274 schroedinger/Makefile
275 schroedinger/cuda/Makefile
276 schroedinger/opengl/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
291 schroedinger/schroversion.h
292 schroedinger-uninstalled.pc