#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

# The link-editor related source files and Makefile files have at times been
# unified across all presently maintained release gates.  However, some of the
# compiler pre-processor flags and link-editor flags are different among the
# releases.  This file is used to specify such flags. 
# 
# This file is included by ./Makefile.com, but may also be included directly in
# the case where the utility is relying on the contents of ../../Makefile.com.
# 
# This file should be the only file which is different among the presently
# maintained release workspaces, when the sources are unified.
#
# CPPFEATUREMACROS provides for selectively turning on/off features within the
# various link-editor components.  Presently, none are set.
#
# Some source files need to use #ifdef to distinguish between the patch release,
# and for the packages targeting to the pre-libc/libthread unified environment.
# These values are available for CPPFLAGS:
#	
#	SGS_PRE_UNIFIED_PROCESS
#
#		is set if the target release is for pre-libc/libthread unified
#		environment. This is used for rtld and crle.

#
# Common Macro definitions
#
VAR_CPPFLAGS=
VAR_LINTFLAGS64=	-m64

VAR_PLAT_sparc=		sparc
VAR_PLAT_i386=		intel/ia32
VAR_PLAT_amd64=		intel/amd64

VAR_POUND_1=
VAR_POUND_2=		$(POUND_SIGN)

#
# VAR_AVLDIR - directory to find avl.c in.
#
# The avl.c file is under usr/src/common/avl in Solaris 10 (and later),
# but in earlier releases it is not present (problem to be solved).
#
# The avl.h and avl_impl.h files are under usr/src/uts/common/sys in
# Solaris 10 (and later). They are under usr/src/cmd/sgs/tools/common/sys
# in Solaris 9 and earlier.
#
# For Solaris 9 and earlier releases, we will have our own copy of the
# files avl.c, avl.h and avl_impl.h until these files are back ported into
# the system.
#
VAR_AVLDIR=		$(SRCBASE)/common/avl
VAR_AVLINCDIR=

#
# VAR_DTRDIR - directory to find dtrace_data.c in.
#
# In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate
# files under sgs/rtld.  This file is now under usr/src/common/dtrace.
#
VAR_DTRDIR=             $(SRCBASE)/common/dtrace

#
# VAR_SGSBINPROG
#
# For Solaris 10 and earlier releases, the SGS components were installed in
# /usr/ccs/bin.  These components are now installed in /usr/bin with associated
# symbolic links for compatibility. For previous behavior, set the VAR_SGSBIN*
# variables to the appropriate ROOTCCSBIN* rule and set the VAR_SGSCCSLINK*
# rules to null.
#
VAR_SGSBIN=		$(ROOTBIN)
VAR_SGSBINPROG=		$(ROOTPROG)
VAR_SGSBIN64=		$(ROOTBIN64)
VAR_SGSBINPROG64=	$(ROOTPROG64)

VAR_SGSCCSLINK=		$(ROOTCCSBINLINK)
VAR_SGSCCSLINK64=	$(ROOTCCSBINLINK64)

#
# ld
#
VAR_LD_NATIVE_LLDLIBS=
VAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../lib'
VAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../lib/$(MACH64)'

#
# elfdump
#
VAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../lib'
VAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'

#
# elfedit
#
VAR_ELFEDIT_LLDFLAGS=	'-R$$ORIGIN/../../lib'
VAR_ELFEDIT_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'

#
# lddstub
#
VAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'

#
# libconv
#
VAR_LIBCONV_CPPFLAGS=

#
# libdl
#
VAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
VAR_LIBDL_ETCDYNLIB=

#
# libelf
#
VAR_LIBELF_LDLIBS=
VAR_LIBELF_ROOTDEMODIR_DIRMODE=	755

#
# libld
#
VAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
				$(VAR_AVLINCDIR)
VAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)

#
# Tools
#
VAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)

#
# liblddbg
#
VAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
VAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE

#
# librtld_db
#
VAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)

#
# rtld
#
VAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
VAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
VAR_RTLD_SONAME=	/lib/ld.so.1
VAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1

VAR_RTLD_ETCDYNLIB=
VAR_RTLD_CPPFEATUREMACROS=
VAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
VAR_RTLD_EXTRASUBDIRS=	mdbmod