Makefile: fix ldconfig selection for internal toolchains
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 26 Jul 2010 21:53:37 +0000 (23:53 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 26 Jul 2010 21:57:01 +0000 (23:57 +0200)
Commit ed0d45fdd (Choose host/target ldconfig based on availability)
added a runtime check for a cross-ldconfig being available.
Unfortunately this checks runs too early (at package/Makefile.in parsing
time), so it always fails when using an internal toolchain as ldconfig
isn't built yet.

Fix it by moving the check to the only place it is used (target-finalize).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Makefile
package/Makefile.in

index f6e02bc29d15b9f93f01e26f3ab3f43c1c5e147f..a864aae65d570101b327f8dc050ce489b29ac745 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -406,8 +406,12 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
        rm -rf $(TARGET_DIR)/usr/share/gtk-doc
 endif
        find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIPCMD) 2>/dev/null || true
-       $(TARGET_LDCONFIG) -r $(TARGET_DIR) 2>/dev/null
-
+       if [ -x "$(TARGET_CROSS)ldconfig" ]; \
+       then \
+               $(TARGET_CROSS)ldconfig -r $(TARGET_DIR) 2>/dev/null; \
+       else \
+               /sbin/ldconfig -r $(TARGET_DIR) 2>/dev/null; \
+       fi
        mkdir -p $(TARGET_DIR)/etc
        echo $(BR2_VERSION)$(shell $(TOPDIR)/scripts/setlocalversion) > \
                $(TARGET_DIR)/etc/br-version
index 1962466e2f1345105f026615bdef478eaf6cc2af..fc53a1b1e932748dc25c7248de643379e7bfc429 100644 (file)
@@ -127,12 +127,6 @@ TARGET_RANLIB   = $(TARGET_CROSS)ranlib
 TARGET_OBJCOPY  = $(TARGET_CROSS)objcopy
 TARGET_OBJDUMP  = $(TARGET_CROSS)objdump
 
-ifeq ($(shell $(SHELL) -c "command -v $(TARGET_CROSS)ldconfig"),)
-TARGET_LDCONFIG = /sbin/ldconfig
-else
-TARGET_LDCONFIG = $(TARGET_CROSS)ldconfig
-endif
-
 ifeq ($(BR2_STRIP_strip),y)
 STRIP_DISCARD_ALL:=--discard-all
 STRIP_STRIP_UNNEEDED:=--strip-unneeded