elf2flt: fix build when zlib is not installed on the host
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 26 May 2013 12:08:13 +0000 (12:08 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 27 May 2013 21:50:54 +0000 (23:50 +0200)
For a reason that's fairly unclear to me, Peter added a '-lz' link
flag to the elf2flt.mk build in d5664ee99 ("elf2flt: fix link").

However, the zlib library may not necessarily be installed on the host
machine, so we should depend on host-zlib, and pass the appropriate
LDFLAGS. This is what this patch does.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
toolchain/elf2flt/elf2flt.mk

index 134034bf96bad5e888d5461757c52d6aafeb3355..52e199cda39cf98b53fe37e087dc2f941409a8e8 100644 (file)
@@ -19,7 +19,7 @@ $(ELF2FLT_DIR)/.patched: $(ELF2FLT_DIR)/.unpacked
 
 $(ELF2FLT_DIR)/.configured: $(ELF2FLT_DIR)/.patched
        (cd $(ELF2FLT_DIR); rm -rf config.cache; \
-               LDFLAGS=-lz \
+               LDFLAGS="$(HOST_LDFLAGS) -lz" \
                $(ELF2FLT_DIR)/configure $(QUIET) \
                --with-bfd-include-dir=$(HOST_BINUTILS_DIR)/bfd/ \
                --with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
@@ -33,7 +33,7 @@ $(ELF2FLT_DIR)/$(ELF2FLT_BINARY): $(ELF2FLT_DIR)/.configured
        $(MAKE) -C $(ELF2FLT_DIR) all
        $(MAKE) -C $(ELF2FLT_DIR) install
 
-elf2flt: uclibc_target uclibc-configured binutils gcc $(ELF2FLT_DIR)/$(ELF2FLT_BINARY)
+elf2flt: uclibc_target uclibc-configured binutils gcc host-zlib $(ELF2FLT_DIR)/$(ELF2FLT_BINARY)
 
 elf2flt-clean:
        rm -rf $(ELF2FLT_SOURCE)