[apparmor] [patch] libapparmor - use python-config if it exists when configuring

Steve Beattie steve at nxnw.org
Tue Jan 29 07:44:18 UTC 2013


Author: Dmitrijs Ledkovs <dmitrij.ledkov at ubuntu.com>

This patch modifies the libapparmor macro for python to use
python-config if it exists to determine what CPPFLAGS and LDFLAGS to
use when building the python swig libraries. Without this addition,
python detection fails on ubuntu 13.04. I've confirmed that with this
patch applied, the python libraries still build successfully on older
releases as well (as far back as ubuntu 11.10).

---
 libraries/libapparmor/m4/ac_python_devel.m4 |    6 ++++++
 1 file changed, 6 insertions(+)

Index: b/libraries/libapparmor/m4/ac_python_devel.m4
===================================================================
--- a/libraries/libapparmor/m4/ac_python_devel.m4
+++ b/libraries/libapparmor/m4/ac_python_devel.m4
@@ -79,6 +79,9 @@ $ac_distutils_result])
         # Check for Python include path
         #
         AC_MSG_CHECKING([for Python include path])
+        if type $PYTHON-config; then
+                PYTHON_CPPFLAGS=`$PYTHON-config --includes`
+        fi
         if test -z "$PYTHON_CPPFLAGS"; then
                 python_path=`$PYTHON -c "import distutils.sysconfig; \
                         print distutils.sysconfig.get_python_inc();"`
@@ -94,6 +97,9 @@ $ac_distutils_result])
         # Check for Python library path
         #
         AC_MSG_CHECKING([for Python library path])
+        if type $PYTHON-config; then
+                PYTHON_LDFLAGS=`$PYTHON-config --ldflags`
+        fi
         if test -z "$PYTHON_LDFLAGS"; then
                 # (makes two attempts to ensure we've got a version number
                 # from the interpreter)

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130128/e8be50b4/attachment.pgp>


More information about the AppArmor mailing list