python-numpy: add optional blas/lapack support
authorSamuel Martin <s.martin49@gmail.com>
Tue, 22 Apr 2014 23:15:38 +0000 (01:15 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 16 Jul 2014 20:46:31 +0000 (22:46 +0200)
python-numpy can be linked with libblas and liblapack, so
automatically do it when clapack is enabled.

[Thomas:
 - Fix issues in the original submission and reformat according to
   Yann E. Morin suggestions.
 - Properly format the "libraries" entry in site.cfg as outlined in
   the example site.cfg file: the list of libraries should be
   space-separated.]

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/python-numpy/python-numpy.mk

index e309ef6afa8d14f9aa1322067377df33f917eb11..3d3a6c52d0325b046957e86f4f14161af4398404 100644 (file)
@@ -11,6 +11,11 @@ PYTHON_NUMPY_LICENSE = BSD-3c
 PYTHON_NUMPY_LICENSE_FILES = LICENSE.txt
 PYTHON_NUMPY_SETUP_TYPE = distutils
 
+ifeq ($(BR2_PACKAGE_CLAPACK),y)
+PYTHON_NUMPY_DEPENDENCIES += clapack
+PYTHON_NUMPY_SITE_CFG_LIBS += blas lapack
+endif
+
 PYTHON_NUMPY_BUILD_OPT = --fcompiler=None
 
 define PYTHON_NUMPY_CONFIGURE_CMDS
@@ -18,7 +23,7 @@ define PYTHON_NUMPY_CONFIGURE_CMDS
        echo "[DEFAULT]" >> $(@D)/site.cfg
        echo "library_dirs = $(STAGING_DIR)/usr/lib" >> $(@D)/site.cfg
        echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg
-       echo "libraries =" >> $(@D)/site.cfg
+       echo "libraries =" $(subst $(space),$(comma),$(PYTHON_NUMPY_SITE_CFG_LIBS)) >> $(@D)/site.cfg
 endef
 
 # Some package may include few headers from NumPy, so let's install it