2003-04-11 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@gnu.org>
Sat, 12 Apr 2003 00:00:30 +0000 (00:00 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 12 Apr 2003 00:00:30 +0000 (00:00 +0000)
* Makefile ($(objpfx)multidir.mk): New target, generated makefile that
sets variable `multidir'; include that.
(generated): Add it.
($(objpfx)$(multidir)/crti.o): New target.
[$(multidir) != .] (generated-dirs, extra-objs, omit-deps): Add it.

linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile [deleted file]
linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile
nptl/Makefile

diff --git a/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile b/linuxthreads/sysdeps/unix/sysv/linux/sparc/Makefile
deleted file mode 100644 (file)
index a03d358..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-ifeq ($(subdir),linuxthreads)
-# gcc has /usr/lib{,64}/crti.o hardcoded in the specs file, because otherwise
-# it would normally find {64,32}bit crt[in].o.
-LDFLAGS-pthread.so += -specs=$(objpfx)specs
-before-compile += $(objpfx)specs
-generated += specs
-$(objpfx)specs:
-       $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs \
-         | sed 's~\(/usr/lib\(\|64\)/\|^\|\([^/a-z]\)\)\(crt[in]\.o\)~\3'$(objpfx)'\4~g' > $@.new
-       mv -f $@.new $@
-endif
index 28d2e22cd3254c12c5e32482e4ddd5e9b4b2668b..044c07c31cc3a8d0c87bba6db96c45c575464690 100644 (file)
@@ -1,12 +1,3 @@
 ifeq ($(subdir),linuxthreads)
 CFLAGS-pt-initfini.s = -g0 -fPIC -fno-inline-functions -fno-asynchronous-unwind-tables
-# gcc -m64 has /usr/lib64/crti.o hardcoded in the specs file, because otherwise
-# it would normally find 32bit crti.o.
-LDFLAGS-pthread.so += -specs=$(objpfx)specs
-before-compile += $(objpfx)specs
-generated += specs
-$(objpfx)specs:
-       $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs \
-       | sed 's,\(/usr/lib\(\|64\)/\|^\|\([^/a-z]\)\)\(crt[in]\.o\),\3./\4,g' > $@.new
-       mv -f $@.new $@
 endif
index 0877b2a10e9445754cf35bbf665a94db1ea14cef..cd8ad98c38e433b168035f750a54c6aad38ac67e 100644 (file)
@@ -327,7 +327,27 @@ $(objpfx)defs.h: $(objpfx)pt-initfini.s
 $(objpfx)crti.o: $(objpfx)crti.S $(objpfx)defs.h
        $(compile.S) -g0 $(ASFLAGS-.os) -o $@
 
-generated += crti.S defs.h pt-initfini.s $(objpfx)tst-atfork2.mtrace \
+# Set the `multidir' variable by grabbing the variable from the compiler.
+# We do it once and save the result in a generated makefile.
+-include $(objpfx)multidir.mk
+$(objpfx)multidir.mk: $(common-objpfx)config.make
+       dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
+       echo "multidir := $$dir" > $@T
+       mv -f $@T $@
+
+generated += crti.S defs.h pt-initfini.s multidir.mk
+
+extra-objs += crti.o
+omit-deps += crti
+ifneq (,$(filter-out .,$(multidir)))
+generated-dirs := $(firstword $(subst /, , $(multidir)))
+extra-objs += $(multidir)/crti.o
+omit-deps += $(multidir)/crti
+$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/
+       ln -f $< $@
+endif
+
+generated += $(objpfx)tst-atfork2.mtrace \
             $(addsuffix .so,$(strip $(modules-names)))
 
 $(objpfx)version.d: $(objpfx)banner.h