added preferences_interface
[gpiv.git] / configure.in
blob8d3775f2e83a7fd3faaba8a35c948ed4d694c0b0
1 dnl Process this file with autoconf to produce a configure script.
3 dnl =========== Initialization
4 AC_INIT(gpiv, 0.5.2,  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 AC_CHECK_LIB(gpiv, gpiv_piv_interrogate_ia, ,
88         AC_MSG_ERROR([libgpiv has not been installed]))
89 AC_CHECK_LIB(gpiv, gpiv_scan_resourcefiles, ,
90         AC_MSG_ERROR([libgpiv has not been installed]))
92 dnl AC_CHECK_HEADER(gpiv.h, ,AC_MSG_ERROR("giv.h is not installed"))
93 AC_CHECK_HEADERS([stdlib.h string.h unistd.h fftw3.h gpiv.h])
94 dnl hdf5.h 
96 AC_ARG_ENABLE(cam, 
97          [  --enable-cam            enable data acquisition],
98          [ENABLE_CAM="-DENABLE_CAM"]
99          )
100 AC_SUBST(ENABLE_CAM)
103 AC_ARG_ENABLE(trig, 
104          [  --enable-trig           enable (realtime) triggering],
105          [ENABLE_TRIG="-DENABLE_TRIG"]
106          )
107 AC_SUBST(ENABLE_TRIG)
110 if test $ENABLE_CAM || test $ENABLE_TRIG; then
111         ENABLE_DAC="-DENABLE_DAC"
112 AC_SUBST(ENABLE_DAC)
115 if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
116         AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
117         AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
118 Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))
120         AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
121         AC_MSG_ERROR("libraw1394 not installed"))
123         AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
124         AC_MSG_ERROR("libdc1394_control not installed"))
126         AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
127         AC_MSG_ERROR("missing dc1394_control.h"))
129         AC_CHECK_HEADER(libraw1394/raw1394.h, ,
130         AC_MSG_ERROR("missing raw1394.h"))
134 if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
135         AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
136         AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
137 Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
141 AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
142         AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)
144 AC_ARG_ENABLE(rta, 
145         [  --enable-rta=RTA_DIR     place where the RTAI code resides 
146                            (default /usr/lib/realtime)],
147         [RTA_TOPDIR="$enableval"],
148         [RTA_TOPDIR="/usr/lib/realtime"]
149         )
150 AC_SUBST(RTA_TOPDIR)
153 AC_ARG_ENABLE(k, 
154         [  --enable-k=K_DIR         place where the installed kernel 
155                            headers resides 
156                           (default /usr/src/kernel-headers-2.4.27-adeos)],
157         [K_TOPDIR="$enableval"],
158         [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
159         )
160 AC_SUBST(K_TOPDIR)
163 AC_ARG_ENABLE(img-width, 
164         [  --enable-img-width=WIDTH     maximum image width to be used (default SVGA)],
165         [OVERRIDE_IMAGE_WIDTH_MAX="-DIMAGE_WIDTH_MAX=$enableval"] 
166         )
167 AC_SUBST(OVERRIDE_IMAGE_WIDTH_MAX)
171 AC_ARG_ENABLE(img-height, 
172         [  --enable-img-height=HEIGHT   maximum image height to be used (default SVGA)],
173         [OVERRIDE_IMAGE_HEIGHT_MAX="-DIMAGE_HEIGHT_MAX=$enableval"] 
174         )
175 AC_SUBST(OVERRIDE_IMAGE_HEIGHT_MAX)
178 AC_ARG_ENABLE(canvas_aa, 
179         [  --enable-canvas-aa       Use Anti Aliased canvas for viewer; slower but 
180                            better displaying of image and resulting data],
181         [CANVAS_AA="-DCANVAS_AA"]
182         )
183 AC_SUBST(CANVAS_AA)
186 AC_ARG_ENABLE(debug, 
187         [  --enable-debug           debug version (more verbose)],
188         [DEBUG="-DDEBUG"] 
189         )
190 AC_SUBST(DEBUG)
194 dnl GNOME_DISABLE_DEPRECATED="-DGNOME_DISABLE_DEPRECATED"
195 dnl AC_SUBST(GNOME_DISABLE_DEPRECATED)
198 AC_OUTPUT([
199         Makefile
200         doc/Makefile
201         doc/C/Makefile
202         doc/C/figures/Makefile
203         src/Makefile
204         po/Makefile.in
205         man/Makefile
206         pixmaps/Makefile
207  ])
210 echo "===================================================================="
211 echo "Configuration succesfully finished"
212  if test $HAVE_GNOME_PRINT; then
213         echo "with gnomeprint"
214  else
215         echo "without gnomeprint"
216  fi
218  if test $ENABLE_CAM; then 
219         echo "with (IEEE-1394) camera enabled"
220  fi
222  if test $ENABLE_TRIG; then 
223         echo "with (realtime) triggering enabled."
225         if test x$CONTROL = xfalse ; then
226                 echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
227                 echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
228                 echo "and RTAI kernel modules that are needed for the triggering of camera and lasers"
229                 echo ""
230          fi
231  fi
232 echo "Type 'make' and 'make install' to build and install gpiv"
233 echo "===================================================================="