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 57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate# with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 227c478bd9Sstevel@tonic-gate# 237adeeb5aSmike_s# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gatePROG= getconf 287c478bd9Sstevel@tonic-gateXPG4PROG= getconf 297c478bd9Sstevel@tonic-gateXPG6PROG= getconf 307c478bd9Sstevel@tonic-gateX4= objs.xpg4 317c478bd9Sstevel@tonic-gateX6= objs.xpg6 327c478bd9Sstevel@tonic-gateOBJS= getconf.o 337c478bd9Sstevel@tonic-gateXPG4EXOBJS= $(X4)/getconf.o 347c478bd9Sstevel@tonic-gateXPG6EXOBJS= $(X6)/getconf.o 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gateXPG4EXOBJS += values-xpg4.o 397c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 407c478bd9Sstevel@tonic-gate# XPG4 417c478bd9Sstevel@tonic-gate$(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate# XPG6MODE: Depending on the version of the compiler, the value of 447c478bd9Sstevel@tonic-gate# __STDC_VERSION__ may differ even in the presence of the same compilation 457c478bd9Sstevel@tonic-gate# options. The default compilation mode for Sun compilers that support the 46*bd0ce624SYuri Pankov# C99 standard is -xc99=all,no_lib. CSTD= is equivalent to -xc99=all,no_lib. 477c478bd9Sstevel@tonic-gate# This translates to C99 semantics without the C99 library specific behaviors 487c478bd9Sstevel@tonic-gate# and dependencies. 497c478bd9Sstevel@tonic-gate# 507c478bd9Sstevel@tonic-gate# For pre-5.7 compilers (unless patched with 117551-04 or 117552-05), in the 517c478bd9Sstevel@tonic-gate# default compilation mode, __STDC_VERSION__ was defined to be 199901L. For 527c478bd9Sstevel@tonic-gate# 5.7 and on compilers, __STDC_VERSION__ defaults to 199409L in order to 537c478bd9Sstevel@tonic-gate# maintain source compatibility. Neither of these cases results in the 547c478bd9Sstevel@tonic-gate# importing of /usr/lib/values-xpg6.o, so we need to either manually import 557c478bd9Sstevel@tonic-gate# it via linking with a local version of the object, or set -xc99=%all which 56*bd0ce624SYuri Pankov# by default imports /usr/lib/values-xpg6.o. CSTD=CSTD_GNU99 is equivalent 57*bd0ce624SYuri Pankov# to -xc99=all. If CSTD_GNU99 is defined and we also attempt to link with a 587c478bd9Sstevel@tonic-gate# local version of values-xpg6.o, an error will occur due to multiple 597c478bd9Sstevel@tonic-gate# definitions for __xpg4 and __xpg6. Because /usr/lib/values-xpg6.o was 607c478bd9Sstevel@tonic-gate# delivered in Solaris 10 and is a stable interface, there is no need to 617c478bd9Sstevel@tonic-gate# build and link with a local version of the object. 627c478bd9Sstevel@tonic-gate# 637c478bd9Sstevel@tonic-gate# The gcc compiler behaves differently and requires -std=gnu99. 647c478bd9Sstevel@tonic-gate# 657c478bd9Sstevel@tonic-gate# For XPG4, we need to link with a local version of values-xpg4.o because 667c478bd9Sstevel@tonic-gate# the compiler only imports this by default (from /usr/lib/values-xpg4.o) 677c478bd9Sstevel@tonic-gate# if we use the c89 utility as opposed to cc. 687c478bd9Sstevel@tonic-gate 69*bd0ce624SYuri PankovXPG6MODE = $(CSTD_GNU99) 70*bd0ce624SYuri Pankov$(XPG6) := CSTD = $(XPG6MODE) 717c478bd9Sstevel@tonic-gate$(XPG6) := CFLAGS += -D_XOPEN_SOURCE=600 -I$(SRC)/lib/libc/inc 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate.KEEP_STATE: 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4) $(XPG6) 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate$(PROG): $(OBJS) 787c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 797c478bd9Sstevel@tonic-gate $(POST_PROCESS) 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate$(XPG4): $(X4) $(XPG4EXOBJS) 827c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(XPG4EXOBJS) $(LDLIBS) 837c478bd9Sstevel@tonic-gate $(POST_PROCESS) 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate$(XPG6): $(X6) $(XPG6EXOBJS) 867c478bd9Sstevel@tonic-gate $(LINK.c) -o $@ $(XPG6EXOBJS) $(LDLIBS) 877c478bd9Sstevel@tonic-gate $(POST_PROCESS) 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate$(XPG4EXOBJS): $(X4) 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate$(X4)/%.o: %.c 947c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate$(X4): 987c478bd9Sstevel@tonic-gate -@mkdir -p $@ 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate$(XPG6EXOBJS): $(X6) 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate$(X6)/%.o: %.c 1057c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate$(X6): 1097c478bd9Sstevel@tonic-gate -@mkdir -p $@ 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gateinstall: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG) 1137c478bd9Sstevel@tonic-gate 1143e76f9d6SRichard Lowevalues-xpg4.o: ../../lib/crt/common/values-xpg4.c 1153e76f9d6SRichard Lowe $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gateclean: 1187c478bd9Sstevel@tonic-gate -@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \ 1197c478bd9Sstevel@tonic-gate $(PROG) $(XPG4) $(XPG6) 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gatelint: lint_PROG 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 124