Add i386 support for the amd64 ld.
authorSimon 'corecode' Schubert <corecode@fs.ei.tum.de>
Sat, 3 Jan 2009 22:00:08 +0000 (23:00 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Tue, 6 Jan 2009 02:57:16 +0000 (03:57 +0100)
gnu/usr.bin/binutils217/ld/Makefile
gnu/usr.bin/binutils217/ld/Makefile.amd64
gnu/usr.bin/binutils217/ld/Makefile.i386

index 05e4e63..301292f 100644 (file)
@@ -1,5 +1,7 @@
 # $DragonFly: src/gnu/usr.bin/binutils217/ld/Makefile,v 1.1 2007/04/13 12:24:32 corecode Exp $
 
+ELF_SCR_EXT=   x xbn xn xr xs xu xc xsc
+
 .include "../Makefile.inc0"
 
 .PATH: ${SRCDIR}/ld
index 46a643e..98f8b17 100644 (file)
@@ -8,10 +8,9 @@ CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
 CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
 _amd64_path=   ${USRDATA_PREFIX}/usr/lib
 EMS+=          ${NATIVE_EMULATION}
-LDSCRIPTS+=    ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn \
-               ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
-               ${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu \
-               ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
+.for ext in ${ELF_SCR_EXT}
+LDSCRIPTS+=    ${NATIVE_EMULATION}.${ext}
+.endfor
 SRCS+= e${NATIVE_EMULATION}.c
 CLEANFILES+=   e${NATIVE_EMULATION}.c
 
@@ -30,3 +29,20 @@ e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
                no \
                ${NATIVE_EMULATION:Q} \
                ${TARGET_TUPLE:Q}
+
+X86_EMULATION= elf_i386
+# XXX adjust path
+_i386_path=    ${USRDATA_PREFIX}/usr/lib/i386
+EMS+=          ${X86_EMULATION}
+.for ext in ${ELF_SCR_EXT}
+LDSCRIPTS+=    ${X86_EMULATION}.${ext}
+.endfor
+
+SRCS+=         e${X86_EMULATION}.c
+CLEANFILES+=   e${X86_EMULATION}.c
+e${X86_EMULATION}.c: emulparams/${X86_EMULATION}.sh emultempl/elf32.em \
+    scripttempl/elf.sc genscripts.sh stringify.sed
+       sh ${SRCDIR}/ld/genscripts.sh ${SRCDIR:Q}/ld ${_i386_path:Q} \
+           "" "" \
+           ${HOST} ${TARGET_TUPLE:Q} ${TARGET_TUPLE:Q} \
+           ${X86_EMULATION:Q} "" no ${X86_EMULATION:Q} ${TARGET_TUPLE:Q}
index 0ea5795..a1a6327 100644 (file)
@@ -12,8 +12,9 @@ _i386_path=   ${USRDATA_PREFIX}/usr/lib
 _i386_path=    /usr/cross/i386-dragonfly/usr/lib
 .endif
 EMS+=          ${NATIVE_EMULATION}
-LDSCRIPTS+=    ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
-               ${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
+.for ext in ${ELF_SCR_EXT}
+LDSCRIPTS+=    ${NATIVE_EMULATION}.${ext}
+.endfor
 SRCS+= e${NATIVE_EMULATION}.c
 CLEANFILES+=   e${NATIVE_EMULATION}.c