source: trunk/configure.in @ 2140

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

Fixes for RapptureGUI build Makefile

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