usr/src/cmd/perl/5.6.1/extract_config.sh
author wesolows
Tue, 20 Sep 2005 15:07:36 -0700
changeset 580 70dfd36fd02c
parent 0 68f95e015346
child 1717 ef845d4a1074
permissions -rw-r--r--
6237094 perl build should honor $(CC) 6272179 relocation processing should be bypassed when building libgenunix et al 6307198 Need to pass in -save_args option when the new gcc is available 6310495 gcc and sun4 rootnex don't get along 6310534 new gcc options should be used to build ON 6319181 cw needs -xbuiltin support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
#!/bin/ksh -p
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
#
580
70dfd36fd02c 6237094 perl build should honor $(CC)
wesolows
parents: 0
diff changeset
     4
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     5
# Use is subject to license terms.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     6
#
580
70dfd36fd02c 6237094 perl build should honor $(CC)
wesolows
parents: 0
diff changeset
     7
# ident	"%Z%%M%	%I%	%E% SMI"
70dfd36fd02c 6237094 perl build should honor $(CC)
wesolows
parents: 0
diff changeset
     8
#
70dfd36fd02c 6237094 perl build should honor $(CC)
wesolows
parents: 0
diff changeset
     9
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
# This script extracts values from the passed config.sh file and prints them to
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
# stdout in a form that is suitable for including in a Makefile.  This removes
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
# the requirement to manually keep the various Makefile macros in step with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
# contents of config.sh.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
if  [ -z "$1" -o ! -r "$1" ]; then
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
	printf 'No config.sh file specified\n' >&2
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
	exit 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    21
typeset -r config=$1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    22
typeset -r perlsrc=cmd/perl/5.6.1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    23
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    24
# Pull in config.sh.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    25
set -e
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    26
. $config
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    27
set +e
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
printf '# This file was automatically generated from %s by %s\n\n' \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    30
    $config $(basename $0)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
# ON Makefile macro adjustments.  Perl needs to build/ship with a consistent
580
70dfd36fd02c 6237094 perl build should honor $(CC)
wesolows
parents: 0
diff changeset
    34
# set of flags, and needs to build with the selected compilers.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
#
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
printf 'C99MODE = $(C99_DISABLE)\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
printf 'COPTFLAG = %s\n' "$optimize"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
printf 'SPACEFLAG =\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
printf 'ILDOFF =\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
printf 'CERRWARN =\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
printf 'G_SHARED = %s\n' "$lddlflags"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
printf 'sparc_C_PICFLAGS = %s\n' "$cccdlflags"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
printf 'i386_C_PICFLAGS = %s\n' "$cccdlflags"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
printf 'C_PICFLAGS = %s\n' "$cccdlflags"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
printf 'DYNFLAGS += $(ZIGNORE)\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
# Global stuff.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
printf 'PERL_VERSION = %s\n' $version
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
printf 'PERL_DISTRIB = $(SRC)/%s/distrib\n' $perlsrc
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
printf 'PERL_CONTRIB = $(SRC)/%s/contrib\n' $perlsrc
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
printf 'PERL_UTILS = $(SRC)/%s/utils\n' $perlsrc
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    52
printf 'MINIPERL = $(PERL_DISTRIB)/miniperl\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    53
printf 'PERL_CONFIG_PM = $(PERL_DISTRIB)/lib/Config.pm\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    54
printf 'PERL_CONFIG_H = $(PERL_DISTRIB)/config.h\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    55
printf 'PERL_CONFIGDEP = $(PERL_CONFIG_H) $(PERL_CONFIG_PM)\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    56
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
# Directory locations.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    58
printf 'PERL_REAL_ROOT_STEM = %s\n' ${prefix%/$version}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    59
printf 'PERL_REAL_ROOT_DIR = %s\n' $prefix
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    60
printf 'PERL_REAL_BIN_DIR = %s\n' $binexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    61
printf 'PERL_REAL_ARCHLIB_DIR = %s\n' $archlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    62
printf 'PERL_REAL_CORE_DIR = %s/CORE\n' $archlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    63
printf 'PERL_REAL_SITE_DIR = %s\n' $sitearchexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    64
printf 'PERL_REAL_VENDOR_DIR = %s\n' $vendorarchexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    65
printf 'PERL_REAL_POD_DIR = %s/pod\n' $privlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    66
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    67
# Directory locations relative to the current build $ROOT.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    68
printf 'PERL_ROOT_STEM = $(ROOT)%s\n' ${prefix%/$version}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    69
printf 'PERL_ROOT_DIR = $(ROOT)%s\n' $prefix
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    70
printf 'PERL_BIN_DIR = $(ROOT)%s\n' $binexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    71
printf 'PERL_ARCHLIB_DIR = $(ROOT)%s\n' $archlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    72
printf 'PERL_CORE_DIR = $(ROOT)%s/CORE\n' $archlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    73
printf 'PERL_SITE_DIR = $(ROOT)%s\n' $sitearchexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    74
printf 'PERL_VENDOR_DIR = $(ROOT)%s\n' $vendorarchexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    75
printf 'PERL_POD_DIR = $(ROOT)%s/pod\n' $privlibexp
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    76
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    77
# Compilation environment flags
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    78
printf 'KEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    79
printf 'PERL_COREFLAGS = -DPERL_CORE\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    80
printf 'PERL_LFFLAGS = %s\n' "$ccflags_uselargefiles"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    81
printf 'PERL_LDLIBS = %s\n' "$perllibs"
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    82
printf 'PERL_MM_ENV = $(KEEP_STATE_OFF); unset VERSION; '
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    83
printf 'PERL5LIB=$(PERL_UTILS)/lib:$(PERL_DISTRIB)/lib; export PERL5LIB\n'
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    84
printf "PERL_MM_ARGS = DEFINE='\$(DTEXTDOM)'\n"