source: trunk/configure.in @ 2709

Last change on this file since 2709 was 2709, checked in by dkearney, 12 years ago

adding R bindings with app-fermi example.

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