source: trunk/configure.in @ 2663

Last change on this file since 2663 was 2663, checked in by gah, 12 years ago
File size: 14.9 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
137
138AC_ARG_WITH(
139    [ffmpeg],
140    [AS_HELP_STRING([--with-ffmpeg[=DIR]],
141      [location of ffmpeg @<:@default=yes@:>@])],
142    [],
143    [with_ffmpeg=yes])
144
145AC_ARG_WITH(
146    [tclsh],
147    [AS_HELP_STRING([--with-tclsh[=DIR]],
148        [location of tclsh @<:@default=yes@:>@])],
149    [],
150    [with_tclsh=yes])
151
152TCLSH=""
153if test "${with_tclsh}" != "no" ; then
154  tclsh="tclsh${TCL_VERSION}"
155  if test "${with_tclsh}" = "yes" ; then
156    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${exec_prefix}/bin:${PATH}])
157  else
158    AC_PATH_PROG(TCLSH, ${tclsh}, [], [${with_tclsh}/bin:${with_tclsh}])
159  fi
160  if test "x${TCLSH}" = "x" ; then
161    AC_ERROR([can't find tclsh])
162  fi
163fi
164
165 
166TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
167
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
247
248if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
249  . ${exec_prefix}/lib/tclConfig.sh
250fi
251if test -f "${exec_prefix}/lib/tkConfig.sh" ; then
252  . ${exec_prefix}/lib/tkConfig.sh
253fi
254
255# -----------------------------------------------------------------------
256#
257# Compiler characteristics:
258#   Check for existence of types of size_t and pid_t
259#
260# -----------------------------------------------------------------------
261
262AC_C_BIGENDIAN
263AC_CHECK_SIZEOF(int)
264AC_CHECK_SIZEOF(long)
265AC_CHECK_SIZEOF(long long)
266AC_CHECK_SIZEOF(void *)
267
268SIZEOF_LONG="${ac_cv_sizeof_long}"
269SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
270SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
271SIZEOF_INT="${ac_cv_sizeof_int}"
272
273
274#--------------------------------------------------------------------
275# Set the default compiler switches based on the --enable-symbols
276# option.
277#--------------------------------------------------------------------
278
279SC_ENABLE_SYMBOLS
280
281
282#--------------------------------------------------------------------
283# search for ffmpeg libraries libavcodec, libavformat, libswscale
284#--------------------------------------------------------------------
285
286AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
287[[#define __STDC_CONSTANT_MACROS 1
288  #ifdef HAVE_FFMPEG_AVCODEC_H
289  # include <ffmpeg/avcodec.h>
290  #endif
291]])
292
293AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
294[[#define __STDC_CONSTANT_MACROS 1
295  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
296  # include <libavcodec/avcodec.h>
297  #endif
298]])
299
300AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
301[[#define __STDC_CONSTANT_MACROS 1
302  #ifdef HAVE_FFMPEG_AVFORMAT_H
303  # include <ffmpeg/avformat.h>
304  #endif
305]])
306
307AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
308[[#define __STDC_CONSTANT_MACROS 1
309  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
310  # include <libavformat/avformat.h>
311  #endif
312]])
313
314AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
315[[#define __STDC_CONSTANT_MACROS 1
316  #ifdef HAVE_FFMPEG_AVUTIL_H
317  # include <ffmpeg/avutil.h>
318  #endif
319]])
320
321AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
322[[#define __STDC_CONSTANT_MACROS 1
323  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
324  # include <libavutil/avutil.h>
325  #endif
326]])
327
328AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
329[[#define __STDC_CONSTANT_MACROS 1
330  #ifdef HAVE_FFMPEG_SWSCALE_H
331  # include <ffmpeg/swscale.h>
332  #endif
333]])
334
335AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
336[[#define __STDC_CONSTANT_MACROS 1
337  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
338  # include <libswscale/swscale.h>
339  #endif
340]])
341
342HAVE_FFMPEG_LIBS=""
343if test "${with_ffmpeg}" != "no"; then
344  if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
345        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
346     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
347        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
348     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
349        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
350     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
351        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
352    HAVE_FFMPEG_LIBS="yes"
353    AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
354  fi
355fi
356
357AC_CHECK_FUNCS(img_convert)
358AC_CHECK_FUNCS(sws_scale)
359
360AC_SUBST(CFLAGS_DEBUG)
361AC_SUBST(CFLAGS_OPTIMIZE)
362AC_SUBST(ENABLE_GUI)
363AC_SUBST(HAVE_FFMPEG_LIBS)
364AC_SUBST(HAVE_INTTYPES_H)
365AC_SUBST(HAVE_RUBY_DEVEL)
366AC_SUBST(INSTALL_PREFIX)
367AC_SUBST(JAVA)
368AC_SUBST(JAVAC)
369AC_SUBST(JAVAH)
370AC_SUBST(JAVA_HOME)
371AC_SUBST(JAVA_INC_DIR)
372AC_SUBST(JAVA_INC_SPEC)
373AC_SUBST(LIB_SEARCH_DIRS)
374AC_SUBST(MAKE, ${make_command})
375AC_SUBST(MATLAB)
376AC_SUBST(MCC)
377AC_SUBST(MEX)
378AC_SUBST(MEXEXT)
379AC_SUBST(MEX_ARCH)
380AC_SUBST(MKOCTFILE2)
381AC_SUBST(MKOCTFILE3)
382AC_SUBST(OCTAVE_VERSION)
383AC_SUBST(OCTAVE_VERSION_MAJOR)
384AC_SUBST(PERL)
385AC_SUBST(PERL_ARCHLIB)
386AC_SUBST(PERL_ARCHLIBEXP)
387AC_SUBST(PERL_CCFLAGS)
388AC_SUBST(PERL_CPPFLAGS)
389AC_SUBST(PERL_INCLUDES)
390AC_SUBST(PERL_INSTALLARCHLIB)
391AC_SUBST(PERL_LIBSPEC)
392AC_SUBST(PERL_PRIVLIB)
393AC_SUBST(PERL_VENDORLIB)
394AC_SUBST(PERL_VERSION)
395AC_SUBST(PERL_VERSION_RV)
396AC_SUBST(PYTHON)
397AC_SUBST(PYTHON_CFLAGS)
398AC_SUBST(PYTHON_DISTUTILS)
399AC_SUBST(PYTHON_INCDIR)
400AC_SUBST(PYTHON_INCLUDES)
401AC_SUBST(PYTHON_LDFLAGS)
402AC_SUBST(PYTHON_LIB)
403AC_SUBST(PYTHON_LIBDIR)
404AC_SUBST(PYTHON_SITE_DIR)
405AC_SUBST(PYTHON_SITE_PACKAGES)
406AC_SUBST(PYTHON_VERSION)
407AC_SUBST(RP_BASE)
408AC_SUBST(RUBY)
409AC_SUBST(RUBY_PLATFORM)
410AC_SUBST(RUBY_VERSION_RV)
411AC_SUBST(SHLIB_CFLAGS)
412AC_SUBST(SHLIB_LD)
413AC_SUBST(SHLIB_LDFLAGS)
414AC_SUBST(SHLIB_SUFFIX)
415AC_SUBST(SIZEOF_INT)
416AC_SUBST(SIZEOF_LONG)
417AC_SUBST(SIZEOF_LONG_LONG)
418AC_SUBST(SIZEOF_VOID_P)
419AC_SUBST(STLIB_LD)
420AC_SUBST(TCLSH)
421AC_SUBST(TCL_INC_SPEC)
422AC_SUBST(TCL_LIB_SPEC)
423AC_SUBST(TCL_VERSION)
424AC_SUBST(TCL_VERSION)
425AC_SUBST(TK_INC_SPEC)
426AC_SUBST(TK_LIB_SPEC)
427AC_SUBST(TK_XLIBSW)
428AC_SUBST(TK_VERSION)
429AC_SUBST(VTKDIR)
430AC_SUBST(XSUBPP)
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.