Make alsa-lib depend on libpython, if new BR2_PACKAGE_ALSA_LIB_PYTHON is selected
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Sat, 17 Jan 2009 00:19:06 +0000 (00:19 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Sat, 17 Jan 2009 00:19:06 +0000 (00:19 -0000)
package/multimedia/alsa-lib/Config.in
package/multimedia/alsa-lib/alsa-lib.mk
package/python/python.mk

index 3077d36b1330620dea6f7d0a4af155ad77872faf..6d9ee835e02d351d72bc1352b38cf3ba186ecc17 100644 (file)
@@ -5,3 +5,14 @@ config BR2_PACKAGE_ALSA_LIB
          functionality to the Linux operating system.
 
          http://www.alsa-project.org/
+
+config BR2_PACKAGE_ALSA_LIB_PYTHON
+       bool "Python support for alsa-lib"
+       depends on BR2_PACKAGE_ALSA_LIB
+       select BR2_PACKAGE_PYTHON
+       help
+         Add python support for alsa-lib.
+         Python will be built and libpython will be installed
+         in the target directory
+         http://www.alsa-project.org/
+
index b8706264680a7b5786bddba9b2e9fdea57d183d5..5105b2bb788bfdccd48128daacc71ea219f3b602 100644 (file)
@@ -17,8 +17,9 @@ else
 ALSA_LIB_ABI:=
 endif
 
-ifeq ($(BR2_PACKAGE_PYTHON),y)
+ifeq ($(BR2_PACKAGE_ALSA_LIB_PYTHON),y)
 ALSA_LIB_CONFIGURE_OPTS += --with-pythonlibs=-lpython$(PYTHON_VERSION_MAJOR)
+ALSA_LIB_DEPS = libpython
 else
 ALSA_LIB_CONFIGURE_OPTS += --disable-python
 endif
@@ -74,7 +75,7 @@ $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY): $(STAGING_DIR)/$(ALSA_LIB_TARGET_BINARY
        -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/alsa-lib/smixer/*.so
        touch -c $@
 
-alsa-lib: uclibc $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
+alsa-lib: uclibc $(ALSA_LIB_DEPS) $(TARGET_DIR)/$(ALSA_LIB_TARGET_BINARY)
 
 alsa-lib-source: $(DL_DIR)/$(ALSA-LIB_SOURCE)
 
index d775cce3f2bab60bc404c4d58bff12697fcd4a63..3173ad0c42d52d4a822947ccc4d2284ae1a8b6b4 100644 (file)
@@ -167,25 +167,41 @@ ifneq ($(BR2_PACKAGE_PYTHON_TKINTER),y)
        rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/lib-tk
 endif
 
-$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so: $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
-               cp -dpr $(PYTHON_DIR)/libpython*.so.* $(STAGING_DIR)/usr/lib
-               (\
-               cd $(STAGING_DIR)/usr/lib ; \
-               rm -f libpython$(PYTHON_VERSION_MAJOR).so ; \
-               ln -s `basename  \`ls libpython*.so.*\`` libpython$(PYTHON_VERSION_MAJOR).so \
-               )
-
-libpython:     $(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so
-
-python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY) libpython
+python: uclibc $(PYTHON_DEPS) $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
 
 python-clean:
        -$(MAKE) -C $(PYTHON_DIR) distclean
        rm -f $(PYTHON_DIR)/.configured $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
        -rm -rf $(TARGET_DIR)/usr/lib/python* $(TARGET_DIR)/usr/include/python*
+       -rm -f $(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so
 
 python-dirclean:
        rm -rf $(PYTHON_DIR)
+
+####  LIBPYTHON
+
+
+LIBPYTHON_BINARY:=libpython$(PYTHON_VERSION_MAJOR).so
+
+libpython:     python $(TARGET_DIR)/usr/lib/$(LIBPYTHON_BINARY)
+
+
+$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so: $(TARGET_DIR)/$(PYTHON_TARGET_BINARY)
+               cp -dpr $(PYTHON_DIR)/$(LIBPYTHON_BINARY).* $(STAGING_DIR)/usr/lib
+               (\
+               cd $(STAGING_DIR)/usr/lib ; \
+               rm -f $(LIBPYTHON_BINARY) ; \
+               ln -s `basename  \`ls libpython*.so.*\`` $(LIBPYTHON_BINARY) \
+               )
+
+$(TARGET_DIR)/usr/lib/$(LIBPYTHON_BINARY): $(STAGING_DIR)/usr/lib/$(LIBPYTHON_BINARY)
+               cp -dpr $(STAGING_DIR)/usr/lib/$(LIBPYTHON_BINARY).* $(TARGET_DIR)/usr/lib
+               (\
+               cd $(TARGET_DIR)/usr/lib ; \
+               rm -f $(LIBPYTHON_BINARY) ; \
+               ln -s `basename  \`ls libpython*.so.*\`` $(LIBPYTHON_BINARY) \
+               )
+
 #############################################################
 #
 # Toplevel Makefile options