Changeset View
Standalone View
Makefile.inc1
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | |||||
.if !defined(VERSION) | .if !defined(VERSION) | ||||
REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION | REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION | ||||
BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH | BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH | ||||
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ | SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ | ||||
${SRCDIR}/sys/sys/param.h | ${SRCDIR}/sys/sys/param.h | ||||
VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} | VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} | ||||
.endif | .endif | ||||
KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 | KNOWN_ARCHES?= aarch64/arm64 amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 | ||||
.if ${TARGET} == ${TARGET_ARCH} | .if ${TARGET} == ${TARGET_ARCH} | ||||
_t= ${TARGET} | _t= ${TARGET} | ||||
.else | .else | ||||
_t= ${TARGET_ARCH}/${TARGET} | _t= ${TARGET_ARCH}/${TARGET} | ||||
.endif | .endif | ||||
.for _t in ${_t} | .for _t in ${_t} | ||||
.if empty(KNOWN_ARCHES:M${_t}) | .if empty(KNOWN_ARCHES:M${_t}) | ||||
.error Unknown target ${TARGET_ARCH}:${TARGET}. | .error Unknown target ${TARGET_ARCH}:${TARGET}. | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
.if defined(CROSS_TOOLCHAIN_PREFIX) | .if defined(CROSS_TOOLCHAIN_PREFIX) | ||||
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | ||||
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | ||||
.endif | .endif | ||||
# If we do not have a bootstrap binutils (because the in-tree one does not | # If we do not have a bootstrap binutils (because the in-tree one does not | ||||
# support the target architecture), provide a default cross-binutils prefix. | # support the target architecture), provide a default cross-binutils prefix. | ||||
# This allows aarch64 builds, for example, to automatically use the | # This allows aarch64 builds, for example, to automatically use the | ||||
# aarch64-binutils port or package. | # aarch64-binutils port or package. | ||||
imp: This is ugly. Why is aarch64 special? Why wouldn't we need it for sparc64 if we removed ld and… | |||||
Not Done Inline Actions
We would. I was originally planning require users to set CROSS_BINUTILS_PREFIX in order to make use of this, but Andy wanted it to be automatic. Do you have a sketch of something that would be a more generic way to do it? emaste: > Why wouldn't we need it for sparc64 if we removed ld and gcc?
We would. I was originally… | |||||
Not Done Inline ActionsI'm not entirely sure. Let me think about that one. imp: I'm not entirely sure. Let me think about that one. | |||||
Not Done Inline ActionsWe can change the test to BINUTILS_BOOTSTRAP in __ALWAYS_NO instead. It seems reasonable that those cases where we force it off ought to have the default. Something similar to # If we do not have a bootstrap binutils (because the in-tree one does not # support the target architecture), provide a default cross-binutils prefix. # This allows aarch64 builds, for example, to automatically use the # aarch64-binutils port or package. .if !empty(__ALWAYS_NO:MBINUTILS_BOOTSTRAP) && !defined(CROSS_BINUTILS_PREFIX) CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ .if !exists(${CROSS_BINUTILS_PREFIX}) .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. .endif .endif emaste: We can change the test to `BINUTILS_BOOTSTRAP` in `__ALWAYS_NO` instead. It seems reasonable… | |||||
Not Done Inline ActionsI like this notion. That's acceptable to me. imp: I like this notion. That's acceptable to me. | |||||
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ | .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ | ||||
Not Done Inline ActionsShould we add a check here and warn or error out if the package is missing? andrew: Should we add a check here and warn or error out if the package is missing? | |||||
Not Done Inline ActionsI originally had a test that CROSS_BINUTILS_PREFIX exists, but @imp pointed out that it's also possible to use a per-file prefix, not a path prefix. I suppose we should change the test to also check for empty CROSS_BINUTILS_PREFIX, and test directory existence in that case. emaste: I originally had a test that CROSS_BINUTILS_PREFIX exists, but @imp pointed out that it's also… | |||||
!defined(CROSS_BINUTILS_PREFIX) | !defined(CROSS_BINUTILS_PREFIX) | ||||
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ | CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ | ||||
.if !exists(${CROSS_BINUTILS_PREFIX}) | .if !exists(${CROSS_BINUTILS_PREFIX}) | ||||
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. | .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
XCOMPILERS= CC CXX CPP | XCOMPILERS= CC CXX CPP | ||||
▲ Show 20 Lines • Show All 1,136 Lines • ▼ Show 20 Lines | _elftctools= lib/libelftc \ | ||||
usr.bin/elfcopy \ | usr.bin/elfcopy \ | ||||
usr.bin/nm \ | usr.bin/nm \ | ||||
usr.bin/size \ | usr.bin/size \ | ||||
usr.bin/strings | usr.bin/strings | ||||
# These are not required by the build, but can be useful for developers who | # These are not required by the build, but can be useful for developers who | ||||
# cross-build on a FreeBSD 10 host: | # cross-build on a FreeBSD 10 host: | ||||
_elftctools+= usr.bin/addr2line | _elftctools+= usr.bin/addr2line | ||||
.endif | .endif | ||||
.elif ${TARGET_ARCH} != ${MACHINE_ARCH} && ${MK_ELFTOOLCHAIN_TOOLS} != "no" | |||||
# A cross-strip is not passed in WMAKEENV, so build elfcopy/strip. | |||||
_elftctools= lib/libelftc \ | |||||
usr.bin/elfcopy | |||||
.endif | .endif | ||||
# If an full path to an external cross compiler is given, don't build | # If an full path to an external cross compiler is given, don't build | ||||
# a cross compiler. | # a cross compiler. | ||||
.if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" | .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" | ||||
.if ${MK_CLANG_BOOTSTRAP} != "no" | .if ${MK_CLANG_BOOTSTRAP} != "no" | ||||
_clang= usr.bin/clang | _clang= usr.bin/clang | ||||
_clang_libs= lib/clang | _clang_libs= lib/clang | ||||
▲ Show 20 Lines • Show All 695 Lines • Show Last 20 Lines |
This is ugly. Why is aarch64 special? Why wouldn't we need it for sparc64 if we removed ld and gcc? I really don't like this at all.
I know it is here for convenience, but there's got to be a more generic way to do it.