1da2e3ebdSchin# 2da2e3ebdSchin# CDDL HEADER START 3da2e3ebdSchin# 4da2e3ebdSchin# The contents of this file are subject to the terms of the 5da2e3ebdSchin# Common Development and Distribution License (the "License"). 6da2e3ebdSchin# You may not use this file except in compliance with the License. 7da2e3ebdSchin# 8da2e3ebdSchin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9da2e3ebdSchin# or http://www.opensolaris.org/os/licensing. 10da2e3ebdSchin# See the License for the specific language governing permissions 11da2e3ebdSchin# and limitations under the License. 12da2e3ebdSchin# 13da2e3ebdSchin# When distributing Covered Code, include this CDDL HEADER in each 14da2e3ebdSchin# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15da2e3ebdSchin# If applicable, add the following below this CDDL HEADER, with the 16da2e3ebdSchin# fields enclosed by brackets "[]" replaced with your own identifying 17da2e3ebdSchin# information: Portions Copyright [yyyy] [name of copyright owner] 18da2e3ebdSchin# 19da2e3ebdSchin# CDDL HEADER END 20da2e3ebdSchin# 217c2fbfb3SApril Chin 22da2e3ebdSchin# 237c2fbfb3SApril Chin# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24da2e3ebdSchin# Use is subject to license terms. 25da2e3ebdSchin# 26b30d1939SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association. 27b30d1939SAndy Fiddaman# 28da2e3ebdSchin 29da2e3ebdSchin# 30da2e3ebdSchin# Temporarily control building AST l10n catalogs until all build 31da2e3ebdSchin# machines have been updated. 32da2e3ebdSchin# 33da2e3ebdSchin 34da2e3ebdSchin# Should we build AST l10n catalogs ? 35da2e3ebdSchin# This can be overridden at build time via: 367c2fbfb3SApril Chin# $ export ON_BUILD_AST_L10N_CATALOGS=0 377c2fbfb3SApril ChinON_BUILD_AST_L10N_CATALOGS=1 38da2e3ebdSchin 39da2e3ebdSchinDO_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:0=$(POUND_SIGN)) 40da2e3ebdSchinDONT_BUILD_AST_CATALOGS_1= $(ON_BUILD_AST_L10N_CATALOGS:1=$(POUND_SIGN)) 41da2e3ebdSchinDO_BUILD_AST_CATALOGS= $(DO_BUILD_AST_CATALOGS_1:1=) 42da2e3ebdSchinDONT_BUILD_AST_CATALOGS= $(DONT_BUILD_AST_CATALOGS_1:0=) 43da2e3ebdSchin 44da2e3ebdSchin# 45da2e3ebdSchin# l10n message catalog generation for AST libraries 46da2e3ebdSchin# 47da2e3ebdSchin 48b30d1939SAndy FiddamanMSGLIBNAME= $(ASTLIB) 49da2e3ebdSchinASTMSGCATALOG= $(ROOT)/usr/lib/locale/C/LC_MESSAGES/$(MSGLIBNAME) 50da2e3ebdSchin 51da2e3ebdSchin$(DO_BUILD_AST_CATALOGS)ASTMSGCC= \ 52*3770e1faSAndy Fiddaman PATH="$(ASTBINDIR):/bin:/usr/bin" \ 53*3770e1faSAndy Fiddaman /usr/bin/ksh93 $(MSGCC) >>msgcc.out 2>&1 54da2e3ebdSchin 55b30d1939SAndy FiddamanASTMSGS= $(LIBOBJS:%.o=msgs/%.mso) 56da2e3ebdSchin 57da2e3ebdSchin# cpp defines needed by msgcc 58da2e3ebdSchini386_ASTMSGCCFLAGS= -D__i386 59da2e3ebdSchinamd64_ASTMSGCCFLAGS= -D__amd64 60da2e3ebdSchinsparc_ASTMSGCCFLAGS= -D__sparc 61da2e3ebdSchinsparcv9_ASTMSGCCFLAGS= -D__sparcv9 62b30d1939SAndy FiddamanASTMSGCCFLAGS= -D_STDC_C99 -D__STDC__ -D__BUILTIN_VA_ARG_INCR \ 63b30d1939SAndy Fiddaman $($(TARGETMACH)_ASTMSGCCFLAGS) 64da2e3ebdSchin 65b30d1939SAndy Fiddamanmsgs/%.mso: $(ASTSRC)/%.c 66da2e3ebdSchin @mkdir -p "$$(dirname "$@")" ; \ 67da2e3ebdSchin print "# Processing file $< to $@" >>msgcc.out ; \ 68da2e3ebdSchin $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@" 69da2e3ebdSchinmsgs/%.mso: ../%.c 70da2e3ebdSchin @mkdir -p "$$(dirname "$@")" ; \ 71da2e3ebdSchin print "# Processing file $< to $@" >>msgcc.out ; \ 72da2e3ebdSchin $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -c "$<" -o "$@" 73da2e3ebdSchin 74da2e3ebdSchin$(MSGLIBNAME).msg: $(ASTMSGS) 75da2e3ebdSchin @print "# Processing files $(ASTMSGS) to $@" >>msgcc.out ; \ 76da2e3ebdSchin $(ASTMSGCC) -M-set=ast $(ASTMSGCCFLAGS) $(CFLAGS) $(CPPFLAGS) -o $@ $(ASTMSGS) 77da2e3ebdSchin 78da2e3ebdSchin$(ASTMSGCATALOG): $(MSGLIBNAME).msg 79da2e3ebdSchin @$(RM) "$(ASTMSGCATALOG)" ; \ 80fd66f38dSchin sed 's/^$$translation msgcc .*//' <"$(MSGLIBNAME).msg" | gencat "$@" - ; \ 81fd66f38dSchin $(CHMOD) 0644 $(ASTMSGCATALOG) 82da2e3ebdSchin 83da2e3ebdSchin# Main catalog target 84da2e3ebdSchin$(DO_BUILD_AST_CATALOGS)_msg: $(ASTMSGCATALOG) 85da2e3ebdSchin 86b30d1939SAndy Fiddaman# Create empty catalog file when we do not build it (to avoid that we have to 87b30d1939SAndy Fiddaman# hack the package database each time we toggle the switch) 88da2e3ebdSchin$(DONT_BUILD_AST_CATALOGS)_msg: 89da2e3ebdSchin$(DONT_BUILD_AST_CATALOGS) $(RM) $(ASTMSGCATALOG) ; \ 90fd66f38dSchin $(TOUCH) $(ASTMSGCATALOG) ; \ 91fd66f38dSchin $(CHMOD) 0644 $(ASTMSGCATALOG) 92da2e3ebdSchin 93da2e3ebdSchin# Add message catalogs to the list of files to "clobber" 94da2e3ebdSchinCLOBBERFILES += \ 95da2e3ebdSchin $(ASTMSGS) \ 96da2e3ebdSchin $(ASTMSGCATALOG) \ 97da2e3ebdSchin $(MSGLIBNAME).msg \ 98da2e3ebdSchin msgcc.out 99