source: branches/blt4/configure.in @ 1985

Last change on this file since 1985 was 1973, checked in by gah, 14 years ago
File size: 25.5 KB
Line 
1AC_INIT([Rappture],[1.1],[rappture@nanohub.org])
2dnl AC_CONFIG_HEADER(src/core/RpConfig.h)
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
17if test "${libdir}" != "${prefix}/lib"; then
18    LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}"
19else
20    LIB_SEARCH_DIRS="-L${libdir}"
21fi
22
23AC_SUBST(LIB_SEARCH_DIRS)
24
25AC_PROG_INSTALL
26AC_PROG_INSTALL
27AC_PROG_RANLIB
28AC_PROG_LN_S
29AC_PROG_MKDIR_P
30AC_PROG_MAKE_SET
31
32# Check for C, C++, and FORTRAN
33AC_PROG_CC
34AC_PROG_CXX
35# Avoid g95
36AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32])
37
38AC_LANG([C])
39
40AC_HEADER_STDC
41AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?))
42
43AC_LANG([C++])
44
45AC_CHECK_FUNCS([sysinfo])
46AC_CHECK_HEADERS(sys/sysinfo.h)
47
48AC_CHECK_LIB(m, main,,AC_MSG_ERROR(librappture requires libm))
49AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++))
50AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?))
51AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?))
52AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?))
53AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?))
54AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?))
55AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?))
56AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?))
57AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?))
58AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?))
59AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?))
60AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?))
61AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?))
62AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?))
63AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?))
64AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?))
65
66AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?))
67AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?))
68AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?))
69AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?))
70AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?))
71AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?))
72AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?))
73AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?))
74AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?))
75dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?))
76AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?))
77AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?))
78AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?))
79
80AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?))
81if test "${ac_cv_header_inttypes_h}" = "yes" ; then
82  HAVE_INTTYPES_H=1
83else
84  HAVE_INTTYPES_H=0
85fi
86AC_SUBST(HAVE_INTTYPES_H)
87
88
89SC_CONFIG_CFLAGS
90
91make_command=""
92for m in "$MAKE" make gmake gnumake ; do
93  if test "x${m}" != "x" ; then
94    if  ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then
95      make_command=$m; break;
96    fi
97  fi
98done
99if test "x${make_command}" = "x" ; then
100  AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE])
101fi
102AC_SUBST(MAKE, ${make_command})
103
104AC_ARG_ENABLE(
105    [gui],
106    [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])],
107    [],
108    [enable_gui=yes])
109
110ENABLE_GUI=
111if test "$enable_gui" != "no" ; then
112    ENABLE_GUI="yes"
113fi
114AC_SUBST(ENABLE_GUI)
115
116rp_with_tclsh="yes"
117AC_ARG_WITH(
118    [tclsh],
119    [AS_HELP_STRING([--with-tclsh[=DIR]],
120        [location of tclsh @<:@default=yes@:>@])],
121    [],
122    [rp_with_tclsh=$withval])
123
124TCLSH=
125if test "${rp_with_tclsh}" != "no" ; then
126    AC_MSG_CHECKING([for tclsh])
127    if test -x "${rp_with_tclsh}/bin/tclsh"
128    then
129        echo Found tclsh in ${rp_with_tclsh}/bin/tclsh
130        TCLSH="${rp_with_tclsh}/bin/tclsh"
131    else
132       if test -x "${rp_with_tclsh}"
133        then
134            echo "Found tclsh in ${rp_with_tclsh}"
135            TCLSH="${rp_with_tclsh}"
136        else
137            if test -x "${exec_prefix}/bin/tclsh"
138            then
139                echo Found tclsh in ${exec_prefix}/bin/tclsh
140                TCLSH="${exec_prefix}/bin/tclsh"
141            else
142                for v in 8.4 8.5 8.6 ; do
143                    if test -x "${exec_prefix}/bin/tclsh${v}"
144                    then
145                        echo Found tclsh in ${exec_prefix}/bin/tclsh${v}
146                        TCLSH="${exec_prefix}/bin/tclsh${v}"
147                        break
148                    fi
149                done
150            fi
151        fi
152    fi
153    if ! test -x ${TCLSH}
154    then
155        AC_PATH_PROG(TCLSH, tclsh)
156    fi
157fi
158
159AC_MSG_RESULT([${TCLSH}])
160AC_SUBST(TCLSH)
161
162TCL_VERSION="8.4"
163for dir in \
164 ${exec_prefix} \
165 ${exec_prefix}/lib ; do
166  tclconfig="${dir}/tclConfig.sh"
167  if test -f "$tclconfig" ; then
168    . $tclconfig
169    break
170  fi
171done
172TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
173
174if test "x$rp_with_tcllib" != "x" ; then
175   tclconfig="${rp_with_tcllib}/tclConfig.sh"
176   if test -f "$tclconfig" ; then
177    . $tclconfig
178   fi
179   TCL_LIB_SPEC="-L${rp_with_tcllib} -ltcl${TCL_VERSION}"
180fi
181if test "x$rp_with_tclinclude" != "x" ; then
182   TCL_INC_SPEC="-I${rp_with_tclinclude}"
183fi
184
185AC_SUBST(TCL_VERSION)
186AC_SUBST(TCL_INC_SPEC)
187AC_SUBST(TCL_LIB_SPEC)
188
189AC_ARG_WITH(
190    [vtk],
191    [AS_HELP_STRING([--with-vtk[=DIR]],
192        [location of vtk library @<:@default=yes@:>@])],
193    [rp_with_vtk=$withval], [rp_with_vtk=yes])
194
195AC_MSG_CHECKING([for vtk])
196VTKDIR=""
197
198if test "$rp_with_vtk" != "no" ; then
199  if test "$rp_with_vtk" = "yes" ; then
200    for path in \
201     $libdir \
202     $prefix/lib \
203     $exec_prefix/lib \
204     /usr/lib
205    do
206      for vtk in $path/vtk-* ; do
207        if test -d "${vtk}" ; then
208          VTKDIR=${vtk}
209        fi
210      done
211      if test "x${VTKDIR}" != "x" ; then
212        break
213      fi
214    done
215  fi
216fi
217AC_SUBST(VTKDIR)
218AC_MSG_RESULT([$VTKDIR])
219
220
221AC_ARG_WITH(
222    [matlab],
223    [AS_HELP_STRING([--with-matlab[=DIR]],
224        [location of matlab and mex compiler @<:@default=yes@:>@])],
225    [rp_with_matlab=$withval],
226    [rp_with_matlab=yes])
227
228MCC=""
229MEX=""
230MEX_ARCH=""
231MEXEXT=""
232MATLAB=
233if test "$rp_with_matlab" != "no" ; then
234  if test "$rp_with_matlab" = "yes" ; then
235    AC_PATH_PROG(MATLAB, matlab)
236  else
237    AC_PATH_PROG(MATLAB, matlab, [], [${rp_with_matlab}/bin:${rp_with_matlab}])
238  fi
239fi
240
241if test "x$MATLAB" != "x" ; then
242  # Found matlab.  May be a symlink to the real binary.  Run "matlab -e"
243  # to tell where matlab is installed.
244
245  matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin
246
247  # Now see if we can find "mex" or "mexext" there.
248  AC_PATH_PROG(MEX, mex, [], [${matlab_bindir}])
249  AC_PATH_PROG(MEXEXT, mexext, [], [${matlab_bindir}])
250
251  # Run "mexext" to get the expected module extension for this platform.
252  AC_MSG_CHECKING([for mex extension])
253  if test "x$MEXEXT" != "x" ; then
254    MEXEXT=`$MEXEXT`
255  else
256    MEXEXT="mexglx"
257  fi
258  AC_MSG_RESULT([$MEXEXT])
259  AC_PATH_PROG(MCC, mcc, [], [${matlab_bindir}])
260  AC_MSG_CHECKING([for mcc extension])
261fi
262
263AC_SUBST(MCC)
264AC_SUBST(MEX)
265AC_SUBST(MATLAB)
266AC_SUBST(MEX_ARCH)
267AC_SUBST(MEXEXT)
268
269# Standard octave search (use the installed version of octave)
270AC_ARG_WITH(
271    [octave],
272    [AS_HELP_STRING([--with-octave[=DIR]],
273        [location of octave compiler MKOCTFILE @<:@default=yes@:>@])],
274    [rp_with_octave=$withval],
275    [rp_with_octave=yes])
276
277OCTAVE=
278OCTAVE2=
279OCTAVE3=
280OCTAVE_VERSION=
281OCTAVE_VERSION_MAJOR=
282MKOCTFILE=
283MKOCTFILE2=
284MKOCTFILE3=
285if test "$rp_with_octave" != "no" ; then
286  AC_MSG_CHECKING([for octave and mkoctfile])
287  if test "$rp_with_octave" = "yes" ; then
288    AC_PATH_PROG(OCTAVE, octave)
289    AC_PATH_PROG(MKOCTFILE, mkoctfile)
290  else
291    MKOCTFILE=$rp_with_octave
292    OCTAVE=$rp_with_octave
293  fi
294fi
295if test "x${OCTAVE}" != "x" ; then
296  OCTAVE_VERSION=`${OCTAVE} -v | grep version | cut -d' ' -f4`
297  OCTAVE_VERSION_MAJOR=`echo ${OCTAVE_VERSION} | cut -d'.' -f1`
298  if test "${OCTAVE_VERSION_MAJOR}" == "3" ; then
299    OCTAVE3=$OCTAVE
300    MKOCTFILE3=$MKOCTFILE
301  fi
302  if test "${OCTAVE_VERSION_MAJOR}" == "2" ; then
303    OCTAVE2=$OCTAVE
304    MKOCTFILE2=$MKOCTFILE
305  fi
306fi
307
308# Check if octave2 was designated *in addition* to the installed version.
309AC_ARG_WITH(
310    [octave2],
311    [AS_HELP_STRING([--with-octave2[=DIR]],
312        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
313    [rp_with_octave2=$withval],
314    [rp_with_octave2=no])
315
316if test "$rp_with_octave2" != "no" ; then
317  if test "$rp_with_octave2" = "yes" ; then
318    AC_MSG_CHECKING([for octave and mkoctfile])
319    AC_PATH_PROG(octave2, octave)
320    AC_PATH_PROG(mkoctfile2, mkoctfile)
321  else
322    octave2=$rp_with_octave2
323    mkoctfile2=`dirname $rp_with_octave2`/mkoctfile
324  fi
325fi
326if test "x${octave2}" != "x" ; then
327  version=`${octave2} -v | grep version | cut -d' ' -f4`
328  version_major=`echo ${version} | cut -d'.' -f1`
329  if test "$version_major" = "2" ; then
330    OCTAVE2=$octave2
331    MKOCTFILE2=$mkoctfile2
332  fi
333fi
334
335# Check if octave3 was designated *in addition* to the installed version.
336
337AC_ARG_WITH(
338    [octave3],
339    [AS_HELP_STRING([--with-octave3[=DIR]],
340        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
341    [rp_with_octave3=$withval],
342    [rp_with_octave3=no])
343
344echo rp_with_octave3=$rp_with_octave3
345if test "$rp_with_octave3" != "no" ; then
346  if test "$rp_with_octave3" = "yes" ; then
347    AC_MSG_CHECKING([for octave and mkoctfile])
348    AC_PATH_PROG(octave3, octave)
349    AC_PATH_PROG(mkoctfile3, mkoctfile)
350  else
351    octave3=$rp_with_octave3
352    mkoctfile3=`dirname $rp_with_octave3`/mkoctfile
353  fi
354fi
355
356echo octave3=$octave3
357if test "x${octave3}" != "x" ; then
358  echo version="${octave3} -v | grep version | cut -d' ' -f4"
359  version=`${octave3} -v | grep version | cut -d' ' -f4`
360  echo version=$version
361  version_major=`echo ${version} | cut -d'.' -f1`
362  echo version_major=$version_major
363  if test "$version_major" = "3" ; then
364    OCTAVE3=$rp_with_octave3
365    MKOCTFILE3=$mkoctfile3
366  fi
367fi
368
369AC_SUBST(OCTAVE2)
370AC_SUBST(OCTAVE3)
371AC_SUBST(OCTAVE)
372AC_SUBST(OCTAVE_VERSION)
373AC_SUBST(OCTAVE_VERSION_MAJOR)
374AC_SUBST(MKOCTFILE)
375AC_SUBST(MKOCTFILE2)
376AC_SUBST(MKOCTFILE3)
377
378AC_ARG_WITH(
379    [perl],
380    [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=yes@:>@])],
381    [],
382    [rp_with_perl=yes])
383
384PERL=
385PERL_INCLUDES=
386PERL_ARCHLIB=
387PERL_ARCHLIBEXP=
388PERL_VERSION=
389PERL_VENDORLIB=
390PERL_PRIVLIB=
391PERL_CPPFLAGS=
392PERL_CCFlAGS=
393PERL_VERSION_RV=
394PERL_LIBSPEC=
395if test "$rp_with_perl" != "no" ; then
396  AC_MSG_CHECKING([for perl])
397  if test "$rp_with_perl" != "yes" ; then
398    AC_PATH_PROG(PERL, perl, [], [$rp_with_perl/bin:$rp_with_perl])
399  else
400    AC_PATH_PROG(PERL, perl)
401  fi
402  if test "x${PERL}" != "x" ; then
403    PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'`
404    PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'`
405    PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'`
406    PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'`
407    PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'`
408    PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'`
409    PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'`
410    PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
411    PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
412    echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}"
413
414    # libperl may or may not be installed.  Check for its existence.
415    if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then
416      PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl"
417    fi
418  fi
419fi
420AC_MSG_RESULT([${PERL}])
421AC_SUBST(PERL)
422AC_SUBST(PERL_INCLUDES)
423AC_SUBST(PERL_ARCHLIB)
424AC_SUBST(PERL_ARCHLIBEXP)
425AC_SUBST(PERL_VERSION)
426AC_SUBST(PERL_CCFLAGS)
427AC_SUBST(PERL_CPPFLAGS)
428AC_SUBST(PERL_VENDORLIB)
429AC_SUBST(PERL_PRIVLIB)
430AC_SUBST(PERL_INSTALLARCHLIB)
431AC_SUBST(PERL_VERSION_RV)
432AC_SUBST(PERL_LIBSPEC)
433
434PYTHON=""
435PYTHON_CFLAGS=""
436PYTHON_CPPFLAGS=""
437HAVE_PYTHON_DISTUTILS=""
438PYTHON_INCLUDES=""
439PYTHON_LDFLAGS=""
440PYTHON_LIB=""
441PYTHON_LIBDIR=""
442PYTHON_SITE_DIR=""
443PYTHON_SITE_PACKAGES=""
444PYTHON_VERSION=""
445pythondir=""
446
447AC_ARG_WITH([python],
448    [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=yes@:>@])],
449    [],
450    [rp_with_python=yes])
451
452if test "$rp_with_python" != "no" ; then
453  AC_MSG_CHECKING([for python])
454  if test -x "$rp_with_python/bin/python"; then
455    echo Found python in $rp_with_python/bin/python
456    PYTHON="$rp_with_python/bin/python"
457  elif test -x "$rp_with_python"; then
458    echo Found python in $rp_with_python
459    PYTHON="$rp_with_python"
460  else
461    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
462  fi
463  if test "x${PYTHON}" != "x"; then
464    PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
465    echo Using python version $PYTHON_VERSION
466  fi
467  if test "x${PYTHON_VERSION}" != "x"; then
468    if test -r $rp_with_python/include/python$PYTHON_VERSION/Python.h -a \
469     -d $rp_with_python/lib/python$PYTHON_VERSION/site-packages; then
470      PYTHON_INCLUDES=$rp_with_python/include/python$PYTHON_VERSION
471      PYTHON_SITE_PACKAGES=$rp_with_python/lib/python$PYTHON_VERSION/site-packages
472    else
473      if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
474        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
475        PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
476      else
477        if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
478          PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
479          PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
480        else
481          echo could not find python$PYTHON_VERSION/Python.h
482        fi
483      fi
484      if test ! -d "$PYTHON_SITE_PACKAGES"; then
485        PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
486      fi
487    fi
488  fi
489  if test "x$rp_with_python" != "x" ;  then
490    pythondir='$(PYTHON_SITE_PACKAGES)'
491  else
492    pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
493  fi
494
495  AC_MSG_CHECKING([for python distutils])
496  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
497        build build_ext 2>&1 > /dev/null
498  if test $? = 0 ; then
499    HAVE_PYTHON_DISTUTILS="yes"
500  else
501     HAVE_PYTHON_DISTUTILS="no"
502  fi
503  AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
504
505  if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
506    #
507    # Check for Python include path
508    #
509    AC_MSG_CHECKING([for Python include path])
510    if test "x${PYTHON_CPPFLAGS}" = "x"; then
511      incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
512       print distutils.sysconfig.get_python_inc();"`
513      if test -n "${incdir}"; then
514        python_path="-I${incdir}"
515      fi
516      PYTHON_CPPFLAGS=$python_path
517    fi
518    AC_MSG_RESULT([$PYTHON_CPPFLAGS])
519    AC_SUBST([PYTHON_CPPFLAGS])
520    #
521    # python distutils found, get settings from python directly
522    #
523    AC_MSG_CHECKING([location of site-packages])
524    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
525
526    PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print \" \".join(flags);'`"
527    PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print \" \".join(libs);'`"
528    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
529    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
530  fi
531fi 
532AC_SUBST(pythondir)
533
534AC_SUBST(PYTHON)
535AC_SUBST(PYTHON_VERSION)
536AC_SUBST(PYTHON_INCLUDES)
537AC_SUBST(PYTHON_SITE_PACKAGES)
538AC_SUBST(HAVE_PYTHON_DISTUTILS)
539
540rp_with_ruby="yes"
541
542RUBY=""
543RUBY_DEV_PKG="no"
544
545AC_ARG_WITH(
546    [ruby],
547    [AS_HELP_STRING([--with-ruby=DIR], [location of ruby @<:@default=yes@:>@])],
548    [rp_with_ruby=$withval])
549
550if test "${rp_with_ruby}" != "no" ; then
551  if test "${rp_with_ruby}" = "yes" ; then
552    AC_PATH_PROG(RUBY, ruby)
553  else
554    AC_PATH_PROG(RUBY, ruby, [], [${rp_with_ruby}/bin:${rp_with_ruby}])
555  fi
556fi
557AC_SUBST(RUBY)
558
559RUBY_VERSION_RV=
560RUBY_PLATFORM=
561if test "x${RUBY}" != "x" ; then
562  AX_PROG_RUBY_VERSION
563  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
564  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
565  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
566  if test -z "$ac_mkmf_result"; then
567    HAVE_RUBY_DEVEL="yes"
568    AX_RUBY_DEV_FLAGS([${RUBY}])
569  fi
570fi
571AC_SUBST(HAVE_RUBY_DEVEL)
572AC_SUBST(RUBY_VERSION_RV)
573AC_SUBST(RUBY_PLATFORM)
574
575rp_with_java="yes"
576JAVA=""
577JAVAH=""
578JAVAC=""
579JAVA_DEV_PKG="no"
580AC_ARG_WITH(
581    [java],
582    [AS_HELP_STRING([--with-java=DIR], [location of java @<:@default=yes@:>@])],
583    [rp_with_java=$withval])
584
585if test "${rp_with_java}" != "no" ; then
586  if test "${rp_with_java}" = "yes" ; then
587    AC_PATH_PROG(JAVA,  java)
588    AC_PATH_PROG(JAVAC, javac)
589    AC_PATH_PROG(JAVAH, javah)
590  else
591    AC_PATH_PROG(JAVA,  java,  [], [${rp_with_java}/bin:${rp_with_java}])
592    AC_PATH_PROG(JAVAC, javac, [], [${rp_with_java}/bin:${rp_with_java}])
593    AC_PATH_PROG(JAVAH, javah, [], [${rp_with_java}/bin:${rp_with_java}])
594  fi
595fi
596JDK=
597JAVA_HOME=
598JAVA_INC_DIR=
599JAVA_INC_SPEC=
600
601# If java exists, let's look for the jni.h file.
602if test "x${JAVA}" != "x" ; then
603  for d in \
604   /apps/java/jdk1.6.0_01 \
605   /usr/lib/jvm/*sun-1.6* \
606   /opt/sun-jdk-1.6* \
607   /opt/icedtea6-* \
608   /opt/sun-jdk-1.5* \
609   /usr/lib/jvm/*sun-1.5*
610  do
611    if test -r "${d}/include/jni.h" ; then
612      JDK=${d}
613      break;
614    fi
615  done
616  JAVA_HOME=$JDK
617  JAVA_INC_DIR=${JDK}/include
618  JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
619fi
620
621AC_SUBST(JAVA)
622AC_SUBST(JAVAC)
623AC_SUBST(JAVAH)
624AC_SUBST(JAVA_HOME)
625AC_SUBST(JAVA_INC_DIR)
626AC_SUBST(JAVA_INC_SPEC)
627
628RP_BASE=`pwd`
629AC_SUBST(RP_BASE)
630
631SC_ENABLE_SHARED
632
633#--------------------------------------------------------------------
634# This macro figures out what flags to use with the compiler/linker
635# when building shared/static debug/optimized objects.  This information
636# is all taken from the tclConfig.sh file.
637#--------------------------------------------------------------------
638
639AC_SUBST(CFLAGS_DEBUG)
640AC_SUBST(CFLAGS_OPTIMIZE)
641AC_SUBST(STLIB_LD)
642AC_SUBST(SHLIB_LD)
643AC_SUBST(SHLIB_CFLAGS)
644AC_SUBST(SHLIB_LDFLAGS)
645AC_SUBST(SHLIB_SUFFIX)
646
647if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
648  . ${exec_prefix}/lib/tclConfig.sh
649fi
650if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
651  . ${exec_prefix}/lib/tkConfig.sh
652fi
653AC_SUBST(TCL_VERSION)
654AC_SUBST(TK_VERSION)
655
656# -----------------------------------------------------------------------
657#
658# Compiler characteristics:
659#   Check for existence of types of size_t and pid_t
660#
661# -----------------------------------------------------------------------
662
663AC_C_BIGENDIAN
664AC_CHECK_SIZEOF(int)
665AC_CHECK_SIZEOF(long)
666AC_CHECK_SIZEOF(long long)
667AC_CHECK_SIZEOF(void *)
668
669SIZEOF_LONG="${ac_cv_sizeof_long}"
670SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
671SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
672SIZEOF_INT="${ac_cv_sizeof_int}"
673AC_SUBST(SIZEOF_INT)
674AC_SUBST(SIZEOF_LONG)
675AC_SUBST(SIZEOF_LONG_LONG)
676AC_SUBST(SIZEOF_VOID_P)
677
678
679#--------------------------------------------------------------------
680# Set the default compiler switches based on the --enable-symbols
681# option.
682#--------------------------------------------------------------------
683
684SC_ENABLE_SYMBOLS
685
686
687#--------------------------------------------------------------------
688# search for ffmpeg libraries libavcodec, libavformat, libswscale
689#--------------------------------------------------------------------
690
691AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
692[[#define __STDC_CONSTANT_MACROS 1
693  #ifdef HAVE_FFMPEG_AVCODEC_H
694  # include <ffmpeg/avcodec.h>
695  #endif
696]])
697
698AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
699[[#define __STDC_CONSTANT_MACROS 1
700  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
701  # include <libavcodec/avcodec.h>
702  #endif
703]])
704
705AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
706[[#define __STDC_CONSTANT_MACROS 1
707  #ifdef HAVE_FFMPEG_AVFORMAT_H
708  # include <ffmpeg/avformat.h>
709  #endif
710]])
711
712AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
713[[#define __STDC_CONSTANT_MACROS 1
714  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
715  # include <libavformat/avformat.h>
716  #endif
717]])
718
719AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
720[[#define __STDC_CONSTANT_MACROS 1
721  #ifdef HAVE_FFMPEG_AVUTIL_H
722  # include <ffmpeg/avutil.h>
723  #endif
724]])
725
726AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
727[[#define __STDC_CONSTANT_MACROS 1
728  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
729  # include <libavutil/avutil.h>
730  #endif
731]])
732
733AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
734[[#define __STDC_CONSTANT_MACROS 1
735  #ifdef HAVE_FFMPEG_SWSCALE_H
736  # include <ffmpeg/swscale.h>
737  #endif
738]])
739
740AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
741[[#define __STDC_CONSTANT_MACROS 1
742  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
743  # include <libswscale/swscale.h>
744  #endif
745]])
746
747HAVE_FFMPEG_LIBS=""
748if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
749        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
750     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
751        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
752     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
753        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
754     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
755        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
756  HAVE_FFMPEG_LIBS="yes"
757  AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
758else
759  HAVE_FFMPEG_LIBS=""
760fi
761
762AC_CHECK_FUNCS(img_convert)
763AC_CHECK_FUNCS(sws_scale)
764AC_SUBST(HAVE_FFMPEG_LIBS)
765
766ac_configure_args="--disable-threads --enable-shared"
767AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
768
769dnl read Makefile.in and write Makefile
770AC_CONFIG_FILES([
771    Makefile
772    packages/Makefile
773    src/Makefile
774    src/core/Makefile
775    src/core2/Makefile
776    src/objects/Makefile
777    src/objects/RpHash.h
778    gui/Makefile
779    gui/apps/Makefile
780    gui/apps/about
781    gui/apps/encodedata
782    gui/apps/rappture
783    gui/apps/rappture-csh.env
784    gui/apps/rappture.env
785    gui/apps/rappture.use
786    gui/apps/rerun
787    gui/apps/simsim
788    gui/apps/xmldiff
789    gui/pkgIndex.tcl
790    gui/scripts/Makefile
791    instant/Makefile
792    instant/irappture
793    lang/Makefile
794    lang/java/Makefile
795    lang/java/rappture/Makefile
796    lang/perl/Makefile
797    lang/perl/Makefile.PL
798    lang/python/Makefile
799    lang/python/setup.py
800    lang/matlab/Makefile
801    lang/octave/Makefile
802    lang/octave/octave2/Makefile
803    lang/octave/octave3/Makefile
804    lang/ruby/Makefile
805    lang/ruby/build.rb
806    lang/tcl/Makefile
807    lang/tcl/pkgIndex.tcl
808    lang/tcl/src/Makefile
809    lang/tcl/scripts/Makefile
810    lang/tcl/tests/Makefile
811    lib/Makefile
812    examples/3D/Makefile
813    examples/Makefile
814    examples/app-fermi/2.0/Makefile
815    examples/app-fermi/Makefile
816    examples/app-fermi/cee/Makefile
817    examples/app-fermi/fortran/Makefile
818    examples/app-fermi/java/Makefile
819    examples/app-fermi/matlab/Makefile
820    examples/app-fermi/matlab/compiled/Makefile
821    examples/app-fermi/matlab/uncompiled/Makefile
822    examples/app-fermi/octave/Makefile
823    examples/app-fermi/octave/2/Makefile
824    examples/app-fermi/octave/3/Makefile
825    examples/app-fermi/perl/Makefile
826    examples/app-fermi/python/Makefile
827    examples/app-fermi/ruby/Makefile
828    examples/app-fermi/tcl/Makefile
829    examples/app-fermi/wrapper/Makefile
830    examples/app-fermi/wrapper/cee/Makefile
831    examples/app-fermi/wrapper/perl/Makefile
832    examples/app-fermi/wrapper/python/Makefile
833    examples/app-fermi/wrapper/tcl/Makefile
834    examples/c-example/Makefile
835    examples/canvas/Makefile
836    examples/demo.bash
837    examples/flow/Makefile
838    examples/flow/demo1/Makefile
839    examples/flow/demo2/Makefile
840    examples/flow/demo3/Makefile
841    examples/graph/Makefile
842    examples/objects/Makefile
843    examples/objects/axis/Makefile
844    examples/objects/contour/Makefile
845    examples/objects/curve/Makefile
846    examples/objects/dxWriter/Makefile
847    examples/objects/floatBuffer/Makefile
848    examples/objects/histogram/Makefile
849    examples/objects/library/Makefile
850    examples/objects/number/Makefile
851    examples/objects/path/Makefile
852    examples/objects/plot/Makefile
853    examples/objects/scatter/Makefile
854    examples/objects/string/Makefile
855    examples/objects/tree/Makefile
856    examples/objects/xmlparser/Makefile
857    examples/zoo/Makefile
858    examples/zoo/binary/Makefile
859    examples/zoo/boolean/Makefile
860    examples/zoo/choice/Makefile
861    examples/zoo/cloud/Makefile
862    examples/zoo/cloud/matlab/Makefile
863    examples/zoo/curve/Makefile
864    examples/zoo/datatable/Makefile
865    examples/zoo/datatable/matlab/Makefile
866    examples/zoo/enable/Makefile
867    examples/zoo/field/Makefile
868    examples/zoo/filechoice/Makefile
869    examples/zoo/group/Makefile
870    examples/zoo/image/Makefile
871    examples/zoo/image/docs/Makefile
872    examples/zoo/image/examples/Makefile
873    examples/zoo/integer/Makefile
874    examples/zoo/integer2/Makefile
875    examples/zoo/loader/Makefile
876    examples/zoo/loader/examples/Makefile
877    examples/zoo/loadrun/Makefile
878    examples/zoo/log/Makefile
879    examples/zoo/note/Makefile
880    examples/zoo/note/docs/Makefile
881    examples/zoo/number/Makefile
882    examples/zoo/number2/Makefile
883    examples/zoo/periodicelement/Makefile
884    examples/zoo/parallelepiped/Makefile
885    examples/zoo/phase/Makefile
886    examples/zoo/sequence/Makefile
887    examples/zoo/sequence/examples/Makefile
888    examples/zoo/string/Makefile
889    examples/zoo/structure/Makefile
890    examples/zoo/structure/examples/Makefile
891    examples/zoo/table/Makefile
892    examples/zoo/unirect2d/Makefile
893    test/Makefile
894    test/src/Makefile
895])
896AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.