From da832afe9455211d1d27cdf46d40b2879f2da313 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sun, 20 Feb 2011 16:04:02 +0000 Subject: [PATCH] lsof: cross-build properly I found that the lsof build was using the build host's ar and ranlib instead of the target's. That's tolerable when the build host is Linux/ELF. It's not so great when building on Mac OS X. I also found that lsof was reporting that it was built with the native compiler instead of the cross-compiler. Signed-off-by: Mark Mentovai SVN-Revision: 25614 --- utils/lsof/Makefile | 6 +++++- utils/lsof/patches/005-lsof_ccv.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 utils/lsof/patches/005-lsof_ccv.patch diff --git a/utils/lsof/Makefile b/utils/lsof/Makefile index 6035fa472..340fbe195 100644 --- a/utils/lsof/Makefile +++ b/utils/lsof/Makefile @@ -33,13 +33,17 @@ endef define Build/Configure cd $(PKG_BUILD_DIR); \ - LINUX_CLIB="-DGLIBCV=2" LSOF_VSTR="$(LINUX_VERSION)" \ + LINUX_CLIB="-DGLIBCV=2" \ + LSOF_CC="$(TARGET_CC)" \ + LSOF_VSTR="$(LINUX_VERSION)" \ ./Configure -n linux endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) \ CC="$(TARGET_CC)" \ + AR="$(TARGET_CROSS)ar cr" \ + RANLIB="$(TARGET_CROSS)ranlib" \ DEBUG="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" endef diff --git a/utils/lsof/patches/005-lsof_ccv.patch b/utils/lsof/patches/005-lsof_ccv.patch new file mode 100644 index 000000000..11d882058 --- /dev/null +++ b/utils/lsof/patches/005-lsof_ccv.patch @@ -0,0 +1,12 @@ +--- a/Configure ++++ b/Configure +@@ -2547,6 +2547,9 @@ + if test "X$LSOF_CC" = "X" # { + then + LSOF_CC=cc ++ fi # } ++ if test "X$LSOF_CCV" = "X" # { ++ then + LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` + fi # } + LSOF_DIALECT_DIR="" -- 2.30.2