source: branches/blt4/configure.in @ 2679

Last change on this file since 2679 was 2679, checked in by gah, 12 years ago
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
203
204RUBY=""
205RUBY_DEV_PKG="no"
206
207AC_ARG_WITH(
208    [ruby],
209    [AS_HELP_STRING([--with-ruby=DIR], [location of ruby @<:@default=yes@:>@])],
210    [],
211    [with_ruby="yes"])
212
213if test "${with_ruby}" != "no" ; then
214  if test "${with_ruby}" = "yes" ; then
215    AC_PATH_PROG(RUBY, ruby)
216  else
217    AC_PATH_PROG(RUBY, ruby, [], [${with_ruby}/bin:${with_ruby}])
218  fi
219fi
220
221RUBY_VERSION_RV=
222RUBY_PLATFORM=
223if test "x${RUBY}" != "x" ; then
224  AX_PROG_RUBY_VERSION
225  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
226  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
227  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
228  if test -z "$ac_mkmf_result"; then
229    HAVE_RUBY_DEVEL="yes"
230    AX_RUBY_DEV_FLAGS([${RUBY}])
231  fi
232fi
233
234
235RP_BASE=`pwd`
236
237SC_ENABLE_SHARED
238
239#--------------------------------------------------------------------
240# This macro figures out what flags to use with the compiler/linker
241# when building shared/static debug/optimized objects.  This information
242# is all taken from the tclConfig.sh file.
243#--------------------------------------------------------------------
244
245if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
246  . ${exec_prefix}/lib/tclConfig.sh
247fi
248if test -f "${exec_prefix}/lib/tkConfig.sh" ; then
249  . ${exec_prefix}/lib/tkConfig.sh
250fi
251
252# -----------------------------------------------------------------------
253#
254# Compiler characteristics:
255#   Check for existence of types of size_t and pid_t
256#
257# -----------------------------------------------------------------------
258
259AC_C_BIGENDIAN
260AC_CHECK_SIZEOF(int)
261AC_CHECK_SIZEOF(long)
262AC_CHECK_SIZEOF(long long)
263AC_CHECK_SIZEOF(void *)
264
265SIZEOF_LONG="${ac_cv_sizeof_long}"
266SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
267SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
268SIZEOF_INT="${ac_cv_sizeof_int}"
269
270
271#--------------------------------------------------------------------
272# Set the default compiler switches based on the --enable-symbols
273# option.
274#--------------------------------------------------------------------
275
276SC_ENABLE_SYMBOLS
277
278
279#--------------------------------------------------------------------
280# search for ffmpeg libraries libavcodec, libavformat, libswscale
281#--------------------------------------------------------------------
282
283AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
284[[#define __STDC_CONSTANT_MACROS 1
285  #ifdef HAVE_FFMPEG_AVCODEC_H
286  # include <ffmpeg/avcodec.h>
287  #endif
288]])
289
290AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
291[[#define __STDC_CONSTANT_MACROS 1
292  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
293  # include <libavcodec/avcodec.h>
294  #endif
295]])
296
297AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
298[[#define __STDC_CONSTANT_MACROS 1
299  #ifdef HAVE_FFMPEG_AVFORMAT_H
300  # include <ffmpeg/avformat.h>
301  #endif
302]])
303
304AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
305[[#define __STDC_CONSTANT_MACROS 1
306  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
307  # include <libavformat/avformat.h>
308  #endif
309]])
310
311AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
312[[#define __STDC_CONSTANT_MACROS 1
313  #ifdef HAVE_FFMPEG_AVUTIL_H
314  # include <ffmpeg/avutil.h>
315  #endif
316]])
317
318AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
319[[#define __STDC_CONSTANT_MACROS 1
320  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
321  # include <libavutil/avutil.h>
322  #endif
323]])
324
325AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
326[[#define __STDC_CONSTANT_MACROS 1
327  #ifdef HAVE_FFMPEG_SWSCALE_H
328  # include <ffmpeg/swscale.h>
329  #endif
330]])
331
332AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
333[[#define __STDC_CONSTANT_MACROS 1
334  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
335  # include <libswscale/swscale.h>
336  #endif
337]])
338
339HAVE_FFMPEG_LIBS=""
340if test "${with_ffmpeg}" != "no"; then
341  if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
342        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
343     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
344        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
345     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
346        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
347     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
348        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
349    HAVE_FFMPEG_LIBS="yes"
350    AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
351  fi
352fi
353
354AC_CHECK_FUNCS(img_convert)
355AC_CHECK_FUNCS(sws_scale)
356
357AC_SUBST(CFLAGS_DEBUG)
358AC_SUBST(CFLAGS_OPTIMIZE)
359AC_SUBST(ENABLE_GUI)
360AC_SUBST(HAVE_FFMPEG_LIBS)
361AC_SUBST(HAVE_INTTYPES_H)
362AC_SUBST(HAVE_RUBY_DEVEL)
363AC_SUBST(INSTALL_PREFIX)
364AC_SUBST(JAVA)
365AC_SUBST(JAVAC)
366AC_SUBST(JAVAH)
367AC_SUBST(JAVA_HOME)
368AC_SUBST(JAVA_INC_DIR)
369AC_SUBST(JAVA_INC_SPEC)
370AC_SUBST(LIB_SEARCH_DIRS)
371AC_SUBST(MAKE, ${make_command})
372AC_SUBST(MATLAB)
373AC_SUBST(MCC)
374AC_SUBST(MEX)
375AC_SUBST(MEXEXT)
376AC_SUBST(MEX_ARCH)
377AC_SUBST(MKOCTFILE2)
378AC_SUBST(MKOCTFILE3)
379AC_SUBST(OCTAVE_VERSION)
380AC_SUBST(OCTAVE_VERSION_MAJOR)
381AC_SUBST(PERL)
382AC_SUBST(PERL_ARCHLIB)
383AC_SUBST(PERL_ARCHLIBEXP)
384AC_SUBST(PERL_CCFLAGS)
385AC_SUBST(PERL_CPPFLAGS)
386AC_SUBST(PERL_INCLUDES)
387AC_SUBST(PERL_INSTALLARCHLIB)
388AC_SUBST(PERL_LIBSPEC)
389AC_SUBST(PERL_PRIVLIB)
390AC_SUBST(PERL_VENDORLIB)
391AC_SUBST(PERL_VERSION)
392AC_SUBST(PERL_VERSION_RV)
393AC_SUBST(PYTHON)
394AC_SUBST(PYTHON_CFLAGS)
395AC_SUBST(PYTHON_DISTUTILS)
396AC_SUBST(PYTHON_INCDIR)
397AC_SUBST(PYTHON_INCLUDES)
398AC_SUBST(PYTHON_LDFLAGS)
399AC_SUBST(PYTHON_LIB)
400AC_SUBST(PYTHON_LIBDIR)
401AC_SUBST(PYTHON_SITE_DIR)
402AC_SUBST(PYTHON_SITE_PACKAGES)
403AC_SUBST(PYTHON_VERSION)
404AC_SUBST(RP_BASE)
405AC_SUBST(RUBY)
406AC_SUBST(RUBY_PLATFORM)
407AC_SUBST(RUBY_VERSION_RV)
408AC_SUBST(SHLIB_CFLAGS)
409AC_SUBST(SHLIB_LD)
410AC_SUBST(SHLIB_LDFLAGS)
411AC_SUBST(SHLIB_SUFFIX)
412AC_SUBST(SIZEOF_INT)
413AC_SUBST(SIZEOF_LONG)
414AC_SUBST(SIZEOF_LONG_LONG)
415AC_SUBST(SIZEOF_VOID_P)
416AC_SUBST(STLIB_LD)
417AC_SUBST(TCLSH)
418AC_SUBST(TCL_INC_SPEC)
419AC_SUBST(TCL_LIB_SPEC)
420AC_SUBST(TCL_VERSION)
421AC_SUBST(TCL_VERSION)
422AC_SUBST(TK_INC_SPEC)
423AC_SUBST(TK_LIB_SPEC)
424AC_SUBST(TK_XLIBSW)
425AC_SUBST(TK_VERSION)
426AC_SUBST(VTKDIR)
427AC_SUBST(XSUBPP)
428
429ac_configure_args="--disable-threads --enable-shared"
430AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
431
432dnl read Makefile.in and write Makefile
433AC_CONFIG_FILES([
434    Makefile
435    packages/Makefile
436    src/Makefile
437    src/core/Makefile
438    src/core2/Makefile
439    src/objects/Makefile
440    src/objects/RpHash.h
441    gui/Makefile
442    gui/apps/Makefile
443    gui/apps/about
444    gui/apps/encodedata
445    gui/apps/rappture
446    gui/apps/rappture-csh.env
447    gui/apps/rappture.env
448    gui/apps/rappture.use
449    gui/apps/rerun
450    gui/apps/simsim
451    gui/apps/xmldiff
452    gui/pkgIndex.tcl
453    gui/scripts/Makefile
454    gui/src/Makefile
455    builder/Makefile
456    builder/pkgIndex.tcl
457    builder/scripts/Makefile
458    tester/Makefile
459    tester/pkgIndex.tcl
460    tester/scripts/Makefile
461    lang/Makefile
462    lang/java/Makefile
463    lang/java/rappture/Makefile
464    lang/perl/Makefile
465    lang/perl/Makefile.PL
466    lang/python/Makefile
467    lang/python/setup.py
468    lang/matlab/Makefile
469    lang/octave/Makefile
470    lang/octave/octave2/Makefile
471    lang/octave/octave3/Makefile
472    lang/ruby/Makefile
473    lang/ruby/build.rb
474    lang/tcl/Makefile
475    lang/tcl/pkgIndex.tcl
476    lang/tcl/src/Makefile
477    lang/tcl/scripts/Makefile
478    lang/tcl/tests/Makefile
479    lib/Makefile
480    examples/3D/Makefile
481    examples/Makefile
482    examples/app-fermi/2.0/Makefile
483    examples/app-fermi/Makefile
484    examples/app-fermi/cee/Makefile
485    examples/app-fermi/fortran/Makefile
486    examples/app-fermi/java/Makefile
487    examples/app-fermi/matlab/Makefile
488    examples/app-fermi/matlab/compiled/Makefile
489    examples/app-fermi/matlab/uncompiled/Makefile
490    examples/app-fermi/octave/octave2/Makefile
491    examples/app-fermi/octave/octave3/Makefile
492    examples/app-fermi/octave/Makefile
493    examples/app-fermi/perl/Makefile
494    examples/app-fermi/python/Makefile
495    examples/app-fermi/ruby/Makefile
496    examples/app-fermi/tcl/Makefile
497    examples/app-fermi/wrapper/Makefile
498    examples/app-fermi/wrapper/cee/Makefile
499    examples/app-fermi/wrapper/perl/Makefile
500    examples/app-fermi/wrapper/python/Makefile
501    examples/app-fermi/wrapper/tcl/Makefile
502    examples/c-example/Makefile
503    examples/canvas/Makefile
504    examples/demo.bash
505    examples/flow/Makefile
506    examples/flow/demo1/Makefile
507    examples/flow/demo2/Makefile
508    examples/flow/demo3/Makefile
509    examples/graph/Makefile
510    examples/objects/Makefile
511    examples/objects/axis/Makefile
512    examples/objects/contour/Makefile
513    examples/objects/curve/Makefile
514    examples/objects/dxWriter/Makefile
515    examples/objects/floatBuffer/Makefile
516    examples/objects/histogram/Makefile
517    examples/objects/library/Makefile
518    examples/objects/number/Makefile
519    examples/objects/path/Makefile
520    examples/objects/plot/Makefile
521    examples/objects/scatter/Makefile
522    examples/objects/string/Makefile
523    examples/objects/tree/Makefile
524    examples/objects/xmlparser/Makefile
525    examples/zoo/Makefile
526    examples/zoo/binary/Makefile
527    examples/zoo/boolean/Makefile
528    examples/zoo/choice/Makefile
529    examples/zoo/cloud/Makefile
530    examples/zoo/cloud/matlab/Makefile
531    examples/zoo/curve/Makefile
532    examples/zoo/datatable/Makefile
533    examples/zoo/datatable/matlab/Makefile
534    examples/zoo/enable/Makefile
535    examples/zoo/field/Makefile
536    examples/zoo/filechoice/Makefile
537    examples/zoo/group/Makefile
538    examples/zoo/histogram/Makefile
539    examples/zoo/image/Makefile
540    examples/zoo/image/docs/Makefile
541    examples/zoo/image/examples/Makefile
542    examples/zoo/integer/Makefile
543    examples/zoo/integer2/Makefile
544    examples/zoo/loader/Makefile
545    examples/zoo/loader/examples/Makefile
546    examples/zoo/loadrun/Makefile
547    examples/zoo/log/Makefile
548    examples/zoo/note/Makefile
549    examples/zoo/note/docs/Makefile
550    examples/zoo/number/Makefile
551    examples/zoo/number2/Makefile
552    examples/zoo/parallelepiped/Makefile
553    examples/zoo/periodicelement/Makefile
554    examples/zoo/phase/Makefile
555    examples/zoo/sequence/Makefile
556    examples/zoo/sequence/examples/Makefile
557    examples/zoo/string/Makefile
558    examples/zoo/structure/Makefile
559    examples/zoo/structure/examples/Makefile
560    examples/zoo/table/Makefile
561    examples/zoo/unirect2d/Makefile
562    oldtest/Makefile
563    oldtest/src/Makefile
564])
565AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.