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# 21d656abb5SVladimir Kotal# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 227c478bd9Sstevel@tonic-gate# Use is subject to license terms. 23f808c858Sraf# 24f808c858Sraf 257c478bd9Sstevel@tonic-gate# 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 = . 34241c90a0SRichard LoweLIBS += $(LIBRARY) 357c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 367c478bd9Sstevel@tonic-gateLDFLAGS = -r 37241c90a0SRichard LoweLDLIBS += -lsa 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate# 407c478bd9Sstevel@tonic-gate# Reset ROOTLIBDIR to an alternate directory so that we don't clash with 417c478bd9Sstevel@tonic-gate# $(ROOT)/usr/lib. The Makefiles over in usr/src/psm expect to find our 427c478bd9Sstevel@tonic-gate# libraries here. 437c478bd9Sstevel@tonic-gate# 447c478bd9Sstevel@tonic-gateROOTLIBDIR = $(ROOT)/stand/lib 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate# 477c478bd9Sstevel@tonic-gate# Paths to a variety of commonly-referenced directories. Note that we use 487c478bd9Sstevel@tonic-gate# relative paths so that references to filenames in the source (e.g., 497c478bd9Sstevel@tonic-gate# through use of assert()) are not exposed absolutely (for reasons of 507c478bd9Sstevel@tonic-gate# taste and to help make the binaries end up the same even when built from 517c478bd9Sstevel@tonic-gate# different workspaces). Makefiles that are more than one directory level 527c478bd9Sstevel@tonic-gate# deeper than this Makefile need to set DIRREL appropriately so that the 537c478bd9Sstevel@tonic-gate# relative paths can still be accessed correctly. 547c478bd9Sstevel@tonic-gate# 557c478bd9Sstevel@tonic-gateTOPDIR = $(DIRREL)../../.. 567c478bd9Sstevel@tonic-gateSTANDDIR = $(DIRREL)../.. 577c478bd9Sstevel@tonic-gateCMNNETDIR = $(TOPDIR)/common/net 587c478bd9Sstevel@tonic-gateSYSDIR = $(TOPDIR)/uts 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate# 617c478bd9Sstevel@tonic-gate# As a courtesy to the numerous standalone libraries which are built from 627c478bd9Sstevel@tonic-gate# sources living elsewhere, we provide a generic CMNDIR macro which the 637c478bd9Sstevel@tonic-gate# library's Makefile can set (if need be) to the primary other directory 647c478bd9Sstevel@tonic-gate# it grabs its sources from. 657c478bd9Sstevel@tonic-gate# 667c478bd9Sstevel@tonic-gateCMNDIR = . 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate# 697c478bd9Sstevel@tonic-gate# Configure the appropriate #defines and #include path for building 707c478bd9Sstevel@tonic-gate# standalone bits. Note that we turn off access to /usr/include and 717c478bd9Sstevel@tonic-gate# the proto area since those headers match libc's implementation, and 727c478bd9Sstevel@tonic-gate# libc is of course not available to standalone binaries. 737c478bd9Sstevel@tonic-gate# 74241c90a0SRichard LoweCPPDEFS = -D$(KARCH) -D_BOOT -D_KERNEL -D_MACHDEP 75241c90a0SRichard LoweCPPINCS = -YI,$(STANDDIR)/lib/sa -I$(STANDDIR)/lib/sa \ 76257873cfSJohn.Zolnowsky@Sun.COM -I$(STANDDIR) -I$(SRCDIR) -I$(CMNDIR) \ 777c478bd9Sstevel@tonic-gate -I$(STANDDIR)/$(MACH) -I$(SYSDIR)/common $(ARCHDIRS) \ 787c478bd9Sstevel@tonic-gate -I$(SYSDIR)/sun4 -I$(SYSDIR)/$(KARCH) 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gateCPPFLAGS = $(CPPDEFS) $(CPPINCS) 817c478bd9Sstevel@tonic-gateAS_CPPFLAGS = $(CPPDEFS) $(CPPINCS:-YI,%=-I%) 82*5d9d9091SRichard LoweASFLAGS = -D__STDC__ -D_ASM 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate# 857c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 867c478bd9Sstevel@tonic-gate# building libssl or libcrypto. 87bda1f129SMark Phalan# Exclusions here are for both legal and size reasons. 887c478bd9Sstevel@tonic-gate# 89d656abb5SVladimir KotalOPENSSL_SRC = ../../../common/openssl 907c478bd9Sstevel@tonic-gateOPENSSL_BUILD_CPPFLAGS_sparc = -DB_ENDIAN 91bda1f129SMark PhalanOPENSSL_BUILD_CPPFLAGS = -DOPENSSL_NO_ECDH -DOPENSSL_NO_ECDSA \ 92bda1f129SMark Phalan -DOPENSSL_NO_HW_4758_CCA -DOPENSSL_NO_HW_AEP \ 93bda1f129SMark Phalan -DOPENSSL_NO_HW_ATALLA -DOPENSSL_NO_HW_CHIL \ 94bda1f129SMark Phalan -DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_GMP \ 95bda1f129SMark Phalan -DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_PADLOCK \ 96bda1f129SMark Phalan -DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_UBSEC \ 97bda1f129SMark Phalan -DOPENSSL_NO_HW \ 987c478bd9Sstevel@tonic-gate -DOPENSSL_NO_MD2 -DOPENSSL_NO_MD4 -DOPENSSL_NO_MDC2 \ 997c478bd9Sstevel@tonic-gate -DOPENSSL_NO_RIPEMD -DOPENSSL_NO_RC3 -DOPENSSL_NO_RC4 \ 1007c478bd9Sstevel@tonic-gate -DOPENSSL_NO_EC -DOPENSSL_NO_RC5 -DOPENSSL_NO_IDEA \ 1017c478bd9Sstevel@tonic-gate -DOPENSSL_NO_CAST -DOPENSSL_NO_AES \ 1027c478bd9Sstevel@tonic-gate -DDEVRANDOM=\"/dev/urandom\" \ 103bda1f129SMark Phalan -I.. \ 1047c478bd9Sstevel@tonic-gate $(OPENSSL_BUILD_CPPFLAGS_$(MACH)) \ 105257873cfSJohn.Zolnowsky@Sun.COM -I$(ROOT)/usr/include \ 1067c478bd9Sstevel@tonic-gate -I$(OPENSSL_SRC) -I$(OPENSSL_SRC)/crypto 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate# 1097c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking the DHCP 1107c478bd9Sstevel@tonic-gate# routines in $SRC/common/net/dhcp. 1117c478bd9Sstevel@tonic-gate# 1127c478bd9Sstevel@tonic-gateDHCPCPPFLAGS = -I$(CMNNETDIR)/dhcp 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate# 1157c478bd9Sstevel@tonic-gate# CPPFLAGS values that *must* be included whenever linking with or 1167c478bd9Sstevel@tonic-gate# building libsock. 1177c478bd9Sstevel@tonic-gate# 1187c478bd9Sstevel@tonic-gate# The header files for libsock provide alternate definitions for data 1197c478bd9Sstevel@tonic-gate# types that are also defined in <sys/stream.h>. To make sure we get the 1207c478bd9Sstevel@tonic-gate# right ones, prevent <sys/stream.h>'s contents from being included. This 1217c478bd9Sstevel@tonic-gate# is shameful. 1227c478bd9Sstevel@tonic-gate# 1237c478bd9Sstevel@tonic-gateSOCKCPPFLAGS = -I$(STANDDIR)/lib/sock -D_SYS_STREAM_H 1247c478bd9Sstevel@tonic-gate 1255a0af816SRobert Mustacchi# 1265a0af816SRobert Mustacchi# Using Makefile.lib pulls in the stack protector. Explicitly disable it 1275a0af816SRobert Mustacchi# as it is not initialized or supported in this environment currently. 1285a0af816SRobert Mustacchi# 1295a0af816SRobert MustacchiSTACKPROTECT = none 1305a0af816SRobert Mustacchi 1317c478bd9Sstevel@tonic-gate.KEEP_STATE: 132