14032N/A+# Script for running the C/C++ compiler when building python modules
14032N/A+# The contents of this file are subject to the terms of the
14032N/A+# Common Development and Distribution License, Version 1.0 only
14032N/A+# (the "License"). You may not use this file except in compliance
14032N/A+# See the License for the specific language governing permissions
14032N/A+# and limitations under the License.
14032N/A+# When distributing Covered Code, include this CDDL HEADER in each
14032N/A+# If applicable, add the following below this CDDL HEADER, with the
14032N/A+# fields enclosed by brackets "[]" replaced with your own identifying
14032N/A+# information: Portions Copyright [yyyy] [name of copyright owner]
14032N/A+# Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
14032N/A+# Use is subject to license terms.
14032N/A+# name of the compiler executable
14032N/A+# name of the GNU compiler executable
14032N/A+# name of the programming language
14032N/A+# name of the env variable for setting the compiler path
14032N/A+if [ "x$MYNAME" = xpyCC ]; then
14032N/A+ if [ "x$PYCC_CXX" != x ]; then
14032N/A+# check if the CC env variable is set
14032N/A+ # verify that it doesn't point to this script
14032N/A+ echo "WARNING: "$CVAR" is set to this script; ignoring this value to avoid an infinite loop"
14032N/A+# check again if the CC env variable is set
14032N/A+ # $CC is an absolute path name
14032N/A+ echo "WARNING: pycc: $CC not found" 1>&2
14032N/A+ # check if $CC is an executable
14032N/A+ if [ ! -x "$CC" -o ! -f "$CC" ]; then
14032N/A+ echo "WARNING: pycc: $CC is not an executable" 1>&2
14032N/A+ echo "WARNING: pycc: $CC not found" 1>&2
14032N/A+ # Look for the Sun Studio compiler in the PATH
14032N/A+ if [ -x "$dir/$GCCEXE" ]; then
14032N/A+ # Cannot continue without a C compiler
14032N/A+ echo "ERROR: no $CLANG compiler not found; update your PATH or set the $CVAR env variable" 1>&2
14032N/A+# We need to make some modifications to adapt correctly to compiler options
14032N/A+# that differ between GCC and Studio.
14032N/A+ # need -shared to link shared objects properly
14032N/A+ extra_flags="$extra_flags -shared"
14032N/A+ extra_flags="$extra_flags -fPIC -DPIC"
14032N/A+ extra_flags="$extra_flags -KPIC"