bug repair: loading .png image, from Adrian Daerr
[gpiv.git] / configure.in
blob9d1e711fa054f2e63a7bb0dabe2a033709409c08
1 dnl Process this file with autoconf to produce a configure script.
3 dnl =========== Initialization
4 AC_INIT(gpiv, 0.6.0,  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
25 #------------------------------------------------------------------------------
26 # From gpaint:
27 # The gnomeui library is required but the gnomeprint and gnomeprintui libraries
28 # are optional. First we verify the gnomeui library is present. Then we check 
29 # for the presence of the gnomeprint libraries and set a flag to indicate the 
30 # print libraries are present. Finally, we run pkg-config to get the compile and
31 # link flags for the combined set of libraries to eliminate duplications in 
32 # the CFLAGS.
33 ## GNOME_MODULES="libgnomeui-2 >= 2.0.0"
34 GNOME_PRINT="libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >=2.2.0"
35 PKG_CHECK_MODULES(GPIV_UI, libgnomeui-2.0)
36 PKG_CHECK_MODULES(GPIV_PRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
37 gpiv_have_gnome_print=1, echo "gnomeprint libraries are not available.")
39 if test "x$gpiv_have_gnome_print" = "x1"; then
40         echo "gnomeprint IS available"
41         AC_DEFINE(HAVE_GNOME_PRINT,"1")
42         GPIV_GNOME_LIBS="libgnomeui-2.0 libgnomeprint-2.2 libgnomeprintui-2.2"
43 else
44         echo "gnomeprint NOT available"
45         GPIV_GNOME_LIBS="libgnomeui-2.0"
48 echo "configuring with libraries: " $gpiv_gnome_libs
49 PKG_CHECK_MODULES(GPIV, $GPIV_GNOME_LIBS)
50 AC_SUBST(GPIV_CFLAGS)
51 AC_SUBST(GPIV_LIBS)
54 dnl ========== Add the languages which the application supports.
55 GETTEXT_PACKAGE=gpiv
56 AC_SUBST(GETTEXT_PACKAGE)
57 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
58 ALL_LINGUAS="ca de nl"
59 AM_GLIB_GNU_GETTEXT
62 AC_PROG_INTLTOOL
65 dnl =========== Checking on libraries and headers
66 AC_CHECK_LIB(glib-2.0, g_malloc0, , 
67         AC_MSG_ERROR("libglib not installed"))
69 dnl H5Fcreate
70 dnl AC_CHECK_LIB(hdf5, H5Fopen, , 
71 dnl        AC_MSG_ERROR("libhdf5 not installed"))
74 dnl ========== include fftw3
75  AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
76         AC_MSG_ERROR("libfftw3 not installed"))
78 AC_CHECK_LIB(gslcblas, main, , 
79         AC_MSG_ERROR("libgslcblas not installed"))
81 AC_CHECK_LIB(gsl, main, , 
82         AC_MSG_ERROR("libgsl not installed"))
84 dnl AC_CHECK_LIB(gslcblas, gsl_fit_linear, , 
85 dnl     AC_MSG_ERROR("libgsl not installed"))
87 dnl
88 dnl Enabling Message Passing Interface (MPI) for parallel computing
89 dnl
90 AC_ARG_ENABLE(mpi, 
91          [  --enable-mpi            enable Message Protocol Interface (MPI)],
92          [ENABLE_MPI="-DENABLE_MPI"]
93          )
94 AC_SUBST(ENABLE_MPI)
96 if test  "${ENABLE_MPI}" == '-DENABLE_MPI'; then
97 dnl     ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), 
98 dnl             AC_MSG_ERROR("libmpi IS NOT installed"))
100         AC_CHECK_PROG(MPIRUN, mpirun, true, false)
101         if test x$MPIRUN = xfalse ; then
102                 AC_MSG_ERROR("missing mpirun \
103 Needed by gpiv when --enable-mpi")
104         fi
106         AC_CHECK_PROG(RR, gpiv_rr, true, false)
107         if test x$RR = xfalse ; then
108                 AC_MSG_ERROR("missing mpi-enabled gpiv_rr from gpivtools. \
109 Needed by gpiv when --enable-mpi")
110         fi
112         AC_CHECK_LIB(gpiv_mpi, gpiv_piv_mpi_bcast_pivpar, ,
113         AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv_mpi. \
114 Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure"))
116 else
117         AC_CHECK_LIB(gpiv, gpiv_piv_interrogate_img, ,
118                 AC_MSG_ERROR([libgpiv has not been installed]))
122 dnl AC_CHECK_HEADER(gpiv.h, ,AC_MSG_ERROR("giv.h is not installed"))
123 AC_CHECK_HEADERS([stdlib.h string.h unistd.h fftw3.h gpiv.h])
124 dnl hdf5.h 
126 AC_ARG_ENABLE(cam, 
127          [  --enable-cam            enable data acquisition],
128          [ENABLE_CAM="-DENABLE_CAM"]
129          )
130 AC_SUBST(ENABLE_CAM)
133 AC_ARG_ENABLE(trig, 
134          [  --enable-trig           enable (realtime) triggering],
135          [ENABLE_TRIG="-DENABLE_TRIG"]
136          )
137 AC_SUBST(ENABLE_TRIG)
140 if test $ENABLE_CAM || test $ENABLE_TRIG; then
141         ENABLE_DAC="-DENABLE_DAC"
142 AC_SUBST(ENABLE_DAC)
145 if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
146         AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
147         AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
148 Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))
150         AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
151         AC_MSG_ERROR("libraw1394 not installed"))
153         AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
154         AC_MSG_ERROR("libdc1394_control not installed"))
156         AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
157         AC_MSG_ERROR("missing dc1394_control.h"))
159         AC_CHECK_HEADER(libraw1394/raw1394.h, ,
160         AC_MSG_ERROR("missing raw1394.h"))
164 if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
165         AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
166         AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
167 Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
171 AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
172         AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)
174 AC_ARG_ENABLE(rta, 
175         [  --enable-rta=RTA_DIR     place where the RTAI code resides 
176                            (default /usr/lib/realtime)],
177         [RTA_TOPDIR="$enableval"],
178         [RTA_TOPDIR="/usr/lib/realtime"]
179         )
180 AC_SUBST(RTA_TOPDIR)
183 AC_ARG_ENABLE(k, 
184         [  --enable-k=K_DIR         place where the installed kernel 
185                            headers resides 
186                           (default /usr/src/kernel-headers-2.4.27-adeos)],
187         [K_TOPDIR="$enableval"],
188         [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
189         )
190 AC_SUBST(K_TOPDIR)
193 AC_ARG_ENABLE(img-width, 
194         [  --enable-img-width=WIDTH     maximum image width to be used (default SVGA)],
195         [OVERRIDE_IMAGE_WIDTH_MAX="-DIMAGE_WIDTH_MAX=$enableval"] 
196         )
197 AC_SUBST(OVERRIDE_IMAGE_WIDTH_MAX)
201 AC_ARG_ENABLE(img-height, 
202         [  --enable-img-height=HEIGHT   maximum image height to be used (default SVGA)],
203         [OVERRIDE_IMAGE_HEIGHT_MAX="-DIMAGE_HEIGHT_MAX=$enableval"] 
204         )
205 AC_SUBST(OVERRIDE_IMAGE_HEIGHT_MAX)
208 AC_ARG_ENABLE(canvas_aa, 
209         [  --enable-canvas-aa       Use Anti Aliased canvas for viewer; slower but 
210                            better displaying of image and resulting data],
211         [CANVAS_AA="-DCANVAS_AA"]
212         )
213 AC_SUBST(CANVAS_AA)
216 AC_ARG_ENABLE(debug, 
217         [  --enable-debug           debug version (more verbose)],
218         [DEBUG="-DDEBUG"] 
219         )
220 AC_SUBST(DEBUG)
224 dnl GNOME_DISABLE_DEPRECATED="-DGNOME_DISABLE_DEPRECATED"
225 dnl AC_SUBST(GNOME_DISABLE_DEPRECATED)
228 AC_OUTPUT([
229         Makefile
230         doc/Makefile
231         doc/C/Makefile
232         doc/C/figures/Makefile
233         src/Makefile
234         po/Makefile.in
235         man/Makefile
236         pixmaps/Makefile
237  ])
240 echo "===================================================================="
241 echo "Configuration succesfully finished"
242  if test $HAVE_GNOME_PRINT; then
243         echo "with gnomeprint"
244  else
245         echo "without gnomeprint"
246  fi
248  if test $ENABLE_CAM; then 
249         echo "with (IEEE-1394) camera enabled"
250  fi
252  if test $ENABLE_TRIG; then 
253         echo "with (realtime) triggering enabled."
255         if test x$CONTROL = xfalse ; then
256                 echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
257                 echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
258                 echo "and RTAI kernel modules that are needed for the triggering of camera and lasers"
259                 echo ""
260          fi
261  fi
263  if test $ENABLE_MPI; then 
264         echo "Using Message Passing Interface (MPI)"
265         echo "for processing on distributed memory systems"
266  fi
268 echo "Type 'make' and 'make install' to build and install gpiv"
269 echo "===================================================================="