Only check for Python development support if building netns components.

This commit is contained in:
tgoff0 2015-05-26 20:39:56 +00:00
parent b67bbb1156
commit fd0af6176a

View file

@ -224,27 +224,29 @@ if test "x$want_python" = "xno"; then
fi fi
if test "x$want_python" = "xyes"; then if test "x$want_python" = "xyes"; then
CFLAGS_save=$CFLAGS if test "x$want_linux_netns" = "xyes"; then
CPPFLAGS_save=$CPPFLAGS CFLAGS_save=$CFLAGS
if test "x$PYTHON_INCLUDE_DIR" = "x"; then CPPFLAGS_save=$CPPFLAGS
PYTHON_INCLUDE_DIR=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"` if test "x$PYTHON_INCLUDE_DIR" = "x"; then
PYTHON_INCLUDE_DIR=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"`
fi
CFLAGS="-I$PYTHON_INCLUDE_DIR"
CPPFLAGS="-I$PYTHON_INCLUDE_DIR"
AC_CHECK_HEADERS([Python.h], [],
AC_MSG_ERROR([Python bindings require Python development headers (try installing your 'python-devel' or 'python-dev' package)]))
CFLAGS=$CFLAGS_save
CPPFLAGS=$CPPFLAGS_save
PKG_CHECK_MODULES(libev, libev,
AC_MSG_RESULT([found libev using pkgconfig OK])
AC_SUBST(libev_CFLAGS)
AC_SUBST(libev_LIBS),
AC_MSG_RESULT([did not find libev using pkconfig...])
AC_CHECK_LIB([ev], ev_set_allocator,
AC_MSG_RESULT([found libev OK])
AC_SUBST(libev_CFLAGS)
AC_SUBST(libev_LIBS, [-lev]),
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
fi fi
CFLAGS="-I$PYTHON_INCLUDE_DIR"
CPPFLAGS="-I$PYTHON_INCLUDE_DIR"
AC_CHECK_HEADERS([Python.h], [],
AC_MSG_ERROR([Python bindings require Python development headers (try installing your 'python-devel' or 'python-dev' package)]))
CFLAGS=$CFLAGS_save
CPPFLAGS=$CPPFLAGS_save
PKG_CHECK_MODULES(libev, libev,
AC_MSG_RESULT([found libev using pkgconfig OK])
AC_SUBST(libev_CFLAGS)
AC_SUBST(libev_LIBS),
AC_MSG_RESULT([did not find libev using pkconfig...])
AC_CHECK_LIB([ev], ev_set_allocator,
AC_MSG_RESULT([found libev OK])
AC_SUBST(libev_CFLAGS)
AC_SUBST(libev_LIBS, [-lev]),
AC_MSG_ERROR([Python bindings require libev (try installing your 'libev-devel' or 'libev-dev' package)])))
AC_SUBST(pyprefix, `eval ${PYTHON} ./python-prefix.py ${PYTHON_PREFIX} ${PYTHON_VERSION}`) AC_SUBST(pyprefix, `eval ${PYTHON} ./python-prefix.py ${PYTHON_PREFIX} ${PYTHON_VERSION}`)
if test "${pyprefix}" != "${PYTHON_PREFIX}"; then if test "${pyprefix}" != "${PYTHON_PREFIX}"; then
pythondir=`echo ${pythondir} | sed -e 's,[$][{]prefix[}],${pyprefix},g'` pythondir=`echo ${pythondir} | sed -e 's,[$][{]prefix[}],${pyprefix},g'`