Use DO32 for all the places that we need to flag we're building a 32

bit version of a library. Use a generic name since this may be usefule
elsewhere.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-11-06 15:21:51 +00:00
parent 7e3b76ca57
commit 4780427469
6 changed files with 16 additions and 10 deletions

View File

@ -4,7 +4,7 @@
.include "defs.mk"
.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1
FICL_CPUARCH= i386
.elif ${MACHINE_ARCH:Mmips64*} != ""
FICL_CPUARCH= mips64
@ -15,7 +15,7 @@ FICL_CPUARCH= ${MACHINE_CPUARCH}
.PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH}
.if ${MACHINE_CPUARCH} == "amd64"
.if defined(FICL32)
.if ${DO32:U0} == 1
CFLAGS+= -m32 -I.
.else
CFLAGS+= -fPIC
@ -30,7 +30,7 @@ CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC}
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -DBF_DICTSIZE=15000
.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1
.if !exists(machine)
${SRCS:M*.c:R:S/$/.o/g}: machine

View File

@ -10,9 +10,13 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
SRCS= ${BASE_SRCS} sysdep.c softcore.c
CLEANFILES= softcore.c testmain testmain.o
.if ${MACHINE_CPUARCH} == "i386" || \
(${MACHINE_CPUARCH} == "amd64" && defined(FICL32))
(${MACHINE_CPUARCH} == "amd64" && defined(DO32))
CFLAGS+= -march=i386
.endif
.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
CFLAGS+= -m32
.endif
.if defined(HAVE_PNP)
CFLAGS+= -DHAVE_PNP
.endif

View File

@ -1,5 +1,5 @@
# $FreeBSD$
FICL32=
DO32=1
.include "${.CURDIR}/../ficl/Makefile"

View File

@ -1,5 +1,7 @@
# $FreeBSD$
DO32=1
.include <bsd.init.mk>
LIB=sa32

View File

@ -17,16 +17,16 @@ CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
CFLAGS+= -I${SYSDIR}/crypto/skein
.if ${MACHINE_CPUARCH} == "i386" || \
(${MACHINE_CPUARCH} == "amd64" && defined(ZFS32))
(${MACHINE_CPUARCH} == "amd64" && defined(DO32))
CFLAGS+= -march=i386
.endif
.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
CFLAGS+= -m32
.endif
CFLAGS+= -Wformat -Wall
.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
CLEANFILES+= machine
machine: .NOMETA
ln -sf ${SYSDIR}/i386/include machine
@ -35,7 +35,7 @@ machine: .NOMETA
.include <bsd.stand.mk>
.include <bsd.lib.mk>
.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)
.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32)
.if !exists(machine)
beforedepend ${OBJS}: machine
.endif

View File

@ -1,5 +1,5 @@
# $FreeBSD$
ZFS32=1
DO32=1
.include "${.CURDIR}/../zfs/Makefile"