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