From cb66f4dd7307ba19692eeec23d7019f96c898e54 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Sat, 12 Apr 2003 15:07:46 +0000 Subject: [PATCH] Make sure legacy stuff comes last. Some tools that use legacy stuff (binutils) depend on this order. For this to work, provide (and use) specialized versions of bsd.prog.mk and bsd.lib.mk that include the standard versions first, then augment CFLAGS, DPADD, LDADD, and LDFLAGS as necessary, with the legacy stuff. Tested on: 4.0-RELEASE --- Makefile.inc1 | 5 ++--- tools/build/{ => mk}/Makefile.boot | 14 ++++---------- tools/build/mk/bsd.lib.mk | 4 ++++ tools/build/mk/bsd.prog.mk | 4 ++++ 4 files changed, 14 insertions(+), 13 deletions(-) rename tools/build/{ => mk}/Makefile.boot (58%) create mode 100644 tools/build/mk/bsd.lib.mk create mode 100644 tools/build/mk/bsd.prog.mk diff --git a/Makefile.inc1 b/Makefile.inc1 index 6b6a17041543..b74da18d9886 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -193,9 +193,8 @@ CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ # bootstrap-tools stage BMAKEENV= DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ - __MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \ - OLD_MAKE_CONF=${__MAKE_CONF} \ - WORLDTMP=${WORLDTMP} + WORLDTMP=${WORLDTMP} \ + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ BOOTSTRAPPING=${OSRELDATE} \ diff --git a/tools/build/Makefile.boot b/tools/build/mk/Makefile.boot similarity index 58% rename from tools/build/Makefile.boot rename to tools/build/mk/Makefile.boot index 4ad522e4e505..ba2c5f724aab 100644 --- a/tools/build/Makefile.boot +++ b/tools/build/mk/Makefile.boot @@ -3,18 +3,12 @@ # FreeBSD didn't always have the __FBSDID() macro in . # We could do this with a sys/cdefs.h wrapper, but given that this would # slow down all new builds for such a simple concept, we do it here. -.if defined(BOOTSTRAPPING) && \ - ( ${BOOTSTRAPPING} < 440001 || \ +.if ( ${BOOTSTRAPPING} < 440001 || \ ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500024 )) CFLAGS+= -D__FBSDID=__RCSID .endif CFLAGS+= -I${WORLDTMP}/legacy/usr/include -DPADD= ${WORLDTMP}/legacy/usr/lib/libegacy.a -LDADD= -legacy -LDFLAGS= -L${WORLDTMP}/legacy/usr/lib - -OLD_MAKE_CONF?= /etc/make.conf -.if exists(${OLD_MAKE_CONF}) -.include "${OLD_MAKE_CONF}" -.endif +DPADD+= ${WORLDTMP}/legacy/usr/lib/libegacy.a +LDADD+= -legacy +LDFLAGS+= -L${WORLDTMP}/legacy/usr/lib diff --git a/tools/build/mk/bsd.lib.mk b/tools/build/mk/bsd.lib.mk new file mode 100644 index 000000000000..744f5b5a8b9d --- /dev/null +++ b/tools/build/mk/bsd.lib.mk @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include "../../../share/mk/bsd.lib.mk" +.include "Makefile.boot" diff --git a/tools/build/mk/bsd.prog.mk b/tools/build/mk/bsd.prog.mk new file mode 100644 index 000000000000..d650665d6200 --- /dev/null +++ b/tools/build/mk/bsd.prog.mk @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include "../../../share/mk/bsd.prog.mk" +.include "Makefile.boot"