1 | AC_INIT([Rappture],[1.1],[rappture@nanohub.org]) |
---|
2 | dnl AC_CONFIG_HEADER(src/core/RpConfig.h) |
---|
3 | AC_CONFIG_AUX_DIR(cf) |
---|
4 | AC_CONFIG_HEADER(src/core/config.h) |
---|
5 | |
---|
6 | #------------------------------------------------------------------------ |
---|
7 | # Handle the --prefix=... option |
---|
8 | #------------------------------------------------------------------------ |
---|
9 | |
---|
10 | if test "${prefix}" = "NONE"; then |
---|
11 | prefix=/usr/local |
---|
12 | fi |
---|
13 | if test "${exec_prefix}" = "NONE"; then |
---|
14 | exec_prefix=$prefix |
---|
15 | fi |
---|
16 | |
---|
17 | if test "${libdir}" != "${prefix}/lib"; then |
---|
18 | LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}" |
---|
19 | else |
---|
20 | LIB_SEARCH_DIRS="-L${libdir}" |
---|
21 | fi |
---|
22 | |
---|
23 | AC_SUBST(LIB_SEARCH_DIRS) |
---|
24 | |
---|
25 | AC_PROG_INSTALL |
---|
26 | AC_PROG_INSTALL |
---|
27 | AC_PROG_RANLIB |
---|
28 | AC_PROG_LN_S |
---|
29 | AC_PROG_MKDIR_P |
---|
30 | AC_PROG_MAKE_SET |
---|
31 | |
---|
32 | # Check for C, C++, and FORTRAN |
---|
33 | AC_PROG_CC |
---|
34 | AC_PROG_CXX |
---|
35 | # Avoid g95 |
---|
36 | AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32]) |
---|
37 | |
---|
38 | AC_LANG([C]) |
---|
39 | |
---|
40 | AC_HEADER_STDC |
---|
41 | AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) |
---|
42 | |
---|
43 | AC_LANG([C++]) |
---|
44 | |
---|
45 | AC_CHECK_FUNCS([sysinfo]) |
---|
46 | AC_CHECK_HEADERS(sys/sysinfo.h) |
---|
47 | |
---|
48 | AC_CHECK_LIB(m, main,,AC_MSG_ERROR(librappture requires libm)) |
---|
49 | AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) |
---|
50 | AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?)) |
---|
51 | AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?)) |
---|
52 | AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?)) |
---|
53 | AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?)) |
---|
54 | AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?)) |
---|
55 | AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?)) |
---|
56 | AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?)) |
---|
57 | AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?)) |
---|
58 | AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) |
---|
59 | AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?)) |
---|
60 | AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?)) |
---|
61 | AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?)) |
---|
62 | AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) |
---|
63 | AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) |
---|
64 | AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) |
---|
65 | |
---|
66 | AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?)) |
---|
67 | AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?)) |
---|
68 | AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?)) |
---|
69 | AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?)) |
---|
70 | AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?)) |
---|
71 | AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?)) |
---|
72 | AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?)) |
---|
73 | AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?)) |
---|
74 | AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?)) |
---|
75 | dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?)) |
---|
76 | AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?)) |
---|
77 | AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?)) |
---|
78 | AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?)) |
---|
79 | |
---|
80 | AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?)) |
---|
81 | if test "${ac_cv_header_inttypes_h}" = "yes" ; then |
---|
82 | HAVE_INTTYPES_H=1 |
---|
83 | else |
---|
84 | HAVE_INTTYPES_H=0 |
---|
85 | fi |
---|
86 | AC_SUBST(HAVE_INTTYPES_H) |
---|
87 | |
---|
88 | |
---|
89 | SC_CONFIG_CFLAGS |
---|
90 | |
---|
91 | make_command="" |
---|
92 | for m in "$MAKE" make gmake gnumake ; do |
---|
93 | if test "x${m}" != "x" ; then |
---|
94 | if ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then |
---|
95 | make_command=$m; break; |
---|
96 | fi |
---|
97 | fi |
---|
98 | done |
---|
99 | if test "x${make_command}" = "x" ; then |
---|
100 | AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE]) |
---|
101 | fi |
---|
102 | AC_SUBST(MAKE, ${make_command}) |
---|
103 | |
---|
104 | AC_ARG_ENABLE( |
---|
105 | [gui], |
---|
106 | [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])], |
---|
107 | [], |
---|
108 | [enable_gui=yes]) |
---|
109 | |
---|
110 | ENABLE_GUI= |
---|
111 | if test "$enable_gui" != "no" ; then |
---|
112 | ENABLE_GUI="yes" |
---|
113 | fi |
---|
114 | AC_SUBST(ENABLE_GUI) |
---|
115 | |
---|
116 | with_tclsh="yes" |
---|
117 | AC_ARG_WITH( |
---|
118 | [tclsh], |
---|
119 | [AS_HELP_STRING([--with-tclsh[=DIR]], |
---|
120 | [location of tclsh @<:@default=yes@:>@])], |
---|
121 | [], |
---|
122 | [with_tclsh=yes]) |
---|
123 | |
---|
124 | TCLSH= |
---|
125 | if test "$with_tclsh" != "no" ; then |
---|
126 | AC_MSG_CHECKING([for tclsh]) |
---|
127 | if test -x "$with_tclsh/bin/tclsh" |
---|
128 | then |
---|
129 | echo Found tclsh in $with_tclsh/bin/tclsh |
---|
130 | TCLSH="$with_tclsh/bin/tclsh" |
---|
131 | else |
---|
132 | if test -x "$with_tclsh" |
---|
133 | then |
---|
134 | echo Found tclsh in $with_tclsh |
---|
135 | TCLSH="$with_tclsh" |
---|
136 | else |
---|
137 | AC_PATH_PROG(TCLSH, tclsh) |
---|
138 | fi |
---|
139 | fi |
---|
140 | fi |
---|
141 | AC_MSG_RESULT([${TCLSH}]) |
---|
142 | AC_SUBST(TCLSH) |
---|
143 | |
---|
144 | TCL_VERSION="8.4" |
---|
145 | for dir in \ |
---|
146 | ${exec_prefix} \ |
---|
147 | ${exec_prefix}/lib ; do |
---|
148 | tclconfig="${dir}/tclConfig.sh" |
---|
149 | if test -f "$tclconfig" ; then |
---|
150 | . $tclconfig |
---|
151 | break |
---|
152 | fi |
---|
153 | done |
---|
154 | TCL_INC_SPEC="$TCL_INCLUDE_SPEC" |
---|
155 | |
---|
156 | if test "x$with_tcllib" != "x" ; then |
---|
157 | tclconfig="${with_tcllib}/tclConfig.sh" |
---|
158 | if test -f "$tclconfig" ; then |
---|
159 | . $tclconfig |
---|
160 | fi |
---|
161 | TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}" |
---|
162 | fi |
---|
163 | if test "x$with_tclinclude" != "x" ; then |
---|
164 | TCL_INC_SPEC="-I${with_tclinclude}" |
---|
165 | fi |
---|
166 | |
---|
167 | AC_SUBST(TCL_VERSION) |
---|
168 | AC_SUBST(TCL_INC_SPEC) |
---|
169 | AC_SUBST(TCL_LIB_SPEC) |
---|
170 | |
---|
171 | AC_ARG_WITH( |
---|
172 | [vtk], |
---|
173 | [AS_HELP_STRING([--with-vtk[=DIR]], |
---|
174 | [location of vtk library @<:@default=yes@:>@])], |
---|
175 | [with_vtk=$withval], [with_vtk=yes]) |
---|
176 | |
---|
177 | AC_MSG_CHECKING([for vtk]) |
---|
178 | VTKDIR="" |
---|
179 | |
---|
180 | if test "$with_vtk" != "no" ; then |
---|
181 | if test "$with_vtk" = "yes" ; then |
---|
182 | for path in \ |
---|
183 | $libdir \ |
---|
184 | $prefix/lib \ |
---|
185 | $exec_prefix/lib \ |
---|
186 | /usr/lib |
---|
187 | do |
---|
188 | for vtk in $path/vtk-* ; do |
---|
189 | if test -d "${vtk}" ; then |
---|
190 | VTKDIR=${vtk} |
---|
191 | fi |
---|
192 | done |
---|
193 | if test "x${VTKDIR}" != "x" ; then |
---|
194 | break |
---|
195 | fi |
---|
196 | done |
---|
197 | fi |
---|
198 | fi |
---|
199 | AC_SUBST(VTKDIR) |
---|
200 | AC_MSG_RESULT([$VTKDIR]) |
---|
201 | |
---|
202 | |
---|
203 | AC_ARG_WITH( |
---|
204 | [matlab], |
---|
205 | [AS_HELP_STRING([--with-matlab[=DIR]], |
---|
206 | [location of matlab and mex compiler @<:@default=yes@:>@])], |
---|
207 | [with_matlab=$withval], |
---|
208 | [with_matlab=yes]) |
---|
209 | |
---|
210 | MCC="" |
---|
211 | MEX="" |
---|
212 | MEX_ARCH="" |
---|
213 | MEXEXT="" |
---|
214 | MATLAB= |
---|
215 | if test "$with_matlab" != "no" ; then |
---|
216 | if test "$with_matlab" = "yes" ; then |
---|
217 | AC_PATH_PROG(MATLAB, matlab) |
---|
218 | else |
---|
219 | AC_PATH_PROG(MATLAB, matlab, [], [${with_matlab}/bin:${with_matlab}]) |
---|
220 | fi |
---|
221 | fi |
---|
222 | |
---|
223 | if test "x$MATLAB" != "x" ; then |
---|
224 | # Found matlab. May be a symlink to the real binary. Run "matlab -e" |
---|
225 | # to tell where matlab is installed. |
---|
226 | |
---|
227 | matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin |
---|
228 | |
---|
229 | # Now see if we can find "mex" or "mexext" there. |
---|
230 | AC_PATH_PROG(MEX, mex, [], [${matlab_bindir}]) |
---|
231 | AC_PATH_PROG(MEXEXT, mexext, [], [${matlab_bindir}]) |
---|
232 | |
---|
233 | # Run "mexext" to get the expected module extension for this platform. |
---|
234 | AC_MSG_CHECKING([for mex extension]) |
---|
235 | if test "x$MEXEXT" != "x" ; then |
---|
236 | MEXEXT=`$MEXEXT` |
---|
237 | else |
---|
238 | MEXEXT="mexglx" |
---|
239 | fi |
---|
240 | AC_MSG_RESULT([$MEXEXT]) |
---|
241 | AC_PATH_PROG(MCC, mcc, [], [${matlab_bindir}]) |
---|
242 | AC_MSG_CHECKING([for mcc extension]) |
---|
243 | fi |
---|
244 | |
---|
245 | AC_SUBST(MCC) |
---|
246 | AC_SUBST(MEX) |
---|
247 | AC_SUBST(MATLAB) |
---|
248 | AC_SUBST(MEX_ARCH) |
---|
249 | AC_SUBST(MEXEXT) |
---|
250 | |
---|
251 | # Standard octave search (use the installed version of octave) |
---|
252 | AC_ARG_WITH( |
---|
253 | [octave], |
---|
254 | [AS_HELP_STRING([--with-octave[=DIR]], |
---|
255 | [location of octave compiler MKOCTFILE @<:@default=yes@:>@])], |
---|
256 | [with_octave=$withval], |
---|
257 | [with_octave=yes]) |
---|
258 | |
---|
259 | OCTAVE= |
---|
260 | OCTAVE2= |
---|
261 | OCTAVE3= |
---|
262 | OCTAVE_VERSION= |
---|
263 | OCTAVE_VERSION_MAJOR= |
---|
264 | MKOCTFILE= |
---|
265 | MKOCTFILE2= |
---|
266 | MKOCTFILE3= |
---|
267 | if test "$with_octave" != "no" ; then |
---|
268 | AC_MSG_CHECKING([for octave and mkoctfile]) |
---|
269 | if test "$with_octave" = "yes" ; then |
---|
270 | AC_PATH_PROG(OCTAVE, octave) |
---|
271 | AC_PATH_PROG(MKOCTFILE, mkoctfile) |
---|
272 | else |
---|
273 | AC_PATH_PROG(OCTAVE, octave, [], [${with_octave}/bin:${with_octave}]) |
---|
274 | AC_PATH_PROG(MKOCTFILE, mkoctfile, [], |
---|
275 | [${with_octave}/bin:${with_octave}]) |
---|
276 | fi |
---|
277 | if test "x${OCTAVE}" != "x" ; then |
---|
278 | OCTAVE_VERSION=`${OCTAVE} -v | grep version | cut -d' ' -f4` |
---|
279 | OCTAVE_VERSION_MAJOR=`echo ${OCTAVE_VERSION} | cut -d'.' -f1` |
---|
280 | if test "${OCTAVE_VERSION_MAJOR}" == "3" ; then |
---|
281 | OCTAVE3=$OCTAVE |
---|
282 | MKOCTFILE3=$MKOCTFILE |
---|
283 | fi |
---|
284 | if test "${OCTAVE_VERSION_MAJOR}" == "2" ; then |
---|
285 | OCTAVE2=$OCTAVE |
---|
286 | MKOCTFILE2=$MKOCTFILE |
---|
287 | fi |
---|
288 | fi |
---|
289 | fi |
---|
290 | |
---|
291 | # Check if octave2 was designated *in addition* to the installed version. |
---|
292 | AC_ARG_WITH( |
---|
293 | [octave2], |
---|
294 | [AS_HELP_STRING([--with-octave2[=DIR]], |
---|
295 | [location of octave compiler MKOCTFILE @<:@default=no@:>@])], |
---|
296 | [with_octave2=$withval], |
---|
297 | [with_octave2=no]) |
---|
298 | |
---|
299 | if test "$with_octave2" != "no" ; then |
---|
300 | AC_MSG_CHECKING([for octave and mkoctfile]) |
---|
301 | AC_PATH_PROG(octave2, octave, [], [${with_octave2}/bin:${with_octave2}]) |
---|
302 | AC_PATH_PROG(mkoctfile2, mkoctfile, [], |
---|
303 | [${with_octave2}/bin:${with_octave2}]) |
---|
304 | if test "x${octave2}" != "x" ; then |
---|
305 | version=`${octave2} -v | grep version | cut -d' ' -f4` |
---|
306 | version_major=`echo ${version} | cut -d'.' -f1` |
---|
307 | if test "$version_major" = "2" ; then |
---|
308 | OCTAVE2=$octave2 |
---|
309 | MKOCTFILE2=$mkoctfile2 |
---|
310 | fi |
---|
311 | fi |
---|
312 | fi |
---|
313 | # Check if octave3 was designated *in addition* to the installed version. |
---|
314 | AC_ARG_WITH( |
---|
315 | [octave3], |
---|
316 | [AS_HELP_STRING([--with-octave3[=DIR]], |
---|
317 | [location of octave compiler MKOCTFILE @<:@default=no@:>@])], |
---|
318 | [with_octave3=$withval], |
---|
319 | [with_octave3=no]) |
---|
320 | if test "$with_octave3" != "no" ; then |
---|
321 | AC_MSG_CHECKING([for octave and mkoctfile]) |
---|
322 | AC_PATH_PROG(octave3, octave, [], [${with_octave3}/bin:${with_octave3}]) |
---|
323 | AC_PATH_PROG(mkoctfile3, mkoctfile, [], |
---|
324 | [${with_octave3}/bin:${with_octave3}]) |
---|
325 | if test "x${octave3}" != "x" ; then |
---|
326 | version=`${octave3} -v | grep version | cut -d' ' -f4` |
---|
327 | version_major=`echo ${version} | cut -d'.' -f1` |
---|
328 | if test "$version_major" = "3" ; then |
---|
329 | OCTAVE3=$with_octave3 |
---|
330 | MKOCTFILE3=$mkoctfile3 |
---|
331 | fi |
---|
332 | fi |
---|
333 | fi |
---|
334 | |
---|
335 | AC_SUBST(OCTAVE2) |
---|
336 | AC_SUBST(OCTAVE3) |
---|
337 | AC_SUBST(OCTAVE) |
---|
338 | AC_SUBST(OCTAVE_VERSION) |
---|
339 | AC_SUBST(OCTAVE_VERSION_MAJOR) |
---|
340 | AC_SUBST(MKOCTFILE) |
---|
341 | AC_SUBST(MKOCTFILE2) |
---|
342 | AC_SUBST(MKOCTFILE3) |
---|
343 | |
---|
344 | PERL= |
---|
345 | PERL_INCLUDES= |
---|
346 | PERL_ARCHLIB= |
---|
347 | PERL_ARCHLIBEXP= |
---|
348 | PERL_VERSION= |
---|
349 | PERL_VENDORLIB= |
---|
350 | PERL_PRIVLIB= |
---|
351 | PERL_CPPFLAGS= |
---|
352 | PERL_CCFlAGS= |
---|
353 | PERL_VERSION_RV= |
---|
354 | PERL_LIBSPEC= |
---|
355 | if test "$with_perl" != "no" ; then |
---|
356 | AC_MSG_CHECKING([for perl]) |
---|
357 | if test "$with_perl" != "yes" ; then |
---|
358 | AC_PATH_PROG(PERL, perl, [], [$with_perl/bin:$with_perl]) |
---|
359 | else |
---|
360 | AC_PATH_PROG(PERL, perl) |
---|
361 | fi |
---|
362 | if test "x${PERL}" != "x" ; then |
---|
363 | PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'` |
---|
364 | PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'` |
---|
365 | PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'` |
---|
366 | PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'` |
---|
367 | PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'` |
---|
368 | PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'` |
---|
369 | PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'` |
---|
370 | PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'` |
---|
371 | PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2` |
---|
372 | echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" |
---|
373 | |
---|
374 | # libperl may or may not be installed. Check for its existence. |
---|
375 | if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then |
---|
376 | PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl" |
---|
377 | fi |
---|
378 | fi |
---|
379 | fi |
---|
380 | AC_MSG_RESULT([${PERL}]) |
---|
381 | AC_SUBST(PERL) |
---|
382 | AC_SUBST(PERL_INCLUDES) |
---|
383 | AC_SUBST(PERL_ARCHLIB) |
---|
384 | AC_SUBST(PERL_ARCHLIBEXP) |
---|
385 | AC_SUBST(PERL_VERSION) |
---|
386 | AC_SUBST(PERL_CCFLAGS) |
---|
387 | AC_SUBST(PERL_CPPFLAGS) |
---|
388 | AC_SUBST(PERL_VENDORLIB) |
---|
389 | AC_SUBST(PERL_PRIVLIB) |
---|
390 | AC_SUBST(PERL_INSTALLARCHLIB) |
---|
391 | AC_SUBST(PERL_VERSION_RV) |
---|
392 | AC_SUBST(PERL_LIBSPEC) |
---|
393 | |
---|
394 | PYTHON="" |
---|
395 | PYTHON_CFLAGS="" |
---|
396 | PYTHON_CPPFLAGS="" |
---|
397 | HAVE_PYTHON_DISTUTILS="" |
---|
398 | PYTHON_INCLUDES="" |
---|
399 | PYTHON_LDFLAGS="" |
---|
400 | PYTHON_LIB="" |
---|
401 | PYTHON_LIBDIR="" |
---|
402 | PYTHON_SITE_DIR="" |
---|
403 | PYTHON_SITE_PACKAGES="" |
---|
404 | PYTHON_VERSION="" |
---|
405 | pythondir="" |
---|
406 | |
---|
407 | AC_ARG_WITH([python], |
---|
408 | [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=yes@:>@])], |
---|
409 | [], |
---|
410 | [with_python=yes]) |
---|
411 | |
---|
412 | if test "$with_python" != "no" ; then |
---|
413 | AC_MSG_CHECKING([for python]) |
---|
414 | if test -x "$with_python/bin/python"; then |
---|
415 | echo Found python in $with_python/bin/python |
---|
416 | PYTHON="$with_python/bin/python" |
---|
417 | elif test -x "$with_python"; then |
---|
418 | echo Found python in $with_python |
---|
419 | PYTHON="$with_python" |
---|
420 | else |
---|
421 | AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) |
---|
422 | fi |
---|
423 | if test "x${PYTHON}" != "x"; then |
---|
424 | PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` |
---|
425 | echo Using python version $PYTHON_VERSION |
---|
426 | fi |
---|
427 | if test "x${PYTHON_VERSION}" != "x"; then |
---|
428 | if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ |
---|
429 | -d $with_python/lib/python$PYTHON_VERSION/site-packages; then |
---|
430 | PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION |
---|
431 | PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages |
---|
432 | else |
---|
433 | if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then |
---|
434 | PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' |
---|
435 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
436 | else |
---|
437 | if test -r /usr/include/python$PYTHON_VERSION/Python.h; then |
---|
438 | PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION |
---|
439 | PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' |
---|
440 | else |
---|
441 | echo could not find python$PYTHON_VERSION/Python.h |
---|
442 | fi |
---|
443 | fi |
---|
444 | if test ! -d "$PYTHON_SITE_PACKAGES"; then |
---|
445 | PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` |
---|
446 | fi |
---|
447 | fi |
---|
448 | fi |
---|
449 | if test "x$with_python" != "x" ; then |
---|
450 | pythondir='$(PYTHON_SITE_PACKAGES)' |
---|
451 | else |
---|
452 | pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' |
---|
453 | fi |
---|
454 | |
---|
455 | AC_MSG_CHECKING([for python distutils]) |
---|
456 | ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \ |
---|
457 | build build_ext 2>&1 > /dev/null |
---|
458 | if test $? = 0 ; then |
---|
459 | HAVE_PYTHON_DISTUTILS="yes" |
---|
460 | else |
---|
461 | HAVE_PYTHON_DISTUTILS="no" |
---|
462 | fi |
---|
463 | AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS]) |
---|
464 | |
---|
465 | if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then |
---|
466 | # |
---|
467 | # Check for Python include path |
---|
468 | # |
---|
469 | AC_MSG_CHECKING([for Python include path]) |
---|
470 | if test "x${PYTHON_CPPFLAGS}" = "x"; then |
---|
471 | incdir_path=`${PYTHON} -c "import distutils.sysconfig; \ |
---|
472 | print distutils.sysconfig.get_python_inc();"` |
---|
473 | if test -n "${incdir}"; then |
---|
474 | python_path="-I${incdir}" |
---|
475 | fi |
---|
476 | PYTHON_CPPFLAGS=$python_path |
---|
477 | fi |
---|
478 | AC_MSG_RESULT([$PYTHON_CPPFLAGS]) |
---|
479 | AC_SUBST([PYTHON_CPPFLAGS]) |
---|
480 | # |
---|
481 | # python distutils found, get settings from python directly |
---|
482 | # |
---|
483 | AC_MSG_CHECKING([location of site-packages]) |
---|
484 | PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`" |
---|
485 | |
---|
486 | PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print \" \".join(flags);'`" |
---|
487 | PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print \" \".join(libs);'`" |
---|
488 | PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`" |
---|
489 | PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`" |
---|
490 | fi |
---|
491 | fi |
---|
492 | AC_SUBST(pythondir) |
---|
493 | |
---|
494 | AC_SUBST(PYTHON) |
---|
495 | AC_SUBST(PYTHON_VERSION) |
---|
496 | AC_SUBST(PYTHON_INCLUDES) |
---|
497 | AC_SUBST(PYTHON_SITE_PACKAGES) |
---|
498 | AC_SUBST(HAVE_PYTHON_DISTUTILS) |
---|
499 | |
---|
500 | with_ruby="yes" |
---|
501 | |
---|
502 | RUBY="" |
---|
503 | RUBY_DEV_PKG="no" |
---|
504 | |
---|
505 | AC_ARG_WITH(ruby, |
---|
506 | AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]), |
---|
507 | [with_ruby=$with_val]) |
---|
508 | if test "${with_ruby}" != "no" ; then |
---|
509 | if test "${with_ruby}" = "yes" ; then |
---|
510 | AC_PATH_PROG(RUBY, ruby) |
---|
511 | else |
---|
512 | AC_PATH_PROG(RUBY, ruby, [], |
---|
513 | [${with_ruby}/bin/ruby:${with_ruby}]) |
---|
514 | fi |
---|
515 | fi |
---|
516 | AC_SUBST(RUBY) |
---|
517 | |
---|
518 | RUBY_VERSION_RV= |
---|
519 | RUBY_PLATFORM= |
---|
520 | if test "x${RUBY}" != "x" ; then |
---|
521 | AX_PROG_RUBY_VERSION |
---|
522 | RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2` |
---|
523 | RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'` |
---|
524 | ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1` |
---|
525 | if test -z "$ac_mkmf_result"; then |
---|
526 | HAVE_RUBY_DEVEL="yes" |
---|
527 | AX_RUBY_DEV_FLAGS([${RUBY}]) |
---|
528 | fi |
---|
529 | fi |
---|
530 | AC_SUBST(HAVE_RUBY_DEVEL) |
---|
531 | AC_SUBST(RUBY_VERSION_RV) |
---|
532 | AC_SUBST(RUBY_PLATFORM) |
---|
533 | |
---|
534 | with_java="yes" |
---|
535 | JAVA="" |
---|
536 | JAVAH="" |
---|
537 | JAVAC="" |
---|
538 | JAVA_DEV_PKG="no" |
---|
539 | |
---|
540 | JDK= |
---|
541 | JAVA_HOME= |
---|
542 | JAVA_INC_DIR= |
---|
543 | JAVA_INC_SPEC= |
---|
544 | |
---|
545 | # If java exists, let's look for the jni.h file. |
---|
546 | if test "x${JAVA}" != "x" ; then |
---|
547 | for d in \ |
---|
548 | ${with_java} \ |
---|
549 | /usr/lib/jvm/java-6-sun \ |
---|
550 | /apps/java/jdk1.6.0_01 \ |
---|
551 | /opt/icedtea6-* \ |
---|
552 | /opt/sun-jdk-1.6* \ |
---|
553 | /opt/sun-jdk-1.5* |
---|
554 | do |
---|
555 | if test -r "${d}/include/jni.h" ; then |
---|
556 | JDK=${d} |
---|
557 | break; |
---|
558 | fi |
---|
559 | done |
---|
560 | JAVA_HOME=$JDK |
---|
561 | JAVA_INC_DIR=${JDK}/include |
---|
562 | JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux" |
---|
563 | fi |
---|
564 | |
---|
565 | AC_ARG_WITH(java, |
---|
566 | AS_HELP_STRING([--with-java=PATH], [absolute path to java executable]), |
---|
567 | [with_java=$with_val]) |
---|
568 | if test "${with_java}" != "no" ; then |
---|
569 | if test "${with_java}" = "yes" ; then |
---|
570 | AC_PATH_PROG(JAVA, java) |
---|
571 | AC_PATH_PROG(JAVAC, javac) |
---|
572 | AC_PATH_PROG(JAVAH, javah) |
---|
573 | else |
---|
574 | AC_PATH_PROG(JAVA, java, [], |
---|
575 | [${with_java}/bin:${with_java}]) |
---|
576 | AC_PATH_PROG(JAVAC, javac, [], |
---|
577 | [${with_java}/bin:${with_java}]) |
---|
578 | AC_PATH_PROG(JAVAH, javah, [], |
---|
579 | [${with_java}/bin:${with_java}]) |
---|
580 | fi |
---|
581 | fi |
---|
582 | |
---|
583 | AC_SUBST(JAVA) |
---|
584 | AC_SUBST(JAVAC) |
---|
585 | AC_SUBST(JAVAH) |
---|
586 | AC_SUBST(JAVA_HOME) |
---|
587 | AC_SUBST(JAVA_INC_DIR) |
---|
588 | AC_SUBST(JAVA_INC_SPEC) |
---|
589 | |
---|
590 | AC_MSG_CHECKING([for OpenDX headers]) |
---|
591 | DX_INC_DIR="" |
---|
592 | for dir in \ |
---|
593 | /apps/rappture/include \ |
---|
594 | /usr/dx/include \ |
---|
595 | /usr/include |
---|
596 | do |
---|
597 | if test -r "${dir}/dx/dx.h" ; then |
---|
598 | DX_INC_DIR="$dir" |
---|
599 | break |
---|
600 | fi |
---|
601 | done |
---|
602 | |
---|
603 | if test "${DX_INC_DIR}" = "/usr/include" ; then |
---|
604 | DX_INC_SPEC="" |
---|
605 | else |
---|
606 | DX_INC_SPEC="-I{DX_INC_DIR}" |
---|
607 | fi |
---|
608 | AC_SUBST(DX_INC_SPEC) |
---|
609 | AC_MSG_RESULT([${DX_INC_DIR}]) |
---|
610 | |
---|
611 | AC_MSG_CHECKING([for OpenDX libraries]) |
---|
612 | DX_LIB_DIR="" |
---|
613 | for dir in \ |
---|
614 | /apps/rappture/lib \ |
---|
615 | /usr/lib/dx/lib_linux \ |
---|
616 | /usr/dx/lib_linux \ |
---|
617 | /usr/lib |
---|
618 | do |
---|
619 | if test -r "${dir}/libDXcallm.a" ; then |
---|
620 | DX_LIB_DIR="$dir" |
---|
621 | break |
---|
622 | fi |
---|
623 | done |
---|
624 | |
---|
625 | if test "${DX_LIB_DIR}" = "/usr" ; then |
---|
626 | DX_LIB_SPEC="" |
---|
627 | else |
---|
628 | DX_LIB_SPEC="-L${DX_LIB_DIR}" |
---|
629 | fi |
---|
630 | |
---|
631 | AC_SUBST(DX_LIB_SPEC) |
---|
632 | AC_MSG_RESULT([${DX_LIB_DIR}]) |
---|
633 | |
---|
634 | RP_BASE=`pwd` |
---|
635 | AC_SUBST(RP_BASE) |
---|
636 | |
---|
637 | SC_ENABLE_SHARED |
---|
638 | |
---|
639 | #-------------------------------------------------------------------- |
---|
640 | # This macro figures out what flags to use with the compiler/linker |
---|
641 | # when building shared/static debug/optimized objects. This information |
---|
642 | # is all taken from the tclConfig.sh file. |
---|
643 | #-------------------------------------------------------------------- |
---|
644 | |
---|
645 | AC_SUBST(CFLAGS_DEBUG) |
---|
646 | AC_SUBST(CFLAGS_OPTIMIZE) |
---|
647 | AC_SUBST(STLIB_LD) |
---|
648 | AC_SUBST(SHLIB_LD) |
---|
649 | AC_SUBST(SHLIB_CFLAGS) |
---|
650 | AC_SUBST(SHLIB_LDFLAGS) |
---|
651 | AC_SUBST(SHLIB_SUFFIX) |
---|
652 | |
---|
653 | if test -f "${exec_prefix}/lib/tclConfig.sh" ; then |
---|
654 | . ${exec_prefix}/lib/tclConfig.sh |
---|
655 | fi |
---|
656 | if test -f "${exec_prefix}/lib/tclConfig.sh" ; then |
---|
657 | . ${exec_prefix}/lib/tkConfig.sh |
---|
658 | fi |
---|
659 | AC_SUBST(TCL_VERSION) |
---|
660 | AC_SUBST(TK_VERSION) |
---|
661 | |
---|
662 | # ----------------------------------------------------------------------- |
---|
663 | # |
---|
664 | # Compiler characteristics: |
---|
665 | # Check for existence of types of size_t and pid_t |
---|
666 | # |
---|
667 | # ----------------------------------------------------------------------- |
---|
668 | |
---|
669 | AC_C_BIGENDIAN |
---|
670 | AC_CHECK_SIZEOF(int) |
---|
671 | AC_CHECK_SIZEOF(long) |
---|
672 | AC_CHECK_SIZEOF(long long) |
---|
673 | AC_CHECK_SIZEOF(void *) |
---|
674 | |
---|
675 | SIZEOF_LONG="${ac_cv_sizeof_long}" |
---|
676 | SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}" |
---|
677 | SIZEOF_VOID_P="${ac_cv_sizeof_void_p}" |
---|
678 | SIZEOF_INT="${ac_cv_sizeof_int}" |
---|
679 | AC_SUBST(SIZEOF_INT) |
---|
680 | AC_SUBST(SIZEOF_LONG) |
---|
681 | AC_SUBST(SIZEOF_LONG_LONG) |
---|
682 | AC_SUBST(SIZEOF_VOID_P) |
---|
683 | |
---|
684 | |
---|
685 | #-------------------------------------------------------------------- |
---|
686 | # Set the default compiler switches based on the --enable-symbols |
---|
687 | # option. |
---|
688 | #-------------------------------------------------------------------- |
---|
689 | |
---|
690 | SC_ENABLE_SYMBOLS |
---|
691 | |
---|
692 | ac_configure_args="--disable-threads --enable-shared" |
---|
693 | AC_CONFIG_SUBDIRS( [packages/optimizer/src] ) |
---|
694 | |
---|
695 | dnl read Makefile.in and write Makefile |
---|
696 | AC_CONFIG_FILES([ |
---|
697 | Makefile |
---|
698 | packages/Makefile |
---|
699 | src/Makefile |
---|
700 | src/core/Makefile |
---|
701 | src/core2/Makefile |
---|
702 | src/objects/Makefile |
---|
703 | src/objects/RpHash.h |
---|
704 | gui/Makefile |
---|
705 | gui/apps/Makefile |
---|
706 | gui/apps/about |
---|
707 | gui/apps/encodedata |
---|
708 | gui/apps/rappture |
---|
709 | gui/apps/rappture-csh.env |
---|
710 | gui/apps/rappture.env |
---|
711 | gui/apps/rappture.use |
---|
712 | gui/apps/rerun |
---|
713 | gui/apps/simsim |
---|
714 | gui/apps/xmldiff |
---|
715 | gui/pkgIndex.tcl |
---|
716 | gui/scripts/Makefile |
---|
717 | instant/Makefile |
---|
718 | instant/irappture |
---|
719 | lang/Makefile |
---|
720 | lang/java/Makefile |
---|
721 | lang/java/rappture/Makefile |
---|
722 | lang/perl/Makefile |
---|
723 | lang/perl/Makefile.PL |
---|
724 | lang/python/Makefile |
---|
725 | lang/python/setup.py |
---|
726 | lang/matlab/Makefile |
---|
727 | lang/octave/Makefile |
---|
728 | lang/octave/RpOctaveInterface.h |
---|
729 | lang/ruby/Makefile |
---|
730 | lang/ruby/build.rb |
---|
731 | lang/tcl/Makefile |
---|
732 | lang/tcl/pkgIndex.tcl |
---|
733 | lang/tcl/src/Makefile |
---|
734 | lang/tcl/scripts/Makefile |
---|
735 | lang/tcl/tests/Makefile |
---|
736 | lib/Makefile |
---|
737 | examples/3D/Makefile |
---|
738 | examples/Makefile |
---|
739 | examples/app-fermi/2.0/Makefile |
---|
740 | examples/app-fermi/Makefile |
---|
741 | examples/app-fermi/cee/Makefile |
---|
742 | examples/app-fermi/fortran/Makefile |
---|
743 | examples/app-fermi/java/Makefile |
---|
744 | examples/app-fermi/matlab/Makefile |
---|
745 | examples/app-fermi/matlab/compiled/Makefile |
---|
746 | examples/app-fermi/matlab/uncompiled/Makefile |
---|
747 | examples/app-fermi/octave/Makefile |
---|
748 | examples/app-fermi/octave/2/Makefile |
---|
749 | examples/app-fermi/octave/3/Makefile |
---|
750 | examples/app-fermi/perl/Makefile |
---|
751 | examples/app-fermi/python/Makefile |
---|
752 | examples/app-fermi/ruby/Makefile |
---|
753 | examples/app-fermi/tcl/Makefile |
---|
754 | examples/app-fermi/wrapper/Makefile |
---|
755 | examples/app-fermi/wrapper/cee/Makefile |
---|
756 | examples/app-fermi/wrapper/python/Makefile |
---|
757 | examples/app-fermi/wrapper/tcl/Makefile |
---|
758 | examples/c-example/Makefile |
---|
759 | examples/canvas/Makefile |
---|
760 | examples/demo.bash |
---|
761 | examples/flow/Makefile |
---|
762 | examples/flow/demo1/Makefile |
---|
763 | examples/flow/demo2/Makefile |
---|
764 | examples/flow/demo3/Makefile |
---|
765 | examples/graph/Makefile |
---|
766 | examples/objects/Makefile |
---|
767 | examples/objects/axis/Makefile |
---|
768 | examples/objects/contour/Makefile |
---|
769 | examples/objects/curve/Makefile |
---|
770 | examples/objects/dxWriter/Makefile |
---|
771 | examples/objects/floatBuffer/Makefile |
---|
772 | examples/objects/histogram/Makefile |
---|
773 | examples/objects/library/Makefile |
---|
774 | examples/objects/number/Makefile |
---|
775 | examples/objects/path/Makefile |
---|
776 | examples/objects/plot/Makefile |
---|
777 | examples/objects/scatter/Makefile |
---|
778 | examples/objects/string/Makefile |
---|
779 | examples/objects/tree/Makefile |
---|
780 | examples/objects/xmlparser/Makefile |
---|
781 | examples/zoo/Makefile |
---|
782 | examples/zoo/binary/Makefile |
---|
783 | examples/zoo/boolean/Makefile |
---|
784 | examples/zoo/choice/Makefile |
---|
785 | examples/zoo/cloud/Makefile |
---|
786 | examples/zoo/cloud/matlab/Makefile |
---|
787 | examples/zoo/curve/Makefile |
---|
788 | examples/zoo/enable/Makefile |
---|
789 | examples/zoo/field/Makefile |
---|
790 | examples/zoo/filechoice/Makefile |
---|
791 | examples/zoo/group/Makefile |
---|
792 | examples/zoo/image/Makefile |
---|
793 | examples/zoo/image/docs/Makefile |
---|
794 | examples/zoo/image/examples/Makefile |
---|
795 | examples/zoo/integer/Makefile |
---|
796 | examples/zoo/integer2/Makefile |
---|
797 | examples/zoo/loader/Makefile |
---|
798 | examples/zoo/loader/examples/Makefile |
---|
799 | examples/zoo/loadrun/Makefile |
---|
800 | examples/zoo/log/Makefile |
---|
801 | examples/zoo/note/Makefile |
---|
802 | examples/zoo/note/docs/Makefile |
---|
803 | examples/zoo/number/Makefile |
---|
804 | examples/zoo/number2/Makefile |
---|
805 | examples/zoo/periodicelement/Makefile |
---|
806 | examples/zoo/phase/Makefile |
---|
807 | examples/zoo/sequence/Makefile |
---|
808 | examples/zoo/sequence/examples/Makefile |
---|
809 | examples/zoo/string/Makefile |
---|
810 | examples/zoo/structure/Makefile |
---|
811 | examples/zoo/structure/examples/Makefile |
---|
812 | examples/zoo/table/Makefile |
---|
813 | examples/zoo/unirect2d/Makefile |
---|
814 | test/Makefile |
---|
815 | test/src/Makefile |
---|
816 | ]) |
---|
817 | AC_OUTPUT |
---|