Changeset 29


Ignore:
Timestamp:
Sep 24, 2010, 4:10:10 PM (9 years ago)
Author:
david
Message:

-modification compilation support python, possibilité de compiler sans le support python

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/configure.ac

    r28 r29  
    128128# ===========================================================================
    129129
     130
     131
     132
    130133AC_ARG_WITH([python],
    131         [AS_HELP_STRING([--with-python=PATH], [specify an alternative directory for python installation])],
    132         [PYTHONCONFIG="$withval/bin/python-config"], [PYTHONCONFIG=""])
    133 
    134 if test "x$PYTHONCONFIG" = "x"; then
    135         # PYTHON was not specified, so search within the current path
    136         AC_PATH_PROG([PYTHONCONFIG], [python-config])
    137 
    138         # If we couldn't find python-config, display a warning
    139         if test "x$PYTHONCONFIG" = "x"; then
    140                 AC_MSG_ERROR([could not find python-config from libpython within the current path. You may need to try re-running configure with a --with-python parameter.])
    141         fi
    142 else
    143         # PYTHON was specified; display a message to the user
    144         if test "x$PYTHON" = "xyes"; then
    145                 AC_MSG_ERROR([you must specify a parameter to --with-python, e.g. --with-python=/path/to/python])
    146         else
    147                 if test -f $PYTHONCONFIG; then
    148                         AC_MSG_RESULT([Using user-specified python-config file: $PYTHONCONFIG])
    149                 else
    150                         AC_MSG_ERROR([the user-specified python-config file $PYTHONCONFIG does not exist])
    151                 fi     
    152         fi
    153 fi
    154 
    155 
    156 # Extract the linker and include flags
    157 PYTHON_LDFLAGS=`$PYTHONCONFIG --libs`
    158 PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
    159 
    160 # Check headers file
    161 CPPFLAGS_SAVE="$CPPFLAGS"
    162 CPPFLAGS="$PYTHON_CPPFLAGS"
    163 AC_CHECK_HEADERS([Python.h],
     134        [AS_HELP_STRING([--with-python=PATH], [To enabled python support or specify an alternative directory for python installation,  disabled by default])],
     135        [PYTHON_PATH="$withval"; PYTHON_ENABLED="-DUSE_PYTHON"], [PYTHON_ENABLED=""])
     136
     137
     138if test -z "$PYTHON_ENABLED"
     139then
     140        PYTHON_FILE=""
     141else
     142        PYTHONCONFIG="$PYTHON_PATH/bin/python-config"
     143        PYTHON_FILE="service_internal_python.o"
     144        if test  "$PYTHON_PATH" = "yes"
     145        then
     146                # PHP was not specified, so search within the current path
     147                AC_PATH_PROG([PYTHONCONFIG], [python-config])
     148        else
     149                PYTHONCONFIG="$PYTHON_PATH/bin/python-config"
     150        fi
     151
     152        # Extract the linker and include flags
     153        PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags`
     154        PYTHON_CPPFLAGS=`$PYTHONCONFIG --cflags`
     155
     156        # Check headers file
     157        CPPFLAGS_SAVE="$CPPFLAGS"
     158        CPPFLAGS="$PYTHON_CPPFLAGS"
     159        AC_CHECK_HEADERS([Python.h],
    164160                 [], [AC_MSG_ERROR([could not find headers include related to libpython])])
    165161
    166 # Ensure we can link against libpython
    167 LIBS_SAVE="$LIBS"
    168 LIBS="$PYTHON_LDFLAGS"
    169 # Shouldn't we get python here rather than python2.6 :) ??
    170 PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
    171 AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
    172 
    173 AC_SUBST([PYTHON_CPPFLAGS])
    174 AC_SUBST([PYTHON_LDFLAGS])
     162        # Ensure we can link against libphp
     163        LIBS_SAVE="$LIBS"
     164        LIBS="$PYTHON_LDFLAGS"
     165        PY_LIB=`$PYTHONCONFIG --libs | sed -e 's/^.*\(python2\..\)$/\1/'`
     166        AC_CHECK_LIB([$PY_LIB], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], [])
     167        AC_SUBST([PYTHON_CPPFLAGS])
     168        AC_SUBST([PYTHON_LDFLAGS])
     169fi
     170
     171AC_SUBST([PYTHON_ENABLED])
     172AC_SUBST([PYTHON_FILE])
    175173
    176174# ===========================================================================
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png