2003-11-27 13:12:02 +03:00
|
|
|
#!/bin/sh
|
2003-12-04 17:38:00 +03:00
|
|
|
# $NetBSD: mknative-binutils,v 1.3 2003/12/04 14:38:00 mrg Exp $
|
2003-11-27 13:12:02 +03:00
|
|
|
#
|
|
|
|
# Shell script for generating all the constants needed for a native
|
|
|
|
# platform build of src/gnu/dist/binutils.
|
|
|
|
#
|
|
|
|
|
|
|
|
# initialise
|
|
|
|
|
|
|
|
_TMPDIR=$2
|
|
|
|
_TOP=$3
|
|
|
|
_PLATFORM=$4
|
|
|
|
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*= ,,'`
|
|
|
|
|
|
|
|
. $_TOP/tools/gcc/mknative.common
|
|
|
|
|
2003-12-04 17:38:00 +03:00
|
|
|
##### gnu/lib/libbfd #####
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
get_libbfd () {
|
2003-12-04 17:38:00 +03:00
|
|
|
mkdir -p $_TOP/gnu/lib/libbfd/arch/$MACHINE_ARCH
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
getvars bfd/Makefile \
|
|
|
|
libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
|
|
|
|
INCLUDES TDEFAULTS
|
2003-12-04 17:38:00 +03:00
|
|
|
} | write_mk gnu/lib/libbfd/arch/$MACHINE_ARCH/defs.mk
|
2003-11-27 13:12:02 +03:00
|
|
|
|
2003-12-04 17:38:00 +03:00
|
|
|
write_c gnu/lib/libbfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h
|
|
|
|
write_c gnu/lib/libbfd/arch/$MACHINE_ARCH/bfdver.h <$_TMPDIR/bfd/bfdver.h
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
cat $_TMPDIR/bfd/config.h
|
2003-12-04 17:38:00 +03:00
|
|
|
} | write_c gnu/lib/libbfd/arch/$MACHINE_ARCH/config.h
|
2003-11-27 13:12:02 +03:00
|
|
|
}
|
|
|
|
|
2003-12-04 17:38:00 +03:00
|
|
|
##### gnu/lib/libopcodes #####
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
get_libopcodes () {
|
2003-12-04 17:38:00 +03:00
|
|
|
mkdir -p $_TOP/gnu/lib/libopcodes/arch/$MACHINE_ARCH
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
getvars opcodes/Makefile \
|
|
|
|
archdefs BFD_MACHINES libopcodes_la_SOURCES
|
2003-12-04 17:38:00 +03:00
|
|
|
} | write_mk gnu/lib/libopcodes/arch/$MACHINE_ARCH/defs.mk
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
cat $_TMPDIR/opcodes/config.h
|
2003-12-04 17:38:00 +03:00
|
|
|
} | write_c gnu/lib/libopcodes/arch/$MACHINE_ARCH/config.h
|
2003-11-27 13:12:02 +03:00
|
|
|
}
|
|
|
|
|
2003-12-04 17:38:00 +03:00
|
|
|
##### gnu/lib/libiberty #####
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
get_libiberty () {
|
2003-12-04 17:38:00 +03:00
|
|
|
mkdir -p $_TOP/gnu/lib/libiberty
|
2003-11-27 13:12:02 +03:00
|
|
|
|
|
|
|
getvars libiberty/Makefile \
|
|
|
|
ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
|
2003-12-04 17:38:00 +03:00
|
|
|
| write_mk gnu/lib/libiberty/defs.mk
|
2003-11-27 13:12:02 +03:00
|
|
|
|
2003-12-04 17:38:00 +03:00
|
|
|
write_c gnu/lib/libiberty/config.h \
|
2003-11-27 13:12:02 +03:00
|
|
|
<$_TMPDIR/libiberty/config.h
|
|
|
|
}
|
|
|
|
|
|
|
|
##### gnu/usr.bin/binutils #####
|
|
|
|
|
|
|
|
get_binutils () {
|
|
|
|
### common
|
|
|
|
|
|
|
|
mkdir -p $_TOP/gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH
|
|
|
|
|
|
|
|
{
|
|
|
|
getvars binutils/Makefile \
|
|
|
|
VERSION DEFS INCLUDES PROGRAMS
|
|
|
|
getvars binutils/doc/Makefile \
|
|
|
|
man_MANS TEXINFOS
|
|
|
|
|
|
|
|
for f in `getvars binutils/Makefile PROGRAMS | sed 'y,-,_,;s,^[^=]*=,,'`; do
|
|
|
|
getvars binutils/Makefile ${f}_OBJECTS ${f}_DEPENDENCIES
|
|
|
|
done
|
|
|
|
} | write_mk gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH/defs.mk
|
|
|
|
|
|
|
|
write_c gnu/usr.bin/binutils/common/arch/$MACHINE_ARCH/config.h \
|
|
|
|
<$_TMPDIR/binutils/config.h
|
|
|
|
|
|
|
|
### gas
|
|
|
|
|
|
|
|
mkdir -p $_TOP/gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH
|
|
|
|
|
|
|
|
getvars gas/Makefile \
|
|
|
|
DEFS INCLUDES OBJS \
|
|
|
|
| write_mk gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH/defs.mk
|
|
|
|
|
|
|
|
for f in config itbl-cpu obj-format targ-cpu targ-env; do
|
|
|
|
write_c gnu/usr.bin/binutils/gas/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gas/$f.h
|
|
|
|
done
|
|
|
|
|
|
|
|
### gprof
|
|
|
|
|
|
|
|
mkdir -p $_TOP/gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH
|
|
|
|
|
|
|
|
getvars gprof/Makefile \
|
|
|
|
DEFS gprof_OBJECTS INCLUDES TEXINFOS \
|
|
|
|
| write_mk gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH/defs.mk
|
|
|
|
|
|
|
|
write_c gnu/usr.bin/binutils/gprof/arch/$MACHINE_ARCH/gconfig.h <$_TMPDIR/gprof/gconfig.h
|
|
|
|
|
|
|
|
### ld
|
|
|
|
|
|
|
|
mkdir -p $_TOP/gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH
|
|
|
|
|
|
|
|
{
|
|
|
|
getvars ld/Makefile \
|
|
|
|
DEFS EMUL EMULATION_OFILES INCLUDES OFILES STRINGIFY TEXINFOS
|
|
|
|
getvars ld/Makefile \
|
|
|
|
target_alias | sed 's,[\._0-9A-Z]*$,,'
|
|
|
|
} | write_mk gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH/defs.mk
|
|
|
|
|
|
|
|
for f in config ldemul-list; do
|
|
|
|
write_c gnu/usr.bin/binutils/ld/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/ld/$f.h
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
##### main #####
|
|
|
|
|
|
|
|
case $1 in
|
2003-11-27 13:52:53 +03:00
|
|
|
all|binutils) # everything (uses "canadian cross" temp environment)
|
2003-11-27 13:12:02 +03:00
|
|
|
get_binutils
|
|
|
|
get_libbfd
|
|
|
|
get_libopcodes
|
|
|
|
get_libiberty
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
*) echo invalid arguments; exit 1;;
|
|
|
|
esac
|