xref: /illumos-gate/usr/src/stand/lib/Makefile.com (revision 28ab0ca48b3e331cbbb231b1c8325f9f24f9af95)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24
25#
26# Common macro definitions and pattern rules for stand libraries.
27# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib.
28#
29
30include $(SRC)/lib/Makefile.lib
31include $(SRC)/stand/lib/Makefile.$(MACH)
32
33SRCDIR =	.
34LIBS +=		$(LIBRARY)
35CFLAGS +=	$(CCVERBOSE)
36LDFLAGS =	-r
37LDLIBS +=	-lsa
38
39#
40# Reset ROOTLIBDIR to an alternate directory so that we don't clash with
41# $(ROOT)/usr/lib.  The Makefiles over in usr/src/psm expect to find our
42# libraries here.
43#
44ROOTLIBDIR = $(ROOT)/stand/lib
45
46#
47# Paths to a variety of commonly-referenced directories.  Note that we use
48# relative paths so that references to filenames in the source (e.g.,
49# through use of assert()) are not exposed absolutely (for reasons of
50# taste and to help make the binaries end up the same even when built from
51# different workspaces).  Makefiles that are more than one directory level
52# deeper than this Makefile need to set DIRREL appropriately so that the
53# relative paths can still be accessed correctly.
54#
55TOPDIR =	$(DIRREL)../../..
56STANDDIR =	$(DIRREL)../..
57CMNNETDIR =	$(TOPDIR)/common/net
58SYSDIR	=	$(TOPDIR)/uts
59
60#
61# As a courtesy to the numerous standalone libraries which are built from
62# sources living elsewhere, we provide a generic CMNDIR macro which the
63# library's Makefile can set (if need be) to the primary other directory
64# it grabs its sources from.
65#
66CMNDIR =	.
67
68#
69# Configure the appropriate #defines and #include path for building
70# standalone bits.  Note that we turn off access to /usr/include and
71# the proto area since those headers match libc's implementation, and
72# libc is of course not available to standalone binaries.
73#
74CPPDEFS	=	-D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP
75CPPINCS	=	-YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \
76		-I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \
77		-I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \
78		-I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH)
79
80CPPFLAGS =	$(CPPDEFS) $(CPPINCS)
81AS_CPPFLAGS =	$(CPPDEFS) $(CPPINCS:-YI,%=-I%)
82ASFLAGS =	-P -D__STDC__ -D_ASM
83
84#
85# While things are pretty much 32-bit lint-clean, there are a ton of
86# suspect pointer casts.  Since these may be serious problems (especially
87# on SPARC), this really needs to be investigated thoroughly one day.
88# However, we shouldn't feel too bad: the whole kernel is linted with this
89# turned off as well (along with a dozen other disabled warnings).
90#
91# The other two -erroff's are needed only because lint's -u flag is lame
92# and also turns off "name used but not defined" checks (so we instead
93# just enumerate the errors that -u turns off that we want turned off).
94#
95LINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \
96	    -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \
97	    -erroff=E_STATIC_UNUSED
98
99#
100# CPPFLAGS values that *must* be included whenever linking with or
101# building libssl or libcrypto.
102# Exclusions here are for both legal and size reasons.
103#
104OPENSSL_SRC = ../../../common/openssl
105OPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN
106OPENSSL_BUILD_CPPFLAGS = -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA \
107			-DOPENSSL_NO_HW_4758_CCA -DOPENSSL_NO_HW_AEP \
108			-DOPENSSL_NO_HW_ATALLA -DOPENSSL_NO_HW_CHIL \
109			-DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_GMP \
110			-DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_PADLOCK \
111			-DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_UBSEC \
112			-DOPENSSL_NO_HW \
113			-DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \
114			-DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \
115			-DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \
116			-DOPENSSL_NO_CAST -DOPENSSL_NO_AES \
117			-DDEVRANDOM=\"/dev/urandom\" \
118			-I.. \
119			$(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \
120			-I$(ROOT)/usr/include \
121			-I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto
122
123#
124# CPPFLAGS values that *must* be included whenever linking the DHCP
125# routines in $SRC/common/net/dhcp.
126#
127DHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp
128
129#
130# CPPFLAGS values that *must* be included whenever linking with or
131# building libsock.
132#
133# The header files for libsock provide alternate definitions for data
134# types that are also defined in <sys/stream.h>.  To make sure we get the
135# right ones, prevent <sys/stream.h>'s contents from being included.  This
136# is shameful.
137#
138SOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H
139
140#
141# Using Makefile.lib pulls in the stack protector. Explicitly disable it
142# as it is not initialized or supported in this environment currently.
143#
144STACKPROTECT = none
145
146.KEEP_STATE:
147