summaryrefslogtreecommitdiff
blob: beb9dd4de815db90c32cf7e0676cfcccc681966e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Fix underlinking issues, caused by missing -lpython27 and -lpthread

--- nlopt-2.4.2/configure.ac
+++ nlopt-2.4.2/configure.ac
@@ -161,33 +161,17 @@
 dnl Python:
 AM_PATH_PYTHON([],[have_python=yes],[have_python=no])
 if test $have_python = yes; then
-  AC_ARG_VAR([PYTHON_CONFIG], [python-config program])
-  AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config],
-                [unknown], [`dirname $PYTHON`:$PATH])
-  AC_MSG_CHECKING([for Python include flags])
-  if test "x$PYTHON_CONFIG" = "xunknown"; then
-      pinc=-I`echo "import distutils.sysconfig; print (distutils.sysconfig.get_python_inc())" | $PYTHON - 2>/dev/null`
-      test "x$pinc" = "x-I" && pinc=""
-  else
-      pinc=`$PYTHON_CONFIG --includes 2>/dev/null`
-  fi
-  AC_MSG_RESULT([${pinc:-unknown}])
-  PYTHON_INCLUDES="$pinc"
-  save_CPPFLAGS=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-  AC_CHECK_HEADER([Python.h], [], [AC_MSG_WARN([disabling Python wrappers]) 
-                                   have_python=no])
-  if test $have_python = yes; then
+  PKG_CHECK_MODULES([PYTHON], [python-2.7])
+  CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
+  
     AC_MSG_CHECKING([for Numpy include directory])
     pinc=`echo "import numpy; print (numpy.get_include())" | $PYTHON - 2>/dev/null`
     AC_MSG_RESULT([${pinc:-unknown}])
-    test -n "$pinc" && PYTHON_INCLUDES="$PYTHON_INCLUDES -I$pinc"
+    test -n "$pinc" && PYTHON_INCLUDES="$PYTHON_CFLAGS -I$pinc"
     CPPFLAGS="$save_CPPFLAGS $PYTHON_INCLUDES"
     AC_CHECK_HEADER([numpy/arrayobject.h],[],[
       AC_MSG_WARN([disabling Python wrappers])
       have_python=no],[#include <Python.h>])
-  fi
-  CPPFLAGS=$save_CPPFLAGS
 fi
 
 fi # with_python
--- nlopt-2.4.2/swig/Makefile.am
+++ nlopt-2.4.2/swig/Makefile.am
@@ -9,7 +9,7 @@
 # Guile wrapper
 
 libnlopt@NLOPT_SUFFIX@_guile_la_SOURCES = nlopt-guile.cpp
-libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la @GUILE_LIBS@
+libnlopt@NLOPT_SUFFIX@_guile_la_LIBADD = -lpthread ../libnlopt@NLOPT_SUFFIX@.la @GUILE_LIBS@
 libnlopt@NLOPT_SUFFIX@_guile_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
 libnlopt@NLOPT_SUFFIX@_guile_la_CPPFLAGS = $(GUILE_CPPFLAGS) -I$(top_srcdir)/api
 
@@ -23,7 +23,7 @@
 # Python wrapper
 
 _nlopt_la_SOURCES = nlopt-python.cpp
-_nlopt_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la
+_nlopt_la_LIBADD = ../libnlopt@NLOPT_SUFFIX@.la @PYTHON_LIBS@
 _nlopt_la_LDFLAGS = -module -version-info @SHARED_VERSION_INFO@
 _nlopt_la_CPPFLAGS = $(PYTHON_INCLUDES) -I$(top_srcdir)/api