source: trunk/configure.in @ 2310

Last change on this file since 2310 was 2310, checked in by gah, 12 years ago

update from trunk

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