mk: Add FORCE_CPUTYPE which overrides user's CPUTYPE or forcefully sets CPUTYPE
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 24 Feb 2011 06:13:24 +0000 (14:13 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 25 Feb 2011 14:25:04 +0000 (22:25 +0800)
lib/libstand/Makefile
share/mk/bsd.cpu.mk
share/mk/bsd.init.mk
sys/boot/Makefile
sys/boot/pc32/Makefile
sys/boot/pc32/Makefile.inc

index caff104..46ee091 100644 (file)
@@ -20,7 +20,7 @@ CFLAGS+=      -ffreestanding
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 CFLAGS+=       -mpreferred-stack-boundary=2
-CPUTYPE=       i386
+FORCE_CPUTYPE= i386
 .endif
 
 .if ${MACHINE_ARCH} == "x86_64"
index 376f3ff..e2cb7ab 100644 (file)
@@ -28,6 +28,10 @@ HOST_CCVER?= ${_DEFAULT_CCVER}
 _DEFAULT_BINUTILSVER=  binutils217
 HOST_BINUTILSVER?=     ${_DEFAULT_BINUTILSVER}
 
+.if defined(FORCE_CPUTYPE)
+CPUTYPE= ${FORCE_CPUTYPE}
+.endif
+
 .if defined(CCVER_BSD_CPU_MK)
 .  if ${CCVER_BSD_CPU_MK} != ""
 .    include "${CCVER_BSD_CPU_MK}"
index 85d9d7c..65ee05e 100644 (file)
@@ -10,7 +10,7 @@ __<bsd.init.mk>__:
 .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"
 .endif
-.if ${CCVER} != ${_CCVER}
+.if ${CCVER} != ${_CCVER} || defined(FORCE_CPUTYPE)
 .include <bsd.cpu.mk>
 .endif
 .include <bsd.own.mk>
index f0f99ea..783c5e4 100644 (file)
@@ -5,11 +5,6 @@
 .MAKEFLAGS:  MACHINE_ARCH=i386 MACHINE_PLATFORM=pc32 REALLY_X86_64=true
 .endif
 
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
-CPUTYPE=       i386
-.makeenv CPUTYPE
-.endif
-
 # Build DLoader
 SUBDIR+=               dloader
 
index 7eee5ab..dabf338 100644 (file)
@@ -1,6 +1,3 @@
-CPUTYPE=       i386
-.makeenv CPUTYPE
-
 SUBDIR=                mbr boot0 btx boot2 cdboot kgzldr libi386 loader loader_tftp \
                boot0sio
 
index 2819c3f..62ca992 100644 (file)
@@ -7,7 +7,7 @@ LOADER_ADDRESS?=        0x200000
 CFLAGS+=               -ffreestanding -mpreferred-stack-boundary=2
 
 # override CPU type, so that gcc doesn't insert mmx/sse instructions
-CPUTYPE=               i386
+FORCE_CPUTYPE=         i386
 
 WARNS?=        1