]> granicus.if.org Git - cracklib/commitdiff
remaining python patch to disable build if header missing
authorNathan Neulinger <nneul@neulinger.org>
Mon, 26 Sep 2005 20:49:12 +0000 (20:49 +0000)
committerNathan Neulinger <nneul@neulinger.org>
Mon, 26 Sep 2005 20:49:12 +0000 (20:49 +0000)
git-svn-id: file:///tmp/cracklib-svn/trunk/cracklib@66 4175fe1e-86d5-4fdc-8e6a-506fab9d8533

NEWS
configure.in
python/Makefile.am
python/cracklibmodule.c

diff --git a/NEWS b/NEWS
index 29cd994962ad6bce97d96a16594dd7c02f94a8ec..cdd5b08478c2396b566f4c85cf64cee8a736ad47 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 v2.8.4  Patches for mod_php build issues
         Full localization of strings thanks to Thorsten Kukuk.
+       Patches for python binding support thanks to Nalin Dahyabhai
 v2.8.3  Deal with integer type and header portability issues
 v2.8.2  Check for LINE_MAX, cygwin workaround (sf patch #125964, Jürgen)
        Fix a buffer overflow in packlib file handling (not a security issue)
index d23e863bdf07a70dd48b9c8b6b12a756a45ee8ed..6cd03bdf773eeab7438667a57106acfe06122ae9 100644 (file)
@@ -53,18 +53,30 @@ AC_ARG_WITH(python,
 AC_HELP_STRING(--without,[Build a python module (default auto)]),
 build_python=$withval,build_python=auto)
 if test "$build_python" != no ; then
-   AM_PATH_PYTHON(,,[
-   if test "$build_python" = auto ; then
-      AC_MSG_WARN([python was not found, continuing])
-      build_python=no
-   else
-      AC_MSG_ERROR([python was required but not found])
+   AM_PATH_PYTHON(,,
+                  [if test "$build_python" != yes ; then
+                      AC_MSG_WARN([python was not found, continuing])
+                      build_python=no
+                   else
+                      AC_MSG_ERROR([python was required but not found])
+                   fi])
+   if test "$build_python" != no ; then
+      AC_CHECK_HEADERS(python${PYTHON_VERSION}/Python.h,,
+                      [if test "$build_python" != yes ; then
+                          AC_MSG_WARN([python headers not found, continuing])
+                          build_python=no
+                       else
+                          AC_MSG_ERROR([python headers not found])
+                       fi])
    fi
-   ])
    if test "$build_python" != no ; then
       build_python=yes
    fi
 fi
+if test $build_python = yes ; then
+       AC_CHECK_HEADERS(python${PYTHON_VERSION}/Python.h,,
+                        [AC_MSG_ERROR([python headers not found])])
+fi
 AM_CONDITIONAL(BUILD_PYTHON,[test "$build_python" = "yes"])
 
 AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \
index f6abc0c9473ddea4ec020866e89f706ca0832f06..dee5d12080569df797512227be72e8ea4008b3ac 100644 (file)
@@ -1,7 +1,7 @@
 if BUILD_PYTHON
 pyexec_LTLIBRARIES = cracklibmodule.la
 cracklibmodule_la_LDFLAGS = -module -avoid-version
-INCLUDES = -I${PYTHON_PREFIX}/include/python${PYTHON_VERSION} -I/usr/include/python${PYTHON_VERSION}
 DEFS += '-DDEFAULT_CRACKLIB_DICT="$(pkgdatadir)/pw_dict"'
+DEFS += '-DPYTHON_H="python@PYTHON_VERSION@/Python.h"'
 endif
 
index 2b2bbd758b478b372f24f588fc797351f3a2c286..8c2869d06675c67558bc4b405fac5538464da053 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <Python.h>
+#include PYTHON_H
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #endif