mirror of
https://github.com/opnsense/src.git
synced 2026-02-27 11:50:47 -05:00
FreeBSD. This method attempts to centralize all the necessary hacks or work arounds in one of two places in the tree (src/Makefile.inc1 and src/tools/build). We build a small compatibility library (libbuild.a) as well as selectively installing necessary include files. We then include this directory when building host binaries. This removes all the past release compatibilty hacks from various places in the tree. We still build on tip of stable and current. I will work with those that want to support more, although I anticipate it will just work. Many thanks to ru@, obrien@ and jhb@ for providing valuable input at various stage of implementation, as well as for working together to positively effect a change for the better.
50 lines
1.3 KiB
Makefile
50 lines
1.3 KiB
Makefile
# $FreeBSD$
|
|
|
|
.include "../Makefile.inc0"
|
|
|
|
.PATH: ${SRCDIR}/ld
|
|
|
|
PROG= ld
|
|
SCRIPTDIR= /usr/libdata/ldscripts
|
|
SRCS+= ldcref.c ldctor.c ldemul.c ldemul-list.h ldexp.c ldfile.c \
|
|
ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \
|
|
ldver.c ldwrite.c lexsup.c mri.c
|
|
|
|
WARNS= 1
|
|
CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
|
|
CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
|
|
CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
|
|
NOSHARED?= yes
|
|
DPADD+= ${RELTOP}/libbfd/libbfd.a
|
|
DPADD+= ${RELTOP}/libiberty/libiberty.a
|
|
LDADD= ${DPADD}
|
|
CLEANDIRS+= ldscripts
|
|
CLEANFILES+= ldemul-list.h stringify.sed
|
|
|
|
# If set, BINUTILSDISTDIR is the path to a directory containing the full GNU
|
|
# binutils release. FreeBSD only distributes the bits that are required to
|
|
# build native architectures. BINUTILSDISTDIR is needed to build cross tools.
|
|
.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
|
|
.PATH: ${BINUTILSDISTDIR}/ld
|
|
CFLAGS+= -I${BINUTILSDISTDIR}/ld
|
|
.endif
|
|
|
|
EMXFR=
|
|
EMLST=
|
|
.for _e in ${EMS}
|
|
EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
|
|
EMLST+= &ld_${_e}_emulation,
|
|
.endfor
|
|
|
|
ldemul-list.h:
|
|
echo "${EMXFR}" > ${.TARGET}
|
|
echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
|
|
|
|
stringify.sed:
|
|
ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
|
|
|
|
afterinstall:
|
|
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
|
${LDSCRIPTS:S|^|ldscripts/|} ${DESTDIR}${SCRIPTDIR}
|
|
|
|
.include <bsd.prog.mk>
|