#
# 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
#
#
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
#
# sed script to fix the rbconfig.rb file after
# the configure and install of ruby
# use gcc/g++ instead of build-system-specific paths to Studio compilers cc/CC
# Note that for the first two command lines below,
# /usr/bin/sed correctly substitutes; /usr/bin/gsed does not.
# Use /usr/bin/sed for this script.
s/\'CC=.*\/cc\'/\'CC=\/usr\/bin\/gcc\'/
s/\'CXX=.*\/CC\'/\'CXX=\/usr\/bin\/g++\'/
s/\'CFLAGS=.[^\']*\'/\'CFLAGS=CFLAGS_GCC\'/
s/\'CXXFLAGS=.[^\']*\'/\'CXXFLAGS=CXXFLAGS_GCC\'/
s/CONFIG\[\"CC\"\].*$/CONFIG\[\"CC\"\] = \"\/usr\/bin\/gcc\"/
s/CONFIG\[\"CXX\"\].*$/CONFIG\[\"CXX\"\] = \"\/usr\/bin\/g++\"/
s/CONFIG\[\"CFLAGS\"\].*$/CONFIG\[\"CFLAGS\"\] = \"CFLAGS_GCC\"/
s/CONFIG\[\"CXXFLAGS\"\].*$/CONFIG\[\"CXXFLAGS\"\] = \"CXXFLAGS_GCC\"/
s/CONFIG\[\"CCDLFLAGS\"\].*$/CONFIG\[\"CCDLFLAGS\"\] = \"-fPIC\"/
s/"$(CC) -G"/"$(CC) -shared"/
s/"$(CXX) -G"/"$(CXX) -shared"/
# These paths to GNU commands are symlinks which are only available when
# the pkg facet.gnu-links is true, so use the non-faceted paths