1*0Sstevel@tonic-gate#!/usr/bin/ksh 2*0Sstevel@tonic-gate# 3*0Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc. All rights reserved. 4*0Sstevel@tonic-gate# Use is subject to license terms. 5*0Sstevel@tonic-gate# 6*0Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 7*0Sstevel@tonic-gate# 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate# 10*0Sstevel@tonic-gate# This script was used to generate the perl configuration files used to support 11*0Sstevel@tonic-gate# the use of gcc to build perl extensions against perl 5.8.4 as shipped in ON. 12*0Sstevel@tonic-gate# This script should be run from within the perl source directory. 13*0Sstevel@tonic-gate# 14*0Sstevel@tonic-gate 15*0Sstevel@tonic-gate# Delete any old configuration files. 16*0Sstevel@tonic-gate[[ -f config.sh ]] && rm config.sh 17*0Sstevel@tonic-gate[[ -f Policy.sh ]] && rm Policy.sh 18*0Sstevel@tonic-gate 19*0Sstevel@tonic-gate# Die on error. 20*0Sstevel@tonic-gateset -e 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate# Global settings. 23*0Sstevel@tonic-gatePerlPfx=/usr/perl5 # Prefix for perl installation 24*0Sstevel@tonic-gatePerlRel=5.8.4 # Perl version 25*0Sstevel@tonic-gatePerlArch=$(arch)-solaris-64int # Perl architecture 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate# Create the config.over file to override some common settings. 28*0Sstevel@tonic-gatecat > config.over <<'EOF' 29*0Sstevel@tonic-gateCC=`which cc | sed -e 's!/bin/gcc!!'` 30*0Sstevel@tonic-gateccflags=`echo $ccflags | sed -e 's! *-I/usr/local/include *! !'` 31*0Sstevel@tonic-gateccflags=`echo $ccflags | sed -e 's! *-fno-strict-aliasing *! !'` 32*0Sstevel@tonic-gateccflags="$ccflags -D_TS_ERRNO" 33*0Sstevel@tonic-gateccsymbols=`echo $ccsymbols | sed -e 's! *__GNUC__=[0-9][0-9]* *! !g'` 34*0Sstevel@tonic-gateccsymbols=`echo $ccsymbols | sed -e 's! *__GNUC_MINOR__=[0-9][0-9]* *! !g'` 35*0Sstevel@tonic-gatecppsymbols=`echo $cppsymbols | sed -e 's! *__GNUC__=[0-9][0-9]* *! !g'` 36*0Sstevel@tonic-gatecppsymbols=`echo $cppsymbols | sed -e 's! *__GNUC_MINOR__=[0-9][0-9]* *! !g'` 37*0Sstevel@tonic-gateccversion='GNU gcc' 38*0Sstevel@tonic-gatecf_by='perl-bugs' 39*0Sstevel@tonic-gatecf_email='perl-bugs@sun.com' 40*0Sstevel@tonic-gatecf_time='' 41*0Sstevel@tonic-gatecppflags='' 42*0Sstevel@tonic-gategccosandvers='' 43*0Sstevel@tonic-gategccversion='' 44*0Sstevel@tonic-gateinc_version_list='' 45*0Sstevel@tonic-gateinc_version_list_init='0' 46*0Sstevel@tonic-gateinstallusrbinperl='undef' 47*0Sstevel@tonic-gatelddlflags='-G' 48*0Sstevel@tonic-gateldflags='' 49*0Sstevel@tonic-gatelibpth='/lib /usr/lib /usr/ccs/lib' 50*0Sstevel@tonic-gate#libsdirs=`echo $libsdirs | sed -e "s! *${CC}[^ ]* *! !"` 51*0Sstevel@tonic-gate#libsfound=`echo $libsfound | sed -e "s! *${CC}[^ ]* *! !"` 52*0Sstevel@tonic-gatelibspath='/lib /usr/lib /usr/ccs/lib' 53*0Sstevel@tonic-gatelocincpth="/usr/sfw/include /opt/sfw/include $locincpth" 54*0Sstevel@tonic-gate#loclibpth=`echo $loclibpth | sed -e 's!${CC}! !' -e 's!${CC}! !'` 55*0Sstevel@tonic-gateloclibpth="/usr/sfw/lib /opt/sfw/lib $loclibpth" 56*0Sstevel@tonic-gate#loclibpth=`echo $loclibpth | sed -e "s! *${CC}[^ ]* *! !"` 57*0Sstevel@tonic-gatemake_set_make='#' 58*0Sstevel@tonic-gatemydomain='.sun.com' 59*0Sstevel@tonic-gatemyhostname='localhost' 60*0Sstevel@tonic-gateif [ `uname -p` = "sparc" ]; then 61*0Sstevel@tonic-gate myuname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2' 62*0Sstevel@tonic-gateelse 63*0Sstevel@tonic-gate myuname='sunos localhost 5.10 i86pc i386 i86pc' 64*0Sstevel@tonic-gatefi 65*0Sstevel@tonic-gateosvers='2.10' 66*0Sstevel@tonic-gatepager='/usr/bin/more' 67*0Sstevel@tonic-gateperl5='/bin/perl' 68*0Sstevel@tonic-gateperladmin='perl-bugs@sun.com' 69*0Sstevel@tonic-gateEOF 70*0Sstevel@tonic-gate 71*0Sstevel@tonic-gate# Run Configure with the correct flags to give the required config files 72*0Sstevel@tonic-gate./Configure -dsOE \ 73*0Sstevel@tonic-gate -Duseshrplib -Uusemymalloc -Duse64bitint \ 74*0Sstevel@tonic-gate -Dcc=gcc -Doptimize='-O2 -fno-strict-aliasing' \ 75*0Sstevel@tonic-gate -Dprefix=$PerlPfx/$PerlRel \ 76*0Sstevel@tonic-gate -Dprivlib=$PerlPfx/$PerlRel/lib \ 77*0Sstevel@tonic-gate -Darchlib=$PerlPfx/$PerlRel/lib/$PerlArch \ 78*0Sstevel@tonic-gate -Dsiteprefix=$PerlPfx/$PerlRel \ 79*0Sstevel@tonic-gate -Dsitelib=$PerlPfx/site_perl/$PerlRel \ 80*0Sstevel@tonic-gate -Dsitearch=$PerlPfx/site_perl/$PerlRel/$PerlArch \ 81*0Sstevel@tonic-gate -Dvendorprefix=$PerlPfx/$PerlRel \ 82*0Sstevel@tonic-gate -Dvendorlib=$PerlPfx/vendor_perl/$PerlRel \ 83*0Sstevel@tonic-gate -Dvendorarch=$PerlPfx/vendor_perl/$PerlRel/$PerlArch \ 84*0Sstevel@tonic-gate -Dman1dir=$PerlPfx/$PerlRel/man/man1 \ 85*0Sstevel@tonic-gate -Dman3dir=$PerlPfx/$PerlRel/man/man3 \ 86*0Sstevel@tonic-gate | 2>&1 tee configure.log 87*0Sstevel@tonic-gatesed -e "s/^config_args=.*/config_args=''/" \ 88*0Sstevel@tonic-gate -e "s/^config_argc=.*/config_argc=0/" \ 89*0Sstevel@tonic-gate -e "/^config_arg[1-9][0-9]*=/d" \ 90*0Sstevel@tonic-gate -e "s/ threads threads\\/shared//" \ 91*0Sstevel@tonic-gate -e "s/' */'/g" \ 92*0Sstevel@tonic-gate -e "s/ *'/'/g" \ 93*0Sstevel@tonic-gate config.sh > config.new 94*0Sstevel@tonic-gatemv config.new config.sh 95*0Sstevel@tonic-gate 96*0Sstevel@tonic-gate# Expand config.sh into the generated files used during the build 97*0Sstevel@tonic-gate./Configure -S 98