0
|
1 |
#!/bin/ksh -p
|
|
2 |
|
|
3 |
#
|
580
|
4 |
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
0
|
5 |
# Use is subject to license terms.
|
|
6 |
#
|
580
|
7 |
# ident "%Z%%M% %I% %E% SMI"
|
|
8 |
#
|
|
9 |
|
0
|
10 |
#
|
|
11 |
# This script extracts values from the passed config.sh file and prints them to
|
|
12 |
# stdout in a form that is suitable for including in a Makefile. This removes
|
|
13 |
# the requirement to manually keep the various Makefile macros in step with the
|
|
14 |
# contents of config.sh.
|
|
15 |
#
|
|
16 |
|
|
17 |
if [ -z "$1" -o ! -r "$1" ]; then
|
|
18 |
printf 'No config.sh file specified\n' >&2
|
|
19 |
exit 1
|
|
20 |
fi
|
|
21 |
typeset -r config=$1
|
|
22 |
typeset -r perlsrc=cmd/perl/5.6.1
|
|
23 |
|
|
24 |
# Pull in config.sh.
|
|
25 |
set -e
|
|
26 |
. $config
|
|
27 |
set +e
|
|
28 |
|
|
29 |
printf '# This file was automatically generated from %s by %s\n\n' \
|
|
30 |
$config $(basename $0)
|
|
31 |
|
|
32 |
#
|
|
33 |
# ON Makefile macro adjustments. Perl needs to build/ship with a consistent
|
580
|
34 |
# set of flags, and needs to build with the selected compilers.
|
0
|
35 |
#
|
|
36 |
printf 'C99MODE = $(C99_DISABLE)\n'
|
|
37 |
printf 'COPTFLAG = %s\n' "$optimize"
|
|
38 |
printf 'SPACEFLAG =\n'
|
|
39 |
printf 'ILDOFF =\n'
|
|
40 |
printf 'CERRWARN =\n'
|
|
41 |
printf 'G_SHARED = %s\n' "$lddlflags"
|
|
42 |
printf 'sparc_C_PICFLAGS = %s\n' "$cccdlflags"
|
|
43 |
printf 'i386_C_PICFLAGS = %s\n' "$cccdlflags"
|
|
44 |
printf 'C_PICFLAGS = %s\n' "$cccdlflags"
|
|
45 |
printf 'DYNFLAGS += $(ZIGNORE)\n'
|
|
46 |
|
|
47 |
# Global stuff.
|
|
48 |
printf 'PERL_VERSION = %s\n' $version
|
|
49 |
printf 'PERL_DISTRIB = $(SRC)/%s/distrib\n' $perlsrc
|
|
50 |
printf 'PERL_CONTRIB = $(SRC)/%s/contrib\n' $perlsrc
|
|
51 |
printf 'PERL_UTILS = $(SRC)/%s/utils\n' $perlsrc
|
|
52 |
printf 'MINIPERL = $(PERL_DISTRIB)/miniperl\n'
|
|
53 |
printf 'PERL_CONFIG_PM = $(PERL_DISTRIB)/lib/Config.pm\n'
|
|
54 |
printf 'PERL_CONFIG_H = $(PERL_DISTRIB)/config.h\n'
|
|
55 |
printf 'PERL_CONFIGDEP = $(PERL_CONFIG_H) $(PERL_CONFIG_PM)\n'
|
|
56 |
|
|
57 |
# Directory locations.
|
|
58 |
printf 'PERL_REAL_ROOT_STEM = %s\n' ${prefix%/$version}
|
|
59 |
printf 'PERL_REAL_ROOT_DIR = %s\n' $prefix
|
|
60 |
printf 'PERL_REAL_BIN_DIR = %s\n' $binexp
|
|
61 |
printf 'PERL_REAL_ARCHLIB_DIR = %s\n' $archlibexp
|
|
62 |
printf 'PERL_REAL_CORE_DIR = %s/CORE\n' $archlibexp
|
|
63 |
printf 'PERL_REAL_SITE_DIR = %s\n' $sitearchexp
|
|
64 |
printf 'PERL_REAL_VENDOR_DIR = %s\n' $vendorarchexp
|
|
65 |
printf 'PERL_REAL_POD_DIR = %s/pod\n' $privlibexp
|
|
66 |
|
|
67 |
# Directory locations relative to the current build $ROOT.
|
|
68 |
printf 'PERL_ROOT_STEM = $(ROOT)%s\n' ${prefix%/$version}
|
|
69 |
printf 'PERL_ROOT_DIR = $(ROOT)%s\n' $prefix
|
|
70 |
printf 'PERL_BIN_DIR = $(ROOT)%s\n' $binexp
|
|
71 |
printf 'PERL_ARCHLIB_DIR = $(ROOT)%s\n' $archlibexp
|
|
72 |
printf 'PERL_CORE_DIR = $(ROOT)%s/CORE\n' $archlibexp
|
|
73 |
printf 'PERL_SITE_DIR = $(ROOT)%s\n' $sitearchexp
|
|
74 |
printf 'PERL_VENDOR_DIR = $(ROOT)%s\n' $vendorarchexp
|
|
75 |
printf 'PERL_POD_DIR = $(ROOT)%s/pod\n' $privlibexp
|
|
76 |
|
|
77 |
# Compilation environment flags
|
|
78 |
printf 'KEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES\n'
|
|
79 |
printf 'PERL_COREFLAGS = -DPERL_CORE\n'
|
|
80 |
printf 'PERL_LFFLAGS = %s\n' "$ccflags_uselargefiles"
|
|
81 |
printf 'PERL_LDLIBS = %s\n' "$perllibs"
|
|
82 |
printf 'PERL_MM_ENV = $(KEEP_STATE_OFF); unset VERSION; '
|
|
83 |
printf 'PERL5LIB=$(PERL_UTILS)/lib:$(PERL_DISTRIB)/lib; export PERL5LIB\n'
|
|
84 |
printf "PERL_MM_ARGS = DEFINE='\$(DTEXTDOM)'\n"
|