frame: remove SchroUpsampledFrame
[schroedinger.git] / configure.ac
blob8caa56034426a04a6b3baa4df35bca00e4d90eaa
1 AC_PREREQ([2.58])
2 dnl PLEASE remove the nano when doing a release
3 AC_INIT(schroedinger,1.0.11.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="11:0:11"
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
30 AC_C_BIGENDIAN
31 AG_GST_ARG_GCOV
33 dnl allow for different autotools
34 AS_AUTOTOOLS_ALTERNATE
36 AC_CONFIG_SRCDIR([schroedinger/schro.h])
38 AC_CONFIG_MACRO_DIR([m4])
39 ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
40 AC_SUBST(ACLOCAL_AMFLAGS)
42 dnl set up gettext
43 dnl the version check needs to stay here because autopoint greps for it
44 #AM_GNU_GETTEXT_VERSION([0.11.5])
45 #AM_GNU_GETTEXT([external])
47 AC_CHECK_LIBM
48 AC_SUBST(LIBM)
50 dnl Orc is required
51 ORC_VER="0.4.16"
52 PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_VER, HAVE_ORC=yes, HAVE_ORC=no)
53 if test "x${HAVE_ORC}" != xyes ; then
54   AC_ERROR([orc-0.4 >= $ORC_VER is required])
56 SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS orc-0.4 >= $ORC_VER"
57 ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
58 AC_SUBST(ORCC)
59 AM_CONDITIONAL(HAVE_ORCC, test "x$cross_compiling" != xyes)
61 AC_ARG_WITH([thread],
62     AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]),
63     [],
64     [with_thread=auto])
66 AC_MSG_CHECKING([threading implementation to use])
67 if test "x${with_thread}" = "xauto" ; then
68   case $host_os in
69     mingw* | pw32*)
70       with_thread=win32
71       ;;
72     *)
73       with_thread=pthread
74       ;;
75   esac
77 AC_MSG_RESULT([$with_thread])
79 THREAD_IMPL=${with_thread}
80 AC_SUBST(THREAD_IMPL)
82 if test "x${with_thread}" = "xpthread" ; then
83   case "$host_os" in 
84     openbsd*)
85       PTHREAD_CFLAGS=
86       PTHREAD_LIBS=-pthread
87       ;;
88     *)
89       PTHREAD_CFLAGS=
90       PTHREAD_LIBS=-lpthread
91       ;;
92   esac
93   AC_SUBST(PTHREAD_CFLAGS)
94   AC_SUBST(PTHREAD_LIBS)
97 if test "x${with_thread}" = "xgthread" ; then
98   PKG_CHECK_MODULES(GTHREAD, gthread-2.0, HAVE_GTHREAD=yes, HAVE_GTHREAD=no)
99   AC_SUBST(GTHREAD_LIBS)
100   AC_SUBST(GTHREAD_CFLAGS)
101   SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS gthread-2.0"
104 AC_ARG_WITH([opengl],
105     AS_HELP_STRING([--with-opengl=PATH],[prefix where OpenGL is installed [[default=no]]]),
106     [],
107     [with_opengl=no])
109 AC_ARG_ENABLE(encoder, AC_HELP_STRING([--disable-encoder],
110               [disable encoder (default=enabled)]))
111 AM_CONDITIONAL(ENABLE_ENCODER, test "x$enable_encoder" != "xno")
112 if [ test "x$enable_encoder" != "xno" ] ; then
113   AC_DEFINE(ENABLE_ENCODER, 1, [Enable encoder])
115 AC_ARG_ENABLE(motion-ref, AC_HELP_STRING([--disable-motion-ref],
116               [disable motion reference code (default=enabled)]))
117 AM_CONDITIONAL(ENABLE_MOTION_REF, test "x$enable_motion_ref" != "xno")
118 if [ test "x$enable_motion_ref" != "xno" ] ; then
119   AC_DEFINE(ENABLE_MOTION_REF, 1, [Enable motion reference code])
122 ##################################################
123 # Check for gtk-doc.
124 ##################################################
126 if test "x$cross_compiling" = "xyes" ; then
127   enable_gtk_doc=no
129 GTK_DOC_CHECK([1.0])
131 AS_COMPILER_FLAG(-Wall, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall")
132 if test "x$SCHRO_CVS" = "xyes"
133 then
134   AS_COMPILER_FLAG(-Werror, SCHRO_CFLAGS="$SCHRO_CFLAGS -Werror")
135   AS_COMPILER_FLAG(-Wno-strict-overflow, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wno-strict-overflow")
138 AS_COMPILER_FLAG(-O3, CFLAGS=`echo $CFLAGS | sed s/O2/O3/`)
140 # Enable severe pain
141 #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")
142 #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"
143 #SCHRO_CFLAGS="$SCHRO_CFLAGS $COMPANY_CFLAGS"
145 SCHRO_CFLAGS="$SCHRO_CFLAGS -I\$(top_srcdir)"
146 AC_SUBST(SCHRO_CFLAGS)
149 ########################
150 # Check for CUDA
151 ########################
152 AC_ARG_WITH([cuda],
153     AS_HELP_STRING([--with-cuda=PATH],[prefix where cuda is installed [[default=no]]]),
154     [],
155     [with_cuda=no])
156 if test "x$with_cuda" = xyes; then
157   AC_PATH_PROG([NVCC], [nvcc], no, [$PATH:/usr/local/cuda/bin])
158   if test "x$NVCC" = xno ; then
159     AC_MSG_FAILURE(["--with-cuda was give, but nvcc was not found"])
160   fi
161   with_cuda=`echo $NVCC|sed 's,bin/nvcc,,'`
164 if test "x$with_cuda" != xno; then
165   CUDA_CFLAGS="-I$with_cuda/include"
166   CUDA_LIBS="-L$with_cuda/lib -lcudart"
167   NVCC="$with_cuda/bin/nvcc"
168   NVCCFLAGS="-O2 -use_fast_math"
169   HAVE_CUDA=yes
170   AC_DEFINE(HAVE_CUDA, 1, [Compile in CUDA rendering backend])
171 else
172   CUDA_CFLAGS=
173   CUDA_LIBS=
174   NVCC=
175   NVCCFLAGS=
176   HAVE_CUDA=no
178 AC_SUBST(CUDA_CFLAGS)
179 AC_SUBST(CUDA_LIBS)
180 AC_SUBST(NVCC)
181 AC_SUBST(NVCCFLAGS)
182 AM_CONDITIONAL(HAVE_CUDA, test "x$HAVE_CUDA" = "xyes")
184 ########################
185 # Check for OpenGL/GLEW
186 ########################
187 if test "x$with_opengl" = xyes; then
188   save_CPPFLAGS="$CPPFLAGS"
189   save_LIBS="$LIBS"
190   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
191   LIBS="$LIBS $X_LIBS"
192   AC_CHECK_LIB(GL, glTexImage2D, [
193     OPENGL_CFLAGS=
194     OPENGL_LIBS=-lGL
195     HAVE_OPENGL=yes
196     AC_DEFINE(HAVE_OPENGL, 1, [Compile in OpenGL rendering backend])
197   ], [HAVE_OPENGL=no])
198   if test "x${HAVE_OPENGL}" = xyes ; then
199     AC_CHECK_LIB(GLEW, glewInit, [
200       OPENGL_CFLAGS=
201       OPENGL_LIBS="-lGL -lGLEW"
202       HAVE_LIBGLEW=yes
203     ], [HAVE_LIBGLEW=no])
204     if test "x${HAVE_LIBGLEW}" != xyes ; then
205       AC_ERROR([libglew1.5 is required])
206     fi
207   fi
208   CPPFLAGS="$save_CPPFLAGS"
209   LIBS="$save_LIBS"
211 AC_SUBST(OPENGL_CFLAGS)
212 AC_SUBST(OPENGL_LIBS)
213 AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = "xyes")
216 AM_CONDITIONAL(BUILD_BROKEN_TESTS, false)
218 SCHRO_LIBS="\$(top_builddir)/schroedinger/libschroedinger-$SCHRO_MAJORMINOR.la"
219 # hack around ld bug
220 SCHRO_LIBS="$SCHRO_LIBS $ORC_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM"
221 #SCHRO_LIBS="$SCHRO_LIBS -lprofiler"
222 AC_SUBST(SCHRO_LIBS)
224 AC_SUBST(SCHRO_PKG_DEPS)
225 AS_HOST_DEFINES()
226         
227 pkgconfigdir="\$(libdir)/pkgconfig"
228 AC_SUBST(pkgconfigdir)
230 AC_CONFIG_FILES([
231 Makefile 
232 doc/Makefile
233 schroedinger/Makefile
234 schroedinger/cuda/Makefile
235 schroedinger/opengl/Makefile
236 testsuite/Makefile
237 testsuite/cache/Makefile
238 testsuite/cuda/Makefile
239 testsuite/perf/Makefile
240 testsuite/coder/Makefile
241 testsuite/dirac/Makefile
242 testsuite/installation/Makefile
243 testsuite/manual/Makefile
244 testsuite/opengl/Makefile
245 testsuite/prototype/Makefile
246 testsuite/streams/Makefile
247 testsuite/tables2/Makefile
248 tools/Makefile
249 schroedinger/schroversion.h
250 schroedinger-uninstalled.pc
251 schroedinger.pc
252 schroedinger.spec
254 AC_OUTPUT