# # 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 (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2021 OmniOS Community Edition (OmniOSce) Association. # C_AST = $(CONTRIB)/ast C_ASTINIT = $(C_AST)/src/cmd/INIT AST= $(SRC)/cmd/ast AST_TOOLS = $(AST)/tools AST_LCGEN = $(AST_TOOLS)/lcgen AST_PROTO = $(AST_TOOLS)/proto -p -s -l $(C_AST)/lib/package/ast.lic \ -o '$(AST_LICENSE)' # Override this top level flag so the compiler builds in its native C99 mode. CSTD= $(CSTD_GNU99) # # Shell feature flags. # * - the upstream build configuration can be viewed at # $(CONTRIB)/ast/src/cmd/ksh93/Makefile # # These options are enabled, and are also enabled by default in the upstream # build framework*: # # SHOPT_2DMATCH two dimensional .sh.match for ${var//pat/str} # SHOPT_BGX one SIGCHLD trap per completed job # SHOPT_BRACEPAT C-shell {...,...} expansions (, required) # SHOPT_DYNAMIC dynamic loading for builtins # SHOPT_ESH emacs/gmacs edit mode # SHOPT_FILESCAN fast file scan # SHOPT_FIXEDARRAY fixed dimension indexed array # SHOPT_HISTEXPAND csh-style history file expansions # SHOPT_KIA shell information database generation # SHOPT_MULTIBYTE multibyte character handling # SHOPT_NAMESPACE allow namespaces # SHOPT_OPTIMIZE optimize loop invariants # SHOPT_RAWONLY make viraw the only vi mode # SHOPT_STATS add .sh.stats variable # SHOPT_SUID_EXEC allow (safe) suid/sgid shell scripts # SHOPT_TYPEDEF enable typeset type definitions # SHOPT_VSH vi edit mode # These options are enabled but are not enabled by default in the upstream # build framework*: # # SHOPT_SYSRC attempt . /etc/ksh.kshrc if interactive # These options are NOT enabled but are enabled by default in the upstream # build framework*: # # SHOPT_AUDIT enable auditing per SHOPT_AUDITFILE # SHOPT_COSHELL build with connection to coshell # SHOPT_EDPREDICT predictive editing # These options are NOT enabled and are also NOT enabled in the upstream # build framework*: # # SHOPT_ACCT accounting # SHOPT_ACCTFILE per user accounting info # SHOPT_AUDITFILE "/etc/ksh_audit" auditing file # SHOPT_BASH bash compatibility code # SHOPT_CRNL accept for # SHOPT_ECHOPRINT make echo equivalent to print # SHOPT_FS_3D 3d file system # SHOPT_OLDTERMIO support both TCGETA and TCGETS # SHOPT_P_SUID real uid's that require -p for set[ug]id # SHOPT_PFSH solaris exec_attr(5) profile execution # SHOPT_REGRESS enable __regress__ builtin # SHOPT_REMOTE enable --rc if running as a remote shell # SHOPT_SEVENBIT strip the eigth bit from characters # SHOPT_SPAWN use spawnveg for fork/exec # SHOPT_TIMEOUT number of seconds for shell timeout LIBSHELLFEATUREFLAGS= \ -DSHOPT_2DMATCH \ -DSHOPT_BGX \ -DSHOPT_BRACEPAT \ -DSHOPT_DYNAMIC \ -DSHOPT_ESH \ -DSHOPT_FILESCAN \ -DSHOPT_FIXEDARRAY \ -DSHOPT_HISTEXPAND \ -DSHOPT_KIA \ -DSHOPT_MULTIBYTE \ -DSHOPT_NAMESPACE \ -DSHOPT_OPTIMIZE \ -DSHOPT_PFSH=0 \ -DSHOPT_RAWONLY \ -DSHOPT_STATS \ -DSHOPT_SUID_EXEC \ -DSHOPT_SYSRC \ -DSHOPT_TYPEDEF \ -DSHOPT_VSH # # common CPP flags for libshell consumers (ksh, shcomp etc.) # LIBSHELLCPPFLAGS= \ -I$(LIBSHELLBASE)/$(LIBSHELLMACH) \ -I$(ASTSRC)/include \ -I$(ROOT)/usr/include/ast \ -I$(ROOT)/usr/include \ \ -DSHOPT_CMDLIB_BLTIN=0 \ '-DSH_CMDLIB_DIR="/usr/ast/bin"' \ '-DSHOPT_CMDLIB_HDR="../common/illumos_cmdlist.h"' \ \ $(LIBSHELLFEATUREFLAGS) \ \ -DKSHELL \ -D_BLD_shell \ -D_PACKAGE_ast \ -D_API_ast=20100309 \ '-DERROR_CATALOG="libshell"' \ -DERROR_CONTEXT_T=Error_context_t \ '-DUSAGE_LICENSE=\ "[-author?David Korn ]" \ "[-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property]" \ "[-license?http://www.eclipse.org/org/documents/epl-v10.html]" \ "[--catalog?libshell]"' # Default CFLAGS/CFLAGS64 for AST sources ASTCFLAGS= $(CCVERBOSE) ASTCFLAGS64= $(CCVERBOSE) # Generated header files generated using this system have a number of # artifacts that are cleaned up by the following action. # # They include a 'generated by' header which includes the full path to # the source file. The path to the root of the gate is removed, leaving only # the relative part of the path. # # They have trailing whitespace, which is removed. # Unfortunately, due to differences in the "sed" command implemented in # various illumos distributions, we can't portably use 'sed -i' here. SEDPATTERN= \ s^$(SRC)/^^g; \ s/ *$$//; \ /def.* _def_.*_$(MACH64)/s/$(MACH64)/$(HDRGUARD)/; \ /def.* _def_.*_$(MACH)/s/$(MACH)/$(HDRGUARD)/; POST_PROCESS_AST= \ { \ tf=$$(mktemp /tmp/ast.XXXXXXXXXX) && \ $(SED) < "$@" > "$$tf" '$(SEDPATTERN)' && \ $(CP) -p "$$tf" "$@" && \ $(RM) "$$tf"; \ }