#
# 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
# 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
#
#
#
# Avoid running configure again during the build due to patches to
# configure-related files by running autoconf before we run configure.
BASH_PATCHLEVEL=$(shell grep -h "define PATCHLEVEL" $(COMPONENT_DIR)/patches/bash* | $(NAWK) '{print $$NF}' | sort -n | tail -1)
# Enable C99 mode + -Xc for its additional warnings.
# Use the maximum number of registers on sparc since we have no libraries
# 8 byte memory alignment + interpretation of non-alignment instead of SIGBUS
# -xinline=%auto -- we like inlining where appropriate
# -xbuiltin=%none -- builtins have been known to be buggy
CFLAGS += $(CPP_C99_EXTENDED_MATH)
# configure checks for some functions, but doesn't seem to want to link in
# the required libraries for them. We avoid linking with libthread.so.1
# just because we pass -mt, by explicitly passing -lc.
# -z redlocsym -- let's shrink the SHT_SYMTAB as much as we can
# Results output is slightly different on Intel vs. SPARC.
# Do not change the order of these regexp transforms.
'-e "/^</d"' \
'-e "/^>/d"' \
'-e "/^---/d"' \
'-e "/^Testing/d"' \
'-e "/m64/d"' \
'-e "/DPROGRAM/d"' \
'-e "/^rm -f/d"' \
'-e "/^ls -l/d"' \
'-e "/text/d"' \
'-e "/size/d"' \
'-e "/bash$$/d"' \
'-e "/warning/d"' \
'-e "s/^[0-9]\{1,\}[a-z]\{1,\}[0-9]\{1,\}//g"' \
'-e "s/^[0-9]\{1,\},[0-9]\{1,\}[a-z]\{1,\}[0-9]\{1,\},[0-9]\{1,\}//g"' \
'-e "/^$$/d"'
# The bash test harness needs the GNU userland utilities
# This avoids the need to patch configure or other files for these dependencies.
else
# Ignore tgetent() checks in configure and use libncurses on Solaris.
# bash will trigger an autoconf during the build; so apply above again
# XXX just apply configure_env?
# COMPONENT_BUILD_ENV += $(CONFIGURE_ENV)
CONFIGURE_OPTIONS += --enable-alias
CONFIGURE_OPTIONS += --enable-history
CONFIGURE_OPTIONS += --enable-select
# avoid permission issues for other users running these tests