Sun Dec 13 09:38:22 2009 UTC ()
- set EMUL_LIB_PATH* for relevant mips emulations
- make sure to install the all right mips ldscripts. XXX ugly


(mrg)
diff -r1.6 -r1.7 src/external/gpl3/binutils/usr.bin/ld/Makefile

cvs diff -r1.6 -r1.7 src/external/gpl3/binutils/usr.bin/ld/Makefile (expand / switch to unified diff)

--- src/external/gpl3/binutils/usr.bin/ld/Makefile 2009/11/27 14:39:39 1.6
+++ src/external/gpl3/binutils/usr.bin/ld/Makefile 2009/12/13 09:38:22 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.6 2009/11/27 14:39:39 skrll Exp $ 1# $NetBSD: Makefile,v 1.7 2009/12/13 09:38:22 mrg Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5TOP= ${NETBSDSRCDIR}/external/gpl3/binutils 5TOP= ${NETBSDSRCDIR}/external/gpl3/binutils
6 6
7.include "${.CURDIR}/../common/Makefile.inc" 7.include "${.CURDIR}/../common/Makefile.inc"
8.include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk" 8.include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"
9 9
10SCRIPTSDIR= /usr/libdata 10SCRIPTSDIR= /usr/libdata
11 11
12PROG= ld 12PROG= ld
13SRCS= ${G_OFILES:.o=.c} 13SRCS= ${G_OFILES:.o=.c}
14CPPFLAGS+= -I${.CURDIR}/arch/${MACHINE_ARCH} \ 14CPPFLAGS+= -I${.CURDIR}/arch/${MACHINE_ARCH} \
@@ -73,45 +73,57 @@ ${PROG}.info: configdoc.texi bfdver.texi @@ -73,45 +73,57 @@ ${PROG}.info: configdoc.texi bfdver.texi
73 73
74DPSRCS+= .depend.${f} e${f}.c 74DPSRCS+= .depend.${f} e${f}.c
75CLEANFILES+= .depend.${f} e${f}.c 75CLEANFILES+= .depend.${f} e${f}.c
76 76
77# XXX super hack 77# XXX super hack
78. if (${MACHINE_ARCH} == "x86_64" && \ 78. if (${MACHINE_ARCH} == "x86_64" && \
79 ("${f}" == "elf_i386" || "${f}" == "i386nbsd")) 79 ("${f}" == "elf_i386" || "${f}" == "i386nbsd"))
80EMUL_LIB_PATH.${f}=/usr/lib/i386 80EMUL_LIB_PATH.${f}=/usr/lib/i386
81. elif (${MACHINE_ARCH} == "sparc64" && \ 81. elif (${MACHINE_ARCH} == "sparc64" && \
82 ("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd")) 82 ("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd"))
83EMUL_LIB_PATH.${f}=/usr/lib/sparc 83EMUL_LIB_PATH.${f}=/usr/lib/sparc
84. else 84. else
85EMUL_LIB_PATH.${f}=/usr/lib 85EMUL_LIB_PATH.${f}=/usr/lib
 86. elif ${MACHINE_ARCH} == "mips64el"
 87. if "${f}" == "elf32ltsmip" || "${f}" == "elf32btsmip"
 88EMUL_LIB_PATH.${f}:=/usr/lib/o32
 89. elif "${f}" == "elf64btsmip" || "${f}" == "elf64btsmip"
 90EMUL_LIB_PATH.${f}:=/usr/lib/64
 91. endif
86. endif 92. endif
87 93
88#GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @ta rget_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ 94#GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @ta rget_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@
89 95
90e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed 96e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed
91 ${_MKTARGET_CREATE} 97 ${_MKTARGET_CREATE}
92 unset MACHINE || true; \ 98 unset MACHINE || true; \
93 LIB_PATH=${EMUL_LIB_PATH.${f}} NATIVE=yes \ 99 LIB_PATH=${EMUL_LIB_PATH.${f}} NATIVE=yes \
94 ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} "/usr" "/usr/bin" \ 100 ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} "/usr" "/usr/bin" \
95 ${G_target_alias} ${G_target_alias} ${G_target_alias} \ 101 ${G_target_alias} ${G_target_alias} ${G_target_alias} \
96 ${G_EMUL} ${LIBDIR} yes ${f} "${G_target_alias}" 102 ${G_EMUL} ${LIBDIR} yes ${f} "${G_target_alias}"
97 103
98.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" 104.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \
 105 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
99FILES+= ${f}.x ${f}.xbn ${f}.xn ${f}.xr ${f}.xu 106FILES+= ${f}.x ${f}.xbn ${f}.xn ${f}.xr ${f}.xu
100 107
101# XXX hack to find out if .xs exists - slow! 108# XXX hack to find out if .xs/.xc exists - slow!
102HAS_XS!= grep '^GENERATE_SHLIB_SCRIPT' ${DIST}/ld/emulparams/${f}.sh || echo 109HAS_XS!= grep '^GENERATE_SHLIB_SCRIPT' ${DIST}/ld/emulparams/${f}.sh || echo
 110# XXX
 111#HAS_XC!= grep '^GENERATE_COMBRELOC_SCRIPT' ${DIST}/ld/emulparams/${f}.sh || echo
103.if !empty(HAS_XS) 112.if !empty(HAS_XS)
104FILES+= ${f}.xc ${f}.xd ${f}.xdc ${f}.xdw ${f}.xs ${f}.xsc ${f}.xsw ${f}.xw 113FILES+= ${f}.xc ${f}.xd ${f}.xdc ${f}.xdw ${f}.xs ${f}.xsc ${f}.xsw ${f}.xw
 114# only do this if we don't have GENERATE_SHLIB_SCRIPT
 115.elif ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
 116FILES+= ${f}.xc ${f}.xs ${f}.xsc ${f}.xsw ${f}.xw
105.endif 117.endif
106.endif # x64_64 || sparc64 118.endif # x64_64 || sparc64
107 119
108.endfor 120.endfor
109 121
110.include <bsd.prog.mk> 122.include <bsd.prog.mk>
111.include <bsd.info.mk> 123.include <bsd.info.mk>
112.include <bsd.subdir.mk> 124.include <bsd.subdir.mk>
113 125
114# Make sure we use the pre-generated C files 126# Make sure we use the pre-generated C files
115.l.c .y.c .y.h: 127.l.c .y.c .y.h:
116 @true 128 @true
117 129