AC_INIT(rappture, 1.1, rappture@nanohub.org) VERSION=0.0.1 #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # AC_PROG_INSTALL AC_PROG_MAKE_SET dnl find and test the C compiler AC_PROG_CC AC_LANG_C 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([f77 fort77 g77 f90 xlf xlf90 fl32]) AC_ARG_WITH(matlab, [ --with-matlab[=DIR] Build Matlab bindings if MEX compiler is found]) dnl AC_CHECK_PROG(MEX, mex, mex, false) MEX= if test "$with_matlab" != "no" ; then dnl WITH_MATLAB = "yes" if test -x "$with_matlab/bin/mex" then echo Found matlab in $with_matlab/bin/mex MEX="$with_matlab/bin/mex" else if test -x "$with_matlab" then echo Found mex in $with_matlab MEX="$with_matlab" else AC_PATH_PROG(MEX, mex) fi fi fi dnl AM_CONDITIONAL(WITH_MATLAB, test x$MEX != x) AC_ARG_WITH(octave, [ --with-octave[=DIR] Build Octave bindings if MKOCTFILE compiler is found]) dnl AC_CHECK_PROG(MKOCTFILE, mkoctfile, mkoctfile, false) MKOCTFILE= if test "$with_octave" != "no" ; then if test -x "$with_octave/bin/mkoctfile" then 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) fi fi fi dnl AM_CONDITIONAL(WITH_OCTAVE, test x$MKOCTFILE != x) 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 AC_ARG_WITH(perl, [ --with-perl[=DIR] Build Perl bindings if found]) dnl AC_CHECK_PROG(PERL, perl, perl, false) dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false") PERL= PERL_INCLUDES= if test "$with_perl" != "no" ; then 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 fi dnl AM_CONDITIONAL(WITH_PERL, test x$PERL != x) dnl dnl check for python dnl PYTHON= PYTHON_VERSION= PYTHON_INCLUDES= PYTHON_SITE_PACKAGES= pythondir= AC_ARG_WITH(python, [ --with-python[=DIR] Build Python bindings if found]) if test "$with_python" != "no" ; then 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.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 dnl AM_CONDITIONAL(WITH_PYTHON, test x$PYTHON != x) dnl AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") dnl if test "$PYTHON_INCLUDES" != "" dnl then dnl PYTHON_SUBDIR=python dnl else dnl PYTHON_SUBDIR= dnl fi AC_SUBST(pythondir) dnl AC_SUBST(PYTHON_SUBDIR) AC_SUBST(MEX) AC_SUBST(MKOCTFILE) AC_SUBST(PERL) AC_SUBST(PERL_INCLUDES) AC_SUBST(PYTHON) AC_SUBST(PYTHON_VERSION) AC_SUBST(PYTHON_INCLUDES) AC_SUBST(PYTHON_SITE_PACKAGES) AC_SUBST(VERSION) RP_BASE=`pwd` AC_SUBST(RP_BASE) AC_CONFIG_SUBDIRS( gui ) dnl read Makefile.in and write Makefile AC_OUTPUT( Makefile \ examples/demo.bash examples/app-fermi/cee/Makefile \ examples/app-fermi/fortran/Makefile \ examples/c-example/Makefile \ perl/Makefile.PL \ python/setup.py \ src/Makefile \ src/matlab/Makefile \ src/octave/Makefile \ test/Makefile \ gui/apps/rappture )