17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5f808c858Sraf# Common Development and Distribution License (the "License"). 6f808c858Sraf# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 21*d656abb5SVladimir Kotal# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 227c478bd9Sstevel@tonic-gate# Use is subject to license terms. 237c478bd9Sstevel@tonic-gate# 24f808c858Sraf 25f808c858Sraf# 267c478bd9Sstevel@tonic-gate# Common macro definitions and pattern rules for stand libraries. 277c478bd9Sstevel@tonic-gate# Basically just a trivial wrapper around $(SRC)/lib/Makefile.lib. 287c478bd9Sstevel@tonic-gate# 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.lib 317c478bd9Sstevel@tonic-gateinclude $(SRC)/stand/lib/Makefile.$(MACH) 327c478bd9Sstevel@tonic-gate 33f808c858SrafSRCDIR = . 347c478bd9Sstevel@tonic-gateLIBS += $(LIBRARY) $(LINTLIB) 357c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 367c478bd9Sstevel@tonic-gateLDFLAGS = -r 377c478bd9Sstevel@tonic-gateLDLIBS += -lsa -lfakeboot 387c478bd9Sstevel@tonic-gate$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate# 417c478bd9Sstevel@tonic-gate# Reset ROOTLIBDIR to an alternate directory so that we don't clash with 427c478bd9Sstevel@tonic-gate# $(ROOT)/usr/lib. The Makefiles over in usr/src/psm expect to find our 437c478bd9Sstevel@tonic-gate# libraries here. 447c478bd9Sstevel@tonic-gate# 457c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOT)/stand/lib 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gate# Paths to a variety of commonly-referenced directories. Note that we use 497c478bd9Sstevel@tonic-gate# relative paths so that references to filenames in the source (e.g., 507c478bd9Sstevel@tonic-gate# through use of assert()) are not exposed absolutely (for reasons of 517c478bd9Sstevel@tonic-gate# taste and to help make the binaries end up the same even when built from 527c478bd9Sstevel@tonic-gate# different workspaces). Makefiles that are more than one directory level 537c478bd9Sstevel@tonic-gate# deeper than this Makefile need to set DIRREL appropriately so that the 547c478bd9Sstevel@tonic-gate# relative paths can still be accessed correctly. 557c478bd9Sstevel@tonic-gate# 567c478bd9Sstevel@tonic-gateTOPDIR = $(DIRREL)../../.. 577c478bd9Sstevel@tonic-gateSTANDDIR = $(DIRREL)../.. 587c478bd9Sstevel@tonic-gateCMNNETDIR = $(TOPDIR)/common/net 597c478bd9Sstevel@tonic-gateSYSDIR = $(TOPDIR)/uts 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate# 627c478bd9Sstevel@tonic-gate# As a courtesy to the numerous standalone libraries which are built from 637c478bd9Sstevel@tonic-gate# sources living elsewhere, we provide a generic CMNDIR macro which the 647c478bd9Sstevel@tonic-gate# library's Makefile can set (if need be) to the primary other directory 657c478bd9Sstevel@tonic-gate# it grabs its sources from. 667c478bd9Sstevel@tonic-gate# 677c478bd9Sstevel@tonic-gateCMNDIR = . 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate# 707c478bd9Sstevel@tonic-gate# Configure the appropriate #defines and #include path for building 717c478bd9Sstevel@tonic-gate# standalone bits. Note that we turn off access to /usr/include and 727c478bd9Sstevel@tonic-gate# the proto area since those headers match libc's implementation, and 737c478bd9Sstevel@tonic-gate# libc is of course not available to standalone binaries. 747c478bd9Sstevel@tonic-gate# 757c478bd9Sstevel@tonic-gateCPPDEFS = -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP 76257873cfSJohn.Zolnowsky@Sun.COMCPPINCS = -YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \ 77257873cfSJohn.Zolnowsky@Sun.COM -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \ 787c478bd9Sstevel@tonic-gate -I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \ 797c478bd9Sstevel@tonic-gate -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gateCPPFLAGS = $(CPPDEFS) $(CPPINCS) 827c478bd9Sstevel@tonic-gateAS_CPPFLAGS = $(CPPDEFS) $(CPPINCS:-YI,%=-I%) 837c478bd9Sstevel@tonic-gateASFLAGS = -P -D__STDC__ -D_ASM 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate# 867c478bd9Sstevel@tonic-gate# While things are pretty much 32-bit lint-clean, there are a ton of 877c478bd9Sstevel@tonic-gate# suspect pointer casts. Since these may be serious problems (especially 887c478bd9Sstevel@tonic-gate# on SPARC), this really needs to be investigated thoroughly one day. 897c478bd9Sstevel@tonic-gate# However, we shouldn't feel too bad: the whole kernel is linted with this 907c478bd9Sstevel@tonic-gate# turned off as well (along with a dozen other disabled warnings). 917c478bd9Sstevel@tonic-gate# 927c478bd9Sstevel@tonic-gate# The other two -erroff's are needed only because lint's -u flag is lame 937c478bd9Sstevel@tonic-gate# and also turns off "name used but not defined" checks (so we instead 947c478bd9Sstevel@tonic-gate# just enumerate the errors that -u turns off that we want turned off). 957c478bd9Sstevel@tonic-gate# 967c478bd9Sstevel@tonic-gateLINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \ 977c478bd9Sstevel@tonic-gate -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 \ 987c478bd9Sstevel@tonic-gate -erroff=E_STATIC_UNUSED 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate# 1017c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 1027c478bd9Sstevel@tonic-gate# building libssl or libcrypto. 1037c478bd9Sstevel@tonic-gate# This overrides the restrictions for the standlone build, some of these 1047c478bd9Sstevel@tonic-gate# may be repeats from OPENSSL_NO_XXX but they are explicit here because 1057c478bd9Sstevel@tonic-gate# we are not just excluding for legal reasons but for size as well. 1067c478bd9Sstevel@tonic-gate# 107*d656abb5SVladimir KotalOPENSSL_SRC = ../../../common/openssl 1087c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN 1097c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS = $(OPENSSL_NO_XXX) -DOPENSSL_NO_HW \ 1107c478bd9Sstevel@tonic-gate -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \ 1117c478bd9Sstevel@tonic-gate -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \ 1127c478bd9Sstevel@tonic-gate -DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \ 1137c478bd9Sstevel@tonic-gate -DOPENSSL_NO_CAST -DOPENSSL_NO_AES \ 1147c478bd9Sstevel@tonic-gate -DDEVRANDOM=\"/dev/urandom\" \ 1157c478bd9Sstevel@tonic-gate $(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \ 116257873cfSJohn.Zolnowsky@Sun.COM -I$(ROOT)/usr/include \ 1177c478bd9Sstevel@tonic-gate -I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate# 1207c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking the DHCP 1217c478bd9Sstevel@tonic-gate# routines in $SRC/common/net/dhcp. 1227c478bd9Sstevel@tonic-gate# 1237c478bd9Sstevel@tonic-gateDHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate# 1267c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 1277c478bd9Sstevel@tonic-gate# building libsock. 1287c478bd9Sstevel@tonic-gate# 1297c478bd9Sstevel@tonic-gate# The header files for libsock provide alternate definitions for data 1307c478bd9Sstevel@tonic-gate# types that are also defined in <sys/stream.h>. To make sure we get the 1317c478bd9Sstevel@tonic-gate# right ones, prevent <sys/stream.h>'s contents from being included. This 1327c478bd9Sstevel@tonic-gate# is shameful. 1337c478bd9Sstevel@tonic-gate# 1347c478bd9Sstevel@tonic-gateSOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gate.KEEP_STATE: 137