Move libbfd compile environment to "libbfd" subdir, with the changes:

- no includes are installed any more, nor any .a libraries
- a unified libbfd can be built if BFD_UNIFIED is set in mk.conf (will
  support dumping/examining objects from all NetBSD architectures of equal
  or lesser pointer size)
This commit is contained in:
tv 1999-02-09 15:57:53 +00:00
parent 5d3f4f89b6
commit c172eeaa1b
5 changed files with 497 additions and 0 deletions

176
gnu/lib/libbfd/Makefile Normal file
View File

@ -0,0 +1,176 @@
# $NetBSD: Makefile,v 1.1 1999/02/09 15:57:53 tv Exp $
LIB= bfd
NOLINT= nolint (GNU source)
NOMAN=
NOPROFILE=
NOLINKLIB=
# for NOPIC, BFD_SLIM, BFD_UNIFIED
.include <bsd.own.mk>
# XXX BFD_UNIFIED should go away if benchmarking shows minor to no difference
.if defined(NOPIC) || !defined(BFD_UNIFIED)
BFD_SLIM=
.endif
.if (${MACHINE_ARCH} == "alpha") || \
(${MACHINE_ARCH} == "sparc64")
BFD64=
.endif
DIST= ${.CURDIR}/../../dist
# generic bfd
SRCS= archive.c archures.c bfd.c cache.c coffgen.c corefile.c \
format.c init.c lib_bfd.c opncls.c reloc.c section.c syms.c \
targets.c hash.c linker.c srec.c binary.c tekhex.c \
ihex.c stabs.c stab-syms.c netbsd-core.c \
dis-buf.c disassemble.c
# libiberty (yuck.)
SRCS+= argv.c basename.c choose-temp.c concat.c cplus-dem.c \
fdmatch.c fnmatch.c getopt.c getopt1.c getruntime.c hex.c \
floatformat.c objalloc.c obstack.c pexecute.c spaces.c \
strerror.c strsignal.c xatexit.c xexit.c xmalloc.c xstrdup.c \
xstrerror.c insque.c
CPPFLAGS+= -DHAVE_CONFIG_H -I. -I${.CURDIR} \
-I${DIST}/bfd -I${DIST}/opcodes -I${DIST}/include \
${ARCHES:S/^/-DARCH_/} ${SELECT_VECS:S/^/-DHAVE_/} \
-DSELECT_ARCHITECTURES="${ARCHES:S/^/,\&bfd_/:S/$/_arch/:S/^,//1}" \
-DDEFAULT_VECTOR=${DEFAULT_VEC.${MACHINE_ARCH}} \
-DSELECT_VECS="${SELECT_VECS:S/^/,\&/:S/^,//1}"
DPSRCS+= bfd.h elf32-target.h elf64-target.h targmatch.h
CLEANFILES+= bfd.h elf32-target.h elf64-target.h targmatch.h
.PATH: ${DIST}/bfd ${DIST}/opcodes ${DIST}/libiberty ${DIST}/include
bfd.h: bfd-in2.h bfd-h.sed
sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.h} >$@
targmatch.h: config.bfd targmatch.sed
sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} >$@
elf32-target.h: elfxx-target.h
sed -e s/NN/32/g < $> > $@
elf64-target.h: elfxx-target.h
sed -e s/NN/64/g < $> > $@
##### alpha #####
.if defined(BFD64) && (${MACHINE_ARCH} == "alpha" || !defined(BFD_SLIM))
ARCHES+= alpha
DEFAULT_VEC.alpha= bfd_elf64_alpha_vec
SELECT_VECS+= ${DEFAULT_VEC.alpha} ecoffalpha_little_vec
SRCS+= cpu-alpha.c elf64-alpha.c coff-alpha.c \
alpha-dis.c alpha-opc.c ecoff.c ecofflink.c \
elf64.c elf.c elflink.c dwarf2.c
.endif
##### arm32 #####
.if (${MACHINE_ARCH} == "arm32" || !defined(BFD_SLIM))
ARCHES+= arm
DEFAULT_VEC.arm32= armnetbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.arm32}
SRCS+= cpu-arm.c aout-arm32.c armnetbsd.c arm-dis.c
.endif
##### i386 #####
.if (${MACHINE_ARCH} == "i386" || !defined(BFD_SLIM))
ARCHES+= i386
DEFAULT_VEC.i386= i386netbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.i386} bfd_elf32_i386_vec i386bsd_vec \
i386freebsd_vec i386coff_vec
SRCS+= cpu-i386.c i386bsd.c i386freebsd.c i386netbsd.c \
coff-i386.c elf32-i386.c i386-dis.c \
aout32.c cofflink.c elf32.c elf.c elflink.c dwarf2.c
.endif
##### m68k #####
.if (${MACHINE_ARCH} == "m68k" || !defined(BFD_SLIM))
ARCHES+= m68k
DEFAULT_VEC.m68k= m68knetbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.m68k} m68k4knetbsd_vec \
bfd_elf32_m68k_vec sunos_big_vec
SRCS+= cpu-m68k.c m68knetbsd.c m68k4knetbsd.c sunos.c \
elf32-m68k.c m68k-dis.c m68k-opc.c \
aout32.c elf32.c elf.c elflink.c dwarf2.c
.endif
##### mipse[bl] #####
.if (${MACHINE_ARCH} == "mips" || \
${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel" || \
!defined(BFD_SLIM))
ARCHES+= mips
DEFAULT_VEC.mips= bfd_elf32_littlemips_vec # compatibility
DEFAULT_VEC.mipseb= bfd_elf32_bigmips_vec
DEFAULT_VEC.mipsel= bfd_elf32_littlemips_vec
SELECT_VECS+= ${DEFAULT_VEC.mipseb} ${DEFAULT_VEC.mipsel} \
ecoff_big_vec ecoff_little_vec
SRCS+= cpu-mips.c elf32-mips.c coff-mips.c \
mips-dis.c mips-opc.c mips16-opc.c \
ecoff.c ecofflink.c elf32.c elf.c elflink.c dwarf2.c
.endif
##### ns32k #####
.if (${MACHINE_ARCH} == "ns32k" || !defined(BFD_SLIM))
ARCHES+= ns32k
DEFAULT_VEC.ns32k= pc532netbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.ns32k}
SRCS+= ns32knetbsd.c aout-ns32k.c cpu-ns32k.c ns32k-dis.c
.endif
##### powerpc #####
.if (${MACHINE_ARCH} == "powerpc" || !defined(BFD_SLIM))
ARCHES+= powerpc
DEFAULT_VEC.powerpc= bfd_elf32_powerpc_vec
SELECT_VECS+= ${DEFAULT_VEC.powerpc} bfd_elf32_powerpcle_vec
SRCS+= cpu-powerpc.c elf32-ppc.c ppc-dis.c ppc-opc.c \
elf32.c elf.c elflink.c dwarf2.c
.endif
##### sparc #####
.if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64" || \
!defined(BFD_SLIM))
ARCHES+= sparc
DEFAULT_VEC.sparc= sparcnetbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.sparc} ${DEFAULT_VEC.sparc64} \
sunos_big_vec bfd_elf32_sparc_vec
SRCS+= cpu-sparc.c sparcnetbsd.c sunos.c elf32-sparc.c \
sparc-dis.c sparc-opc.c \
aout32.c elf32.c elf.c elflink.c dwarf2.c
.if defined(BFD64)
DEFAULT_VEC.sparc64= bfd_elf64_sparc_vec
SRCS+= elf64-sparc.c elf64.c
.endif
.endif
##### vax #####
.if (${MACHINE_ARCH} == "vax" || !defined(BFD_SLIM))
ARCHES+= vax
DEFUALT_VEC.vax= vaxnetbsd_vec
SELECT_VECS+= ${DEFAULT_VEC.vax}
SRCS+= cpu-vax.c vaxnetbsd.c vax-dis.c aout32.c
.endif
# uniq-ify SRCS and SELECT_VECS
SRCS != (for i in ${SRCS}; do echo $$i; done) | sort | uniq
SELECT_VECS != (for i in ${SELECT_VECS}; do echo $$i; done) | sort | uniq
.include <bsd.lib.mk>
${OBJS} ${SOBJS}: bfd.h elf32-target.h elf64-target.h
targets.o targets.so: targmatch.h Makefile

