source: trunk/configure.in @ 3277

Last change on this file since 3277 was 3277, checked in by gah, 11 years ago

fixes for 1.9 ruby build

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