1*7c478bd9Sstevel@tonic-gate# 2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate# 4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate# with the License. 8*7c478bd9Sstevel@tonic-gate# 9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate# and limitations under the License. 13*7c478bd9Sstevel@tonic-gate# 14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate# 20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate# 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate# 26*7c478bd9Sstevel@tonic-gate#ident "%Z%%M% %I% %E% SMI" 27*7c478bd9Sstevel@tonic-gate 28*7c478bd9Sstevel@tonic-gatePROG= getconf 29*7c478bd9Sstevel@tonic-gateXPG4PROG= getconf 30*7c478bd9Sstevel@tonic-gateXPG6PROG= getconf 31*7c478bd9Sstevel@tonic-gateX4= objs.xpg4 32*7c478bd9Sstevel@tonic-gateX6= objs.xpg6 33*7c478bd9Sstevel@tonic-gateOBJS= getconf.o 34*7c478bd9Sstevel@tonic-gateXPG4EXOBJS= $(X4)/getconf.o 35*7c478bd9Sstevel@tonic-gateXPG6EXOBJS= $(X6)/getconf.o 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 38*7c478bd9Sstevel@tonic-gate 39*7c478bd9Sstevel@tonic-gateXPG4EXOBJS += values-xpg4.o 40*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 41*7c478bd9Sstevel@tonic-gate# XPG4 42*7c478bd9Sstevel@tonic-gate$(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate# XPG6MODE: Depending on the version of the compiler, the value of 45*7c478bd9Sstevel@tonic-gate# __STDC_VERSION__ may differ even in the presence of the same compilation 46*7c478bd9Sstevel@tonic-gate# options. The default compilation mode for Sun compilers that support the 47*7c478bd9Sstevel@tonic-gate# C99 standard is -xc99=all,no_lib. C99MODE= is equivalent to -xc99=all,no_lib. 48*7c478bd9Sstevel@tonic-gate# This translates to C99 semantics without the C99 library specific behaviors 49*7c478bd9Sstevel@tonic-gate# and dependencies. 50*7c478bd9Sstevel@tonic-gate# 51*7c478bd9Sstevel@tonic-gate# For pre-5.7 compilers (unless patched with 117551-04 or 117552-05), in the 52*7c478bd9Sstevel@tonic-gate# default compilation mode, __STDC_VERSION__ was defined to be 199901L. For 53*7c478bd9Sstevel@tonic-gate# 5.7 and on compilers, __STDC_VERSION__ defaults to 199409L in order to 54*7c478bd9Sstevel@tonic-gate# maintain source compatibility. Neither of these cases results in the 55*7c478bd9Sstevel@tonic-gate# importing of /usr/lib/values-xpg6.o, so we need to either manually import 56*7c478bd9Sstevel@tonic-gate# it via linking with a local version of the object, or set -xc99=%all which 57*7c478bd9Sstevel@tonic-gate# by default imports /usr/lib/values-xpg6.o. C99MODE=C99_ENABLE is equivalent 58*7c478bd9Sstevel@tonic-gate# to -xc99=all. If C99_ENABLE is defined and we also attempt to link with a 59*7c478bd9Sstevel@tonic-gate# local version of values-xpg6.o, an error will occur due to multiple 60*7c478bd9Sstevel@tonic-gate# definitions for __xpg4 and __xpg6. Because /usr/lib/values-xpg6.o was 61*7c478bd9Sstevel@tonic-gate# delivered in Solaris 10 and is a stable interface, there is no need to 62*7c478bd9Sstevel@tonic-gate# build and link with a local version of the object. 63*7c478bd9Sstevel@tonic-gate# 64*7c478bd9Sstevel@tonic-gate# The gcc compiler behaves differently and requires -std=gnu99. 65*7c478bd9Sstevel@tonic-gate# 66*7c478bd9Sstevel@tonic-gate# For XPG4, we need to link with a local version of values-xpg4.o because 67*7c478bd9Sstevel@tonic-gate# the compiler only imports this by default (from /usr/lib/values-xpg4.o) 68*7c478bd9Sstevel@tonic-gate# if we use the c89 utility as opposed to cc. 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gateXPG6MODE = $(C99_ENABLE) 71*7c478bd9Sstevel@tonic-gate$(__GNUC)XPG6MODE = $(C99_ENABLE) 72*7c478bd9Sstevel@tonic-gate$(XPG6) := C99MODE = $(XPG6MODE) 73*7c478bd9Sstevel@tonic-gate$(XPG6) := CFLAGS += -D_XOPEN_SOURCE=600 -I$(SRC)/lib/libc/inc 74*7c478bd9Sstevel@tonic-gate 75*7c478bd9Sstevel@tonic-gate.KEEP_STATE: 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4) $(XPG6) 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate$(PROG): $(OBJS) 80*7c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 81*7c478bd9Sstevel@tonic-gate $(POST_PROCESS) 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate$(XPG4): $(X4) $(XPG4EXOBJS) 84*7c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(XPG4EXOBJS) $(LDLIBS) 85*7c478bd9Sstevel@tonic-gate $(POST_PROCESS) 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate$(XPG6): $(X6) $(XPG6EXOBJS) 88*7c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(XPG6EXOBJS) $(LDLIBS) 89*7c478bd9Sstevel@tonic-gate $(POST_PROCESS) 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate$(XPG4EXOBJS): $(X4) 93*7c478bd9Sstevel@tonic-gate 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate$(X4)/%.o: %.c 96*7c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gate 99*7c478bd9Sstevel@tonic-gate$(X4): 100*7c478bd9Sstevel@tonic-gate -@mkdir -p $@ 101*7c478bd9Sstevel@tonic-gate 102*7c478bd9Sstevel@tonic-gate 103*7c478bd9Sstevel@tonic-gate$(XPG6EXOBJS): $(X6) 104*7c478bd9Sstevel@tonic-gate 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate$(X6)/%.o: %.c 107*7c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate$(X6): 111*7c478bd9Sstevel@tonic-gate -@mkdir -p $@ 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gateinstall: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG) 115*7c478bd9Sstevel@tonic-gate 116*7c478bd9Sstevel@tonic-gatevalues-xpg4.o: ../../lib/common/common/values-xpg4.c 117*7c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gateclean: 120*7c478bd9Sstevel@tonic-gate -@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \ 121*7c478bd9Sstevel@tonic-gate $(PROG) $(XPG4) $(XPG6) 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gatelint: lint_PROG 124*7c478bd9Sstevel@tonic-gate 125*7c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 126