- Timestamp:
- Sep 24, 2010, 4:10:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/configure.ac
r28 r29 128 128 # =========================================================================== 129 129 130 131 132 130 133 AC_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 138 if test -z "$PYTHON_ENABLED" 139 then 140 PYTHON_FILE="" 141 else 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], 164 160 [], [AC_MSG_ERROR([could not find headers include related to libpython])]) 165 161 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]) 169 fi 170 171 AC_SUBST([PYTHON_ENABLED]) 172 AC_SUBST([PYTHON_FILE]) 175 173 176 174 # ===========================================================================
Note: See TracChangeset
for help on using the changeset viewer.