Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# CDDL HEADER START
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# The contents of this file are subject to the terms of the
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# Common Development and Distribution License, Version 1.0 only
2a40fdc2d34adb8a5c72a748449699666032d461Mark Andrews# (the "License"). You may not use this file except in compliance
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# with the License.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# or http://www.opensolaris.org/os/licensing.
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# See the License for the specific language governing permissions
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# and limitations under the License.
d56e188030368b835122d759ebbf8d9613c166f4Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Use is subject to license terms.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews$(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark Andrews# XPG6MODE: Depending on the version of the compiler, the value of
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# __STDC_VERSION__ may differ even in the presence of the same compilation
3f6174bffe227be44e241a29d186add00c032ff6Mark Andrews# options. The default compilation mode for Sun compilers that support the
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# C99 standard is -xc99=all,no_lib. C99MODE= is equivalent to -xc99=all,no_lib.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# This translates to C99 semantics without the C99 library specific behaviors
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# and dependencies.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# For pre-5.7 compilers (unless patched with 117551-04 or 117552-05), in the
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# default compilation mode, __STDC_VERSION__ was defined to be 199901L. For
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# 5.7 and on compilers, __STDC_VERSION__ defaults to 199409L in order to
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# maintain source compatibility. Neither of these cases results in the
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# importing of /usr/lib/values-xpg6.o, so we need to either manually import
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# it via linking with a local version of the object, or set -xc99=%all which
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# by default imports /usr/lib/values-xpg6.o. C99MODE=C99_ENABLE is equivalent
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# to -xc99=all. If C99_ENABLE is defined and we also attempt to link with a
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# local version of values-xpg6.o, an error will occur due to multiple
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# definitions for __xpg4 and __xpg6. Because /usr/lib/values-xpg6.o was
26a77b80bb7ee886c6fa704348d5e80a011d8811Mark Andrews# delivered in Solaris 10 and is a stable interface, there is no need to
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# build and link with a local version of the object.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# The gcc compiler behaves differently and requires -std=gnu99.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# For XPG4, we need to link with a local version of values-xpg4.o because
62ee2c9f460d2e2e45dcf1abc8b4b4a4a43f5618Mark Andrews# the compiler only imports this by default (from /usr/lib/values-xpg4.o)
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# if we use the c89 utility as opposed to cc.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews$(XPG6) := CFLAGS += -D_XOPEN_SOURCE=600 -I$(SRC)/lib/libc/inc
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrewsinstall: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrewsvalues-xpg4.o: ../../lib/common/common/values-xpg4.c
ea935c46e8261ea10621e5b038426539fe8a7cc5Mark Andrews $(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews -@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \