AC_INIT([Rappture],[1.1],[rappture@nanohub.org]) dnl AC_CONFIG_HEADER(src/core/RpConfig.h) AC_CONFIG_AUX_DIR(cf) AC_CONFIG_HEADER(src/core/config.h) #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi if test "${libdir}" != "${prefix}/lib"; then LIB_SEARCH_DIRS="-L${prefix}/lib -L${libdir}" else LIB_SEARCH_DIRS="-L${libdir}" fi AC_SUBST(LIB_SEARCH_DIRS) AC_PROG_INSTALL AC_PROG_MAKE_SET # Check for C, C++, and FORTRAN AC_PROG_CC AC_PROG_CXX # Avoid g95 AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32]) AC_LANG([C]) AC_HEADER_STDC AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) AC_LANG([C++]) AC_CHECK_FUNCS([sysinfo]) AC_CHECK_HEADERS(sys/sysinfo.h) AC_CHECK_LIB(m, main,,AC_MSG_ERROR(librappture requires libm)) AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) AC_CHECK_HEADERS(algorithm,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cctype,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cfloat,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cmath,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cstdio,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cstdlib,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(cstring,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(fstream,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(iostream,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(iterator,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(sstream,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(assert.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(ctype.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(errno.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(limits.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(string.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(stdlib.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(stddef.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(float.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(math.h,,AC_MSG_WARN(C headers missing ?)) dnl AC_CHECK_HEADERS(ieeefp.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(malloc.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(memory.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(unistd.h,,AC_MSG_WARN(C headers missing ?)) AC_CHECK_HEADERS(inttypes.h,,AC_MSG_WARN(C headers missing ?)) if test "${ac_cv_header_inttypes_h}" = "yes" ; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi AC_SUBST(HAVE_INTTYPES_H) SC_CONFIG_CFLAGS make_command="" for m in "$MAKE" make gmake gnumake ; do if test "x${m}" != "x" ; then if ( sh -c "$m --version" 2>/dev/null | grep GNU >/dev/null ) ; then make_command=$m; break; fi fi done if test "x${make_command}" = "x" ; then AC_MSG_ERROR([Requires GNU make. You can specify a version with \$MAKE]) fi AC_SUBST(MAKE, ${make_command}) AC_ARG_ENABLE( [gui], [AS_HELP_STRING([--enable-gui], [build code related to the graphical user interface @<:@default=yes@:>@])], [], [enable_gui=yes]) ENABLE_GUI= if test "$enable_gui" != "no" ; then ENABLE_GUI="yes" fi AC_SUBST(ENABLE_GUI) with_tclsh="check" AC_ARG_WITH( [tclsh], [AS_HELP_STRING([--with-tclsh[=DIR]], [location of tclsh @<:@default=check@:>@])], [], [with_tclsh=check]) TCLSH= if test "$with_tclsh" != "no" ; then AC_MSG_CHECKING([for tclsh]) if test -x "$with_tclsh/bin/tclsh" then echo Found tclsh in $with_tclsh/bin/tclsh TCLSH="$with_tclsh/bin/tclsh" else if test -x "$with_tclsh" then echo Found tclsh in $with_tclsh TCLSH="$with_tclsh" else AC_PATH_PROG(TCLSH, tclsh) fi fi fi AC_MSG_RESULT([${TCLSH}]) AC_SUBST(TCLSH) AC_ARG_WITH( [matlab], [AS_HELP_STRING([--with-matlab[=DIR]], [location of matlab and mex compiler @<:@default=check@:>@])], [with_matlab=$withval], [with_matlab=yes]) MCC="" MEX="" MEX_ARCH="" MEXEXT="" MATLAB= if test "$with_matlab" != "no" ; then if test "$with_matlab" = "yes" ; then AC_PATH_PROG(MATLAB, matlab) else AC_PATH_PROG(MATLAB, matlab, [${with_matlab}/bin:${with_matlab}]) fi fi if test "x$MATLAB" != "x" ; then # Found matlab. May be a symlink to the real binary. Run "matlab -e" # to tell where matlab is installed. matlab_bindir=`${MATLAB} -e | grep "MATLAB=" | sed s/MATLAB=//`/bin # Now see if we can find "mex" or "mexext" there. AC_PATH_PROG(MEX, mex, [${matlab_bindir}/mex]) AC_PATH_PROG(MEXEXT, mexext, [${matlab_bindir}/mexext]) # Run "mexext" to get the expected module extension for this platform. AC_MSG_CHECKING([for mex extension]) if test "x$MEXEXT" != "x" ; then MEXEXT=`$MEXEXT` else MEXEXT="mexglx" fi AC_MSG_RESULT([$MEXEXT]) AC_PATH_PROG(MCC, mcc, [${matlab_bindir}]) AC_MSG_CHECKING([for mcc extension]) fi AC_SUBST(MCC) AC_SUBST(MEX) AC_SUBST(MATLAB) AC_SUBST(MEX_ARCH) AC_SUBST(MEXEXT) AC_ARG_WITH( [octave], [AS_HELP_STRING([--with-octave[=DIR]], [location of octave compiler MKOCTFILE @<:@default=check@:>@])], [with_octave=$withval], [with_octave=yes]) OCTAVE= OCTAVE_VERSION= OCTAVE_VERSION_MAJOR= MKOCTFILE= if test "$with_octave" != "no" ; then AC_MSG_CHECKING([for octave and mkoctfile]) if test "$with_octave" = "yes" ; then AC_PATH_PROG(OCTAVE, octave) AC_PATH_PROG(MKOCTFILE, mkoctfile) else AC_PATH_PROG(OCTAVE, octave, [$with_octave/bin:$with_octave]) AC_PATH_PROG(MKOCTFILE, mkoctfile, [${with_octave}/bin/mkoctfile:${with_octave}]) fi if test "x${OCTAVE}" != "x" ; then OCTAVE_VERSION=`${OCTAVE} -v | grep version | cut -d' ' -f4` OCTAVE_VERSION_MAJOR=`echo ${OCTAVE_VERSION} | cut -d'.' -f1` fi fi AC_SUBST(OCTAVE) AC_SUBST(OCTAVE_VERSION) AC_SUBST(OCTAVE_VERSION_MAJOR) AC_SUBST(MKOCTFILE) AC_ARG_WITH( [perl], [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])], [], [with_perl=check]) PERL= PERL_INCLUDES= PERL_ARCHLIB= PERL_ARCHLIBEXP= PERL_VERSION= PERL_VENDORLIB= PERL_PRIVLIB= PERL_CPPFLAGS= PERL_CCFlAGS= PERL_VERSION_RV= PERL_LIBSPEC= if test "$with_perl" != "no" ; then AC_MSG_CHECKING([for perl]) if test "$with_perl" != "yes" ; then AC_PATH_PROG(PERL, perl, [$with_perl/bin:$with_perl]) else AC_PATH_PROG(PERL, perl) fi if test "x${PERL}" != "x" ; then PERL_ARCHLIB=`${PERL} -MConfig -e 'print $Config{archlib}'` PERL_VERSION=`${PERL} -MConfig -e 'print $Config{version}'` PERL_CCFLAGS=`${PERL} -MConfig -e 'print $Config{ccflags}'` PERL_CPPFLAGS=`${PERL} -MConfig -e 'print $Config{cppflags}'` PERL_VENDORLIB=`${PERL} -MConfig -e 'print $Config{vendorlib}'` PERL_PRIVLIB=`${PERL} -MConfig -e 'print $Config{privlib}'` PERL_INSTALLARCHLIB=`${PERL} -MConfig -e 'print $Config{installarchlib}'` PERL_ARCHLIBEXP=`${PERL} -MConfig -e 'print $Config{archlibexp}'` PERL_VERSION_RV=`echo ${PERL_VERSION} | cut -d'.' -f1-2` echo perllib="${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" # libperl may or may not be installed. Check for its existence. if test -f "${PERL_ARCHLIBEXP}/CORE/libperl${SHLIB_SUFFIX}" ; then PERL_LIBSPEC="-L${PERL_ARCHLIBEXP}/CORE -lperl" fi fi fi AC_MSG_RESULT([${PERL}]) AC_SUBST(PERL) AC_SUBST(PERL_INCLUDES) AC_SUBST(PERL_ARCHLIB) AC_SUBST(PERL_ARCHLIBEXP) AC_SUBST(PERL_VERSION) AC_SUBST(PERL_CCFLAGS) AC_SUBST(PERL_CPPFLAGS) AC_SUBST(PERL_VENDORLIB) AC_SUBST(PERL_PRIVLIB) AC_SUBST(PERL_INSTALLARCHLIB) AC_SUBST(PERL_VERSION_RV) AC_SUBST(PERL_LIBSPEC) PYTHON="" PYTHON_CFLAGS="" PYTHON_CPPFLAGS="" HAVE_PYTHON_DISTUTILS="" PYTHON_INCLUDES="" PYTHON_LDFLAGS="" PYTHON_LIB="" PYTHON_LIBDIR="" PYTHON_SITE_DIR="" PYTHON_SITE_PACKAGES="" PYTHON_VERSION="" pythondir="" AC_ARG_WITH([python], [AS_HELP_STRING([--with-python[=DIR]],[location of python @<:@default=check@:>@])], [], [with_python=check]) if test "$with_python" != "no" ; then AC_MSG_CHECKING([for python]) if test -x "$with_python/bin/python"; then echo Found python in $with_python/bin/python PYTHON="$with_python/bin/python" elif test -x "$with_python"; then echo Found python in $with_python PYTHON="$with_python" else AC_PATH_PROG(PYTHON, python python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) fi if test "x${PYTHON}" != "x"; then PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` echo Using python version $PYTHON_VERSION fi if test "x${PYTHON_VERSION}" != "x"; then if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ -d $with_python/lib/python$PYTHON_VERSION/site-packages; then PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages else if test -r $prefix/include/python$PYTHON_VERSION/Python.h; then PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)' PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' else if test -r /usr/include/python$PYTHON_VERSION/Python.h; then PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' else echo could not find python$PYTHON_VERSION/Python.h fi fi if test ! -d "$PYTHON_SITE_PACKAGES"; then PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` fi fi fi if test "x$with_python" != "x" ; then pythondir='$(PYTHON_SITE_PACKAGES)' else pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' fi AC_MSG_CHECKING([for python distutils]) ${PYTHON} -c "from distutils.core import setup; setup(name='test')" \ build build_ext 2>&1 > /dev/null if test $? = 0 ; then HAVE_PYTHON_DISTUTILS="yes" else HAVE_PYTHON_DISTUTILS="no" fi AC_MSG_RESULT([$HAVE_PYTHON_DISTUTILS]) if test "${HAVE_PYTHON_DISTUTILS}" = "yes"; then # # Check for Python include path # AC_MSG_CHECKING([for Python include path]) if test "x${PYTHON_CPPFLAGS}" = "x"; then incdir_path=`${PYTHON} -c "import distutils.sysconfig; \ print distutils.sysconfig.get_python_inc();"` if test -n "${incdir}"; then python_path="-I${incdir}" fi PYTHON_CPPFLAGS=$python_path fi AC_MSG_RESULT([$PYTHON_CPPFLAGS]) AC_SUBST([PYTHON_CPPFLAGS]) # # python distutils found, get settings from python directly # AC_MSG_CHECKING([location of site-packages]) PYTHON_SITE_DIR="`${PYTHON} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(0);'`" 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);'`" 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);'`" PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print \"python\" + sysconfig.get_config_var(\"VERSION\");'`" PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print sysconfig.get_config_var(\"LIBDIR\");'`" fi fi AC_SUBST(pythondir) AC_SUBST(PYTHON) AC_SUBST(PYTHON_VERSION) AC_SUBST(PYTHON_INCLUDES) AC_SUBST(PYTHON_SITE_PACKAGES) AC_SUBST(HAVE_PYTHON_DISTUTILS) rappture_with_ruby="yes" RUBY="" RUBY_DEV_PKG="no" AC_ARG_WITH(ruby, AS_HELP_STRING([--with-ruby=PATH], [absolute path to ruby executable]), [rappture_with_ruby=$with_val]) if test "${rappture_with_ruby}" != "no" ; then if test "${rappture_with_ruby}" = "yes" ; then AC_PATH_PROG(RUBY, ruby) else AC_PATH_PROG(RUBY, ruby, [${rappture_with_ruby}/bin/ruby:${rappture_with_ruby}]) fi fi AC_SUBST(RUBY) RUBY_VERSION_RV= RUBY_PLATFORM= if test "x${RUBY}" != "x" ; then AX_PROG_RUBY_VERSION RUBY_VERSION_RV=`echo ${RUBY_VERSION} | cut -d'.' -f1-2` RUBY_PLATFORM=`ruby -e 'puts RUBY_PLATFORM'` ac_mkmf_result=`${RUBY} -r mkmf -e ";" 2>&1` if test -z "$ac_mkmf_result"; then HAVE_RUBY_DEVEL="yes" AX_RUBY_DEV_FLAGS([${RUBY}]) fi fi AC_SUBST(HAVE_RUBY_DEVEL) AC_SUBST(RUBY_VERSION_RV) AC_SUBST(RUBY_PLATFORM) RP_BASE=`pwd` AC_SUBST(RP_BASE) SC_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # is all taken from the tclConfig.sh file. #-------------------------------------------------------------------- AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_LDFLAGS) AC_SUBST(SHLIB_SUFFIX) if test -f "${exec_prefix}/lib/tclConfig.sh" ; then . ${exec_prefix}/lib/tclConfig.sh fi if test -f "${exec_prefix}/lib/tclConfig.sh" ; then . ${exec_prefix}/lib/tkConfig.sh fi AC_SUBST(TCL_VERSION) AC_SUBST(TK_VERSION) # ----------------------------------------------------------------------- # # Compiler characteristics: # Check for existence of types of size_t and pid_t # # ----------------------------------------------------------------------- AC_C_BIGENDIAN AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(void *) SIZEOF_LONG="${ac_cv_sizeof_long}" SIZEOF_LONG_LONG="${ac_cv_sizeof_long_long}" SIZEOF_VOID_P="${ac_cv_sizeof_void_p}" SIZEOF_INT="${ac_cv_sizeof_int}" AC_SUBST(SIZEOF_INT) AC_SUBST(SIZEOF_LONG) AC_SUBST(SIZEOF_LONG_LONG) AC_SUBST(SIZEOF_VOID_P) #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. #-------------------------------------------------------------------- SC_ENABLE_SYMBOLS if test "${SHARED_BUILD}" = "1" ; then CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' else CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' fi ac_configure_args="--disable-threads --enable-shared" AC_CONFIG_SUBDIRS( [packages/optimizer/src] ) dnl read Makefile.in and write Makefile AC_CONFIG_FILES([ Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile lang/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/RpOctaveInterface.h lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/src/Makefile lang/tcl/scripts/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/contour/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/cloud/Makefile examples/zoo/cloud/matlab/Makefile examples/zoo/curve/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/loadrun/Makefile examples/zoo/log/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile examples/zoo/unirect2d/Makefile test/Makefile test/src/Makefile ]) AC_OUTPUT