source: branches/blt4/configure.in @ 2549

Last change on this file since 2549 was 2416, checked in by gah, 13 years ago
File size: 15.1 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
7with_tclsh=yes
8
9#------------------------------------------------------------------------
10# Handle the --prefix=... option
11#------------------------------------------------------------------------
12
13if test "${prefix}" = "NONE"; then
14    prefix=/usr/local
15fi
16if test "${exec_prefix}" = "NONE"; then
17    exec_prefix=$prefix
18fi
19
20AC_ARG_WITH(
21    [install],
22    [AS_HELP_STRING([--with-install[=DIR]],
23        [location of installation @<:@default=yes@:>@])],
24    [],
25    [with_install=yes])
26if test "$with_install" != "yes"; then
27    INSTALL_PREFIX=$with_install
28else
29    INSTALL_PREFIX=$prefix
30fi
31
32
33if test "${libdir}" != "${prefix}/lib"; then
34    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
35else
36    LIB_SEARCH_DIRS="-L${libdir}"
37fi
38
39
40AC_PROG_INSTALL
41AC_PROG_INSTALL
42AC_PROG_RANLIB
43AC_PROG_LN_S
44AC_PROG_MKDIR_P
45AC_PROG_MAKE_SET
46
47# Check for C, C++, and FORTRAN
48AC_PROG_CC
49AC_PROG_CXX
50# Avoid g95
51AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
52
53AC_LANG([C])
54
55AC_HEADER_STDC
56AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
57
58AC_LANG([C++])
59
60AC_CHECK_FUNCS([sysinfo])
61AC_CHECK_HEADERS(sys/sysinfo.h)
62
63AC_CHECK_LIB(m, main,,AC_MSG_ERROR(librappture requires libm))
64AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
65AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
66AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
67AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
68AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
69AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
70AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
71AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
72AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
73AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
74AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
75AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
76AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
77AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
78AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
79AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
80
81AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
82AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
83AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
84AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
85AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
86AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
87AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
88AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
89AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
90dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
91AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
92AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
93AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
94
95AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?))
96if test "${ac_cv_header_inttypes_h}" = "yes" ; then
97  HAVE_INTTYPES_H=1
98else
99  HAVE_INTTYPES_H=0
100fi
101
102
103SC_CONFIG_CFLAGS
104
105make_command=""
106for m in "$MAKE" make gmake gnumake ; do
107  if test "x${m}" != "x" ; then
108    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
109      make_command=$m; break;
110    fi
111  fi
112done
113if test "x${make_command}" = "x" ; then
114  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
115fi
116
117AC_ARG_ENABLE(
118    [gui],
119    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
120    [],
121    [enable_gui=yes])
122
123ENABLE_GUI=
124if test "$enable_gui" != "no" ; then
125    ENABLE_GUI="yes"
126fi
127
128TCL_VERSION="8.4"
129for dir in \
130 ${exec_prefix} \
131 ${exec_prefix}/lib ; do
132  tclconfig="${dir}/tclConfig.sh"
133  if test -f "$tclconfig" ; then
134    . $tclconfig
135    break
136  fi
137done
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
169AC_ARG_WITH(
170    [vtk],
171    [AS_HELP_STRING([--with-vtk[=DIR]],
172        [location of vtk library @<:@default=yes@:>@])],
173    [],
174    [with_vtk=yes])
175
176AC_MSG_CHECKING([for vtk])
177VTKDIR=""
178
179if test "$with_vtk" != "no" ; then
180  if test "$with_vtk" = "yes" ; then
181    for path in \
182     $libdir \
183     $prefix/lib \
184     $exec_prefix/lib \
185     /usr/lib
186    do
187      for vtk in $path/vtk-* ; do
188        if test -d "${vtk}" ; then
189          VTKDIR=${vtk}
190        fi
191      done
192      if test "x${VTKDIR}" != "x" ; then
193        break
194      fi
195    done
196  fi
197fi
198AC_MSG_RESULT([$VTKDIR])
199
200RP_LANG_MATLAB
201RP_LANG_OCTAVE
202RP_LANG_PERL
203RP_LANG_PYTHON
204RP_LANG_JAVA
205
206RUBY=""
207RUBY_DEV_PKG="no"
208
209AC_ARG_WITH(
210    [ruby],
211    [AS_HELP_STRING([--with-ruby=DIR], [location of ruby @<:@default=yes@:>@])],
212    [],
213    [with_ruby="yes"])
214
215if test "${with_ruby}" != "no" ; then
216  if test "${with_ruby}" = "yes" ; then
217    AC_PATH_PROG(RUBY, ruby)
218  else
219    AC_PATH_PROG(RUBY, ruby, [], [${with_ruby}/bin:${with_ruby}])
220  fi
221fi
222
223RUBY_VERSION_RV=
224RUBY_PLATFORM=
225if test "x${RUBY}" != "x" ; then
226  AX_PROG_RUBY_VERSION
227  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
228  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
229  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
230  if test -z "$ac_mkmf_result"; then
231    HAVE_RUBY_DEVEL="yes"
232    AX_RUBY_DEV_FLAGS([${RUBY}])
233  fi
234fi
235
236
237RP_BASE=`pwd`
238
239SC_ENABLE_SHARED
240
241#--------------------------------------------------------------------
242# This macro figures out what flags to use with the compiler/linker
243# when building shared/static debug/optimized objects.  This information
244# is all taken from the tclConfig.sh file.
245#--------------------------------------------------------------------
246
247if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
248  . ${exec_prefix}/lib/tclConfig.sh
249fi
250if test -f "${exec_prefix}/lib/tkConfig.sh" ; then
251  . ${exec_prefix}/lib/tkConfig.sh
252fi
253
254# -----------------------------------------------------------------------
255#
256# Compiler characteristics:
257#   Check for existence of types of size_t and pid_t
258#
259# -----------------------------------------------------------------------
260
261AC_C_BIGENDIAN
262AC_CHECK_SIZEOF(int)
263AC_CHECK_SIZEOF(long)
264AC_CHECK_SIZEOF(long long)
265AC_CHECK_SIZEOF(void *)
266
267SIZEOF_LONG="${ac_cv_sizeof_long}"
268SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
269SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
270SIZEOF_INT="${ac_cv_sizeof_int}"
271
272
273#--------------------------------------------------------------------
274# Set the default compiler switches based on the --enable-symbols
275# option.
276#--------------------------------------------------------------------
277
278SC_ENABLE_SYMBOLS
279
280
281#--------------------------------------------------------------------
282# search for ffmpeg libraries libavcodec, libavformat, libswscale
283#--------------------------------------------------------------------
284
285AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
286[[#define __STDC_CONSTANT_MACROS 1
287  #ifdef HAVE_FFMPEG_AVCODEC_H
288  # include <ffmpeg/avcodec.h>
289  #endif
290]])
291
292AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
293[[#define __STDC_CONSTANT_MACROS 1
294  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
295  # include <libavcodec/avcodec.h>
296  #endif
297]])
298
299AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
300[[#define __STDC_CONSTANT_MACROS 1
301  #ifdef HAVE_FFMPEG_AVFORMAT_H
302  # include <ffmpeg/avformat.h>
303  #endif
304]])
305
306AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
307[[#define __STDC_CONSTANT_MACROS 1
308  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
309  # include <libavformat/avformat.h>
310  #endif
311]])
312
313AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
314[[#define __STDC_CONSTANT_MACROS 1
315  #ifdef HAVE_FFMPEG_AVUTIL_H
316  # include <ffmpeg/avutil.h>
317  #endif
318]])
319
320AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
321[[#define __STDC_CONSTANT_MACROS 1
322  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
323  # include <libavutil/avutil.h>
324  #endif
325]])
326
327AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
328[[#define __STDC_CONSTANT_MACROS 1
329  #ifdef HAVE_FFMPEG_SWSCALE_H
330  # include <ffmpeg/swscale.h>
331  #endif
332]])
333
334AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
335[[#define __STDC_CONSTANT_MACROS 1
336  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
337  # include <libswscale/swscale.h>
338  #endif
339]])
340
341HAVE_FFMPEG_LIBS=""
342if test "${with_ffmpeg}" != "no"; then
343  if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
344        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
345     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
346        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
347     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
348        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
349     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
350        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
351    HAVE_FFMPEG_LIBS="yes"
352    AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
353  fi
354fi
355
356AC_CHECK_FUNCS(img_convert)
357AC_CHECK_FUNCS(sws_scale)
358
359AC_SUBST(CFLAGS_DEBUG)
360AC_SUBST(CFLAGS_OPTIMIZE)
361AC_SUBST(ENABLE_GUI)
362AC_SUBST(HAVE_FFMPEG_LIBS)
363AC_SUBST(HAVE_INTTYPES_H)
364AC_SUBST(HAVE_RUBY_DEVEL)
365AC_SUBST(INSTALL_PREFIX)
366AC_SUBST(JAVA)
367AC_SUBST(JAVAC)
368AC_SUBST(JAVAH)
369AC_SUBST(JAVA_HOME)
370AC_SUBST(JAVA_INC_DIR)
371AC_SUBST(JAVA_INC_SPEC)
372AC_SUBST(LIB_SEARCH_DIRS)
373AC_SUBST(MAKE, ${make_command})
374AC_SUBST(MATLAB)
375AC_SUBST(MCC)
376AC_SUBST(MEX)
377AC_SUBST(MEXEXT)
378AC_SUBST(MEX_ARCH)
379AC_SUBST(MKOCTFILE2)
380AC_SUBST(MKOCTFILE3)
381AC_SUBST(OCTAVE_VERSION)
382AC_SUBST(OCTAVE_VERSION_MAJOR)
383AC_SUBST(PERL)
384AC_SUBST(PERL_ARCHLIB)
385AC_SUBST(PERL_ARCHLIBEXP)
386AC_SUBST(PERL_CCFLAGS)
387AC_SUBST(PERL_CPPFLAGS)
388AC_SUBST(PERL_INCLUDES)
389AC_SUBST(PERL_INSTALLARCHLIB)
390AC_SUBST(PERL_LIBSPEC)
391AC_SUBST(PERL_PRIVLIB)
392AC_SUBST(PERL_VENDORLIB)
393AC_SUBST(PERL_VERSION)
394AC_SUBST(PERL_VERSION_RV)
395AC_SUBST(PYTHON)
396AC_SUBST(PYTHON_CFLAGS)
397AC_SUBST(PYTHON_DISTUTILS)
398AC_SUBST(PYTHON_INCDIR)
399AC_SUBST(PYTHON_INCLUDES)
400AC_SUBST(PYTHON_LDFLAGS)
401AC_SUBST(PYTHON_LIB)
402AC_SUBST(PYTHON_LIBDIR)
403AC_SUBST(PYTHON_SITE_DIR)
404AC_SUBST(PYTHON_SITE_PACKAGES)
405AC_SUBST(PYTHON_VERSION)
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/ruby/Makefile
475    lang/ruby/build.rb
476    lang/tcl/Makefile
477    lang/tcl/pkgIndex.tcl
478    lang/tcl/src/Makefile
479    lang/tcl/scripts/Makefile
480    lang/tcl/tests/Makefile
481    lib/Makefile
482    examples/3D/Makefile
483    examples/Makefile
484    examples/app-fermi/2.0/Makefile
485    examples/app-fermi/Makefile
486    examples/app-fermi/cee/Makefile
487    examples/app-fermi/fortran/Makefile
488    examples/app-fermi/java/Makefile
489    examples/app-fermi/matlab/Makefile
490    examples/app-fermi/matlab/compiled/Makefile
491    examples/app-fermi/matlab/uncompiled/Makefile
492    examples/app-fermi/octave/octave2/Makefile
493    examples/app-fermi/octave/octave3/Makefile
494    examples/app-fermi/octave/Makefile
495    examples/app-fermi/perl/Makefile
496    examples/app-fermi/python/Makefile
497    examples/app-fermi/ruby/Makefile
498    examples/app-fermi/tcl/Makefile
499    examples/app-fermi/wrapper/Makefile
500    examples/app-fermi/wrapper/cee/Makefile
501    examples/app-fermi/wrapper/perl/Makefile
502    examples/app-fermi/wrapper/python/Makefile
503    examples/app-fermi/wrapper/tcl/Makefile
504    examples/c-example/Makefile
505    examples/canvas/Makefile
506    examples/demo.bash
507    examples/flow/Makefile
508    examples/flow/demo1/Makefile
509    examples/flow/demo2/Makefile
510    examples/flow/demo3/Makefile
511    examples/graph/Makefile
512    examples/objects/Makefile
513    examples/objects/axis/Makefile
514    examples/objects/contour/Makefile
515    examples/objects/curve/Makefile
516    examples/objects/dxWriter/Makefile
517    examples/objects/floatBuffer/Makefile
518    examples/objects/histogram/Makefile
519    examples/objects/library/Makefile
520    examples/objects/number/Makefile
521    examples/objects/path/Makefile
522    examples/objects/plot/Makefile
523    examples/objects/scatter/Makefile
524    examples/objects/string/Makefile
525    examples/objects/tree/Makefile
526    examples/objects/xmlparser/Makefile
527    examples/zoo/Makefile
528    examples/zoo/binary/Makefile
529    examples/zoo/boolean/Makefile
530    examples/zoo/choice/Makefile
531    examples/zoo/cloud/Makefile
532    examples/zoo/cloud/matlab/Makefile
533    examples/zoo/curve/Makefile
534    examples/zoo/datatable/Makefile
535    examples/zoo/datatable/matlab/Makefile
536    examples/zoo/enable/Makefile
537    examples/zoo/field/Makefile
538    examples/zoo/filechoice/Makefile
539    examples/zoo/group/Makefile
540    examples/zoo/histogram/Makefile
541    examples/zoo/image/Makefile
542    examples/zoo/image/docs/Makefile
543    examples/zoo/image/examples/Makefile
544    examples/zoo/integer/Makefile
545    examples/zoo/integer2/Makefile
546    examples/zoo/loader/Makefile
547    examples/zoo/loader/examples/Makefile
548    examples/zoo/loadrun/Makefile
549    examples/zoo/log/Makefile
550    examples/zoo/note/Makefile
551    examples/zoo/note/docs/Makefile
552    examples/zoo/number/Makefile
553    examples/zoo/number2/Makefile
554    examples/zoo/parallelepiped/Makefile
555    examples/zoo/periodicelement/Makefile
556    examples/zoo/phase/Makefile
557    examples/zoo/sequence/Makefile
558    examples/zoo/sequence/examples/Makefile
559    examples/zoo/string/Makefile
560    examples/zoo/structure/Makefile
561    examples/zoo/structure/examples/Makefile
562    examples/zoo/table/Makefile
563    examples/zoo/unirect2d/Makefile
564    oldtest/Makefile
565    oldtest/src/Makefile
566])
567AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.