AC_DEFUN(OSSIM_CHECK_LIBGRASS, [ AC_ARG_WITH(grass,[ --with-grass[=ARG] Include GRASS support (ARG=no or libgrass path)],,) LIBGRASS_LIBS= LIBGRASS_INCLUDE= GRASS_SETTING=0 export LIBGRASS_LIBS LIBGRASS_INCLUDE GRASS_SETTING if test "$with_grass" = "no" ; then echo "GRASS support disabled." elif test "$with_grass" = "yes" -o "$with_grass" = "" ; then AC_CHECK_LIB(grass5,G_gisinit_2,GRASS_SETTING=1,GRASS_SETTING=0,) if test "$GRASS_SETTING" = "1" ; then LIBGRASS_LIBS="-lgrass5" fi else GRASS_SETTING=1 LIBGRASS_LIBS="-L$with_grass -L$with_grass/lib -lgrass5" LIBGRASS_INCLUDE="-I$with_grass -I$with_grass/include" echo "using libgrass from $with_grass." fi AC_SUBST(GRASS_SETTING,$GRASS_SETTING) AC_SUBST(LIBGRASS_LIBS,$LIBGRASS_LIBS) AC_SUBST(LIBGRASS_INCLUDE,$LIBGRASS_INCLUDE) ]) AC_DEFUN(OSSIM_CHECK_WXGTK, [ AC_PATH_PROG(WXGTKCONFIG,wxgtk-config,no) if test "$WXGTKCONFIG" = no ; then AC_MSG_ERROR([wxgtk-config was not found, unable to build OSSIM.]) fi WXGTK_INCLUDE=`wxgtk-config --cflags` export WXGTK_INCLUDE AC_SUBST(WXGTK_INCLUDE,$WXGTK_INCLUDE) WXGTK_LIBS=`wxgtk-config --libs` export WXGTK_LIBS AC_SUBST(WXGTK_LIBS,$WXGTK_LIBS) ]) dnl dnl Find Python. dnl AC_DEFUN(AM_PATH_PYTHON, [AC_CHECK_PROGS(PYTHON, python python1.5 python1.4 python1.3,no) if test "$with_python" = no ; then echo "python support disabled" PYTHON=no fi if test "$PYTHON" != no ; then AC_MSG_CHECKING([where .py files should go]) changequote(, )dnl python_prefix=`$PYTHON -c' import sys print sys.prefix'` python_version=`$PYTHON -c' import sys print sys.version[:3]'` changequote([, ])dnl py_lib=$python_prefix/lib/python$python_version pythondir=$py_lib/site-packages pyexecdir=$py_lib/site-packages pythonlib=$py_lib/config/libpython${python_version}.a AC_MSG_RESULT($pythondir) else # these defaults are version independent ... pythondir='$(prefix)/lib/site-python' pyexecdir='$(exec_prefix)/lib/site-python' pythonlib= fi AC_SUBST(pythonlib) AC_SUBST(pythondir) AC_SUBST(pyexecdir)]) dnl finds information needed for compilation of shared library style python dnl extensions. AM_PATH_PYTHON should be called before hand. dnl NFW: Modified from original to avoid overridding CC, SO and OPT AC_DEFUN(AM_INIT_PYEXEC_MOD, [AC_REQUIRE([AM_PATH_PYTHON]) if test "$PYTHON" != no ; then AC_MSG_CHECKING([for python headers]) AC_CACHE_VAL(am_cv_python_includes, [changequote(,)dnl am_cv_python_includes="`$PYTHON -c ' import sys includepy = \"%s/include/python%s\" % (sys.prefix, sys.version[:3]) if sys.version[0] > \"1\" or sys.version[2] > \"4\": libpl = \"%s/include/python%s\" % (sys.exec_prefix, sys.version[:3]) else: libpl = \"%s/lib/python%s/config\" % (sys.exec_prefix, sys.version[:3]) print \"-I%s -I%s\" % (includepy, libpl)'`" changequote([, ])]) PYTHON_INCLUDES="$am_cv_python_includes" AC_MSG_RESULT(found) AC_SUBST(PYTHON_INCLUDES) AC_MSG_CHECKING([definitions from Python makefile]) AC_CACHE_VAL(am_cv_python_makefile, [changequote(,)dnl py_makefile="`$PYTHON -c ' import sys print \"%s/lib/python%s/config/Makefile\"%(sys.exec_prefix, sys.version[:3])'`" if test ! -f "$py_makefile"; then AC_MSG_ERROR([*** Couldn't find the python config makefile. Maybe you are *** missing the development portion of the python installation]) fi eval `sed -n \ -e "s/^CC=[ ]*\(.*\)/am_cv_python_CC='\1'/p" \ -e "s/^OPT=[ ]*\(.*\)/am_cv_python_OPT='\1'/p" \ -e "s/^CCSHARED=[ ]*\(.*\)/am_cv_python_CCSHARED='\1'/p" \ -e "s/^LDSHARED=[ ]*\(.*\)/am_cv_python_LDSHARED='\1'/p" \ -e "s/^SO=[ ]*\(.*\)/am_cv_python_SO='\1'/p" \ $py_makefile` am_cv_python_makefile=found changequote([, ])]) AC_MSG_RESULT(done) PYTHON_CC="$am_cv_python_CC" PYTHON_OPT="$am_cv_python_OPT" PYTHON_SO="$am_cv_python_SO" PYTHON_CFLAGS="$am_cv_python_CCSHARED \$(OPT)" PYTHON_LINK="$am_cv_python_LDSHARED -o \[$]@" else PYTHON_CC="" PYTHON_OPT="" PYTHON_SO="" PYTHON_CFLAGS="" PYTHON_LINK="" fi AC_SUBST(PYTHON_CC)dnl AC_SUBST(PYTHON_OPT)dnl AC_SUBST(PYTHON_SO)dnl AC_SUBST(PYTHON_CFLAGS)dnl AC_SUBST(PYTHON_LINK)])