busybox: add support to link against libtirpc when available
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 4 Nov 2012 07:34:11 +0000 (07:34 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 6 Nov 2012 07:20:16 +0000 (08:20 +0100)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/busybox/busybox.mk

index 2fa1aa53b34f7f2b1ba606a9e289cd671e9d2511..549e150be017301b6823f06e0e35c36f0553bb41 100644 (file)
@@ -15,14 +15,29 @@ BUSYBOX_SOURCE = busybox-$(BUSYBOX_VERSION).tar.bz2
 BUSYBOX_LICENSE = GPLv2
 BUSYBOX_LICENSE_FILES = LICENSE
 
+BUSYBOX_CFLAGS = \
+       $(TARGET_CFLAGS) \
+       -I$(LINUX_HEADERS_DIR)/include
+
+BUSYBOX_LDFLAGS = \
+       $(TARGET_LDFLAGS)
+
+# Link against libtirpc if available so that we can leverage its RPC
+# support for NFS mounting with Busybox
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+BUSYBOX_DEPENDENCIES += libtirpc
+BUSYBOX_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc/
+BUSYBOX_LDFLAGS += -ltirpc
+endif
+
 BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config
 # Allows the build system to tweak CFLAGS
-BUSYBOX_MAKE_ENV = $(TARGET_MAKE_ENV) CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_HEADERS_DIR)/include"
+BUSYBOX_MAKE_ENV = $(TARGET_MAKE_ENV) CFLAGS="$(BUSYBOX_CFLAGS)"
 BUSYBOX_MAKE_OPTS = \
        CC="$(TARGET_CC)" \
        ARCH=$(KERNEL_ARCH) \
        PREFIX="$(TARGET_DIR)" \
-       EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
+       EXTRA_LDFLAGS="$(BUSYBOX_LDFLAGS)" \
        CROSS_COMPILE="$(TARGET_CROSS)" \
        CONFIG_PREFIX="$(TARGET_DIR)" \
        SKIP_STRIP=y