summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/man/man4/Makefile8
-rw-r--r--share/man/man5/Makefile2
-rw-r--r--share/mk/bsd.arch.inc.mk11
-rw-r--r--share/mk/bsd.cpu.mk67
-rw-r--r--share/mk/bsd.endian.mk8
-rw-r--r--share/mk/bsd.lib.mk2
-rw-r--r--share/mk/bsd.sys.mk4
-rw-r--r--share/mk/sys.mk14
8 files changed, 70 insertions, 46 deletions
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 0ae0af2..ceb3859 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -617,7 +617,7 @@ MLINKS+=xe.4 if_xe.4
MLINKS+=xl.4 if_xl.4
MLINKS+=zyd.4 if_zyd.4
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
_acpi_aiboost.4=acpi_aiboost.4
_acpi_asus.4= acpi_asus.4
_acpi_dock.4= acpi_dock.4
@@ -666,12 +666,12 @@ _wpi.4= wpi.4
MLINKS+=lindev.4 full.4
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_atp.4= atp.4
.endif
-.if exists(${.CURDIR}/man4.${MACHINE_ARCH})
-SUBDIR= man4.${MACHINE_ARCH}
+.if exists(${.CURDIR}/man4.${MACHINE_CPUARCH})
+SUBDIR= man4.${MACHINE_CPUARCH}
.endif
.include <bsd.prog.mk>
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
index 1216fc4..7aad66b9 100644
--- a/share/man/man5/Makefile
+++ b/share/man/man5/Makefile
@@ -83,7 +83,7 @@ MLINKS+=resolver.5 resolv.conf.5
MAN+= hesiod.conf.5
.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
_boot.config.5= boot.config.5
.endif
diff --git a/share/mk/bsd.arch.inc.mk b/share/mk/bsd.arch.inc.mk
new file mode 100644
index 0000000..98e429e
--- /dev/null
+++ b/share/mk/bsd.arch.inc.mk
@@ -0,0 +1,11 @@
+#
+# Include the arch-specific Makefile.inc.$ARCH. We go from most specific
+# to least specific, stopping after we get a hit.
+#
+.if exists(${.CURDIR}/Makefile.${MACHINE})
+.include "Makefile.${MACHINE}"
+.elif exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
+.include "Makefile.${MACHINE_ARCH}"
+.elif exists(${.CURDIR}/Makefile.${MACHINE_CPUARCH})
+.include "Makefile.${MACHINE_CPUARCH}"
+.endif
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 8278d47..06b7af1 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -6,18 +6,18 @@
.if !defined(CPUTYPE) || empty(CPUTYPE)
_CPUCFLAGS =
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
MACHINE_CPU = i486
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
MACHINE_CPU = amd64 sse2 sse
-. elif ${MACHINE_ARCH} == "ia64"
+. elif ${MACHINE_CPUARCH} == "ia64"
MACHINE_CPU = itanium
-. elif ${MACHINE_ARCH} == "powerpc"
+. elif ${MACHINE_CPUARCH} == "powerpc"
MACHINE_CPU = aim
-. elif ${MACHINE_ARCH} == "sparc64"
-. elif ${MACHINE_ARCH} == "arm"
+. elif ${MACHINE_CPUARCH} == "sparc64"
+. elif ${MACHINE_CPUARCH} == "arm"
MACHINE_CPU = arm
-. elif ${MACHINE_ARCH} == "mips"
+. elif ${MACHINE_CPUARCH} == "mips"
MACHINE_CPU = mips
. endif
.else
@@ -25,7 +25,7 @@ MACHINE_CPU = mips
# Handle aliases (not documented in make.conf to avoid user confusion
# between e.g. i586 and pentium)
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "nocona"
CPUTYPE = prescott
. elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2"
@@ -54,7 +54,7 @@ CPUTYPE = athlon-mp
. elif ${CPUTYPE} == "k7"
CPUTYPE = athlon
. endif
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2"
CPUTYPE = nocona
. endif
@@ -71,7 +71,7 @@ CPUTYPE = nocona
# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "crusoe"
_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
. elif ${CPUTYPE} == "k5"
@@ -104,9 +104,9 @@ _ICC_CPUCFLAGS = -tpp5
. else
_ICC_CPUCFLAGS =
. endif # ICC on 'i386'
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
_CPUCFLAGS = -march=${CPUTYPE}
-. elif ${MACHINE_ARCH} == "arm"
+. elif ${MACHINE_CPUARCH} == "arm"
. if ${CPUTYPE} == "xscale"
#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
#_CPUCFLAGS = -mcpu=xscale
@@ -114,14 +114,14 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
. else
_CPUCFLAGS = -mcpu=${CPUTYPE}
. endif
-. elif ${MACHINE_ARCH} == "powerpc"
+. elif ${MACHINE_CPUARCH} == "powerpc"
. if ${CPUTYPE} == "e500"
MACHINE_CPU = booke
_CPUCFLAGS = -Wa,-me500 -msoft-float
. else
_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
. endif
-. elif ${MACHINE_ARCH} == "mips"
+. elif ${MACHINE_CPUARCH} == "mips"
. if ${CPUTYPE} == "mips32"
_CPUCFLAGS = -march=mips32
. elif ${CPUTYPE} == "mips32r2"
@@ -141,7 +141,7 @@ _CPUCFLAGS = -march=24kc
# unordered list to make it easy for client makefiles to test for the
# presence of a CPU feature.
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
@@ -180,37 +180,38 @@ MACHINE_CPU = i486 i386
. elif ${CPUTYPE} == "i386"
MACHINE_CPU = i386
. endif
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
MACHINE_CPU = k8 3dnow
. elif ${CPUTYPE} == "nocona"
MACHINE_CPU = sse3
. endif
MACHINE_CPU += amd64 sse2 sse mmx
-. elif ${MACHINE_ARCH} == "ia64"
+. elif ${MACHINE_CPUARCH} == "ia64"
. if ${CPUTYPE} == "itanium"
MACHINE_CPU = itanium
. endif
. endif
.endif
-.if ${MACHINE_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
-CFLAGS += -mbig-endian
-LDFLAGS += -mbig-endian
-LD += -EB
-.endif
+##XXXimp: These are bogus
+#.if ${MACHINE_CPUARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
+#CFLAGS += -mbig-endian
+#LDFLAGS += -mbig-endian
+#LD += -EB
+#.endif
-.if ${MACHINE_ARCH} == "mips"
-. if defined(TARGET_BIG_ENDIAN)
-CFLAGS += -EB
-LDFLAGS += -Wl,-EB
-LD += -EB
-. else
-CFLAGS += -EL
-LDFLAGS += -Wl,-EL
-LD += -EL
-. endif
-CFLAGS += -msoft-float -G0 -mno-dsp -mabicalls
+.if ${MACHINE_CPUARCH} == "mips"
+#. if defined(TARGET_BIG_ENDIAN)
+#CFLAGS += -EB
+#LDFLAGS += -Wl,-EB
+#LD += -EB
+#. else
+#CFLAGS += -EL
+#LDFLAGS += -Wl,-EL
+#LD += -EL
+#. endif
+CFLAGS += -msoft-float -G0 -mabicalls
.endif
# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk
index c2b141f..158554b 100644
--- a/share/mk/bsd.endian.mk
+++ b/share/mk/bsd.endian.mk
@@ -3,12 +3,12 @@
.if ${MACHINE_ARCH} == "amd64" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "ia64" || \
- (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \
- (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN))
+ ${MACHINE_ARCH} == "arm" || \
+ ${MACHINE_ARCH} == "mipsel"
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "sparc64" || \
- ${MACHINE_ARCH} == "arm" || \
- ${MACHINE_ARCH} == "mips"
+ ${MACHINE_ARCH} == "armeb" || \
+ ${MACHINE_ARCH} == "mipseb"
TARGET_ENDIANNESS= 4321
.endif
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 470d9d4..54de4e9 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -53,7 +53,7 @@ STRIP?= -s
.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .m .C .f .y .l .ln
.if !defined(PICFLAG)
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
PICFLAG=-fPIC
.else
PICFLAG=-fpic
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 97860f2..8d0e24a 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -79,8 +79,8 @@ CWARNFLAGS += -Werror
CWARNFLAGS += -Wno-unknown-pragmas
.endif
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
- ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
+.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_CPUARCH} != "ia64" && \
+ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS ?= -fstack-protector
CFLAGS += ${SSP_CFLAGS}
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 51ec039..3d517a3 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -4,6 +4,18 @@
unix ?= We run FreeBSD, not UNIX.
.FreeBSD ?= true
+.if !defined(%POSIX)
+#
+# MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with
+# the same MACHINE_ARCH can run reach-other's binaries, so it
+# necessarily has word size and endian swizzled in. However, support
+# files for these machines often are shared amongst all combinations
+# of size and/or endian. This is called MACHINE_CPU in NetBSD, but
+# that's used for something different in FreeBSD.
+#
+MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/}
+.endif
+
# If the special target .POSIX appears (without prerequisites or
# commands) before the first noncomment line in the makefile, make shall
# process the makefile as specified by the Posix 1003.2 specification.
@@ -35,7 +47,7 @@ CC ?= c89
CFLAGS ?= -O
.else
CC ?= cc
-.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
CFLAGS ?= -O -pipe
.else
CFLAGS ?= -O2 -pipe
OpenPOWER on IntegriCloud