summaryrefslogtreecommitdiffstats
path: root/lib/msun/Makefile
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-02-16 18:26:31 +0000
committerbde <bde@FreeBSD.org>1997-02-16 18:26:31 +0000
commit9e8f1bd4ec847780eb9aaf168c43f1271f0e37f5 (patch)
treeceebd776f63210707bd1eec59b604a7213f9a2ac /lib/msun/Makefile
parent85bd6daaf1022d92875e9125182a7b3db3f3b183 (diff)
downloadFreeBSD-src-9e8f1bd4ec847780eb9aaf168c43f1271f0e37f5.zip
FreeBSD-src-9e8f1bd4ec847780eb9aaf168c43f1271f0e37f5.tar.gz
Select between the generic math functions and the i387-specific ones
at runtime. etc/make.conf: Nuked HAVE_FPU option. lib/msun/Makefile: Always build the i387 objects. Copy the i387 source files at build time so that the i387 objects have different names. This is simpler than renaming the files in the cvs repository or repeating half of bsd.lib.mk to add explicit rules. lib/msun/src/*.c: Renamed all functions that have an i387-specific version by adding `__generic_' to their names. lib/msun/src/get_hw_float.c: New file for getting machdep.hw_float from the kernel. sys/i386/include/asmacros.h: Abuse the ENTRY() macro to generate jump vectors and associated code. This works much like PIC PLT dynamic initialization. The PIC case is messy. The old i387 entry points are renamed. Renaming is easier here because the names are given by macro expansions.
Diffstat (limited to 'lib/msun/Makefile')
-rw-r--r--lib/msun/Makefile20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index d4f6bc4..8bcf65b 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -41,9 +41,7 @@
# default standard
#
-# Enable if you have a i387 (or i486 or Pentium)
-.if defined(HAVE_FPU)
-.PATH: ${.CURDIR}/i387
+ARCH= i387
ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_fmod.S e_log.S e_log10.S \
e_remainder.S e_scalb.S e_sqrt.S s_atan.S s_ceil.S s_copysign.S \
s_cos.S s_finite.S s_floor.S s_ilogb.S s_logb.S \
@@ -51,7 +49,6 @@ ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_fmod.S e_log.S e_log10.S \
# Broken
# ARCH_SRCS+= s_log1p.S
-.endif
.PATH: ${.CURDIR}/man
.PATH: ${.CURDIR}/src
@@ -67,6 +64,7 @@ COMMON_SRCS = e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \
e_log.c e_log10.c e_log10f.c e_logf.c e_pow.c e_powf.c e_rem_pio2.c \
e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \
e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c \
+ get_hw_float.c \
k_cos.c k_cosf.c k_rem_pio2.c k_rem_pio2f.c k_sin.c k_sinf.c \
k_standard.c k_tan.c k_tanf.c \
s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_cbrt.c s_cbrtf.c s_ceil.c \
@@ -90,12 +88,18 @@ COMMON_SRCS = e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \
# FreeBSD's C library supplies these functions:
#COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c
+CLEANFILES+= ${RENAMED_ARCH_SRCS}
+RENAMED_ARCH_SRCS= ${ARCH_SRCS:S/^/${ARCH}_/g}
+SRCS= ${COMMON_SRCS} ${RENAMED_ARCH_SRCS}
-SRCS=${COMMON_SRCS}
-
-# Substitute common sources with any arch specific sources
+# Generate rules to rename arch-specific sources to avoid conflicts.
+# The path to the arch-specific sources is given explicitly instead of
+# with `.PATH: ${.CURDIR}/${ARCH}' since otherwise bsd.lib.mk would
+# use .S.o rules instead of .c.o rules for the conflicting prefixes
+# (except after `make depend' it uses the correct rules!).
.for i in ${ARCH_SRCS}
- SRCS:=${SRCS:S/${i:S/.S/.c/}/$i/}
+${ARCH}_${i}: ${.CURDIR}/i387/${i}
+ cp ${.ALLSRC} ${.TARGET}
.endfor
MANSRC= ${.CURDIR}/man
OpenPOWER on IntegriCloud