xref: /illumos-gate/usr/src/cmd/sgs/Makefile.var (revision cd61ae21)
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
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# 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#
215aefb655Srie
227c478bd9Sstevel@tonic-gate#
2320c1c355SRod Evans# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24cf9a187cSAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
2756deab07SRod Evans# The link-editor related source files and Makefile files have at times been
2856deab07SRod Evans# unified across all presently maintained release gates.  However, some of the
2956deab07SRod Evans# compiler pre-processor flags and link-editor flags are different among the
30cf9a187cSAndy Fiddaman# releases.  This file is used to specify such flags.
31cf9a187cSAndy Fiddaman#
3256deab07SRod Evans# This file is included by ./Makefile.com, but may also be included directly in
3356deab07SRod Evans# the case where the utility is relying on the contents of ../../Makefile.com.
34cf9a187cSAndy Fiddaman#
355aefb655Srie# This file should be the only file which is different among the presently
3656deab07SRod Evans# maintained release workspaces, when the sources are unified.
377c478bd9Sstevel@tonic-gate#
387c478bd9Sstevel@tonic-gate# CPPFEATUREMACROS provides for selectively turning on/off features within the
3956deab07SRod Evans# various link-editor components.  Presently, none are set.
4056deab07SRod Evans#
4156deab07SRod Evans# Some source files need to use #ifdef to distinguish between the patch release,
4256deab07SRod Evans# and for the packages targeting to the pre-libc/libthread unified environment.
4356deab07SRod Evans# These values are available for CPPFLAGS:
44cf9a187cSAndy Fiddaman#
457c478bd9Sstevel@tonic-gate#	SGS_PRE_UNIFIED_PROCESS
467c478bd9Sstevel@tonic-gate#
477c478bd9Sstevel@tonic-gate#		is set if the target release is for pre-libc/libthread unified
487c478bd9Sstevel@tonic-gate#		environment. This is used for rtld and crle.
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate#
517c478bd9Sstevel@tonic-gate# Common Macro definitions
527c478bd9Sstevel@tonic-gate#
535aefb655Srie
547c478bd9Sstevel@tonic-gateVAR_PLAT_sparc=		sparc
557c478bd9Sstevel@tonic-gateVAR_PLAT_i386=		intel/ia32
567c478bd9Sstevel@tonic-gateVAR_PLAT_amd64=		intel/amd64
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate#
597c478bd9Sstevel@tonic-gate# VAR_AVLDIR - directory to find avl.c in.
607c478bd9Sstevel@tonic-gate#
6167298654Sdamico# The avl.c file is under usr/src/common/avl in Solaris 10 (and later),
6267298654Sdamico# but in earlier releases it is not present (problem to be solved).
637c478bd9Sstevel@tonic-gate#
6467298654Sdamico# The avl.h and avl_impl.h files are under usr/src/uts/common/sys in
6567298654Sdamico# Solaris 10 (and later). They are under usr/src/cmd/sgs/tools/common/sys
6667298654Sdamico# in Solaris 9 and earlier.
677c478bd9Sstevel@tonic-gate#
687c478bd9Sstevel@tonic-gate# For Solaris 9 and earlier releases, we will have our own copy of the
697c478bd9Sstevel@tonic-gate# files avl.c, avl.h and avl_impl.h until these files are back ported into
707c478bd9Sstevel@tonic-gate# the system.
717c478bd9Sstevel@tonic-gate#
72*69b1fd3fSRichard LoweVAR_AVLDIR=		$(SRC)/common/avl
73*69b1fd3fSRichard LoweVAR_AVLINCDIR=		-I $(SRC)/uts/common
747c478bd9Sstevel@tonic-gate
75e127a3e7Sraf#
76e127a3e7Sraf# VAR_DTRDIR - directory to find dtrace_data.c in.
77e127a3e7Sraf#
7867298654Sdamico# In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate
7967298654Sdamico# files under sgs/rtld.  This file is now under usr/src/common/dtrace.
80e127a3e7Sraf#
81*69b1fd3fSRichard LoweVAR_DTRDIR=             $(SRC)/common/dtrace
82e127a3e7Sraf
8367298654Sdamico#
8467298654Sdamico# VAR_SGSBINPROG
8567298654Sdamico#
8667298654Sdamico# For Solaris 10 and earlier releases, the SGS components were installed in
8767298654Sdamico# /usr/ccs/bin.  These components are now installed in /usr/bin with associated
8867298654Sdamico# symbolic links for compatibility. For previous behavior, set the VAR_SGSBIN*
8967298654Sdamico# variables to the appropriate ROOTCCSBIN* rule and set the VAR_SGSCCSLINK*
9067298654Sdamico# rules to null.
9167298654Sdamico#
9267298654SdamicoVAR_SGSBIN=		$(ROOTBIN)
9367298654SdamicoVAR_SGSBINPROG=		$(ROOTPROG)
9467298654SdamicoVAR_SGSBIN64=		$(ROOTBIN64)
9567298654SdamicoVAR_SGSBINPROG64=	$(ROOTPROG64)
9667298654Sdamico
9767298654SdamicoVAR_SGSCCSLINK=		$(ROOTCCSBINLINK)
9867298654SdamicoVAR_SGSCCSLINK64=	$(ROOTCCSBINLINK64)
9967298654Sdamico
1007c478bd9Sstevel@tonic-gate#
1017c478bd9Sstevel@tonic-gate# ld
1027c478bd9Sstevel@tonic-gate#
103b02637afSrieVAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../lib'
104b02637afSrieVAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../lib/$(MACH64)'
1057c478bd9Sstevel@tonic-gate
1067c478bd9Sstevel@tonic-gate#
1077c478bd9Sstevel@tonic-gate# elfdump
1087c478bd9Sstevel@tonic-gate#
109b02637afSrieVAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../lib'
110b02637afSrieVAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
111d29b2c44Sab
112d29b2c44Sab#
113d29b2c44Sab# elfedit
114d29b2c44Sab#
115d29b2c44SabVAR_ELFEDIT_LLDFLAGS=	'-R$$ORIGIN/../../lib'
116d29b2c44SabVAR_ELFEDIT_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate#
1197c478bd9Sstevel@tonic-gate# lddstub
1207c478bd9Sstevel@tonic-gate#
1217c478bd9Sstevel@tonic-gateVAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate#
1247c478bd9Sstevel@tonic-gate# libld
1257c478bd9Sstevel@tonic-gate#
12620c1c355SRod EvansVAR_LIBLD_CPPFLAGS=		$(VAR_AVLINCDIR)
1277c478bd9Sstevel@tonic-gateVAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate#
1307c478bd9Sstevel@tonic-gate# Tools
1317c478bd9Sstevel@tonic-gate#
1327c478bd9Sstevel@tonic-gateVAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gate#
1357c478bd9Sstevel@tonic-gate# rtld
1367c478bd9Sstevel@tonic-gate#
1377c478bd9Sstevel@tonic-gateVAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
1387c478bd9Sstevel@tonic-gateVAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
139