source: trunk/configure.in @ 2549

Last change on this file since 2549 was 2324, checked in by gah, 13 years ago

added histogram example

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