File: configure.in

package info (click to toggle)
gpiv 0.5.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,088 kB
  • ctags: 1,750
  • sloc: ansic: 29,435; sh: 4,235; makefile: 175
file content (233 lines) | stat: -rw-r--r-- 6,704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
dnl Process this file with autoconf to produce a configure script.

dnl =========== Initialization
AC_INIT(gpiv, 0.5.2,  http://bugzilla.gnome.org/enter_bug.cgi?product=gpiv)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE


dnl =========== basic compiler settings
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC


dnl ========== Export Compiler/linker options
# ============ Switched off:
#AC_SUBST(CFLAGS)
#AC_SUBST(CPPFLAGS)
#AC_SUBST(LDFLAGS)


GNOME_COMPILE_WARNINGS

#------------------------------------------------------------------------------
# From gpaint:
# The gnomeui library is required but the gnomeprint and gnomeprintui libraries
# are optional. First we verify the gnomeui library is present. Then we check 
# for the presence of the gnomeprint libraries and set a flag to indicate the 
# print libraries are present. Finally, we run pkg-config to get the compile and
# link flags for the combined set of libraries to eliminate duplications in 
# the CFLAGS.
## GNOME_MODULES="libgnomeui-2 >= 2.0.0"
GNOME_PRINT="libgnomeprint-2.2 >= 2.2.0 libgnomeprintui-2.2 >=2.2.0"
PKG_CHECK_MODULES(GPIV_UI, libgnomeui-2.0)
PKG_CHECK_MODULES(GPIV_PRINT, libgnomeprint-2.2 libgnomeprintui-2.2,
gpiv_have_gnome_print=1, echo "gnomeprint libraries are not available.")

if test "x$gpiv_have_gnome_print" = "x1"; then
	echo "gnomeprint IS available"
	AC_DEFINE(HAVE_GNOME_PRINT,"1")
	GPIV_GNOME_LIBS="libgnomeui-2.0 libgnomeprint-2.2 libgnomeprintui-2.2"
else
	echo "gnomeprint NOT available"
	GPIV_GNOME_LIBS="libgnomeui-2.0"
fi

echo "configuring with libraries: " $gpiv_gnome_libs
PKG_CHECK_MODULES(GPIV, $GPIV_GNOME_LIBS)
AC_SUBST(GPIV_CFLAGS)
AC_SUBST(GPIV_LIBS)


dnl ========== Add the languages which the application supports.
GETTEXT_PACKAGE=gpiv
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
ALL_LINGUAS="ca de nl"
AM_GLIB_GNU_GETTEXT


AC_PROG_INTLTOOL


dnl =========== Checking on libraries and headers
AC_CHECK_LIB(glib-2.0, g_malloc0, , 
	AC_MSG_ERROR("libglib not installed"))

dnl H5Fcreate
dnl AC_CHECK_LIB(hdf5, H5Fopen, , 
dnl        AC_MSG_ERROR("libhdf5 not installed"))


dnl ========== include fftw3
 AC_CHECK_LIB(fftw3, fftw_plan_dft_r2c_2d, , 
	AC_MSG_ERROR("libfftw3 not installed"))

AC_CHECK_LIB(gslcblas, main, , 
 	AC_MSG_ERROR("libgslcblas not installed"))

AC_CHECK_LIB(gsl, main, , 
 	AC_MSG_ERROR("libgsl not installed"))

dnl AC_CHECK_LIB(gslcblas, gsl_fit_linear, , 
dnl 	AC_MSG_ERROR("libgsl not installed"))

AC_CHECK_LIB(gpiv, gpiv_piv_interrogate_ia, ,
 	AC_MSG_ERROR([libgpiv has not been installed]))
AC_CHECK_LIB(gpiv, gpiv_scan_resourcefiles, ,
 	AC_MSG_ERROR([libgpiv has not been installed]))

dnl AC_CHECK_HEADER(gpiv.h, ,AC_MSG_ERROR("giv.h is not installed"))
AC_CHECK_HEADERS([stdlib.h string.h unistd.h fftw3.h gpiv.h])
dnl hdf5.h 

AC_ARG_ENABLE(cam, 
         [  --enable-cam            enable data acquisition],
         [ENABLE_CAM="-DENABLE_CAM"]
         )
AC_SUBST(ENABLE_CAM)


AC_ARG_ENABLE(trig, 
         [  --enable-trig           enable (realtime) triggering],
         [ENABLE_TRIG="-DENABLE_TRIG"]
         )
AC_SUBST(ENABLE_TRIG)


if test $ENABLE_CAM || test $ENABLE_TRIG; then
	ENABLE_DAC="-DENABLE_DAC"
AC_SUBST(ENABLE_DAC)
fi

if test  "${ENABLE_CAM}" == '-DENABLE_CAM'; then
	AC_CHECK_LIB(gpiv, gpiv_cam_get_camvar, ,
	AC_MSG_ERROR("(IEEE-1394) camera is not working in libgpiv. \
Enable (IEEE-1394) camera in libgpiv or disable it here by leaving out --enable-cam during ./configure"))

	AC_CHECK_LIB(raw1394, raw1394_destroy_handle, ,
	AC_MSG_ERROR("libraw1394 not installed"))

	AC_CHECK_LIB(dc1394_control, dc1394_create_handle, ,
	AC_MSG_ERROR("libdc1394_control not installed"))

	AC_CHECK_HEADER(libdc1394/dc1394_control.h, ,
	AC_MSG_ERROR("missing dc1394_control.h"))

	AC_CHECK_HEADER(libraw1394/raw1394.h, ,
	AC_MSG_ERROR("missing raw1394.h"))
fi


if test  "${ENABLE_TRIG}" == '-DENABLE_TRIG'; then
	AC_CHECK_LIB(gpiv, gpiv_trig_openrtfs, ,
	AC_MSG_ERROR("(Realtime) triggering is not working in libgpiv. \
Enable (realtime) triggering in libgpiv or disable it here by leaving out --enable-trig during ./configure"))
fi


AC_CHECK_PROG(CONTROL, gpiv_control, true, false)
	AM_CONDITIONAL(HAVE_CONTROL, $CONTROL)

AC_ARG_ENABLE(rta, 
        [  --enable-rta=RTA_DIR     place where the RTAI code resides 
			   (default /usr/lib/realtime)],
        [RTA_TOPDIR="$enableval"],
        [RTA_TOPDIR="/usr/lib/realtime"]
        )
AC_SUBST(RTA_TOPDIR)


AC_ARG_ENABLE(k, 
        [  --enable-k=K_DIR         place where the installed kernel 
                           headers resides 
                          (default /usr/src/kernel-headers-2.4.27-adeos)],
        [K_TOPDIR="$enableval"],
        [K_TOPDIR="/usr/src/kernel-headers-2.4.27-adeos"]
        )
AC_SUBST(K_TOPDIR)


AC_ARG_ENABLE(img-width, 
	[  --enable-img-width=WIDTH     maximum image width to be used (default SVGA)],
	[OVERRIDE_IMAGE_WIDTH_MAX="-DIMAGE_WIDTH_MAX=$enableval"] 
	)
AC_SUBST(OVERRIDE_IMAGE_WIDTH_MAX)



AC_ARG_ENABLE(img-height, 
	[  --enable-img-height=HEIGHT   maximum image height to be used (default SVGA)],
	[OVERRIDE_IMAGE_HEIGHT_MAX="-DIMAGE_HEIGHT_MAX=$enableval"] 
	)
AC_SUBST(OVERRIDE_IMAGE_HEIGHT_MAX)


AC_ARG_ENABLE(canvas_aa, 
        [  --enable-canvas-aa       Use Anti Aliased canvas for viewer; slower but 
                           better displaying of image and resulting data],
        [CANVAS_AA="-DCANVAS_AA"]
        )
AC_SUBST(CANVAS_AA)


AC_ARG_ENABLE(debug, 
	[  --enable-debug           debug version (more verbose)],
	[DEBUG="-DDEBUG"] 
	)
AC_SUBST(DEBUG)



dnl GNOME_DISABLE_DEPRECATED="-DGNOME_DISABLE_DEPRECATED"
dnl AC_SUBST(GNOME_DISABLE_DEPRECATED)


AC_OUTPUT([
	Makefile
	doc/Makefile
	doc/C/Makefile
	doc/C/figures/Makefile
	src/Makefile
	po/Makefile.in
	man/Makefile
	pixmaps/Makefile
 ])


echo "===================================================================="
echo "Configuration succesfully finished"
 if test $HAVE_GNOME_PRINT; then
        echo "with gnomeprint"
 else
        echo "without gnomeprint"
 fi

 if test $ENABLE_CAM; then 
	echo "with (IEEE-1394) camera enabled"
 fi

 if test $ENABLE_TRIG; then 
	echo "with (realtime) triggering enabled."

	if test x$CONTROL = xfalse ; then
		echo "Gpiv_control has not been found on this system, and probably gpivtrig-rtl isn't"
		echo "resident as well. This script eases to install and uninstall the gpivtrig-rtl"
		echo "and RTAI kernel modules that are needed for the triggering of camera and lasers"
		echo ""
	 fi
 fi
echo "Type 'make' and 'make install' to build and install gpiv"
echo "===================================================================="