added 'Substitute all FNAME occurrences' option
[gpivtools.git] / configure.in
bloba70e22eca60f0d55ba3c164735cadcbd8157fe22
1 AC_INIT(src/evaluate/rr.c)
2 AM_INIT_AUTOMAKE(gpivtools, 0.6.0)
3 AM_CONFIG_HEADER(config.h)
5 AM_SANITY_CHECK
6 AC_ISC_POSIX
8 AC_PROG_CC
9 AM_PROG_CC_STDC
10 AC_HEADER_STDC
12 AM_MAINTAINER_MODE
14 dnl hints from autoscan START
15 AC_C_CONST
16 AC_FUNC_VPRINTF
17 AC_PROG_AWK
18 AC_PROG_RANLIB
19 AC_TYPE_SIZE_T
20 dnl hints from autoscan END
23 AC_CHECK_PROG(GNUPLOT, gnuplot, true, false)
24 AM_CONDITIONAL(HAVE_GNUPLOT, $GNUPLOT, ,
25         AC_MSG_ERROR("gnuplot not installed");)
26 dnl if test x$GNUPLOT = xfalse ; then
27 dnl     AC_MSG_ERROR("gnuplot not installed");
28 dnl fi
30 dnl dnl PKG_CHECK_MODULES(gpiv, glib >= 1.2.0)
31 dnl AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR("glib not installed"))
32 dnl AC_CHECK_LIB(glib, g_malloc0, , 
33 dnl     AC_MSG_ERROR("libglib not installed"))
34 dnl AC_CHECK_HEADER(glib-1.2/glib.h, ,
35 dnl AC_MSG_ERROR("missing glib-1.2/glib.h")
36 dnl )
38 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.0)
39 AC_SUBST(GLIB_CFLAGS)
40 AC_SUBST(GLIB_LIBS)
42 AC_CHECK_LIB(glib-2.0, g_malloc0, ,
43         AC_MSG_ERROR("libglib not installed"))
45 AC_CHECK_PROG(PERL, perl, true, false)
46 AM_CONDITIONAL(HAVE_PERL, $PERL)
47 AC_CHECK_PROG(PYTHON, python, true, false)
48 AM_CONDITIONAL(HAVE_PYTHON, $PYTHON)
49 AC_CHECK_PROG(CONVERT, convert, true, false)
50 AM_CONDITIONAL(HAVE_CONVERT, $CONVERT)
51 AC_CHECK_PROG(PLOTMTV, plotmtv, true, false)
52 AM_CONDITIONAL(HAVE_PLOTMTV, $PLOTMTV)
54 AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
55                         AC_MSG_ERROR("libfftw3 not installed"))
57 AC_CHECK_LIB(gslcblas, main, ,
58         AC_MSG_ERROR("libgslcblas not installed"))
60 AC_CHECK_LIB(gsl, main, , 
61         AC_MSG_ERROR("libgsl not installed"))
63 dnl AC_CHECK_HEADER(gpiv.h, ,
64 dnl AC_MSG_ERROR("missing gpiv.h"))
67 dnl
68 dnl Enabling Message Passing Interface (MPI) for parallel computing
69 dnl
70 AC_ARG_ENABLE(mpi, 
71          [  --enable-mpi            enable Message Protocol Interface (MPI)],
72          [ENABLE_MPI="-DENABLE_MPI"]
73          )
74 AC_SUBST(ENABLE_MPI)
77 if test  "${ENABLE_MPI}" == '-DENABLE_MPI'; then
78         ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), 
79                 AC_MSG_ERROR("libmpi IS NOT installed"))
81         CC="$MPICC"
82         LIBS="$MPILIBS $LIBS"
84         AC_CHECK_LIB(mpi, main, , 
85                 AC_MSG_ERROR("libmpi not installed"))
86         AC_CHECK_HEADER(mpi.h, ,
87                 AC_MSG_ERROR("missing mpi.h"))
89         AC_CHECK_LIB(gpiv_mpi, gpiv_piv_mpi_bcast_pivpar, ,
90         AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv_mpi. \
91 Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure"))
93         AC_CHECK_PROG(MPIPYTHON, mpipython, true, false)
95 else
96         AC_CHECK_LIB(gpiv, gpiv_warning, ,
97                 AC_MSG_ERROR("libgpiv has not been installed"))
101 AC_CHECK_HEADERS([ stdlib.h string.h unistd.h \
102         fftw3.h \
103         gpiv.h \
104 ], ,
105 dnl      AC_MSG_ERROR("missing one of the required library headers")
111 AC_ARG_ENABLE(cam, 
112          [  --enable-cam            enable (IEEE-1394) camera],
113          [ENABLE_CAM="-DENABLE_CAM"]
114          )
115 AC_SUBST(ENABLE_CAM)
118 AC_ARG_ENABLE(trig, 
119          [  --enable-trig           enable (realtime) triggering],
120          [ENABLE_TRIG="-DENABLE_TRIG"]
121          )
122 AC_SUBST(ENABLE_TRIG)
126 dnl Enabling IEEE1394 camera
128 if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
129         AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
130         AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
131 Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))
133         AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
134         AC_MSG_ERROR("libraw1394 not installed"))
136         AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
137         AC_MSG_ERROR("libdc1394_control not installed"))
139         AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
140         AC_MSG_ERROR("missing dc1394_control.h"))
142         AC_CHECK_HEADER(libraw1394/raw1394.h, ,
143         AC_MSG_ERROR("missing raw1394.h"))
148 dnl Enabling triggering using RTL/RTAI
150 if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
151         AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
152         AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
153 Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
157 AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
158 AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)
162 AC_ARG_ENABLE(rta, 
163         [  --disable-rta=RTATOPDIR     place where the RTAI code \
164 resides (default /usr/lib/realtime)],
165         [RTA_TOPDIR="$enableval"],
166         [RTA_TOPDIR="/usr/lib/realtime"]
167         )
168 AC_SUBST(RTA_TOPDIR)
170 AC_ARG_ENABLE(k, 
171         [  --enable-k=KTOPDIR     place where the installed kernel \
172 headers resides (default /usr/src/kernel-headers-2.4.27-adeos)],
173         [K_TOPDIR="$enableval"],
174         [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
175         )
176 AC_SUBST(K_TOPDIR)
179 AM_CONDITIONAL(HAVE_MPIPYTHON, $MPIPYTHON)
180 AM_CONDITIONAL(BUILD_MPI, test "${ENABLE_MPI}" == '-DENABLE_MPI')
184 dnl Enabling Open Multi-Processing (OMP) for parallel computing
186 AC_ARG_ENABLE(omp, 
187          [  --enable-omp            enable Open Multi-Processing (OMP)],
188          [ENABLE_OMP="ENABLE_OMP"]
189         )
191 if test  "${ENABLE_OMP}" == 'ENABLE_OMP'; then
192         CC="$CC -fopenmp"
194         AC_CHECK_LIB(gomp, main, , 
195                 AC_MSG_ERROR("libgomp not installed"))
196         AC_CHECK_HEADER(omp.h, ,
197                 AC_MSG_ERROR("missing omp.h"))
199 dnl No need to use -DENABLE_OMP: gcc will do that!
203 AC_FUNC_ALLOCA
204 AC_OUTPUT([
205         Makefile
206         src/Makefile
207         src/dac/Makefile
208         src/image/Makefile
209         src/evaluate/Makefile
210         src/validate/Makefile
211         src/post/Makefile
212         src/misc/Makefile
213         man/Makefile
216 echo "===================================================================="
217  if test x$PERL = xfalse ; then
218         echo "Perl has not been found on this system."
219         echo "Though, this is not provided for the building process"
220         echo "Only some independant scripts will not work"
221         echo ""
222  fi
224  if test x$CONVERT = xfalse ; then
225         echo "Convert has not been found on this system."
226         echo "Though, this is not provided for the building process"
227         echo "Only some independant scripts will not work"
228         echo ""
229  fi
231  if test x$PLOTMTV = xfalse ; then
232         echo "Plotmtv has not been found on this system."
233         echo "Though, this is not provided for the building process"
234         echo "Only some independant scripts will not work"
235         echo ""
236  fi
239  echo "Configuration succesfully finished"
240  if test $ENABLE_CAM; then 
241         echo "with (IEEE-1394) camera enabled"
242  fi
244  if test $ENABLE_TRIG; then 
245         echo "with (realtime) triggering enabled."
246         if test x$CONTROL = xfalse ; then
247                 echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
248                 echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
249                 echo "and RTAI kernel modules that are needed for the triggering of camera and lasers."
250                 echo ""
251          fi
252  fi
254  if test $ENABLE_MPI; then 
255         echo "Using Message Passing Interface (MPI)"
256         echo "for processing on distributed memory systems"
257  fi
259  if test $ENABLE_OMP; then
260         echo "Using Open Multi-Processing (OMP)"
261         echo "for processing on shared memory systems"
264  echo "Type 'make' and 'make install' to build and install the gpiv-tools."
265 echo "===================================================================="