diff options
author | kaiw <kaiw@FreeBSD.org> | 2014-01-21 20:42:15 +0000 |
---|---|---|
committer | kaiw <kaiw@FreeBSD.org> | 2014-01-21 20:42:15 +0000 |
commit | e1172e7ec664c086c1df278d03b5f84e4ea882ef (patch) | |
tree | 2790c191ec0e6eef37125413ae268eb95067cc34 /lib | |
parent | 811316c649842c428ac7e87ef8fd4ca0f3373694 (diff) | |
download | FreeBSD-src-e1172e7ec664c086c1df278d03b5f84e4ea882ef.zip FreeBSD-src-e1172e7ec664c086c1df278d03b5f84e4ea882ef.tar.gz |
Reapply revisions r237528, r237531 and r238741 which make libelf
properly include sys/ headers from the source tree instead of the
host.
These patches are also applied to libdwarf since libdwarf requires
the same sys/ headers as libelf.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libdwarf/Makefile | 13 | ||||
-rw-r--r-- | lib/libelf/Makefile | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/lib/libdwarf/Makefile b/lib/libdwarf/Makefile index 5366733..aa4197f 100644 --- a/lib/libdwarf/Makefile +++ b/lib/libdwarf/Makefile @@ -75,14 +75,27 @@ SRCS= \ INCS= dwarf.h libdwarf.h +# +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h + GENSRCS= dwarf_pubnames.c dwarf_pubtypes.c dwarf_weaks.c \ dwarf_funcs.c dwarf_vars.c dwarf_types.c \ dwarf_pro_pubnames.c dwarf_pro_weaks.c \ dwarf_pro_funcs.c dwarf_pro_types.c \ dwarf_pro_vars.c CLEANFILES= ${GENSRCS} +CLEANDIRS= sys CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common -I${TOP}/libelf +sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} + mkdir -p ${.OBJDIR}/sys + ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} + LDADD+= -lelf DPADD+= ${LIBELF} diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile index f120092..58692cf 100644 --- a/lib/libelf/Makefile +++ b/lib/libelf/Makefile @@ -65,10 +65,23 @@ SRCS= elf.c \ INCS= libelf.h gelf.h +# +# We need to link against the correct version of these files. One +# solution is to include ../../sys in the include path. This causes +# problems when a header file in sys depends on a file in another +# part of the tree, e.g. a machine dependent header. +# +SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} +CLEANDIRS= sys CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common +sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} + mkdir -p ${.OBJDIR}/sys + ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} + SHLIB_MAJOR= 1 MAN= elf.3 \ |