25
gnu/lib/libbfd/bfd-h.sed Normal file
View File

@ -0,0 +1,25 @@
# $NetBSD: bfd-h.sed,v 1.1 1999/02/09 15:57:53 tv Exp $
# Preparse bfd.h such that it can be used on multiple machines.
s/@VERSION@/2.9.1/
/@wordsize@/{
i\
#if defined(__alpha__) || defined (__sparc_v9__)\
#define BFD_ARCH_SIZE 64\
#else\
#define BFD_ARCH_SIZE 32\
#endif
d
}
/@BFD_HOST_64BIT_LONG@/ {
i\
#if defined(__alpha__) || defined (__sparc_v9__)\
#define BFD_HOST_64BIT_LONG 1\
#else\
#define BFD_HOST_64BIT_LONG 0\
#endif
d
}
s/@BFD_HOST_64_BIT_DEFINED@/1/
s/@BFD_HOST_64_BIT@/long long/
s/@BFD_HOST_U_64_BIT@/unsigned long long/

289
gnu/lib/libbfd/config.h Normal file
View File

@ -0,0 +1,289 @@
/* $NetBSD: config.h,v 1.1 1999/02/09 15:57:53 tv Exp $ */
/****************/
/* bfd config.h */
/****************/
/* Name of package. */
#define PACKAGE "bfd"
/* Version of package. */
#define VERSION "2.9.1"
/* Whether strstr must be declared even if <string.h> is included. */
/* #undef NEED_DECLARATION_STRSTR */
/* Whether malloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_MALLOC */
/* Whether realloc must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_REALLOC */
/* Whether free must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_FREE */
/* Whether getenv must be declared even if <stdlib.h> is included. */
/* #undef NEED_DECLARATION_GETENV */
/* Define if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Do we need to use the b modifier when opening binary files? */
/* #undef USE_BINARY_FOPEN */
/* Name of host specific header file to include in trad-core.c. */
/* #undef TRAD_HEADER */
/* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
/* #undef HAVE_SYS_PROCFS_H */
/* Do we really want to use mmap if it's available? */
#define USE_MMAP 1
/* Define if you have the fcntl function. */
#define HAVE_FCNTL 1
/* Define if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the madvise function. */
#define HAVE_MADVISE 1
/* Define if you have the mprotect function. */
#define HAVE_MPROTECT 1
/* Define if you have the setitimer function. */
#define HAVE_SETITIMER 1
/* Define if you have the sysconf function. */
#define HAVE_SYSCONF 1
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/**********************/
/* libiberty config.h */
/**********************/
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* #undef CRAY_STACKSEG_END */
/* Define if you have alloca, as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
/* #undef STACK_DIRECTION */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Define if you have the sys_errlist variable. */
#define HAVE_SYS_ERRLIST 1
/* Define if you have the sys_nerr variable. */
#define HAVE_SYS_NERR 1
/* Define if you have the sys_siglist variable. */
#define HAVE_SYS_SIGLIST 1
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the asprintf function. */
/* #undef HAVE_ASPRINTF */
/* Define if you have the atexit function. */
#define HAVE_ATEXIT 1
/* Define if you have the basename function. */
#define HAVE_BASENAME 1
/* Define if you have the bcmp function. */
#define HAVE_BCMP 1
/* Define if you have the bcopy function. */
#define HAVE_BCOPY 1
/* Define if you have the bzero function. */
#define HAVE_BZERO 1
/* Define if you have the clock function. */
#define HAVE_CLOCK 1
/* Define if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the getrusage function. */
#define HAVE_GETRUSAGE 1
/* Define if you have the index function. */
#define HAVE_INDEX 1
/* Define if you have the insque function. */
/* #undef HAVE_INSQUE */
/* Define if you have the memchr function. */
#define HAVE_MEMCHR 1
/* Define if you have the memcmp function. */
#define HAVE_MEMCMP 1
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the memset function. */
#define HAVE_MEMSET 1
/* Define if you have the on_exit function. */
/* #undef HAVE_ON_EXIT */
/* Define if you have the psignal function. */
#define HAVE_PSIGNAL 1
/* Define if you have the random function. */
#define HAVE_RANDOM 1
/* Define if you have the rename function. */
#define HAVE_RENAME 1
/* Define if you have the rindex function. */
#define HAVE_RINDEX 1
/* Define if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define if you have the strchr function. */
#define HAVE_STRCHR 1
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strncasecmp function. */
#define HAVE_STRNCASECMP 1
/* Define if you have the strrchr function. */
#define HAVE_STRRCHR 1
/* Define if you have the strsignal function. */
#define HAVE_STRSIGNAL 1
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
/* Define if you have the strtod function. */
#define HAVE_STRTOD 1
/* Define if you have the strtol function. */
#define HAVE_STRTOL 1
/* Define if you have the strtoul function. */
#define HAVE_STRTOUL 1
/* Define if you have the sysconf function. */
#define HAVE_SYSCONF 1
/* Define if you have the times function. */
#define HAVE_TIMES 1
/* Define if you have the tmpnam function. */
#define HAVE_TMPNAM 1
/* Define if you have the vasprintf function. */
/* #undef HAVE_VASPRINTF */
/* Define if you have the vfprintf function. */
#define HAVE_VFPRINTF 1
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the vsprintf function. */
#define HAVE_VSPRINTF 1
/* Define if you have the waitpid function. */
#define HAVE_WAITPID 1
/* Define if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

4
gnu/lib/libbfd/lib_bfd.c Normal file
View File

@ -0,0 +1,4 @@
/* $NetBSD: lib_bfd.c,v 1.1 1999/02/09 15:57:53 tv Exp $ */
/* ELF systems need this to avoid the "wrong" libbfd.so. */
#include "libbfd.c"

View File

@ -0,0 +1,3 @@
# $NetBSD: shlib_version,v 1.1 1999/02/09 15:57:53 tv Exp $
major=3
minor=0