summaryrefslogtreecommitdiff
path: root/usr/src/lib/libm/Makefile.libm.com
diff options
context:
space:
mode:
authorPiotr Jasiukajtis <estibi@me.com>2014-02-04 20:31:57 +0100
committerDan McDonald <danmcd@omniti.com>2014-10-17 18:00:52 -0400
commit25c28e83beb90e7c80452a7c818c5e6f73a07dc8 (patch)
tree95cb102e7fb37f52d4b3ec3e44508f352a335ee5 /usr/src/lib/libm/Makefile.libm.com
parent4e6070e87069f63bef94d8e79c2fc3cab2c1ab6b (diff)
downloadillumos-joyent-25c28e83beb90e7c80452a7c818c5e6f73a07dc8.tar.gz
693 Opensource replacement of sunwlibm
Reviewed by: Igor Kozhukhov ikozhukhov@gmail.com Reviewed by: Keith M Wesolowski <keith.wesolowski@joyent.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/lib/libm/Makefile.libm.com')
-rw-r--r--usr/src/lib/libm/Makefile.libm.com93
1 files changed, 93 insertions, 0 deletions
diff --git a/usr/src/lib/libm/Makefile.libm.com b/usr/src/lib/libm/Makefile.libm.com
new file mode 100644
index 0000000000..f6f9725596
--- /dev/null
+++ b/usr/src/lib/libm/Makefile.libm.com
@@ -0,0 +1,93 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+#
+
+LIBMDIR = $(SRC)/lib/libm
+
+LIBMSRC = $(LIBMDIR)/common
+
+CPP_CMD = $(CC) -E -Xs
+
+ASSUFFIX_sparc = S
+ASSUFFIX_i386 = s
+ASSUFFIX = $(ASSUFFIX_$(MACH))
+
+# C99MODE of neither enabled nor disabled is "no_lib", whereby we expect
+# C99-the-language, but don't modify the behaviour of library routines. This
+# is VERY IMPORTANT, as -xc99=%all, for instance, would link us with
+# values-xpg6, which would introduce an __xpg6 to our object with the C99
+# flags set, causing us to default C99 libm behaviour on, breaking
+# compatibility.
+C99MODE =
+
+M4FLAGS = -D__STDC__ -DELFOBJ -DPIC
+
+LDBLDIR_sparc = Q
+LDBLDIR_i386 = LD
+LDBLDIR = $(LDBLDIR_$(MACH))
+
+LM_IL = $(LIBMDIR)/$(TARGET_ARCH)/src/locallibm.il
+
+CFLAGS += $(C_PICFLAGS) -D__INLINE $(XSTRCONST) $(LM_IL)
+CFLAGS64 += $(C_PICFLAGS) -D__INLINE $(XSTRCONST) $(LM_IL)
+sparc_CFLAGS += -Wa,-xarch=v8plus
+
+CPPFLAGS += -DELFOBJ \
+ -DLIBM_MT_FEX_SYNC \
+ -I$(LIBMSRC)/C \
+ -I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
+
+# GCC needs __C99FEATURES__ such that the implementations of isunordered,
+# isgreaterequal, islessequal, etc, exist. This is basically equivalent to
+# providing no -xc99 to Studio, in that it gets us the C99 language features,
+# but not values-xpg6, the reason for which is outline with C99MODE.
+CFLAGS += -_gcc=-D__C99FEATURES__
+CFLAGS64 += -_gcc=-D__C99FEATURES__
+
+# libm depends on integer overflow characteristics
+CFLAGS += -_gcc=-fno-strict-overflow
+CFLAGS64 += -_gcc=-fno-strict-overflow
+
+$(DYNLIB) := LDLIBS += -lc
+
+$(LINTLIB) := SRCS = $(LIBMSRC)/$(LINTSRC)
+
+CLEANFILES += pics/*.s pics/*.S
+
+FPDEF_amd64 = -DARCH_amd64
+FPDEF_sparc = -DCG89 -DARCH_v8plus -DFPADD_TRAPS_INCOMPLETE_ON_NAN
+FPDEF_sparcv9 = -DARCH_v9 -DFPADD_TRAPS_INCOMPLETE_ON_NAN
+FPDEF = $(FPDEF_$(TARGET_ARCH))
+
+ASFLAGS = -P -D_ASM $(FPDEF)
+
+XARCH_sparc = v8plus
+XARCH_sparcv9 = v9
+XARCH_i386 = f80387
+XARCH_amd64 = amd64
+XARCH = $(XARCH_$(TARGET_ARCH))
+
+ASOPT_sparc = -xarch=$(XARCH) $(AS_PICFLAGS)
+ASOPT_sparcv9 = -xarch=$(XARCH) $(AS_PICFLAGS)
+ASOPT_i386 =
+ASOPT_amd64 = -xarch=$(XARCH) $(AS_PICFLAGS)
+ASOPT = $(ASOPT_$(TARGET_ARCH))
+
+ASFLAGS += $(ASOPT)
+
+CPPFLAGS_sparc = -DFPADD_TRAPS_INCOMPLETE_ON_NAN \
+ -DFDTOS_TRAPS_INCOMPLETE_IN_FNS_MODE
+
+CPPFLAGS += $(CPPFLAGS_$(MACH))
+ASFLAGS += $(CPPFLAGS)