AC_INIT([Rappture], [1.1], [rappture@nanohub.org]) #------------------------------------------------------------------------ # 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 dnl find and test the C compiler AC_PROG_CC AC_LANG_C AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_LN_S AC_HEADER_STDC AC_CHECK_FUNC(atol,,AC_MSG_ERROR(oops! no atol ?!?)) AC_PROG_CXX AC_LANG_CPLUSPLUS AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(librappture requires libstdc++)) AC_CHECK_HEADERS(stack,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(string,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(list,,AC_MSG_WARN(STL classes missing ?)) AC_CHECK_HEADERS(vector,,AC_MSG_WARN(STL classes missing ?)) AC_PROG_F77([g77 gfortran f77 fort77 f90 xlf xlf90 fl32]) SC_CONFIG_GCC SC_CONFIG_CFLAGS SC_MAKE_LIB 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) dnl AC_ARG_ENABLE( dnl [tcl], dnl [AS_HELP_STRING([--enable-tcl], [build tcl bindings @<:@default=check@:>@])], dnl [], dnl [enable_tcl=check]) dnl dnl BUILD_TCL=yes dnl AC_SUBST(BUILD_TCL) 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) dnl AC_ARG_ENABLE ( dnl [matlab], dnl [AS_HELP_STRING([--enable-matlab], [build matlab bindings @<:@default=check@:>@])], dnl [], dnl [enable_matlab=check]) dnl BUILD_MATLAB=yes dnl AC_SUBST(BUILD_MATLAB) AC_ARG_WITH( [matlab], [AS_HELP_STRING([--with-matlab[=DIR]], [location of matlab and mex compiler @<:@default=check@:>@])], [], [with_matlab=check]) AC_ARG_WITH( [matlab_arch], [AS_HELP_STRING([--with-matlab-arch[=ARCH]], [build Matlab bindings for ARCH architecture @<:@default=check@:>@])], [], [with_matlab_arch=check]) AC_ARG_WITH( [mexext], [AS_HELP_STRING([--with-mexext[=ARCH]], [fallback extension for building mex files @<:@default=check@:>@])], [], [with_mexext=check]) MEX= MEX_ARCH= MEXEXT= dnl if test "$enable_matlab" != "no" ; then if test "$with_matlab" != "no" ; then AC_MSG_CHECKING([for matlab's mex]) if test "$with_matlab" != "no" ; then dnl WITH_MATLAB = "yes" if test -x "$with_matlab/bin/mex" then dnl # echo Found mex in $with_matlab/bin/mex MEX="$with_matlab/bin/mex" else if test -x "$with_matlab" then dnl # echo Found mex in $with_matlab MEX="$with_matlab" else AC_PATH_PROG(MEX, mex) fi fi matlab_path=`dirname $MEX`/matlab if test -x "$matlab_path" then MEX=${MEX} else MEX= fi AC_MSG_RESULT([${MEX}]) if test "$with_matlab_arch" = "check" ; then dnl still need to write the code to check the arch type with_matlab_arch="" fi if test "x$with_matlab_arch" != "x" ; then echo "using matlab architecture \"$with_matlab_arch\"" MEX_ARCH="-arch=$with_matlab_arch" dnl else dnl # if $with_matlab_arch is blank, get the os name from uname fi if test "x$MEX" != "x" ; then mexext_fxn=`dirname $MEX`/mexext if test -x "$mexext_fxn" ; then MEXEXT=`$mexext_fxn` if test "x${MEXEXT}" = "x" ; then dnl not even mexext can figure out what extension to use.... dnl # we should be doing an os type check instead of default mexglx dnl # use $with_matlab_arch if test "$with_mexext" != "check" ; then MEXEXT="mexglx" fi fi else if test "$with_mexext" != "check" ; then MEXEXT="mexglx" fi fi echo "Using mex file extension \"$MEXEXT\"" AC_MSG_RESULT([${MEXEXT}]) else dnl we shouldn't bother the user if we dont find matlab dnl just put out the message and don't compile matlab bindings echo "can't find the matlab compiler \"mex\"" echo "use --with-matlab=DIR to specify the location of a matlab installation" dnl # exit 1 fi fi fi AC_SUBST(MEX) AC_SUBST(MEX_ARCH) AC_SUBST(MEXEXT) dnl AC_ARG_ENABLE( dnl [octave], dnl [AS_HELP_STRING([--enable-octave], [build octave bindings @<:@default=check@:>@])], dnl [], dnl [enable_octave=check]) dnl BUILD_OCTAVE=yes dnl AC_SUBST(BUILD_OCTAVE) AC_ARG_WITH( [octave], [AS_HELP_STRING([--with-octave[=DIR]], [location of octave compiler MKOCTFILE @<:@default=check@:>@])], [], [with_octave=check]) MKOCTFILE= dnl if test "$enable_octave" != "no" ; then if test "$with_octave" != "no" ; then AC_MSG_CHECKING([for mkoctfile]) if test "$with_octave" != "no" ; then if test -x "$with_octave/bin/mkoctfile" then dnl echo Found octave in $with_octave/bin/mkoctfile MKOCTFILE="$with_octave/bin/mkoctfile" else if test -x "$with_octave" then echo Found mkoctfile in $with_octave MKOCTFILE="$with_octave" else AC_PATH_PROG(MKOCTFILE, mkoctfile) if test "x$MKOCTFILE" == "x" ; then dnl we shouldn't bother the user if we dont find mkoctfile dnl just put out the message and don't compile octave bindings echo "can't find the matlab compiler \"mkoctfile\"" echo "use --with-octave=DIR to specify the location of a mkoctfile installation" dnl # exit 1 fi fi fi fi AC_MSG_RESULT([${MKOCTFILE}]) fi AC_SUBST(MKOCTFILE) dnl perl and python check borrowed from dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in dnl dnl Perl is just needed for generating some data for XSLtmark dnl dnl AC_ARG_ENABLE( dnl [perl], dnl [AS_HELP_STRING([--enable-perl], [build perl bindings @<:@default=check@:>@])], dnl [], dnl [enable_perl=check]) dnl BUILD_PERL=yes dnl AC_SUBST(BUILD_PERL) AC_ARG_WITH( [perl], [AS_HELP_STRING([--with-perl[=DIR]], [location of perl @<:@default=check@:>@])], [], [with_perl=check]) PERL= PERL_INCLUDES= PERL_SITE_PACKAGES= if test "$with_perl" != "no" ; then AC_MSG_CHECKING([for perl]) if test -x "$with_perl/bin/perl" then echo Found perl in $with_perl/bin/perl PERL="$with_perl/bin/perl" else if test -x "$with_perl" then echo Found perl in $with_perl PERL="$with_perl" else AC_PATH_PROG(PERL, perl) fi fi PERL_SITE_PACKAGES='$(libdir)/perl5' fi AC_MSG_RESULT([${PERL}]) AC_SUBST(PERL) AC_SUBST(PERL_INCLUDES) AC_SUBST(PERL_SITE_PACKAGES) dnl dnl check for python dnl dnl AC_ARG_ENABLE( dnl [python], dnl [AS_HELP_STRING([--enable-pyton], [build python bindings @<:@default=check@:>@])], dnl [], dnl [enable_python=check]) dnl dnl BUILD_PYTHON=yes dnl AC_SUBST(BUILD_PYTHON) PYTHON= PYTHON_VERSION= PYTHON_INCLUDES= PYTHON_SITE_PACKAGES= 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" else if 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 fi if test "$PYTHON" != "" then PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` echo Using python version $PYTHON_VERSION fi if test "$PYTHON_VERSION" != "" 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 "$with_python" != "" then pythondir='$(PYTHON_SITE_PACKAGES)' else pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages' fi fi AC_SUBST(pythondir) dnl AC_SUBST(PYTHON_SUBDIR) AC_SUBST(PYTHON) AC_SUBST(PYTHON_VERSION) AC_SUBST(PYTHON_INCLUDES) AC_SUBST(PYTHON_SITE_PACKAGES) AC_ARG_WITH( [ruby], [AS_HELP_STRING([--with-ruby[=DIR]], [location of ruby @<:@default=check@:>@])], [], [with_ruby=check]) RUBY="" if test "$with_ruby" != "no" ; then AC_MSG_CHECKING([for ruby]) if test -x "$with_ruby/bin/ruby" then echo Found perl in $with_ruby/bin/ruby PERL="$with_ruby/bin/ruby" else if test -x "$with_ruby" then echo Found ruby in $with_ruby PERL="$with_ruby" else AC_PATH_PROG(RUBY, ruby) fi fi fi AC_MSG_RESULT([${RUBY}]) AC_SUBST(RUBY) 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) #-------------------------------------------------------------------- # 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_CONFIG_SUBDIRS( [packages/optimizer/src] ) dnl read Makefile.in and write Makefile AC_OUTPUT( [ Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile gui/Makefile gui/apps/Makefile gui/apps/rappture gui/apps/rappture.env gui/apps/simsim 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/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 examples/Makefile examples/3D/Makefile examples/app-fermi/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/matlab/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/graph/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/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/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 test/Makefile test/src/Makefile ])