source: trunk/configure.in @ 1873

Last change on this file since 1873 was 1873, checked in by dkearney, 14 years ago

adding video viewing widget. this requires ffmpeg and libav* friends. if the libs are not available, the widget won't be built

File size: 25.4 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
116with_tclsh="yes"
117AC_ARG_WITH(
118    [tclsh],
119    [AS_HELP_STRING([--with-tclsh[=DIR]],
120        [location of tclsh @<:@default=yes@:>@])],
121    [],
122    [with_tclsh=yes])
123
124TCLSH=
125if test "$with_tclsh" != "no" ; then
126    AC_MSG_CHECKING([for tclsh])
127    if test -x "$with_tclsh/bin/tclsh"
128    then
129        echo Found tclsh in $with_tclsh/bin/tclsh
130        TCLSH="$with_tclsh/bin/tclsh"
131    else
132       if test -x "$with_tclsh"
133        then
134            echo Found tclsh in $with_tclsh
135            TCLSH="$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$with_tcllib" != "x" ; then
175   tclconfig="${with_tcllib}/tclConfig.sh"
176   if test -f "$tclconfig" ; then
177    . $tclconfig
178   fi
179   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
180fi
181if test "x$with_tclinclude" != "x" ; then
182   TCL_INC_SPEC="-I${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    [with_vtk=$withval], [with_vtk=yes])
194
195AC_MSG_CHECKING([for vtk])
196VTKDIR=""
197
198if test "$with_vtk" != "no" ; then
199  if test "$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    [with_matlab=$withval],
226    [with_matlab=yes])
227
228MCC=""
229MEX=""
230MEX_ARCH=""
231MEXEXT=""
232MATLAB=
233if test "$with_matlab" != "no" ; then
234  if test "$with_matlab" = "yes" ; then
235    AC_PATH_PROG(MATLAB, matlab)
236  else
237    AC_PATH_PROG(MATLAB, matlab, [], [${with_matlab}/bin:${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    [with_octave=$withval],
275    [with_octave=yes])
276
277OCTAVE=
278OCTAVE2=
279OCTAVE3=
280OCTAVE_VERSION=
281OCTAVE_VERSION_MAJOR=
282MKOCTFILE=
283MKOCTFILE2=
284MKOCTFILE3=
285if test "$with_octave" != "no" ; then
286  AC_MSG_CHECKING([for octave and mkoctfile])
287  if test "$with_octave" = "yes" ; then
288    AC_PATH_PROG(OCTAVE, octave)
289    AC_PATH_PROG(MKOCTFILE, mkoctfile)
290  else
291    AC_PATH_PROG(OCTAVE, octave, [], [$with_octave/bin:$with_octave])
292    AC_PATH_PROG(MKOCTFILE, mkoctfile, [],
293        [${with_octave}/bin/mkoctfile:${with_octave}])
294  fi
295  if 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
306  fi
307fi
308
309# Check if octave2 was designated *in addition* to the installed version.
310AC_ARG_WITH(
311    [octave2],
312    [AS_HELP_STRING([--with-octave2[=DIR]],
313        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
314    [with_octave2=$withval],
315    [with_octave2=no])
316
317if test "$with_octave2" != "no" ; then
318  AC_MSG_CHECKING([for octave and mkoctfile])
319  AC_PATH_PROG(octave2, octave, [], [$with_octave2/bin:$with_octave2])
320  AC_PATH_PROG(mkoctfile, mkoctfile, [],
321        [${with_octave2}/bin/mkoctfile:${with_octave2}])
322  if test "x${octave2}" != "x" ; then
323    version=`${octave2} -v | grep version | cut -d' ' -f4`
324    version_major=`echo ${version} | cut -d'.' -f1`
325    if test "$version_major" = "2" ; then
326      OCTAVE2=$octave2
327      MKOCTFILE2=$mkoctfile2
328    fi
329  fi
330fi
331# Check if octave3 was designated *in addition* to the installed version.
332AC_ARG_WITH(
333    [octave3],
334    [AS_HELP_STRING([--with-octave3[=DIR]],
335        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
336    [with_octave3=$withval],
337    [with_octave3=no])
338if test "$with_octave3" != "no" ; then
339  AC_MSG_CHECKING([for octave and mkoctfile])
340  AC_PATH_PROG(octave3, octave, [], [$with_octave3/bin:$with_octave3])
341  AC_PATH_PROG(mkoctfile3, mkoctfile, [],
342        [${with_octave3}/bin/mkoctfile:${with_octave3}])
343  if test "x${octave3}" != "x" ; then
344    version=`${octave3} -v | grep version | cut -d' ' -f4`
345    version_major=`echo ${version} | cut -d'.' -f1`
346    if test "$version_major" = "3" ; then
347      OCTAVE3=$octave3
348      MKOCTFILE3=$mkoctfile3
349    fi
350  fi
351fi
352
353AC_SUBST(OCTAVE2)
354AC_SUBST(OCTAVE3)
355AC_SUBST(OCTAVE)
356AC_SUBST(OCTAVE_VERSION)
357AC_SUBST(OCTAVE_VERSION_MAJOR)
358AC_SUBST(MKOCTFILE)
359AC_SUBST(MKOCTFILE2)
360AC_SUBST(MKOCTFILE3)
361
362AC_ARG_WITH(
363    [perl],
364    [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=yes@:>@])],
365    [],
366    [with_perl=yes])
367
368PERL=
369PERL_INCLUDES=
370PERL_ARCHLIB=
371PERL_ARCHLIBEXP=
372PERL_VERSION=
373PERL_VENDORLIB=
374PERL_PRIVLIB=
375PERL_CPPFLAGS=
376PERL_CCFlAGS=
377PERL_VERSION_RV=
378PERL_LIBSPEC=
379if test "$with_perl" != "no" ; then
380  AC_MSG_CHECKING([for perl])
381  if test "$with_perl" != "yes" ; then
382    AC_PATH_PROG(PERL, perl, [], [$with_perl/bin:$with_perl])
383  else
384    AC_PATH_PROG(PERL, perl)
385  fi
386  if test "x${PERL}" != "x" ; then
387    PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'`
388    PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'`
389    PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'`
390    PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'`
391    PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'`
392    PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'`
393    PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'`
394    PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
395    PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
396    echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}"
397
398    # libperl may or may not be installed.  Check for its existence.
399    if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then
400      PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl"
401    fi
402  fi
403fi
404AC_MSG_RESULT([${PERL}])
405AC_SUBST(PERL)
406AC_SUBST(PERL_INCLUDES)
407AC_SUBST(PERL_ARCHLIB)
408AC_SUBST(PERL_ARCHLIBEXP)
409AC_SUBST(PERL_VERSION)
410AC_SUBST(PERL_CCFLAGS)
411AC_SUBST(PERL_CPPFLAGS)
412AC_SUBST(PERL_VENDORLIB)
413AC_SUBST(PERL_PRIVLIB)
414AC_SUBST(PERL_INSTALLARCHLIB)
415AC_SUBST(PERL_VERSION_RV)
416AC_SUBST(PERL_LIBSPEC)
417
418PYTHON=""
419PYTHON_CFLAGS=""
420PYTHON_CPPFLAGS=""
421HAVE_PYTHON_DISTUTILS=""
422PYTHON_INCLUDES=""
423PYTHON_LDFLAGS=""
424PYTHON_LIB=""
425PYTHON_LIBDIR=""
426PYTHON_SITE_DIR=""
427PYTHON_SITE_PACKAGES=""
428PYTHON_VERSION=""
429pythondir=""
430
431AC_ARG_WITH([python],
432    [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=yes@:>@])],
433    [],
434    [with_python=yes])
435
436if test "$with_python" != "no" ; then
437  AC_MSG_CHECKING([for python])
438  if test -x "$with_python/bin/python"; then
439    echo Found python in $with_python/bin/python
440    PYTHON="$with_python/bin/python"
441  elif test -x "$with_python"; then
442    echo Found python in $with_python
443    PYTHON="$with_python"
444  else
445    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
446  fi
447  if test "x${PYTHON}" != "x"; then
448    PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
449    echo Using python version $PYTHON_VERSION
450  fi
451  if test "x${PYTHON_VERSION}" != "x"; then
452    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
453     -d $with_python/lib/python$PYTHON_VERSION/site-packages; then
454      PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
455      PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
456    else
457      if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
458        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
459        PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
460      else
461        if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
462          PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
463          PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
464        else
465          echo could not find python$PYTHON_VERSION/Python.h
466        fi
467      fi
468      if test ! -d "$PYTHON_SITE_PACKAGES"; then
469        PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
470      fi
471    fi
472  fi
473  if test "x$with_python" != "x" ;  then
474    pythondir='$(PYTHON_SITE_PACKAGES)'
475  else
476    pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
477  fi
478
479  AC_MSG_CHECKING([for python distutils])
480  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
481        build build_ext 2>&1 > /dev/null
482  if test $? = 0 ; then
483    HAVE_PYTHON_DISTUTILS="yes"
484  else
485     HAVE_PYTHON_DISTUTILS="no"
486  fi
487  AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
488
489  if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
490    #
491    # Check for Python include path
492    #
493    AC_MSG_CHECKING([for Python include path])
494    if test "x${PYTHON_CPPFLAGS}" = "x"; then
495      incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
496       print distutils.sysconfig.get_python_inc();"`
497      if test -n "${incdir}"; then
498        python_path="-I${incdir}"
499      fi
500      PYTHON_CPPFLAGS=$python_path
501    fi
502    AC_MSG_RESULT([$PYTHON_CPPFLAGS])
503    AC_SUBST([PYTHON_CPPFLAGS])
504    #
505    # python distutils found, get settings from python directly
506    #
507    AC_MSG_CHECKING([location of site-packages])
508    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
509
510    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);'`"
511    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);'`"
512    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
513    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
514  fi
515fi 
516AC_SUBST(pythondir)
517
518AC_SUBST(PYTHON)
519AC_SUBST(PYTHON_VERSION)
520AC_SUBST(PYTHON_INCLUDES)
521AC_SUBST(PYTHON_SITE_PACKAGES)
522AC_SUBST(HAVE_PYTHON_DISTUTILS)
523
524rappture_with_ruby="yes"
525
526RUBY=""
527RUBY_DEV_PKG="no"
528
529AC_ARG_WITH(ruby,
530  AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
531  [rappture_with_ruby=$with_val])
532if test "${rappture_with_ruby}" != "no" ; then
533  if test "${rappture_with_ruby}" = "yes" ; then
534    AC_PATH_PROG(RUBY, ruby)
535  else
536    AC_PATH_PROG(RUBY, ruby, [],
537      [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}])
538  fi
539fi
540AC_SUBST(RUBY)
541
542RUBY_VERSION_RV=
543RUBY_PLATFORM=
544if test "x${RUBY}" != "x" ; then
545  AX_PROG_RUBY_VERSION
546  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
547  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
548  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
549  if test -z "$ac_mkmf_result"; then
550    HAVE_RUBY_DEVEL="yes"
551    AX_RUBY_DEV_FLAGS([${RUBY}])
552  fi
553fi
554AC_SUBST(HAVE_RUBY_DEVEL)
555AC_SUBST(RUBY_VERSION_RV)
556AC_SUBST(RUBY_PLATFORM)
557
558rappture_with_java="yes"
559JAVA=""
560JAVAH=""
561JAVAC=""
562JAVA_DEV_PKG="no"
563
564AC_ARG_WITH(java,
565  AS_HELP_STRING([--with-java=PATH], [absolute path to java executable]),
566  [rappture_with_java=$with_val])
567if test "${rappture_with_java}" != "no" ; then
568  if test "${rappture_with_java}" = "yes" ; then
569    AC_PATH_PROG(JAVA, java)
570    AC_PATH_PROG(JAVAC, javac)
571    AC_PATH_PROG(JAVAH, javah)
572  else
573    AC_PATH_PROG(JAVA, java, [],
574      [${rappture_with_java}/bin/java:${rappture_with_java}])
575    AC_PATH_PROG(JAVAC, javac, [],
576      [${rappture_with_java}/bin/java:${rappture_with_java}])
577    AC_PATH_PROG(JAVAH, javah, [],
578      [${rappture_with_java}/bin/java:${rappture_with_java}])
579  fi
580fi
581JDK=
582JAVA_HOME=
583JAVA_INC_DIR=
584JAVA_INC_SPEC=
585
586# If java exists, let's look for the jni.h file.
587if test "x${JAVA}" != "x" ; then
588  for d in \
589   /apps/java/jdk1.6.0_01 \
590   /usr/lib/jvm/*sun-1.6* \
591   /opt/sun-jdk-1.6* \
592   /opt/icedtea6-* \
593   /opt/sun-jdk-1.5* \
594   /usr/lib/jvm/*sun-1.5*
595  do
596    if test -r "${d}/include/jni.h" ; then
597      JDK=${d}
598      break;
599    fi
600  done
601  JAVA_HOME=$JDK
602  JAVA_INC_DIR=${JDK}/include
603  JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
604fi
605
606AC_SUBST(JAVA)
607AC_SUBST(JAVAC)
608AC_SUBST(JAVAH)
609AC_SUBST(JAVA_HOME)
610AC_SUBST(JAVA_INC_DIR)
611AC_SUBST(JAVA_INC_SPEC)
612
613RP_BASE=`pwd`
614AC_SUBST(RP_BASE)
615
616SC_ENABLE_SHARED
617
618#--------------------------------------------------------------------
619# This macro figures out what flags to use with the compiler/linker
620# when building shared/static debug/optimized objects.  This information
621# is all taken from the tclConfig.sh file.
622#--------------------------------------------------------------------
623
624AC_SUBST(CFLAGS_DEBUG)
625AC_SUBST(CFLAGS_OPTIMIZE)
626AC_SUBST(STLIB_LD)
627AC_SUBST(SHLIB_LD)
628AC_SUBST(SHLIB_CFLAGS)
629AC_SUBST(SHLIB_LDFLAGS)
630AC_SUBST(SHLIB_SUFFIX)
631
632if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
633  . ${exec_prefix}/lib/tclConfig.sh
634fi
635if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
636  . ${exec_prefix}/lib/tkConfig.sh
637fi
638AC_SUBST(TCL_VERSION)
639AC_SUBST(TK_VERSION)
640
641# -----------------------------------------------------------------------
642#
643# Compiler characteristics:
644#   Check for existence of types of size_t and pid_t
645#
646# -----------------------------------------------------------------------
647
648AC_C_BIGENDIAN
649AC_CHECK_SIZEOF(int)
650AC_CHECK_SIZEOF(long)
651AC_CHECK_SIZEOF(long long)
652AC_CHECK_SIZEOF(void *)
653
654SIZEOF_LONG="${ac_cv_sizeof_long}"
655SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
656SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
657SIZEOF_INT="${ac_cv_sizeof_int}"
658AC_SUBST(SIZEOF_INT)
659AC_SUBST(SIZEOF_LONG)
660AC_SUBST(SIZEOF_LONG_LONG)
661AC_SUBST(SIZEOF_VOID_P)
662
663
664#--------------------------------------------------------------------
665# Set the default compiler switches based on the --enable-symbols
666# option.
667#--------------------------------------------------------------------
668
669SC_ENABLE_SYMBOLS
670
671if test "${SHARED_BUILD}" = "1" ; then
672    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
673else
674    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
675fi
676
677
678#--------------------------------------------------------------------
679# search for ffmpeg libraries libavcodec, libavformat, libswscale
680#--------------------------------------------------------------------
681
682AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
683[[#define __STDC_CONSTANT_MACROS 1
684  #ifdef HAVE_FFMPEG_AVCODEC_H
685  # include <ffmpeg/avcodec.h>
686  #endif
687]])
688
689AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
690[[#define __STDC_CONSTANT_MACROS 1
691  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
692  # include <libavcodec/avcodec.h>
693  #endif
694]])
695
696AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
697[[#define __STDC_CONSTANT_MACROS 1
698  #ifdef HAVE_FFMPEG_AVFORMAT_H
699  # include <ffmpeg/avformat.h>
700  #endif
701]])
702
703AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
704[[#define __STDC_CONSTANT_MACROS 1
705  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
706  # include <libavformat/avformat.h>
707  #endif
708]])
709
710AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
711[[#define __STDC_CONSTANT_MACROS 1
712  #ifdef HAVE_FFMPEG_AVUTIL_H
713  # include <ffmpeg/avutil.h>
714  #endif
715]])
716
717AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
718[[#define __STDC_CONSTANT_MACROS 1
719  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
720  # include <libavutil/avutil.h>
721  #endif
722]])
723
724AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
725[[#define __STDC_CONSTANT_MACROS 1
726  #ifdef HAVE_FFMPEG_SWSCALE_H
727  # include <ffmpeg/swscale.h>
728  #endif
729]])
730
731AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
732[[#define __STDC_CONSTANT_MACROS 1
733  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
734  # include <libswscale/swscale.h>
735  #endif
736]])
737
738HAVE_FFMPEG_LIBS=""
739if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
740        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
741     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
742        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
743     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
744        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
745     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
746        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
747  HAVE_FFMPEG_LIBS="yes"
748  AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
749else
750  HAVE_FFMPEG_LIBS=""
751fi
752
753AC_CHECK_FUNCS(img_convert)
754AC_CHECK_FUNCS(sws_scale)
755AC_SUBST(HAVE_FFMPEG_LIBS)
756
757
758ac_configure_args="--disable-threads --enable-shared"
759AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
760
761dnl read Makefile.in and write Makefile
762AC_CONFIG_FILES([
763    Makefile
764    packages/Makefile
765    src/Makefile
766    src/core/Makefile
767    src/core2/Makefile
768    src/objects/Makefile
769    src/objects/RpHash.h
770    gui/Makefile
771    gui/apps/Makefile
772    gui/apps/about
773    gui/apps/encodedata
774    gui/apps/rappture
775    gui/apps/rappture-csh.env
776    gui/apps/rappture.env
777    gui/apps/rappture.use
778    gui/apps/rerun
779    gui/apps/simsim
780    gui/apps/xmldiff
781    gui/pkgIndex.tcl
782    gui/scripts/Makefile
783    instant/Makefile
784    instant/irappture
785    lang/Makefile
786    lang/java/Makefile
787    lang/java/rappture/Makefile
788    lang/perl/Makefile
789    lang/perl/Makefile.PL
790    lang/python/Makefile
791    lang/python/setup.py
792    lang/matlab/Makefile
793    lang/octave/Makefile
794    lang/octave/octave2/Makefile
795    lang/octave/octave3/Makefile
796    lang/ruby/Makefile
797    lang/ruby/build.rb
798    lang/tcl/Makefile
799    lang/tcl/pkgIndex.tcl
800    lang/tcl/src/Makefile
801    lang/tcl/scripts/Makefile
802    lang/tcl/tests/Makefile
803    lib/Makefile
804    examples/3D/Makefile
805    examples/Makefile
806    examples/app-fermi/2.0/Makefile
807    examples/app-fermi/Makefile
808    examples/app-fermi/cee/Makefile
809    examples/app-fermi/fortran/Makefile
810    examples/app-fermi/java/Makefile
811    examples/app-fermi/matlab/Makefile
812    examples/app-fermi/matlab/compiled/Makefile
813    examples/app-fermi/matlab/uncompiled/Makefile
814    examples/app-fermi/octave/Makefile
815    examples/app-fermi/octave/2/Makefile
816    examples/app-fermi/octave/3/Makefile
817    examples/app-fermi/perl/Makefile
818    examples/app-fermi/python/Makefile
819    examples/app-fermi/ruby/Makefile
820    examples/app-fermi/tcl/Makefile
821    examples/app-fermi/wrapper/Makefile
822    examples/app-fermi/wrapper/cee/Makefile
823    examples/app-fermi/wrapper/perl/Makefile
824    examples/app-fermi/wrapper/python/Makefile
825    examples/app-fermi/wrapper/tcl/Makefile
826    examples/c-example/Makefile
827    examples/canvas/Makefile
828    examples/demo.bash
829    examples/flow/Makefile
830    examples/flow/demo1/Makefile
831    examples/flow/demo2/Makefile
832    examples/flow/demo3/Makefile
833    examples/graph/Makefile
834    examples/objects/Makefile
835    examples/objects/axis/Makefile
836    examples/objects/contour/Makefile
837    examples/objects/curve/Makefile
838    examples/objects/dxWriter/Makefile
839    examples/objects/floatBuffer/Makefile
840    examples/objects/histogram/Makefile
841    examples/objects/library/Makefile
842    examples/objects/number/Makefile
843    examples/objects/path/Makefile
844    examples/objects/plot/Makefile
845    examples/objects/scatter/Makefile
846    examples/objects/string/Makefile
847    examples/objects/tree/Makefile
848    examples/objects/xmlparser/Makefile
849    examples/zoo/Makefile
850    examples/zoo/binary/Makefile
851    examples/zoo/boolean/Makefile
852    examples/zoo/choice/Makefile
853    examples/zoo/cloud/Makefile
854    examples/zoo/cloud/matlab/Makefile
855    examples/zoo/curve/Makefile
856    examples/zoo/enable/Makefile
857    examples/zoo/field/Makefile
858    examples/zoo/group/Makefile
859    examples/zoo/image/Makefile
860    examples/zoo/image/docs/Makefile
861    examples/zoo/image/examples/Makefile
862    examples/zoo/integer/Makefile
863    examples/zoo/integer2/Makefile
864    examples/zoo/loader/Makefile
865    examples/zoo/loader/examples/Makefile
866    examples/zoo/loadrun/Makefile
867    examples/zoo/log/Makefile
868    examples/zoo/note/Makefile
869    examples/zoo/note/docs/Makefile
870    examples/zoo/number/Makefile
871    examples/zoo/number2/Makefile
872    examples/zoo/periodicelement/Makefile
873    examples/zoo/phase/Makefile
874    examples/zoo/sequence/Makefile
875    examples/zoo/sequence/examples/Makefile
876    examples/zoo/string/Makefile
877    examples/zoo/structure/Makefile
878    examples/zoo/structure/examples/Makefile
879    examples/zoo/table/Makefile
880    examples/zoo/unirect2d/Makefile
881    test/Makefile
882    test/src/Makefile
883])
884AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.