source: branches/blt4/configure.in @ 1958

Last change on this file since 1958 was 1958, checked in by gah, 14 years ago

add unit cell to molvisviewer

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    MKOCTFILE=$with_octave
292    OCTAVE=$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    [with_octave2=$withval],
314    [with_octave2=no])
315
316if test "$with_octave2" != "no" ; then
317  if test "$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=$with_octave2
323    mkoctfile2=`dirname $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    [with_octave3=$withval],
342    [with_octave3=no])
343
344echo with_octave3=$with_octave3
345if test "$with_octave3" != "no" ; then
346  if test "$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=$with_octave3
352    mkoctfile3=`dirname $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=$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    [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 "$with_perl" != "no" ; then
396  AC_MSG_CHECKING([for perl])
397  if test "$with_perl" != "yes" ; then
398    AC_PATH_PROG(PERL, perl, [], [$with_perl/bin:$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    [with_python=yes])
451
452if test "$with_python" != "no" ; then
453  AC_MSG_CHECKING([for python])
454  if test -x "$with_python/bin/python"; then
455    echo Found python in $with_python/bin/python
456    PYTHON="$with_python/bin/python"
457  elif test -x "$with_python"; then
458    echo Found python in $with_python
459    PYTHON="$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 $with_python/include/python$PYTHON_VERSION/Python.h -a \
469     -d $with_python/lib/python$PYTHON_VERSION/site-packages; then
470      PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
471      PYTHON_SITE_PACKAGES=$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$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
540rappture_with_ruby="yes"
541
542RUBY=""
543RUBY_DEV_PKG="no"
544
545AC_ARG_WITH(ruby,
546  AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
547  [rappture_with_ruby=$with_val])
548if test "${rappture_with_ruby}" != "no" ; then
549  if test "${rappture_with_ruby}" = "yes" ; then
550    AC_PATH_PROG(RUBY, ruby)
551  else
552    AC_PATH_PROG(RUBY, ruby, [],
553      [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}])
554  fi
555fi
556AC_SUBST(RUBY)
557
558RUBY_VERSION_RV=
559RUBY_PLATFORM=
560if test "x${RUBY}" != "x" ; then
561  AX_PROG_RUBY_VERSION
562  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
563  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
564  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
565  if test -z "$ac_mkmf_result"; then
566    HAVE_RUBY_DEVEL="yes"
567    AX_RUBY_DEV_FLAGS([${RUBY}])
568  fi
569fi
570AC_SUBST(HAVE_RUBY_DEVEL)
571AC_SUBST(RUBY_VERSION_RV)
572AC_SUBST(RUBY_PLATFORM)
573
574rappture_with_java="yes"
575JAVA=""
576JAVAH=""
577JAVAC=""
578JAVA_DEV_PKG="no"
579
580AC_ARG_WITH(java,
581  AS_HELP_STRING([--with-java=PATH], [absolute path to java executable]),
582  [rappture_with_java=$with_val])
583if test "${rappture_with_java}" != "no" ; then
584  if test "${rappture_with_java}" = "yes" ; then
585    AC_PATH_PROG(JAVA, java)
586    AC_PATH_PROG(JAVAC, javac)
587    AC_PATH_PROG(JAVAH, javah)
588  else
589    AC_PATH_PROG(JAVA, java, [],
590      [${rappture_with_java}/bin/java:${rappture_with_java}])
591    AC_PATH_PROG(JAVAC, javac, [],
592      [${rappture_with_java}/bin/java:${rappture_with_java}])
593    AC_PATH_PROG(JAVAH, javah, [],
594      [${rappture_with_java}/bin/java:${rappture_with_java}])
595  fi
596fi
597JDK=
598JAVA_HOME=
599JAVA_INC_DIR=
600JAVA_INC_SPEC=
601
602# If java exists, let's look for the jni.h file.
603if test "x${JAVA}" != "x" ; then
604  for d in \
605   /apps/java/jdk1.6.0_01 \
606   /usr/lib/jvm/*sun-1.6* \
607   /opt/sun-jdk-1.6* \
608   /opt/icedtea6-* \
609   /opt/sun-jdk-1.5* \
610   /usr/lib/jvm/*sun-1.5*
611  do
612    if test -r "${d}/include/jni.h" ; then
613      JDK=${d}
614      break;
615    fi
616  done
617  JAVA_HOME=$JDK
618  JAVA_INC_DIR=${JDK}/include
619  JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
620fi
621
622AC_SUBST(JAVA)
623AC_SUBST(JAVAC)
624AC_SUBST(JAVAH)
625AC_SUBST(JAVA_HOME)
626AC_SUBST(JAVA_INC_DIR)
627AC_SUBST(JAVA_INC_SPEC)
628
629RP_BASE=`pwd`
630AC_SUBST(RP_BASE)
631
632SC_ENABLE_SHARED
633
634#--------------------------------------------------------------------
635# This macro figures out what flags to use with the compiler/linker
636# when building shared/static debug/optimized objects.  This information
637# is all taken from the tclConfig.sh file.
638#--------------------------------------------------------------------
639
640AC_SUBST(CFLAGS_DEBUG)
641AC_SUBST(CFLAGS_OPTIMIZE)
642AC_SUBST(STLIB_LD)
643AC_SUBST(SHLIB_LD)
644AC_SUBST(SHLIB_CFLAGS)
645AC_SUBST(SHLIB_LDFLAGS)
646AC_SUBST(SHLIB_SUFFIX)
647
648if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
649  . ${exec_prefix}/lib/tclConfig.sh
650fi
651if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
652  . ${exec_prefix}/lib/tkConfig.sh
653fi
654AC_SUBST(TCL_VERSION)
655AC_SUBST(TK_VERSION)
656
657# -----------------------------------------------------------------------
658#
659# Compiler characteristics:
660#   Check for existence of types of size_t and pid_t
661#
662# -----------------------------------------------------------------------
663
664AC_C_BIGENDIAN
665AC_CHECK_SIZEOF(int)
666AC_CHECK_SIZEOF(long)
667AC_CHECK_SIZEOF(long long)
668AC_CHECK_SIZEOF(void *)
669
670SIZEOF_LONG="${ac_cv_sizeof_long}"
671SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
672SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
673SIZEOF_INT="${ac_cv_sizeof_int}"
674AC_SUBST(SIZEOF_INT)
675AC_SUBST(SIZEOF_LONG)
676AC_SUBST(SIZEOF_LONG_LONG)
677AC_SUBST(SIZEOF_VOID_P)
678
679
680#--------------------------------------------------------------------
681# Set the default compiler switches based on the --enable-symbols
682# option.
683#--------------------------------------------------------------------
684
685SC_ENABLE_SYMBOLS
686
687
688#--------------------------------------------------------------------
689# search for ffmpeg libraries libavcodec, libavformat, libswscale
690#--------------------------------------------------------------------
691
692AC_CHECK_HEADERS(ffmpeg/avcodec.h,[],[],
693[[#define __STDC_CONSTANT_MACROS 1
694  #ifdef HAVE_FFMPEG_AVCODEC_H
695  # include <ffmpeg/avcodec.h>
696  #endif
697]])
698
699AC_CHECK_HEADERS(libavcodec/avcodec.h,[],[],
700[[#define __STDC_CONSTANT_MACROS 1
701  #ifdef HAVE_LIBAVCODEC_AVCODEC_H
702  # include <libavcodec/avcodec.h>
703  #endif
704]])
705
706AC_CHECK_HEADERS([ffmpeg/avformat.h],[],[],
707[[#define __STDC_CONSTANT_MACROS 1
708  #ifdef HAVE_FFMPEG_AVFORMAT_H
709  # include <ffmpeg/avformat.h>
710  #endif
711]])
712
713AC_CHECK_HEADERS([libavformat/avformat.h],[],[],
714[[#define __STDC_CONSTANT_MACROS 1
715  #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
716  # include <libavformat/avformat.h>
717  #endif
718]])
719
720AC_CHECK_HEADERS([ffmpeg/avutil.h],[],[],
721[[#define __STDC_CONSTANT_MACROS 1
722  #ifdef HAVE_FFMPEG_AVUTIL_H
723  # include <ffmpeg/avutil.h>
724  #endif
725]])
726
727AC_CHECK_HEADERS([libavutil/avutil.h],[],[],
728[[#define __STDC_CONSTANT_MACROS 1
729  #ifdef HAVE_LIBAVUTIL_AVUTIL_H
730  # include <libavutil/avutil.h>
731  #endif
732]])
733
734AC_CHECK_HEADERS([ffmpeg/swscale.h],[],[],
735[[#define __STDC_CONSTANT_MACROS 1
736  #ifdef HAVE_FFMPEG_SWSCALE_H
737  # include <ffmpeg/swscale.h>
738  #endif
739]])
740
741AC_CHECK_HEADERS([libswscale/swscale.h],[],[],
742[[#define __STDC_CONSTANT_MACROS 1
743  #ifdef HAVE_LIBSWSCALE_SWSCALE_H
744  # include <libswscale/swscale.h>
745  #endif
746]])
747
748HAVE_FFMPEG_LIBS=""
749if [[ \( "${ac_cv_header_ffmpeg_avcodec_h}" = "yes" -o \
750        "${ac_cv_header_libavcodec_avcodec_h}" = "yes" \) -a \
751     \( "${ac_cv_header_ffmpeg_avformat_h}" = "yes" -o \
752        "${ac_cv_header_libavformat_avformat_h}" = "yes" \) -a \
753     \( "${ac_cv_header_ffmpeg_avutil_h}" = "yes" -o \
754        "${ac_cv_header_libavutil_avutil_h}" = "yes" \) -a \
755     \( "${ac_cv_header_ffmpeg_swscale_h}" = "yes" -o \
756        "${ac_cv_header_libswscale_swscale_h}" = "yes" \) ]] ; then
757  HAVE_FFMPEG_LIBS="yes"
758  AC_DEFINE(BUILD_with_ffmpeg, 1, [Build rappture with ffmpeg widgets])
759else
760  HAVE_FFMPEG_LIBS=""
761fi
762
763AC_CHECK_FUNCS(img_convert)
764AC_CHECK_FUNCS(sws_scale)
765AC_SUBST(HAVE_FFMPEG_LIBS)
766
767ac_configure_args="--disable-threads --enable-shared"
768AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
769
770dnl read Makefile.in and write Makefile
771AC_CONFIG_FILES([
772    Makefile
773    packages/Makefile
774    src/Makefile
775    src/core/Makefile
776    src/core2/Makefile
777    src/objects/Makefile
778    src/objects/RpHash.h
779    gui/Makefile
780    gui/apps/Makefile
781    gui/apps/about
782    gui/apps/encodedata
783    gui/apps/rappture
784    gui/apps/rappture-csh.env
785    gui/apps/rappture.env
786    gui/apps/rappture.use
787    gui/apps/rerun
788    gui/apps/simsim
789    gui/apps/xmldiff
790    gui/pkgIndex.tcl
791    gui/scripts/Makefile
792    instant/Makefile
793    instant/irappture
794    lang/Makefile
795    lang/java/Makefile
796    lang/java/rappture/Makefile
797    lang/perl/Makefile
798    lang/perl/Makefile.PL
799    lang/python/Makefile
800    lang/python/setup.py
801    lang/matlab/Makefile
802    lang/octave/Makefile
803    lang/octave/octave2/Makefile
804    lang/octave/octave3/Makefile
805    lang/ruby/Makefile
806    lang/ruby/build.rb
807    lang/tcl/Makefile
808    lang/tcl/pkgIndex.tcl
809    lang/tcl/src/Makefile
810    lang/tcl/scripts/Makefile
811    lang/tcl/tests/Makefile
812    lib/Makefile
813    examples/3D/Makefile
814    examples/Makefile
815    examples/app-fermi/2.0/Makefile
816    examples/app-fermi/Makefile
817    examples/app-fermi/cee/Makefile
818    examples/app-fermi/fortran/Makefile
819    examples/app-fermi/java/Makefile
820    examples/app-fermi/matlab/Makefile
821    examples/app-fermi/matlab/compiled/Makefile
822    examples/app-fermi/matlab/uncompiled/Makefile
823    examples/app-fermi/octave/Makefile
824    examples/app-fermi/octave/2/Makefile
825    examples/app-fermi/octave/3/Makefile
826    examples/app-fermi/perl/Makefile
827    examples/app-fermi/python/Makefile
828    examples/app-fermi/ruby/Makefile
829    examples/app-fermi/tcl/Makefile
830    examples/app-fermi/wrapper/Makefile
831    examples/app-fermi/wrapper/cee/Makefile
832    examples/app-fermi/wrapper/perl/Makefile
833    examples/app-fermi/wrapper/python/Makefile
834    examples/app-fermi/wrapper/tcl/Makefile
835    examples/c-example/Makefile
836    examples/canvas/Makefile
837    examples/demo.bash
838    examples/flow/Makefile
839    examples/flow/demo1/Makefile
840    examples/flow/demo2/Makefile
841    examples/flow/demo3/Makefile
842    examples/graph/Makefile
843    examples/objects/Makefile
844    examples/objects/axis/Makefile
845    examples/objects/contour/Makefile
846    examples/objects/curve/Makefile
847    examples/objects/dxWriter/Makefile
848    examples/objects/floatBuffer/Makefile
849    examples/objects/histogram/Makefile
850    examples/objects/library/Makefile
851    examples/objects/number/Makefile
852    examples/objects/path/Makefile
853    examples/objects/plot/Makefile
854    examples/objects/scatter/Makefile
855    examples/objects/string/Makefile
856    examples/objects/tree/Makefile
857    examples/objects/xmlparser/Makefile
858    examples/zoo/Makefile
859    examples/zoo/binary/Makefile
860    examples/zoo/boolean/Makefile
861    examples/zoo/choice/Makefile
862    examples/zoo/cloud/Makefile
863    examples/zoo/cloud/matlab/Makefile
864    examples/zoo/curve/Makefile
865    examples/zoo/datatable/Makefile
866    examples/zoo/datatable/matlab/Makefile
867    examples/zoo/enable/Makefile
868    examples/zoo/field/Makefile
869    examples/zoo/filechoice/Makefile
870    examples/zoo/group/Makefile
871    examples/zoo/image/Makefile
872    examples/zoo/image/docs/Makefile
873    examples/zoo/image/examples/Makefile
874    examples/zoo/integer/Makefile
875    examples/zoo/integer2/Makefile
876    examples/zoo/loader/Makefile
877    examples/zoo/loader/examples/Makefile
878    examples/zoo/loadrun/Makefile
879    examples/zoo/log/Makefile
880    examples/zoo/note/Makefile
881    examples/zoo/note/docs/Makefile
882    examples/zoo/number/Makefile
883    examples/zoo/number2/Makefile
884    examples/zoo/periodicelement/Makefile
885    examples/zoo/parallelepiped/Makefile
886    examples/zoo/phase/Makefile
887    examples/zoo/sequence/Makefile
888    examples/zoo/sequence/examples/Makefile
889    examples/zoo/string/Makefile
890    examples/zoo/structure/Makefile
891    examples/zoo/structure/examples/Makefile
892    examples/zoo/table/Makefile
893    examples/zoo/unirect2d/Makefile
894    test/Makefile
895    test/src/Makefile
896])
897AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.