i386 removal, part 59/x: Revert a i386 specific local change in dma(8).
[dragonfly.git] / share / mk / bsd.cpu.mk
blob2902691a92331df73dd38fe79005857b6f763fe1
1 # $FreeBSD: src/share/mk/bsd.cpu.mk,v 1.2.2.5 2002/07/19 08:09:32 ru Exp $
3 # include compiler-specific bsd.cpu.mk. Note that CCVER may or may not
4 # be passed as an environment variable. If not set we make it consistent
5 # within make but do not otherwise export it.
7 # _CCVER is used to detect changes to CCVER made in Makefile's after the
8 # fact.
10 # HOST_CCVER is used by the native system compiler and defaults to CCVER.
11 # It is not subject to local CCVER overrides in Makefiles and it is inherited
12 # by all sub-makes.
14 # If the host system does not have the desired compiler for HOST_CCVER
15 # we back off to something it probably does have.
17 _DEFAULT_CCVER= gcc50
18 _DEFAULT_BINUTILSVER= binutils225
20 CCVER ?= ${_DEFAULT_CCVER}
21 _CCVER := ${CCVER}
22 .if exists(/usr/libexec/${_CCVER}/cc) || exists(/usr/libexec/custom/cc)
23 HOST_CCVER?= ${_CCVER}
24 .else
25 HOST_CCVER?= ${_DEFAULT_CCVER}
26 .endif
28 .if exists(/usr/libexec/${_DEFAULT_BINUTILSVER}/elf/as)
29 HOST_BINUTILSVER?= ${_DEFAULT_BINUTILSVER}
30 .else
31 HOST_BINUTILSVER!= basename `find -s /usr/libexec/binutils* -depth 0 | tail -1`
32 .endif
34 .if defined(FORCE_CPUTYPE)
35 CPUTYPE= ${FORCE_CPUTYPE}
36 .endif
38 .if defined(CCVER_BSD_CPU_MK)
39 . if ${CCVER_BSD_CPU_MK} != ""
40 . include "${CCVER_BSD_CPU_MK}"
41 . endif
42 .elif ${CCVER} == gcc47
43 . include <bsd.cpu.gcc47.mk>
44 .elif ${CCVER} == gcc50
45 . include <bsd.cpu.gcc50.mk>
46 .elif ${CCVER:Mclang*}
47 . include <bsd.cpu.clang.mk>
48 .else
49 . include <bsd.cpu.custom.mk>
50 .endif
52 # /usr/bin/cc depend on the CCVER environment variable, make sure CCVER is
53 # exported for /usr/bin/cc and friends. Note that CCVER is unsupported when
54 # cross compiling from 4.x or older versions of DFly and should not be set
55 # by the user.
57 .export CCVER
58 .export HOST_CCVER
60 # We can reassign _CPUCFLAGS and CFLAGS will evaluate properly to the
61 # new value, we do not have to add the variable to CFLAGS twice.
63 .if !defined(NO_CPU_CFLAGS) && !defined(_CPUCFLAGS_ASSIGNED)
64 _CPUCFLAGS_ASSIGNED=TRUE
65 CFLAGS += ${_CPUCFLAGS}
66 .endif