--- gpl/axl/configure.ac 2011/06/08 07:09:12 1.1 +++ gpl/axl/configure.ac 2012/02/17 12:50:02 1.1.1.2 @@ -55,34 +55,66 @@ AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(void *) -AM_PATH_PYTHON([2.3]) +dnl check for py-axl support +AC_ARG_ENABLE(py-axl, [ --disable-py-axl Makes Axl Library to be build without PyAxl: python bindings support], + enable_py_axl_support="$enableval", + enable_py_axl_support=yes) +AM_CONDITIONAL(ENABLE_PY_AXL_SUPPORT, test "x$enable_py_axl_support" = "xyes") +if test "$enable_py_axl_support" = "yes" ; then + AM_PATH_PYTHON([2.3]) -# find python-config -PYTHON_CONFIG=`./get-python-config` + # find python-config + PYTHON_CONFIG=`./get-python-config` -# get python includes -PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` -old_CPPFLAGS=$CPPFLAGS -CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES" -echo "Python includes: $PYTHON_INCLUDES" -AC_SUBST(PYTHON_INCLUDES) + # get site_packages + python_dir_check=`eval ./check-python-dir.py ${pythondir}` -AC_TRY_COMPILE([#include ], - [Py_InitModule3(NULL, NULL, NULL);], - python_devel_found=yes, - python_devel_found=no) -AC_MSG_RESULT([Python development headers status: $python_devel_found]) -if test "x$python_devel_found" = "xno"; then - AC_MSG_WARN([Cannot find Python.h header or current python development environment do not compile symbols required. On debian try to install python-dev package.]) -fi + # get python includes + PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$PYTHON_INCLUDES" + echo "Python includes: $PYTHON_INCLUDES" + AC_SUBST(PYTHON_INCLUDES) -# get python flags and libs -PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags 2>/dev/null` -PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null` -AC_SUBST(PYTHON_CFLAGS) -AC_SUBST(PYTHON_LIBS) + AC_TRY_COMPILE([#include ], + [Py_InitModule3(NULL, NULL, NULL);], + python_devel_found=yes, + python_devel_found=no) + AC_MSG_RESULT([Python development headers status: $python_devel_found]) + if test "x$python_devel_found" = "xno"; then + AC_MSG_WARN([Cannot find Python.h header or current python development environment do not compile symbols required. On debian try to install python-dev package.]) + fi + + # get python flags and libs + PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags 2>/dev/null | sed -r 's/\-arch (\d|\w)+ //g'` + PYTHON_LIBS=`$PYTHON_CONFIG --ldflags 2>/dev/null` + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIBS) + + # check python_install_dir and pythondir maches + python_dir_temp=`eval echo ${pythondir}` + # check python_install_dir and pythondir maches + if test "$python_dir_check" != "ok" ; then + AC_MSG_ERROR([ERROR: pythondir variable is poiting to an unusable location: $python_dir_temp. Error detected: $python_dir_check. Fix your autoconf install or disable python building, for that, pass --disable-py-vortex to configure. This usually indicates a problem with automake package which provides the _AM_PATH_PYTHON_ macro.]) + fi + echo "Python install dir OK: $python_dir_temp" +fi AM_CONDITIONAL(ENABLE_PY_AXL, test "x$python_devel_found" = "xyes") +compiler_options="" +STRICT_PROTOTYPES="" +if test "$compiler" = "gcc" ; then + compiler_options="-Wstrict-prototypes -Wall -Werror -g -ansi" + echo "Detected gcc compiler: $compiler, adding options: $compiler_options" +fi +AC_SUBST(compiler_options) + +AC_CHECK_PROG(PKG_CONFIG, pkg-config, "yes", "no") +if test "$PKG_CONFIG" = "no" ; then + AC_MSG_ERROR([You need to install pkg-config to compile Vortex 1.1. See: http://pkgconfig.freedesktop.org/releases/]) +fi + + ########################## # Check for doxygen tool # ########################## @@ -119,8 +151,7 @@ AC_TRY_LINK([#define _GNU_SOURCE #include ], [ char * result; - vasprintf (&result, "This is a test: %d", NULL); - return 0; + return vasprintf (&result, "This is a test: %d", NULL); ], [have_vasprintf=yes],[have_vasprintf=no]) echo "Checking vasprintf support: $have_vasprintf" @@ -206,6 +237,7 @@ $ac_cv_sizeof_long) pti_cast='(long)' ptui_cast='(un esac # Get current configure for the platform and the os we are running. +echo "Host detected: $host" case $host in *-*-beos*) axl_platform="#define AXL_OS_BEOS (1)" @@ -268,6 +300,7 @@ AC_SUBST(SHARED_EXTENSION) AC_OUTPUT([ Makefile +Makefile.win src/Makefile ns/Makefile doc/Makefile @@ -287,11 +320,12 @@ echo "------------------------------------------" echo "-- LibAXL LIBRARY SETTINGS --" echo "------------------------------------------" echo " Installation prefix: [$prefix]" +echo " Compiler: [$compiler]" echo " Build Axl Namespace support: [$enable_axl_ns]" echo " Build Axl Library tests: [$enable_axl_test]" echo " Build Axl Knife: [$enable_axl_knife]" echo " Build Axl Library debug log: [$enable_axl_log]" -echo " Build PyAxl: [$python_devel_found]" +echo " Build PyAxl: [$enable_py_axl_support]" if test x$DOXYGEN = xyes ; then echo " Build Axl Library doc: enabled" else