Rev Author Line No. Line
178 kaklik 1 AC_INIT(aclocal.m4)
2 # kmando?
3 AM_INIT_AUTOMAKE(mando,1.6)
4 AM_CONFIG_HEADER(config.h)
5  
6 # Checks for programs.
7 AM_PROG_LIBTOOL
8 AC_LANG_CPLUSPLUS
9  
10 AC_MSG_CHECKING([wether C++ compiler works])
11 AC_TRY_LINK([],[],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([Failed to compile and link C++ program.])])
12  
13 dnl Allow customised pkg-config path
14 AC_ARG_WITH(pkg-config-path,
15 AC_HELP_STRING([--with-pkg-config-path=<dirs>],[colon-separated list of pkg-config(1) dirs]),
16 [export PKG_CONFIG_PATH=${withval}])
17  
18 dnl Switch for debug or release mode.
19 AC_ARG_ENABLE(debug,
20 [ --enable-debug=DEBUG compile with debugging assertions (default=no)],
21 enable_debug=$enableval, enable_debug=no )
22  
23 dnl Check for X11
24 AC_PATH_XTRA
25 AC_SUBST(X_LIBS)
26  
27 dnl Check for Xtst
28 old_LIBS="$LIBS"
29 LIBS="$LIBS $X_LIBS"
30 AC_CHECK_LIB(Xtst,XTestFakeMotionEvent,
31 [],
32 [AC_MSG_ERROR(Check for XTestFakeMotionEvent in -lXtst failed)])
33 LIBS="$old_LIBS"
34  
35 dnl Check for boost-library.
36 AC_MSG_CHECKING([for boost])
37 AC_TRY_CPP([#include <boost/version.hpp>
38 #if BOOST_VERSION < 103200
39 #error "Boost version 1.32 or greater required."
40 #endif],
41 AC_MSG_RESULT([yes]),
42 AC_MSG_ERROR([Check for boost library of version >= 1.32 failed.]))
43  
44 dnl Check for libdc1394 (firewire digital camera library).
45 AC_MSG_CHECKING([for dc1394])
46 old_LIBS="$LIBS"
47 LIBS="$LIBS -ldc1394_control -lraw1394"
48 AC_TRY_LINK([#include <libdc1394/dc1394_control.h>],
49 [dc1394_dma_setup_capture( 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0 )],
50 [AC_MSG_RESULT([yes])]
51 [LIBDC1394_OLD="no"]
52 [LIBS_DC1394="-ldc1394_control -lraw1394"],
53 [AC_MSG_RESULT([no (older than version 1.1?)])]
54 [LIBS_DC1394=""])
55 if test "x$LIBS_DC1394" == "x"; then
56 AC_MSG_CHECKING([for old version of dc1394])
57 AC_TRY_LINK([#include <libdc1394/dc1394_control.h>],
58 [dc1394_dma_setup_capture( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0 )],
59 [AC_MSG_RESULT([yes])]
60 [LIBDC1394_OLD="yes"]
61 [AC_DEFINE(LIBDC1394_OLD,yes,Old version of libdc1394)]
62 [LIBS_DC1394="-ldc1394_control -lraw1394"],
63 [AC_MSG_ERROR([Failed to link with dc1394 library (only version 1.x supported)])])
64 fi
65 LIBS="$old_LIBS"
66 AC_SUBST(LIBS_DC1394)
67 if test "x$LIBDC1394_OLD" == "xyes"; then
68 info="$info
69 libdc1394-library : older than version 1.1"
70 else
71 info="$info
72 libdc1394-library : version 1.1 or newer"
73 fi
74 AC_DEFINE(HAVE_LIBDC1394,yes,libdc1394 is present)
75  
76 dnl Check for opengl
77 MDL_HAVE_OPENGL
78 HAVE_OPENGL="yes"
79 AC_MSG_CHECKING([for GL])
80 if test "x$have_GL" != "xyes"; then
81 AC_MSG_RESULT([no])
82 HAVE_OPENGL="no"
83 else
84 AC_MSG_RESULT([yes])
85 fi
86 AC_MSG_CHECKING([for GLU])
87 if test "x$have_GLU" != "xyes"; then
88 AC_MSG_RESULT([no])
89 HAVE_OPENGL="no"
90 else
91 AC_MSG_RESULT([yes])
92 fi
93 AC_MSG_CHECKING([for glut])
94 if test "x$have_glut" != "xyes"; then
95 AC_MSG_RESULT([no])
96 HAVE_OPENGL="no"
97 else
98 AC_MSG_RESULT([yes])
99 fi
100 if test "x$HAVE_OPENGL" != "xyes"; then
101 AC_MSG_ERROR([Check for OpenGL failed.])
102 fi
103  
104 # Checks for libraries.
105 dnl Check for Qt library.
106 PKG_CHECK_MODULES(QT, QtOpenGL >= 4.0.1, HAVE_QT="yes", HAVE_QT="no")
107 dnl PKG_CHECK_MODULES(QT, QtOpenGL_debug >= 4.0.1, HAVE_QT="yes", HAVE_QT="no")
108 if test "x$HAVE_QT" = "xyes" ; then
109 AC_MSG_RESULT([yes])
110 QT_PREFIX="`$PKG_CONFIG --variable=prefix QtCore`/bin"
111 AC_CHECK_FILE("$QT_PREFIX/moc-qt4",
112 [ QT_MOC=$QT_PREFIX/moc-qt4 ],
113 [AC_CHECK_FILE("$QT_PREFIX/moc",
114 [ QT_MOC=$QT_PREFIX/moc ],
115 [ AC_MSG_ERROR([Could not find Qt4 moc.]) ] ) ] )
116 AC_SUBST(QT_MOC)
117 AC_CHECK_FILE("$QT_PREFIX/uic-qt4",
118 [ QT_UIC=$QT_PREFIX/uic-qt4 ],
119 [AC_CHECK_FILE("$QT_PREFIX/uic",
120 [ QT_UIC=$QT_PREFIX/uic ],
121 [ AC_MSG_ERROR([Could not find Qt4 uic.]) ] ) ] )
122 AC_SUBST(QT_UIC)
123 AC_CHECK_FILE("$QT_PREFIX/rcc-qt4",
124 [ QT_RCC=$QT_PREFIX/rcc-qt4 ],
125 [AC_CHECK_FILE("$QT_PREFIX/rcc",
126 [ QT_RCC=$QT_PREFIX/rcc ],
127 [ AC_MSG_ERROR([Could not find Qt4 rcc.]) ] ) ] )
128 AC_SUBST(QT_RCC)
129 else
130 AC_MSG_ERROR([Check for Qt4 failed.])
131 fi
132 AC_SUBST(QT_LIBS)
133 AC_SUBST(QT_CFLAGS)
134  
135 dnl The blas-test called by the lapack-test will exit the script, if no
136 dnl g77 or f77 is found.
137 AC_MSG_CHECKING([for f2c.h])
138 AC_TRY_CPP([#include <f2c.h>],
139 [AC_MSG_RESULT([yes])
140 HAVE_F2C="yes"],
141 [AC_MSG_RESULT([no])
142 HAVE_F2C="no"])
143 if test "x$HAVE_F2C" == "xyes"; then
144 old_LIBS="$LIBS"
145 dnl For older blas-libraries you may have to use
146 dnl ./configure FC=f77
147 dnl or
148 dnl ./configure FC=g77
149 AC_PROG_FC
150 F77=$FC
151 if test "x$F77" != "x"; then
152 ACX_LAPACK([AC_DEFINE(HAVE_LIBLAPACK,yes,lapack library)]
153 [HAVE_LIBLAPACK="yes"],
154 [HAVE_LIBLAPACK="no"])
155 else
156 AC_MSG_WARN([Could not find Fortran compiler. Disabling lapack-support.])
157 HAVE_LIBLAPACK="no"
158 fi
159 else
160 HAVE_LIBLAPACK="no"
161 fi
162 if test "x$HAVE_LIBLAPACK" != "xyes"; then
163 AC_MSG_ERROR([Check for Lapack failed.])
164 fi
165  
166 dnl Check for fftw3 library (required by fftw.h).
167 PKG_CHECK_MODULES(FFTW3, fftw3 >= 3.0.0, HAVE_FFTW3="yes", HAVE_FFTW3="no")
168 PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.0.0, HAVE_FFTW3F="yes", HAVE_FFTW3F="no")
169 if test "x$HAVE_FFTW3" == "xyes"; then
170 if test "x$HAVE_FFTW3F" == "xyes"; then
171 AC_DEFINE(HAVE_LIBFFTW3,yes,fftw library)
172 fi
173 fi
174 if test "x$HAVE_FFTW3" != "xyes"; then
175 AC_MSG_ERROR([Check for fftw3 failed.])
176 fi
177 AC_SUBST(FFTW3_LIBS)
178 AC_SUBST(FFTW3_CFLAGS)
179 AC_SUBST(FFTW3F_LIBS)
180 AC_SUBST(FFTW3F_CFLAGS)
181  
182 # Compiler-flags for debug- or release-mode.
183 if test "x$enable_debug" = "xyes"; then
184 CXXFLAGS='-g $(QT_CFLAGS)'
185 else
186 CXXFLAGS='-O6 -DNDEBUG $(QT_CFLAGS)'
187 fi
188  
189 AC_OUTPUT(
190 Makefile,
191 make clean )
192  
193