bugfix to load image, cleanup building system.
[gpiv.git] / configure.in
blobbe2e2b30679735825c05101971741fe1a4297649
1 dnl Process this file with autoconf to produce a configure script.
3 dnl =========== Initialization
4 AC_INIT(gpiv, 0.6.1,  http://bugzilla.gnome.org/enter_bug.cgi?product=gpiv)
5 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
6 AM_MAINTAINER_MODE
9 dnl =========== basic compiler settings
10 AC_ISC_POSIX
11 AC_PROG_CC
12 AM_PROG_CC_STDC
13 AC_HEADER_STDC
16 dnl ========== Export Compiler/linker options
17 # ============ Switched off:
18 #AC_SUBST(CFLAGS)
19 #AC_SUBST(CPPFLAGS)
20 #AC_SUBST(LDFLAGS)
23 GNOME_COMPILE_WARNINGS
24 PKG_CHECK_MODULES(GPIV_UI, libgnomeui-2.0)
25         GPIV_GNOME_LIBS="libgnomeui-2.0"
26 echo "configuring with libraries: " $gpiv_gnome_libs
27 PKG_CHECK_MODULES(GPIV, $GPIV_GNOME_LIBS)
28 AC_SUBST(GPIV_CFLAGS)
29 AC_SUBST(GPIV_LIBS)
32 dnl ========== Add the languages which the application supports.
33 GETTEXT_PACKAGE=gpiv
34 AC_SUBST(GETTEXT_PACKAGE)
35 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
36 ALL_LINGUAS="ca de nl"
37 AM_GLIB_GNU_GETTEXT
40 AC_PROG_INTLTOOL
43 dnl =========== Checking on libraries and headers
44 AC_CHECK_LIB(glib-2.0, g_malloc0, , 
45         AC_MSG_ERROR("libglib not installed"))
47 dnl H5Fcreate
48 dnl AC_CHECK_LIB(hdf5, H5Fopen, , 
49 dnl        AC_MSG_ERROR("libhdf5 not installed"))
52 dnl ========== include fftw3
53  AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
54         AC_MSG_ERROR("libfftw3 not installed"))
56 AC_CHECK_LIB(gslcblas, main, , 
57         AC_MSG_ERROR("libgslcblas not installed"))
59 AC_CHECK_LIB(gsl, main, , 
60         AC_MSG_ERROR("libgsl not installed"))
62 dnl AC_CHECK_LIB(gslcblas, gsl_fit_linear, , 
63 dnl     AC_MSG_ERROR("libgsl not installed"))
65 dnl
66 dnl Enabling Message Passing Interface (MPI) for parallel computing
67 dnl
68 AC_ARG_ENABLE(mpi, 
69          [  --enable-mpi            enable Message Protocol Interface (MPI)],
70          [ENABLE_MPI="-DENABLE_MPI"]
71          )
72 AC_SUBST(ENABLE_MPI)
74 AC_ARG_ENABLE(rr, 
75          [  --enable-rr            checks also for MPI-enabled gpiv_rr ],
76          [ENABLE_MPI_RR="-DENABLE_MPI_RR"]
77          )
78 AC_SUBST(ENABLE_MPI_RR)
80 if test  "${ENABLE_MPI}" == '-DENABLE_MPI'; then
81 dnl     ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), 
82 dnl             AC_MSG_ERROR("libmpi IS NOT installed"))
84         AC_CHECK_HEADER(mpi/mpi.h, ,AC_MSG_ERROR("mpi.h is not installed"))
86         AC_CHECK_PROG(MPIRUN, mpirun, true, false)
87         if test x$MPIRUN = xfalse ; then
88                 AC_MSG_ERROR("missing mpirun \
89 Needed by gpiv when --enable-mpi")
90         fi
92         if test  "${ENABLE_MPI_RR}" == '-DENABLE_MPI_RR'; then
93                 AC_CHECK_PROG(RR, gpiv_rr, true, false)
94                 if test x$RR = xfalse ; then
95                         AC_MSG_ERROR("missing mpi-enabled gpiv_rr from gpivtools. \
96 Needed by gpiv when --enable-mpi.")
97                 fi
98         else
99                 echo "WARNING: Not checking on MPI-enabled gpiv_rr"
100         fi
102         AC_CHECK_LIB(gpiv_mpi, gpiv_piv_mpi_bcast_pivpar, ,
103         AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv_mpi. \
104 Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure"))
106 else
107         AC_CHECK_LIB(gpiv, gpiv_piv_interrogate_img, ,
108                 AC_MSG_ERROR([libgpiv has not been installed]))
112 dnl AC_CHECK_HEADER(gpiv.h, ,AC_MSG_ERROR("giv.h is not installed"))
113 AC_CHECK_HEADERS([stdlib.h string.h unistd.h fftw3.h gpiv.h])
114 dnl hdf5.h 
116 AC_ARG_ENABLE(cam, 
117          [  --enable-cam            enable data acquisition],
118          [ENABLE_CAM="-DENABLE_CAM"]
119          )
120 AC_SUBST(ENABLE_CAM)
123 AC_ARG_ENABLE(trig, 
124          [  --enable-trig           enable (realtime) triggering],
125          [ENABLE_TRIG="-DENABLE_TRIG"]
126          )
127 AC_SUBST(ENABLE_TRIG)
130 if test $ENABLE_CAM || test $ENABLE_TRIG; then
131         ENABLE_DAC="-DENABLE_DAC"
132 AC_SUBST(ENABLE_DAC)
135 if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
136         AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
137         AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
138 Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))
140         AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
141         AC_MSG_ERROR("libraw1394 not installed"))
143         AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
144         AC_MSG_ERROR("libdc1394_control not installed"))
146         AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
147         AC_MSG_ERROR("missing dc1394_control.h"))
149         AC_CHECK_HEADER(libraw1394/raw1394.h, ,
150         AC_MSG_ERROR("missing raw1394.h"))
154 if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
155         AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
156         AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
157 Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
161 AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
162         AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)
164 AC_ARG_ENABLE(rta, 
165         [  --enable-rta=RTA_DIR     place where the RTAI code resides 
166                            (default /usr/lib/realtime)],
167         [RTA_TOPDIR="$enableval"],
168         [RTA_TOPDIR="/usr/lib/realtime"]
169         )
170 AC_SUBST(RTA_TOPDIR)
173 AC_ARG_ENABLE(k, 
174         [  --enable-k=K_DIR         place where the installed kernel 
175                            headers resides 
176                           (default /usr/src/kernel-headers-2.4.27-adeos)],
177         [K_TOPDIR="$enableval"],
178         [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
179         )
180 AC_SUBST(K_TOPDIR)
183 AC_ARG_ENABLE(img-width, 
184         [  --enable-img-width=WIDTH     maximum image width to be used (default SVGA)],
185         [OVERRIDE_IMAGE_WIDTH_MAX="-DIMAGE_WIDTH_MAX=$enableval"] 
186         )
187 AC_SUBST(OVERRIDE_IMAGE_WIDTH_MAX)
191 AC_ARG_ENABLE(img-height, 
192         [  --enable-img-height=HEIGHT   maximum image height to be used (default SVGA)],
193         [OVERRIDE_IMAGE_HEIGHT_MAX="-DIMAGE_HEIGHT_MAX=$enableval"] 
194         )
195 AC_SUBST(OVERRIDE_IMAGE_HEIGHT_MAX)
198 AC_ARG_ENABLE(canvas_aa, 
199         [  --enable-canvas-aa       Use Anti Aliased canvas for viewer; slower but 
200                            better displaying of image and resulting data],
201         [CANVAS_AA="-DCANVAS_AA"]
202         )
203 AC_SUBST(CANVAS_AA)
206 AC_ARG_ENABLE(debug, 
207         [  --enable-debug           debug version (more verbose)],
208         [DEBUG="-DDEBUG"] 
209         )
210 AC_SUBST(DEBUG)
214 dnl GNOME_DISABLE_DEPRECATED="-DGNOME_DISABLE_DEPRECATED"
215 dnl AC_SUBST(GNOME_DISABLE_DEPRECATED)
218 AC_OUTPUT([
219         Makefile
220         doc/Makefile
221         doc/C/Makefile
222         doc/C/figures/Makefile
223         src/Makefile
224         po/Makefile.in
225         man/Makefile
226         pixmaps/Makefile
227  ])
230 echo "===================================================================="
231 echo "Configuration succesfully finished"
233  if test $ENABLE_CAM; then 
234         echo "with (IEEE-1394) camera enabled"
235  fi
237  if test $ENABLE_TRIG; then 
238         echo "with (realtime) triggering enabled."
240         if test x$CONTROL = xfalse ; then
241                 echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
242                 echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
243                 echo "and RTAI kernel modules that are needed for the triggering of camera and lasers"
244                 echo ""
245          fi
246  fi
248  if test $ENABLE_MPI; then 
249         echo "Using Message Passing Interface (MPI)."
250         echo "for processing on distributed memory systems"
251         echo "MPI-enabled gpivtools package is needed for correct funtioning"
252  fi
254 echo "Type 'make' and 'make install' to build and install gpiv"
255 echo "===================================================================="