source: trunk/configure.in @ 1844

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

allow both octave2 and octave3 builds simultaneously

File size: 22.6 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            AC_PATH_PROG(TCLSH, tclsh)
138        fi
139    fi
140fi
141AC_MSG_RESULT([${TCLSH}])
142AC_SUBST(TCLSH)
143
144TCL_VERSION="8.4"
145for dir in \
146 ${exec_prefix} \
147 ${exec_prefix}/lib ; do
148  tclconfig="${dir}/tclConfig.sh"
149  if test -f "$tclconfig" ; then
150    . $tclconfig
151    break
152  fi
153done
154TCL_INC_SPEC="$TCL_INCLUDE_SPEC"
155
156if test "x$with_tcllib" != "x" ; then
157   tclconfig="${with_tcllib}/tclConfig.sh"
158   if test -f "$tclconfig" ; then
159    . $tclconfig
160   fi
161   TCL_LIB_SPEC="-L${with_tcllib} -ltcl${TCL_VERSION}"
162fi
163if test "x$with_tclinclude" != "x" ; then
164   TCL_INC_SPEC="-I${with_tclinclude}"
165fi
166
167AC_SUBST(TCL_VERSION)
168AC_SUBST(TCL_INC_SPEC)
169AC_SUBST(TCL_LIB_SPEC)
170
171AC_ARG_WITH(
172    [vtk],
173    [AS_HELP_STRING([--with-vtk[=DIR]],
174        [location of vtk library @<:@default=yes@:>@])],
175    [with_vtk=$withval], [with_vtk=yes])
176
177AC_MSG_CHECKING([for vtk])
178VTKDIR=""
179
180if test "$with_vtk" != "no" ; then
181  if test "$with_vtk" = "yes" ; then
182    for path in \
183     $libdir \
184     $prefix/lib \
185     $exec_prefix/lib \
186     /usr/lib
187    do
188      for vtk in $path/vtk-* ; do
189        if test -d "${vtk}" ; then
190          VTKDIR=${vtk}
191        fi
192      done
193      if test "x${VTKDIR}" != "x" ; then
194        break
195      fi
196    done
197  fi
198fi
199AC_SUBST(VTKDIR)
200AC_MSG_RESULT([$VTKDIR])
201
202
203AC_ARG_WITH(
204    [matlab],
205    [AS_HELP_STRING([--with-matlab[=DIR]],
206        [location of matlab and mex compiler @<:@default=yes@:>@])],
207    [with_matlab=$withval],
208    [with_matlab=yes])
209
210MCC=""
211MEX=""
212MEX_ARCH=""
213MEXEXT=""
214MATLAB=
215if test "$with_matlab" != "no" ; then
216  if test "$with_matlab" = "yes" ; then
217    AC_PATH_PROG(MATLAB, matlab)
218  else
219    AC_PATH_PROG(MATLAB, matlab, [], [${with_matlab}/bin:${with_matlab}])
220  fi
221fi
222
223if test "x$MATLAB" != "x" ; then
224  # Found matlab.  May be a symlink to the real binary.  Run "matlab -e"
225  # to tell where matlab is installed.
226
227  matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin
228
229  # Now see if we can find "mex" or "mexext" there.
230  AC_PATH_PROG(MEX, mex, [], [${matlab_bindir}])
231  AC_PATH_PROG(MEXEXT, mexext, [], [${matlab_bindir}])
232
233  # Run "mexext" to get the expected module extension for this platform.
234  AC_MSG_CHECKING([for mex extension])
235  if test "x$MEXEXT" != "x" ; then
236    MEXEXT=`$MEXEXT`
237  else
238    MEXEXT="mexglx"
239  fi
240  AC_MSG_RESULT([$MEXEXT])
241  AC_PATH_PROG(MCC, mcc, [], [${matlab_bindir}])
242  AC_MSG_CHECKING([for mcc extension])
243fi
244
245AC_SUBST(MCC)
246AC_SUBST(MEX)
247AC_SUBST(MATLAB)
248AC_SUBST(MEX_ARCH)
249AC_SUBST(MEXEXT)
250
251# Standard octave search (use the installed version of octave)
252AC_ARG_WITH(
253    [octave],
254    [AS_HELP_STRING([--with-octave[=DIR]],
255        [location of octave compiler MKOCTFILE @<:@default=yes@:>@])],
256    [with_octave=$withval],
257    [with_octave=yes])
258
259OCTAVE=
260OCTAVE2=
261OCTAVE3=
262OCTAVE_VERSION=
263OCTAVE_VERSION_MAJOR=
264MKOCTFILE=
265MKOCTFILE2=
266MKOCTFILE3=
267if test "$with_octave" != "no" ; then
268  AC_MSG_CHECKING([for octave and mkoctfile])
269  if test "$with_octave" = "yes" ; then
270    AC_PATH_PROG(OCTAVE, octave)
271    AC_PATH_PROG(MKOCTFILE, mkoctfile)
272  else
273    AC_PATH_PROG(OCTAVE, octave, [], [$with_octave/bin:$with_octave])
274    AC_PATH_PROG(MKOCTFILE, mkoctfile, [],
275        [${with_octave}/bin/mkoctfile:${with_octave}])
276  fi
277  if test "x${OCTAVE}" != "x" ; then
278    OCTAVE_VERSION=`${OCTAVE} -v | grep version | cut -d' ' -f4`
279    OCTAVE_VERSION_MAJOR=`echo ${OCTAVE_VERSION} | cut -d'.' -f1`
280    if test "${OCTAVE_VERSION_MAJOR}" == "3" ; then
281      OCTAVE3=$OCTAVE
282      MKOCTFILE3=$MKOCTFILE
283    fi
284    if test "${OCTAVE_VERSION_MAJOR}" == "2" ; then
285      OCTAVE2=$OCTAVE
286      MKOCTFILE2=$MKOCTFILE
287    fi
288  fi
289fi
290
291# Check if octave2 was designated *in addition* to the installed version.
292AC_ARG_WITH(
293    [octave2],
294    [AS_HELP_STRING([--with-octave2[=DIR]],
295        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
296    [with_octave2=$withval],
297    [with_octave2=no])
298
299if test "$with_octave2" != "no" ; then
300  AC_MSG_CHECKING([for octave and mkoctfile])
301  AC_PATH_PROG(octave2, octave, [], [$with_octave2/bin:$with_octave2])
302  AC_PATH_PROG(mkoctfile, mkoctfile, [],
303        [${with_octave2}/bin/mkoctfile:${with_octave2}])
304  if test "x${octave2}" != "x" ; then
305    version=`${octave2} -v | grep version | cut -d' ' -f4`
306    version_major=`echo ${version} | cut -d'.' -f1`
307    if test "$version_major" = "2" ; then
308      OCTAVE2=$octave2
309      MKOCTFILE2=$mkoctfile2
310    fi
311  fi
312fi
313# Check if octave3 was designated *in addition* to the installed version.
314AC_ARG_WITH(
315    [octave3],
316    [AS_HELP_STRING([--with-octave3[=DIR]],
317        [location of octave compiler MKOCTFILE @<:@default=no@:>@])],
318    [with_octave3=$withval],
319    [with_octave3=no])
320if test "$with_octave3" != "no" ; then
321  AC_MSG_CHECKING([for octave and mkoctfile])
322  AC_PATH_PROG(octave3, octave, [], [$with_octave3/bin:$with_octave3])
323  AC_PATH_PROG(mkoctfile3, mkoctfile, [],
324        [${with_octave3}/bin/mkoctfile:${with_octave3}])
325  if test "x${octave3}" != "x" ; then
326    version=`${octave3} -v | grep version | cut -d' ' -f4`
327    version_major=`echo ${version} | cut -d'.' -f1`
328    if test "$version_major" = "3" ; then
329      OCTAVE3=$octave3
330      MKOCTFILE3=$mkoctfile3
331    fi
332  fi
333fi
334
335AC_SUBST(OCTAVE2)
336AC_SUBST(OCTAVE3)
337AC_SUBST(OCTAVE)
338AC_SUBST(OCTAVE_VERSION)
339AC_SUBST(OCTAVE_VERSION_MAJOR)
340AC_SUBST(MKOCTFILE)
341AC_SUBST(MKOCTFILE2)
342AC_SUBST(MKOCTFILE3)
343
344AC_ARG_WITH(
345    [perl],
346    [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=yes@:>@])],
347    [],
348    [with_perl=yes])
349
350PERL=
351PERL_INCLUDES=
352PERL_ARCHLIB=
353PERL_ARCHLIBEXP=
354PERL_VERSION=
355PERL_VENDORLIB=
356PERL_PRIVLIB=
357PERL_CPPFLAGS=
358PERL_CCFlAGS=
359PERL_VERSION_RV=
360PERL_LIBSPEC=
361if test "$with_perl" != "no" ; then
362  AC_MSG_CHECKING([for perl])
363  if test "$with_perl" != "yes" ; then
364    AC_PATH_PROG(PERL, perl, [], [$with_perl/bin:$with_perl])
365  else
366    AC_PATH_PROG(PERL, perl)
367  fi
368  if test "x${PERL}" != "x" ; then
369    PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'`
370    PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'`
371    PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'`
372    PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'`
373    PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'`
374    PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'`
375    PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'`
376    PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'`
377    PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2`
378    echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}"
379
380    # libperl may or may not be installed.  Check for its existence.
381    if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then
382      PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl"
383    fi
384  fi
385fi
386AC_MSG_RESULT([${PERL}])
387AC_SUBST(PERL)
388AC_SUBST(PERL_INCLUDES)
389AC_SUBST(PERL_ARCHLIB)
390AC_SUBST(PERL_ARCHLIBEXP)
391AC_SUBST(PERL_VERSION)
392AC_SUBST(PERL_CCFLAGS)
393AC_SUBST(PERL_CPPFLAGS)
394AC_SUBST(PERL_VENDORLIB)
395AC_SUBST(PERL_PRIVLIB)
396AC_SUBST(PERL_INSTALLARCHLIB)
397AC_SUBST(PERL_VERSION_RV)
398AC_SUBST(PERL_LIBSPEC)
399
400PYTHON=""
401PYTHON_CFLAGS=""
402PYTHON_CPPFLAGS=""
403HAVE_PYTHON_DISTUTILS=""
404PYTHON_INCLUDES=""
405PYTHON_LDFLAGS=""
406PYTHON_LIB=""
407PYTHON_LIBDIR=""
408PYTHON_SITE_DIR=""
409PYTHON_SITE_PACKAGES=""
410PYTHON_VERSION=""
411pythondir=""
412
413AC_ARG_WITH([python],
414    [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=yes@:>@])],
415    [],
416    [with_python=yes])
417
418if test "$with_python" != "no" ; then
419  AC_MSG_CHECKING([for python])
420  if test -x "$with_python/bin/python"; then
421    echo Found python in $with_python/bin/python
422    PYTHON="$with_python/bin/python"
423  elif test -x "$with_python"; then
424    echo Found python in $with_python
425    PYTHON="$with_python"
426  else
427    AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
428  fi
429  if test "x${PYTHON}" != "x"; then
430    PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
431    echo Using python version $PYTHON_VERSION
432  fi
433  if test "x${PYTHON_VERSION}" != "x"; then
434    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
435     -d $with_python/lib/python$PYTHON_VERSION/site-packages; then
436      PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
437      PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
438    else
439      if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then
440        PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
441        PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
442      else
443        if test -r /usr/include/python$PYTHON_VERSION/Python.h; then
444          PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
445          PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
446        else
447          echo could not find python$PYTHON_VERSION/Python.h
448        fi
449      fi
450      if test ! -d "$PYTHON_SITE_PACKAGES"; then
451        PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
452      fi
453    fi
454  fi
455  if test "x$with_python" != "x" ;  then
456    pythondir='$(PYTHON_SITE_PACKAGES)'
457  else
458    pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
459  fi
460
461  AC_MSG_CHECKING([for python distutils])
462  ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \
463        build build_ext 2>&1 > /dev/null
464  if test $? = 0 ; then
465    HAVE_PYTHON_DISTUTILS="yes"
466  else
467     HAVE_PYTHON_DISTUTILS="no"
468  fi
469  AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS])
470
471  if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then
472    #
473    # Check for Python include path
474    #
475    AC_MSG_CHECKING([for Python include path])
476    if test "x${PYTHON_CPPFLAGS}" = "x"; then
477      incdir_path=`${PYTHON} -c "import distutils.sysconfig; \
478       print distutils.sysconfig.get_python_inc();"`
479      if test -n "${incdir}"; then
480        python_path="-I${incdir}"
481      fi
482      PYTHON_CPPFLAGS=$python_path
483    fi
484    AC_MSG_RESULT([$PYTHON_CPPFLAGS])
485    AC_SUBST([PYTHON_CPPFLAGS])
486    #
487    # python distutils found, get settings from python directly
488    #
489    AC_MSG_CHECKING([location of site-packages])
490    PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`"
491
492    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);'`"
493    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);'`"
494    PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`"
495    PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`"
496  fi
497fi 
498AC_SUBST(pythondir)
499
500AC_SUBST(PYTHON)
501AC_SUBST(PYTHON_VERSION)
502AC_SUBST(PYTHON_INCLUDES)
503AC_SUBST(PYTHON_SITE_PACKAGES)
504AC_SUBST(HAVE_PYTHON_DISTUTILS)
505
506rappture_with_ruby="yes"
507
508RUBY=""
509RUBY_DEV_PKG="no"
510
511AC_ARG_WITH(ruby,
512  AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]),
513  [rappture_with_ruby=$with_val])
514if test "${rappture_with_ruby}" != "no" ; then
515  if test "${rappture_with_ruby}" = "yes" ; then
516    AC_PATH_PROG(RUBY, ruby)
517  else
518    AC_PATH_PROG(RUBY, ruby, [],
519      [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}])
520  fi
521fi
522AC_SUBST(RUBY)
523
524RUBY_VERSION_RV=
525RUBY_PLATFORM=
526if test "x${RUBY}" != "x" ; then
527  AX_PROG_RUBY_VERSION
528  RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2`
529  RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'`
530  ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1`
531  if test -z "$ac_mkmf_result"; then
532    HAVE_RUBY_DEVEL="yes"
533    AX_RUBY_DEV_FLAGS([${RUBY}])
534  fi
535fi
536AC_SUBST(HAVE_RUBY_DEVEL)
537AC_SUBST(RUBY_VERSION_RV)
538AC_SUBST(RUBY_PLATFORM)
539
540rappture_with_java="yes"
541JAVA=""
542JAVAH=""
543JAVAC=""
544JAVA_DEV_PKG="no"
545
546AC_ARG_WITH(java,
547  AS_HELP_STRING([--with-java=PATH], [absolute path to java executable]),
548  [rappture_with_java=$with_val])
549if test "${rappture_with_java}" != "no" ; then
550  if test "${rappture_with_java}" = "yes" ; then
551    AC_PATH_PROG(JAVA, java)
552    AC_PATH_PROG(JAVAC, javac)
553    AC_PATH_PROG(JAVAH, javah)
554  else
555    AC_PATH_PROG(JAVA, java, [],
556      [${rappture_with_java}/bin/java:${rappture_with_java}])
557    AC_PATH_PROG(JAVAC, javac, [],
558      [${rappture_with_java}/bin/java:${rappture_with_java}])
559    AC_PATH_PROG(JAVAH, javah, [],
560      [${rappture_with_java}/bin/java:${rappture_with_java}])
561  fi
562fi
563JDK=
564JAVA_HOME=
565JAVA_INC_DIR=
566JAVA_INC_SPEC=
567
568# If java exists, let's look for the jni.h file.
569if test "x${JAVA}" != "x" ; then
570  for d in \
571   /apps/java/jdk1.6.0_01 \
572   /usr/lib/jvm/*sun-1.6* \
573   /opt/sun-jdk-1.6* \
574   /opt/icedtea6-* \
575   /opt/sun-jdk-1.5* \
576   /usr/lib/jvm/*sun-1.5*
577  do
578    if test -r "${d}/include/jni.h" ; then
579      JDK=${d}
580      break;
581    fi
582  done
583  JAVA_HOME=$JDK
584  JAVA_INC_DIR=${JDK}/include
585  JAVA_INC_SPEC="-I${JDK}/include -I${JDK}/include/linux"
586fi
587
588AC_SUBST(JAVA)
589AC_SUBST(JAVAC)
590AC_SUBST(JAVAH)
591AC_SUBST(JAVA_HOME)
592AC_SUBST(JAVA_INC_DIR)
593AC_SUBST(JAVA_INC_SPEC)
594
595RP_BASE=`pwd`
596AC_SUBST(RP_BASE)
597
598SC_ENABLE_SHARED
599
600#--------------------------------------------------------------------
601# This macro figures out what flags to use with the compiler/linker
602# when building shared/static debug/optimized objects.  This information
603# is all taken from the tclConfig.sh file.
604#--------------------------------------------------------------------
605
606AC_SUBST(CFLAGS_DEBUG)
607AC_SUBST(CFLAGS_OPTIMIZE)
608AC_SUBST(STLIB_LD)
609AC_SUBST(SHLIB_LD)
610AC_SUBST(SHLIB_CFLAGS)
611AC_SUBST(SHLIB_LDFLAGS)
612AC_SUBST(SHLIB_SUFFIX)
613
614if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
615  . ${exec_prefix}/lib/tclConfig.sh
616fi
617if test -f "${exec_prefix}/lib/tclConfig.sh" ; then
618  . ${exec_prefix}/lib/tkConfig.sh     
619fi
620AC_SUBST(TCL_VERSION)
621AC_SUBST(TK_VERSION)
622
623# -----------------------------------------------------------------------
624#
625# Compiler characteristics:
626#   Check for existence of types of size_t and pid_t
627#
628# -----------------------------------------------------------------------
629
630AC_C_BIGENDIAN
631AC_CHECK_SIZEOF(int)
632AC_CHECK_SIZEOF(long)
633AC_CHECK_SIZEOF(long long)
634AC_CHECK_SIZEOF(void *)
635
636SIZEOF_LONG="${ac_cv_sizeof_long}"
637SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}"
638SIZEOF_VOID_P="${ac_cv_sizeof_void_p}"
639SIZEOF_INT="${ac_cv_sizeof_int}"
640AC_SUBST(SIZEOF_INT)
641AC_SUBST(SIZEOF_LONG)
642AC_SUBST(SIZEOF_LONG_LONG)
643AC_SUBST(SIZEOF_VOID_P)
644
645
646#--------------------------------------------------------------------
647# Set the default compiler switches based on the --enable-symbols
648# option.
649#--------------------------------------------------------------------
650
651SC_ENABLE_SYMBOLS
652
653if test "${SHARED_BUILD}" = "1" ; then
654    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
655else
656    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
657fi
658
659ac_configure_args="--disable-threads --enable-shared"
660AC_CONFIG_SUBDIRS( [packages/optimizer/src] )
661
662dnl read Makefile.in and write Makefile
663AC_CONFIG_FILES([
664    Makefile
665    packages/Makefile
666    src/Makefile
667    src/core/Makefile
668    src/core2/Makefile
669    src/objects/Makefile
670    src/objects/RpHash.h
671    gui/Makefile
672    gui/apps/Makefile
673    gui/apps/about
674    gui/apps/encodedata
675    gui/apps/rappture
676    gui/apps/rappture-csh.env
677    gui/apps/rappture.env
678    gui/apps/rappture.use
679    gui/apps/rerun
680    gui/apps/simsim
681    gui/apps/xmldiff
682    gui/pkgIndex.tcl
683    gui/scripts/Makefile
684    instant/Makefile
685    instant/irappture
686    lang/Makefile
687    lang/java/Makefile
688    lang/java/rappture/Makefile
689    lang/perl/Makefile
690    lang/perl/Makefile.PL
691    lang/python/Makefile
692    lang/python/setup.py
693    lang/matlab/Makefile
694    lang/octave/Makefile
695    lang/octave/octave2/Makefile
696    lang/octave/octave3/Makefile
697    lang/ruby/Makefile
698    lang/ruby/build.rb
699    lang/tcl/Makefile
700    lang/tcl/pkgIndex.tcl
701    lang/tcl/src/Makefile
702    lang/tcl/scripts/Makefile
703    lang/tcl/tests/Makefile
704    lib/Makefile
705    examples/3D/Makefile
706    examples/Makefile
707    examples/app-fermi/2.0/Makefile
708    examples/app-fermi/Makefile
709    examples/app-fermi/cee/Makefile
710    examples/app-fermi/fortran/Makefile
711    examples/app-fermi/java/Makefile
712    examples/app-fermi/matlab/Makefile
713    examples/app-fermi/matlab/compiled/Makefile
714    examples/app-fermi/matlab/uncompiled/Makefile
715    examples/app-fermi/octave/Makefile
716    examples/app-fermi/octave/2/Makefile
717    examples/app-fermi/octave/3/Makefile
718    examples/app-fermi/perl/Makefile
719    examples/app-fermi/python/Makefile
720    examples/app-fermi/ruby/Makefile
721    examples/app-fermi/tcl/Makefile
722    examples/app-fermi/wrapper/Makefile
723    examples/app-fermi/wrapper/cee/Makefile
724    examples/app-fermi/wrapper/python/Makefile
725    examples/app-fermi/wrapper/tcl/Makefile
726    examples/c-example/Makefile
727    examples/canvas/Makefile
728    examples/demo.bash
729    examples/flow/Makefile
730    examples/flow/demo1/Makefile
731    examples/flow/demo2/Makefile
732    examples/flow/demo3/Makefile
733    examples/graph/Makefile
734    examples/objects/Makefile
735    examples/objects/axis/Makefile
736    examples/objects/contour/Makefile
737    examples/objects/curve/Makefile
738    examples/objects/dxWriter/Makefile
739    examples/objects/floatBuffer/Makefile
740    examples/objects/histogram/Makefile
741    examples/objects/library/Makefile
742    examples/objects/number/Makefile
743    examples/objects/path/Makefile
744    examples/objects/plot/Makefile
745    examples/objects/scatter/Makefile
746    examples/objects/string/Makefile
747    examples/objects/tree/Makefile
748    examples/objects/xmlparser/Makefile
749    examples/zoo/Makefile
750    examples/zoo/binary/Makefile
751    examples/zoo/boolean/Makefile
752    examples/zoo/choice/Makefile
753    examples/zoo/cloud/Makefile
754    examples/zoo/cloud/matlab/Makefile
755    examples/zoo/curve/Makefile
756    examples/zoo/enable/Makefile
757    examples/zoo/field/Makefile
758    examples/zoo/group/Makefile
759    examples/zoo/image/Makefile
760    examples/zoo/image/docs/Makefile
761    examples/zoo/image/examples/Makefile
762    examples/zoo/integer/Makefile
763    examples/zoo/integer2/Makefile
764    examples/zoo/loader/Makefile
765    examples/zoo/loader/examples/Makefile
766    examples/zoo/loadrun/Makefile
767    examples/zoo/log/Makefile
768    examples/zoo/note/Makefile
769    examples/zoo/note/docs/Makefile
770    examples/zoo/number/Makefile
771    examples/zoo/number2/Makefile
772    examples/zoo/periodicelement/Makefile
773    examples/zoo/phase/Makefile
774    examples/zoo/sequence/Makefile
775    examples/zoo/sequence/examples/Makefile
776    examples/zoo/string/Makefile
777    examples/zoo/structure/Makefile
778    examples/zoo/structure/examples/Makefile
779    examples/zoo/table/Makefile
780    examples/zoo/unirect2d/Makefile
781    test/Makefile
782    test/src/Makefile
783])
784AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.