[PATCH] 2.6.8.1-mm1 - Clean up a Makefile bogosity

From: Jeff Dike
Date: Tue Aug 17 2004 - 13:29:07 EST


Following a suggestion from Andreas Schwab, this switches the UML build to
a somewhat official way of getting a library search path from gcc.

Jeff

Index: 2.6.8.1-mm1/arch/um/Makefile
===================================================================
--- 2.6.8.1-mm1.orig/arch/um/Makefile 2004-08-17 00:37:04.000000000 -0400
+++ 2.6.8.1-mm1/arch/um/Makefile 2004-08-17 13:18:13.000000000 -0400
@@ -88,10 +88,11 @@

prepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS)

-# This stupidity extracts the directory in which gcc lives so that it can
-# be fed to ld when it's linking .tmp_vmlinux during the ldchk stage.
-LD_DIR = $(shell dirname `gcc -v 2>&1 | head -1 | awk '{print $$NF}'`)
-LDFLAGS_vmlinux = -L/usr/lib -L$(LD_DIR) -r
+# This extracts the library path from gcc with -print-search-dirs and munges
+# the output into a bunch of -L switches.
+LD_DIRS = $(shell gcc -print-search-dirs | grep libraries | \
+ sed -e 's/^.*=/-L/' -e 's/:/ -L/g')
+LDFLAGS_vmlinux = $(LD_DIRS) -r

vmlinux: $(ARCH_DIR)/main.o


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/