2 dnl PLEASE remove the nano when doing a release
3 AC_INIT(schroedinger,1.0.11.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="11:0:11"
23 AC_SUBST(SCHRO_LIBVERSION)
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)
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])
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`
59 AM_CONDITIONAL(HAVE_ORCC, test "x$cross_compiling" != xyes)
62 AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]),
66 AC_MSG_CHECKING([threading implementation to use])
67 if test "x${with_thread}" = "xauto" ; then
77 AC_MSG_RESULT([$with_thread])
79 THREAD_IMPL=${with_thread}
82 if test "x${with_thread}" = "xpthread" ; then
90 PTHREAD_LIBS=-lpthread
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]]]),
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 ##################################################
124 ##################################################
126 if test "x$cross_compiling" = "xyes" ; then
131 AS_COMPILER_FLAG(-Wall, SCHRO_CFLAGS="$SCHRO_CFLAGS -Wall")
132 if test "x$SCHRO_CVS" = "xyes"
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/`)
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 ########################
151 ########################
153 AS_HELP_STRING([--with-cuda=PATH],[prefix where cuda is installed [[default=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"])
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"
170 AC_DEFINE(HAVE_CUDA, 1, [Compile in CUDA rendering backend])
178 AC_SUBST(CUDA_CFLAGS)
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"
190 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
192 AC_CHECK_LIB(GL, glTexImage2D, [
196 AC_DEFINE(HAVE_OPENGL, 1, [Compile in OpenGL rendering backend])
198 if test "x${HAVE_OPENGL}" = xyes ; then
199 AC_CHECK_LIB(GLEW, glewInit, [
201 OPENGL_LIBS="-lGL -lGLEW"
203 ], [HAVE_LIBGLEW=no])
204 if test "x${HAVE_LIBGLEW}" != xyes ; then
205 AC_ERROR([libglew1.5 is required])
208 CPPFLAGS="$save_CPPFLAGS"
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"
220 SCHRO_LIBS="$SCHRO_LIBS $ORC_LIBS $CUDA_LIBS $OPENGL_LIBS $PTHREAD_LIBS $GTHREAD_LIBS $LIBM"
221 #SCHRO_LIBS="$SCHRO_LIBS -lprofiler"
224 AC_SUBST(SCHRO_PKG_DEPS)
227 pkgconfigdir="\$(libdir)/pkgconfig"
228 AC_SUBST(pkgconfigdir)
233 schroedinger/Makefile
234 schroedinger/cuda/Makefile
235 schroedinger/opengl/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
249 schroedinger/schroversion.h
250 schroedinger-uninstalled.pc