source: trunk/configure.in @ 2205

Last change on this file since 2205 was 2205, checked in by gah, 10 years ago
File size: 15.0 KB
Line 
1
2AC_INIT([Rappture],[1.1],[rappture@nanohub.org])
3dnl AC_CONFIG_HEADER(src/core/RpConfig.h)
4AC_CONFIG_AUX_DIR(cf)
5AC_CONFIG_HEADER(src/core/config.h)
6
7with_tclsh=yes
8rp_with_tclsh="yes"
9rp_with_mkoctfile2="no"
10rp_with_mkoctfile3="no"
11rp_with_octave="yes"
12rp_with_vtk="yes"
13rp_with_matlab="yes"
14rp_with_perl="yes"
15rp_with_python="yes"
16rp_with_ruby="yes"
17rp_with_java="yes"
18with_install="yes"
19
20#------------------------------------------------------------------------
21# Handle the --prefix=... option
22#------------------------------------------------------------------------
23
24if test "${prefix}" = "NONE"; then
25    prefix=/usr/local
26fi
27if test "${exec_prefix}" = "NONE"; then
28    exec_prefix=$prefix
29fi
30
31AC_ARG_WITH(
32    [install],
33    [AS_HELP_STRING([--with-install[=DIR]],
34        [location of installation @<:@default=yes@:>@])],
35    [],
36    [with_install=yes])
37if test "$with_install" != "yes"; then
38    INSTALL_PREFIX=$with_install
39else
40    INSTALL_PREFIX=$prefix
41fi
42
43
44if test "${libdir}" != "${prefix}/lib"; then
45    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
46else
47    LIB_SEARCH_DIRS="-L${libdir}"
48fi
49
50
51AC_PROG_INSTALL
52AC_PROG_INSTALL
53AC_PROG_RANLIB
54AC_PROG_LN_S
55AC_PROG_MKDIR_P
56AC_PROG_MAKE_SET
57
58# Check for C, C++, and FORTRAN
59AC_PROG_CC
60AC_PROG_CXX
61# Avoid g95
62AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
63
64AC_LANG([C])
65
66AC_HEADER_STDC
67AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
68
69AC_LANG([C++])
70
71AC_CHECK_FUNCS([sysinfo])
72AC_CHECK_HEADERS(sys/sysinfo.h)
73
74AC_CHECK_LIB(m, main,,AC_MSG_ERROR(librappture requires libm))
75AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
76AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
77AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
78AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
79AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
80AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
81AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
82AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
83AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
84AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
85AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
86AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
87AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
88AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
89AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
90AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
91
92AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
93AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
94AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
95AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
96AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
97AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
98AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
99AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
100AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
101dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
102AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
103AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
104AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
105
106AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?))
107if test "${ac_cv_header_inttypes_h}" = "yes" ; then
108  HAVE_INTTYPES_H=1
109else
110  HAVE_INTTYPES_H=0
111fi
112
113
114SC_CONFIG_CFLAGS
115
116make_command=""
117for m in "$MAKE" make gmake gnumake ; do
118  if test "x${m}" != "x" ; then
119    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
120      make_command=$m; break;
121    fi
122  fi
123done
124if test "x${make_command}" = "x" ; then
125  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
126fi
127
128AC_ARG_ENABLE(
129    [gui],
130    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
131    [],
132    [enable_gui=yes])
133
134ENABLE_GUI=
135if test "$enable_gui" != "no" ; then
136    ENABLE_GUI="yes"
137fi
138
139TCL_VERSION="8.4"
140for dir in \
141 ${exec_prefix} \
142 ${exec_prefix}/lib ; do
143  tclconfig="${dir}/tclConfig.sh"
144  if test -f "$tclconfig" ; then
145    . $tclconfig
146    break
147  fi
148done
149
150
151AC_ARG_WITH(
152    [tclsh],
153    [AS_HELP_STRING([--with-tclsh[=DIR]],
154        [location of tclsh @<:@default=yes@:>@])],
155    [rp_with_tclsh=$withval],
156    [rp_with_tclsh=yes])
157
158TCLSH=""
159if test "${rp_with_tclsh}" != "no" ; then
160  tclsh="tclsh${TCL_VERSION}"
161  if test "${rp_with_tclsh}" = "yes" ; then
162    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${exec_prefix}/bin:${PATH}])
163  else
164    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${rp_with_tclsh}/bin:${rp_with_tclsh}])
165  fi
166  if test "x${TCLSH}" = "x" ; then
167    AC_ERROR([can't find tclsh])
168  fi
169fi
170
171 
172TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
173
174
175AC_ARG_WITH(
176    [vtk],
177    [AS_HELP_STRING([--with-vtk[=DIR]],
178        [location of vtk library @<:@default=yes@:>@])],
179    [rp_with_vtk=$withval], [rp_with_vtk=yes])
180
181AC_MSG_CHECKING([for vtk])
182VTKDIR=""
183
184if test "$rp_with_vtk" != "no" ; then
185  if test "$rp_with_vtk" = "yes" ; then
186    for path in \
187     $libdir \
188     $prefix/lib \
189     $exec_prefix/lib \
190     /usr/lib
191    do
192      for vtk in $path/vtk-* ; do
193        if test -d "${vtk}" ; then
194          VTKDIR=${vtk}
195        fi
196      done
197      if test "x${VTKDIR}" != "x" ; then
198        break
199      fi
200    done
201  fi
202fi
203AC_MSG_RESULT([$VTKDIR])
204
205RP_LANG_MATLAB
206RP_LANG_OCTAVE
207RP_LANG_PERL
208RP_LANG_PYTHON
209RP_LANG_JAVA
210
211rp_with_ruby="yes"
212
213RUBY=""
214RUBY_DEV_PKG="no"
215
216AC_ARG_WITH(
217    [ruby],
218    [AS_HELP_STRING([--with-ruby=DIR], [location of ruby @<:@default=yes@:>@])],
219    [rp_with_ruby=$withval])
220
221if test "${rp_with_ruby}" != "no" ; then
222  if test "${rp_with_ruby}" = "yes" ; then
223    AC_PATH_PROG(RUBY, ruby)
224  else
225    AC_PATH_PROG(RUBY, ruby, [], [${rp_with_ruby}/bin:${rp_with_ruby}])
226  fi
227fi
228
229RUBY_VERSION_RV=
230RUBY_PLATFORM=
231if test "x${RUBY}" != "x" ; then
232  AX_PROG_RUBY_VERSION
233  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
234  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
235  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
236  if test -z "$ac_mkmf_result"; then
237    HAVE_RUBY_DEVEL="yes"
238    AX_RUBY_DEV_FLAGS([${RUBY}])
239  fi
240fi
241
242
243RP_BASE=`pwd`
244
245SC_ENABLE_SHARED
246
247#--------------------------------------------------------------------
248# This macro figures out what flags to use with the compiler/linker
249# when building shared/static debug/optimized objects.  This information
250# is all taken from the tclConfig.sh file.
251#--------------------------------------------------------------------
252
253
254if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
255  . ${exec_prefix}/lib/tclConfig.sh
256fi
257if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
258  . ${exec_prefix}/lib/tkConfig.sh
259fi
260
261# -----------------------------------------------------------------------
262#
263# Compiler characteristics:
264#   Check for existence of types of size_t and pid_t
265#
266# -----------------------------------------------------------------------
267
268AC_C_BIGENDIAN
269AC_CHECK_SIZEOF(int)
270AC_CHECK_SIZEOF(long)
271AC_CHECK_SIZEOF(long long)
272AC_CHECK_SIZEOF(void *)
273
274SIZEOF_LONG="${ac_cv_sizeof_long}"
275SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
276SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
277SIZEOF_INT="${ac_cv_sizeof_int}"
278
279
280#--------------------------------------------------------------------
281# Set the default compiler switches based on the --enable-symbols
282# option.
283#--------------------------------------------------------------------
284
285SC_ENABLE_SYMBOLS
286
287
288#--------------------------------------------------------------------
289# search for ffmpeg libraries libavcodec, libavformat, libswscale
290#--------------------------------------------------------------------
291
292AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
293[[#define __STDC_CONSTANT_MACROS 1
294  #ifdef HAVE_FFMPEG_AVCODEC_H
295  # include <ffmpeg/avcodec.h>
296  #endif
297]])
298
299AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
300[[#define __STDC_CONSTANT_MACROS 1
301  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
302  # include <libavcodec/avcodec.h>
303  #endif
304]])
305
306AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
307[[#define __STDC_CONSTANT_MACROS 1
308  #ifdef HAVE_FFMPEG_AVFORMAT_H
309  # include <ffmpeg/avformat.h>
310  #endif
311]])
312
313AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
314[[#define __STDC_CONSTANT_MACROS 1
315  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
316  # include <libavformat/avformat.h>
317  #endif
318]])
319
320AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
321[[#define __STDC_CONSTANT_MACROS 1
322  #ifdef HAVE_FFMPEG_AVUTIL_H
323  # include <ffmpeg/avutil.h>
324  #endif
325]])
326
327AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
328[[#define __STDC_CONSTANT_MACROS 1
329  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
330  # include <libavutil/avutil.h>
331  #endif
332]])
333
334AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
335[[#define __STDC_CONSTANT_MACROS 1
336  #ifdef HAVE_FFMPEG_SWSCALE_H
337  # include <ffmpeg/swscale.h>
338  #endif
339]])
340
341AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
342[[#define __STDC_CONSTANT_MACROS 1
343  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
344  # include <libswscale/swscale.h>
345  #endif
346]])
347
348HAVE_FFMPEG_LIBS=""
349if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
350        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
351     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
352        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
353     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
354        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
355     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
356        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
357  HAVE_FFMPEG_LIBS="yes"
358  AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
359else
360  HAVE_FFMPEG_LIBS=""
361fi
362
363AC_CHECK_FUNCS(img_convert)
364AC_CHECK_FUNCS(sws_scale)
365
366AC_SUBST(CFLAGS_DEBUG)
367AC_SUBST(CFLAGS_OPTIMIZE)
368AC_SUBST(ENABLE_GUI)
369AC_SUBST(HAVE_FFMPEG_LIBS)
370AC_SUBST(HAVE_INTTYPES_H)
371AC_SUBST(HAVE_RUBY_DEVEL)
372AC_SUBST(INSTALL_PREFIX)
373AC_SUBST(JAVA)
374AC_SUBST(JAVAC)
375AC_SUBST(JAVAH)
376AC_SUBST(JAVA_HOME)
377AC_SUBST(JAVA_INC_DIR)
378AC_SUBST(JAVA_INC_SPEC)
379AC_SUBST(LIB_SEARCH_DIRS)
380AC_SUBST(MAKE, ${make_command})
381AC_SUBST(MATLAB)
382AC_SUBST(MCC)
383AC_SUBST(MEX)
384AC_SUBST(MEXEXT)
385AC_SUBST(MEX_ARCH)
386AC_SUBST(MKOCTFILE2)
387AC_SUBST(MKOCTFILE3)
388AC_SUBST(OCTAVE_VERSION)
389AC_SUBST(OCTAVE_VERSION_MAJOR)
390AC_SUBST(PERL)
391AC_SUBST(PERL_ARCHLIB)
392AC_SUBST(PERL_ARCHLIBEXP)
393AC_SUBST(PERL_CCFLAGS)
394AC_SUBST(PERL_CPPFLAGS)
395AC_SUBST(PERL_INCLUDES)
396AC_SUBST(PERL_INSTALLARCHLIB)
397AC_SUBST(PERL_LIBSPEC)
398AC_SUBST(PERL_PRIVLIB)
399AC_SUBST(PERL_VENDORLIB)
400AC_SUBST(PERL_VERSION)
401AC_SUBST(PERL_VERSION_RV)
402AC_SUBST(PYTHON)
403AC_SUBST(PYTHON_CFLAGS)
404AC_SUBST(PYTHON_DISTUTILS)
405AC_SUBST(PYTHON_INCDIR)
406AC_SUBST(PYTHON_INCLUDES)
407AC_SUBST(PYTHON_LDFLAGS)
408AC_SUBST(PYTHON_LIB)
409AC_SUBST(PYTHON_LIBDIR)
410AC_SUBST(PYTHON_SITE_DIR)
411AC_SUBST(PYTHON_SITE_PACKAGES)
412AC_SUBST(PYTHON_VERSION)
413AC_SUBST(RP_BASE)
414AC_SUBST(RUBY)
415AC_SUBST(RUBY_PLATFORM)
416AC_SUBST(RUBY_VERSION_RV)
417AC_SUBST(SHLIB_CFLAGS)
418AC_SUBST(SHLIB_LD)
419AC_SUBST(SHLIB_LDFLAGS)
420AC_SUBST(SHLIB_SUFFIX)
421AC_SUBST(SIZEOF_INT)
422AC_SUBST(SIZEOF_LONG)
423AC_SUBST(SIZEOF_LONG_LONG)
424AC_SUBST(SIZEOF_VOID_P)
425AC_SUBST(STLIB_LD)
426AC_SUBST(TCLSH)
427AC_SUBST(TCL_INC_SPEC)
428AC_SUBST(TCL_LIB_SPEC)
429AC_SUBST(TCL_VERSION)
430AC_SUBST(TCL_VERSION)
431AC_SUBST(TK_VERSION)
432AC_SUBST(TK_LIB_SPEC)
433AC_SUBST(TK_XLIBSW)
434AC_SUBST(VTKDIR)
435
436ac_configure_args="--disable-threads --enable-shared"
437AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
438
439dnl read Makefile.in and write Makefile
440AC_CONFIG_FILES([
441    Makefile
442    packages/Makefile
443    src/Makefile
444    src/core/Makefile
445    src/core2/Makefile
446    src/objects/Makefile
447    src/objects/RpHash.h
448    gui/Makefile
449    gui/apps/Makefile
450    gui/apps/about
451    gui/apps/encodedata
452    gui/apps/rappture
453    gui/apps/rappture-csh.env
454    gui/apps/rappture.env
455    gui/apps/rappture.use
456    gui/apps/rerun
457    gui/apps/simsim
458    gui/apps/xmldiff
459    gui/pkgIndex.tcl
460    gui/scripts/Makefile
461    gui/src/Makefile
462    builder/Makefile
463    builder/pkgIndex.tcl
464    builder/scripts/Makefile
465    tester/Makefile
466    tester/pkgIndex.tcl
467    tester/scripts/Makefile
468    lang/Makefile
469    lang/java/Makefile
470    lang/java/rappture/Makefile
471    lang/perl/Makefile
472    lang/perl/Makefile.PL
473    lang/python/Makefile
474    lang/python/setup.py
475    lang/matlab/Makefile
476    lang/octave/Makefile
477    lang/octave/octave2/Makefile
478    lang/octave/octave3/Makefile
479    lang/ruby/Makefile
480    lang/ruby/build.rb
481    lang/tcl/Makefile
482    lang/tcl/pkgIndex.tcl
483    lang/tcl/src/Makefile
484    lang/tcl/scripts/Makefile
485    lang/tcl/tests/Makefile
486    lib/Makefile
487    examples/3D/Makefile
488    examples/Makefile
489    examples/app-fermi/2.0/Makefile
490    examples/app-fermi/Makefile
491    examples/app-fermi/cee/Makefile
492    examples/app-fermi/fortran/Makefile
493    examples/app-fermi/java/Makefile
494    examples/app-fermi/matlab/Makefile
495    examples/app-fermi/matlab/compiled/Makefile
496    examples/app-fermi/matlab/uncompiled/Makefile
497    examples/app-fermi/octave/2/Makefile
498    examples/app-fermi/octave/3/Makefile
499    examples/app-fermi/octave/Makefile
500    examples/app-fermi/perl/Makefile
501    examples/app-fermi/python/Makefile
502    examples/app-fermi/ruby/Makefile
503    examples/app-fermi/tcl/Makefile
504    examples/app-fermi/wrapper/Makefile
505    examples/app-fermi/wrapper/cee/Makefile
506    examples/app-fermi/wrapper/perl/Makefile
507    examples/app-fermi/wrapper/python/Makefile
508    examples/app-fermi/wrapper/tcl/Makefile
509    examples/c-example/Makefile
510    examples/canvas/Makefile
511    examples/demo.bash
512    examples/flow/Makefile
513    examples/flow/demo1/Makefile
514    examples/flow/demo2/Makefile
515    examples/flow/demo3/Makefile
516    examples/graph/Makefile
517    examples/objects/Makefile
518    examples/objects/axis/Makefile
519    examples/objects/contour/Makefile
520    examples/objects/curve/Makefile
521    examples/objects/dxWriter/Makefile
522    examples/objects/floatBuffer/Makefile
523    examples/objects/histogram/Makefile
524    examples/objects/library/Makefile
525    examples/objects/number/Makefile
526    examples/objects/path/Makefile
527    examples/objects/plot/Makefile
528    examples/objects/scatter/Makefile
529    examples/objects/string/Makefile
530    examples/objects/tree/Makefile
531    examples/objects/xmlparser/Makefile
532    examples/zoo/Makefile
533    examples/zoo/binary/Makefile
534    examples/zoo/boolean/Makefile
535    examples/zoo/choice/Makefile
536    examples/zoo/cloud/Makefile
537    examples/zoo/cloud/matlab/Makefile
538    examples/zoo/curve/Makefile
539    examples/zoo/enable/Makefile
540    examples/zoo/field/Makefile
541    examples/zoo/group/Makefile
542    examples/zoo/image/Makefile
543    examples/zoo/image/docs/Makefile
544    examples/zoo/image/examples/Makefile
545    examples/zoo/integer/Makefile
546    examples/zoo/integer2/Makefile
547    examples/zoo/loader/Makefile
548    examples/zoo/loader/examples/Makefile
549    examples/zoo/loadrun/Makefile
550    examples/zoo/log/Makefile
551    examples/zoo/note/Makefile
552    examples/zoo/note/docs/Makefile
553    examples/zoo/number/Makefile
554    examples/zoo/number2/Makefile
555    examples/zoo/parallelepiped/Makefile
556    examples/zoo/periodicelement/Makefile
557    examples/zoo/phase/Makefile
558    examples/zoo/sequence/Makefile
559    examples/zoo/sequence/examples/Makefile
560    examples/zoo/string/Makefile
561    examples/zoo/structure/Makefile
562    examples/zoo/structure/examples/Makefile
563    examples/zoo/table/Makefile
564    examples/zoo/unirect2d/Makefile
565    oldtest/Makefile
566    oldtest/src/Makefile
567])
568AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.