diff options
author | Warner Losh <imp@FreeBSD.org> | 2023-09-05 20:58:06 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2023-09-05 22:08:02 +0000 |
commit | b19d8afe4dd205f7d4bfa3282f58b73d504926db (patch) | |
tree | 09d0decdafb4f115657fa4765627381d06668bb9 /lib | |
parent | 815b7436a7c6302365b6514194d27d41cb736227 (diff) | |
download | src-b19d8afe4dd205f7d4bfa3282f58b73d504926db.tar.gz src-b19d8afe4dd205f7d4bfa3282f58b73d504926db.zip |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/Makefile | 14 | ||||
-rw-r--r-- | lib/msun/Makefile | 20 |
2 files changed, 23 insertions, 11 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile index a26215324332..7540eb8c21ad 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -7,12 +7,14 @@ SHLIBDIR?= /lib LIBC_SRCTOP?= ${.CURDIR} -# Pick the current architecture directory for libc. In general, this is -# named MACHINE_CPUARCH, but some ABIs are different enough to require -# their own libc, so allow a directory named MACHINE_ARCH to override this. - -.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH:S/powerpc64le/powerpc64/}) -LIBC_ARCH=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +# Pick the current architecture directory for libc. In general, this is named +# MACHINE_CPUARCH, but some ABIs are different enough to require their own libc, +# so allow a directory named MACHINE_ARCH to override this (though treat +# powerpc64le and powerpc64 the same). +# Note: This is copeid to msun/Makefile +M=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.if exists(${LIBC_SRCTOP}/${M}) +LIBC_ARCH=${M} .else LIBC_ARCH=${MACHINE_CPUARCH} .endif diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 8bc984c2c342..9917be01d863 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -97,17 +97,27 @@ COMMON_SRCS+= s_cospi.c s_cospif.c \ s_sinpi.c s_sinpif.c \ s_tanpi.c s_tanpif.c +# LIBCSRCDIR is defined lazily, so can't be used for exists() below +LIBC_SRCTOP=${SRCTOP}/lib/libc # Location of fpmath.h and _fpmath.h -.if exists(${LIBCSRCDIR}/${MACHINE_ARCH}) -LIBC_ARCH=${MACHINE_ARCH} + +# Pick the current architecture directory for libc. In general, this is named +# MACHINE_CPUARCH, but some ABIs are different enough to require their own libc, +# so allow a directory named MACHINE_ARCH to override this (though treat +# powerpc64le and powerpc64 the same). +# Note: This is copied from libc/Makefile +M=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.if exists(${LIBC_SRCTOP}/${M}) +LIBC_ARCH=${M} .else LIBC_ARCH=${MACHINE_CPUARCH} .endif -CFLAGS+= -I${.CURDIR}/src -I${LIBCSRCDIR}/include \ - -I${LIBCSRCDIR}/${LIBC_ARCH} + +CFLAGS+= -I${.CURDIR}/src -I${LIBC_SRCTOP}/include \ + -I${LIBC_SRCTOP}/${LIBC_ARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map -VERSION_DEF= ${LIBCSRCDIR}/Versions.def +VERSION_DEF= ${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS= ${SYM_MAPS} # C99 long double functions |