components/ruby/ruby-21/Solaris/rbconfig.sedscript
author April Chin <april.chin@oracle.com>
Thu, 11 Aug 2016 14:21:21 -0700
changeset 6615 c59de4872b2d
parent 6265 a254cae29f5b
permissions -rw-r--r--
24435411 In Ruby 2.1 rbconfig.rb file, CXXFLAGS should match GNU compiler options

#
# 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) 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
s%/usr/bin/ginstall%/usr/gnu/bin/install%
s%/usr/bin/gmkdir%/usr/gnu/bin/mkdir%
s%/usr/bin/gsed%/usr/gnu/bin/sed%
s%/usr/bin/ggrep%/usr/gnu/bin/grep%