package Config;
require Exporter;
@ISA = (Exporter);
@EXPORT = qw(%Config);

$] == 5.001 or die sprintf
    "Perl lib version (5.001) doesn't match executable version (%.3f)\n", $];

# This file was created by configpm when Perl was built. Any changes
# made to this file will be lost the next time perl is built.

=head1 NAME

Config - access Perl configuration option

=head1 SYNOPSIS

    use Config;
    if ($Config{'cc'} =~ /gcc/) {
	print "built by gcc\n";
    } 

=head1 DESCRIPTION

The Config module contains everything that was available to the
C<Configure> program at Perl build time.  Shell variables from
F<config.sh> are stored in the readonly-variable C<%Config>, indexed by
their names.

=head1 EXAMPLE

Here's a more sophisticated example of using %Config:

    use Config;

    defined $Config{sig_name} || die "No sigs?";
    foreach $name (split(' ', $Config{sig_name})) {
	$signo{$name} = $i;
	$signame[$i] = $name;
	$i++;
    }   

    print "signal #17 = $signame[17]\n";
    if ($signo{ALRM}) { 
	print "SIGALRM is $signo{ALRM}\n";
    }   

=head1 NOTE

This module contains a good example of how to make a variable
readonly to those outside of it.  

=cut

##
## This file was produced by running the Configure script. It holds all the
## definitions figured out by Configure. Should you modify one of these values,
## do not forget to propagate your changes by running "Configure -der". You may
## instead choose to run each of the .SH files by yourself, or "Configure -S".
##
#
## Configuration time: Wed Dec  6 17:18:21 PST 1995
## Configured by: gvdl
## Target system: kiwi 
#
## Variables propagated from previous config.sh file.

$config_sh=<<'!END!OF!CONFIG!';
archlib='/usr/lib/perl5'
ccflags='-dynamic -fno-common -DUSE_NEXT_CTYPE'
cppflags='-dynamic -fno-common -DUSE_NEXT_CTYPE'
dynamic_ext='Fcntl NDBM_File ODBM_File SDBM_File Socket'
extensions='Fcntl NDBM_File ODBM_File SDBM_File Socket'
intsize='4'
libpth='/lib /usr/lib'
osname='next'
osvers='4_0'
sharpbang='#!'
shsharp='true'
sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH LOST USR1 USR2'
so='dylib'
startsh='#!/bin/sh'
static_ext=' '
Author=''
CONFIG='true'
Date='$Date'
Header=''
Id='$Id'
Locker=''
Log='$Log'
Mcc='Mcc'
PATCHLEVEL='1'
RCSfile='$RCSfile'
Revision='$Revision'
Source=''
State=''
afs='false'
alignbytes='8'
altmake='gnumake'
aphostname=''
archlibexp='/usr/lib/perl5'
archname='none'
awk='awk'
baserev='5.0'
bash=''
bin='/usr/bin'
binexp='/usr/bin'
bison=''
byacc='byacc'
byteorder='4321'
c=''
castflags='0'
cat='cat'
cc='cc'
cccdlflags=' '
ccdlflags=' '
cf_by='gvdl'
cf_time='Wed Dec  6 17:18:21 PST 1995'
chgrp=''
chmod=''
chown=''
clocktype='int'
comm='comm'
compress=''
contains='grep'
cp='cp'
cpio=''
cpp='cpp'
cpp_stuff='42'
cpplast='-'
cppminus='-'
cpprun='cc -E'
cppstdin='cc -E'
cryptlib=''
csh='csh'
d_Gconvert='gcvt((x),(n),(b))'
d_access='define'
d_alarm='define'
d_archlib='undef'
d_attribut='define'
d_bcmp='define'
d_bcopy='define'
d_bsd='undef'
d_bsdpgrp='define'
d_bzero='define'
d_casti32='define'
d_castneg='define'
d_charvspr='undef'
d_chown='define'
d_chroot='define'
d_chsize='undef'
d_closedir='define'
d_const='define'
d_crypt='define'
d_csh='define'
d_cuserid='undef'
d_dbl_dig='define'
d_difftime='define'
d_dirnamlen='undef'
d_dlerror='undef'
d_dlopen='undef'
d_dlsymun='undef'
d_dosuid='undef'
d_dup2='define'
d_eunice='undef'
d_fchmod='define'
d_fchown='define'
d_fcntl='define'
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='undef'
d_fgetpos='define'
d_flexfnam='define'
d_flock='define'
d_fork='define'
d_fpathconf='undef'
d_fsetpos='define'
d_getgrps='define'
d_gethent='define'
d_gethname='undef'
d_getlogin='define'
d_getpgrp2='undef'
d_getpgrp='define'
d_getppid='define'
d_getprior='define'
d_htonl='define'
d_index='undef'
d_isascii='define'
d_killpg='define'
d_link='define'
d_locconv='define'
d_lockf='define'
d_lstat='define'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_memset='define'
d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
d_msg='undef'
d_msgctl='undef'
d_msgget='undef'
d_msgrcv='undef'
d_msgsnd='undef'
d_mymalloc='undef'
d_nice='define'
d_oldsock='undef'
d_open3='define'
d_pathconf='undef'
d_pause='define'
d_phostname='undef'
d_pipe='define'
d_portable='define'
d_pwage='undef'
d_pwchange='undef'
d_pwclass='undef'
d_pwcomment='define'
d_pwexpire='undef'
d_pwquota='define'
d_readdir='define'
d_readlink='define'
d_rename='define'
d_rewinddir='undef'
d_rmdir='define'
d_safebcpy='define'
d_safemcpy='define'
d_seekdir='define'
d_select='define'
d_sem='undef'
d_semctl='undef'
d_semget='undef'
d_semop='undef'
d_setegid='define'
d_seteuid='define'
d_setlinebuf='define'
d_setlocale='define'
d_setpgid='undef'
d_setpgrp2='undef'
d_setpgrp='define'
d_setprior='define'
d_setregid='define'
d_setresgid='undef'
d_setresuid='undef'
d_setreuid='define'
d_setrgid='define'
d_setruid='define'
d_setsid='undef'
d_shm='undef'
d_shmat='undef'
d_shmatprototype='undef'
d_shmctl='undef'
d_shmdt='undef'
d_shmget='undef'
d_shrplib='define'
d_sitelib='undef'
d_socket='define'
d_sockpair='define'
d_statblks='define'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
d_stdiobase='define'
d_stdstdio='define'
d_strchr='define'
d_strcoll='undef'
d_strctcpy='define'
d_strerrm='strerror(e)'
d_strerror='define'
d_strxfrm='undef'
d_suidsafe='undef'
d_symlink='define'
d_syscall='define'
d_sysconf='undef'
d_sysernlst=''
d_syserrlst='define'
d_system='define'
d_tcgetpgrp='undef'
d_tcsetpgrp='undef'
d_telldir='define'
d_time='define'
d_times='define'
d_truncate='define'
d_tzname='define'
d_umask='define'
d_uname='undef'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_wait4='define'
d_waitpid='undef'
d_wcstombs='define'
d_wctomb='define'
d_xenix='undef'
date='date'
db_hashtype='int'
db_prefixtype='int'
defvoidused='15'
direntrytype='struct direct'
dlext='bundle'
dlsrc='dl_next.xs'
echo='echo'
egrep='egrep'
emacs=''
eunicefix=':'
expr='expr'
find='find'
flex=''
fpostype='fpos_t'
freetype='void'
full_csh='/bin/csh'
full_sed='/bin/sed'
gcc=''
gccversion='NeXT DevKit-based CPP 4.0'
gidtype='gid_t'
glibpth='/usr/shlib  /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/local/lib '
grep='grep'
groupcat=''
groupstype='int'
h_fcntl='false'
h_sysfile='true'
hint='recommended'
hostcat='nidump hosts .'
huge=''
i_bsdioctl=''
i_db='undef'
i_dbm='define'
i_dirent='define'
i_dld='undef'
i_dlfcn='undef'
i_fcntl='undef'
i_float='define'
i_gdbm='undef'
i_grp='define'
i_limits='define'
i_malloc='undef'
i_math='define'
i_memory='undef'
i_ndbm='define'
i_neterrno='undef'
i_niin='define'
i_pwd='define'
i_sgtty='define'
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_string='define'
i_sysdir='define'
i_sysfile='define'
i_sysfilio='undef'
i_sysin='undef'
i_sysioctl='define'
i_sysndir='undef'
i_sysparam='define'
i_sysselct='undef'
i_syssockio=''
i_sysstat='define'
i_systime='define'
i_systimek='undef'
i_systimes='define'
i_systypes='define'
i_termio='undef'
i_termios='undef'
i_time='undef'
i_unistd='define'
i_utime='undef'
i_varargs='undef'
i_varhdr='stdarg.h'
i_vfork='undef'
incpath=''
inews=''
installarchlib='/usr/lib/perl5'
installbin='/usr/bin'
installman1dir='/usr/man/man1'
installman3dir='/usr/lib/perl5/man/man3'
installprivlib='/usr/lib/perl5'
installscript='/usr/bin'
installsitelib=''
isnext_4='define'
known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File POSIX SDBM_File Socket'
ksh=''
large=''
ld='cc'
lddlflags='-dynamic -bundle -undefined suppress'
ldflags='-dynamic -prebind'
less=''
libc='/NextLibrary/Frameworks/System.framework/System'
libs=' '
libswanted=' '
line='line'
lint=''
lkflags=''
ln='ln'
lns='/bin/ln -s'
lp=''
lpr=''
ls='ls'
lseektype='off_t'
mab='-arch m68k -arch i386 -arch sparc'
mail=''
mailx=''
make=''
mallocobj=''
mallocsrc=''
malloctype='void *'
man1dir='/usr/man/man1'
man1direxp='/usr/man/man1'
man1ext='1'
man3dir='/usr/lib/perl5/man/man3'
man3direxp='/usr/lib/perl5/man/man3'
man3ext='3'
medium=''
mips=''
mips_type=''
mkdir='mkdir'
models='none'
modetype='int'
more=''
mv=''
myarchname='hppa-next'
mydomain=''
myhostname='kiwi'
myuname='kiwi '
n='-n'
nm_opt=''
nroff='nroff'
optimize='-g -O'
orderlib='false'
package='perl5'
passcat=''
patchlevel='1'
perl='perl'
pg=''
phostname='hostname'
plibpth=''
pmake=''
pp_cflags='optimize="-g"'
pr=''
prefix='/usr'
prefixexp='/usr'
privlib='/usr/lib/perl5'
privlibexp='/usr/lib/perl5'
prototype='define'
randbits='31'
ranlib='sleep 5; /bin/ranlib'
rm='rm'
rmail=''
runnm='true'
scriptdir='/usr/bin'
scriptdirexp='/usr/bin'
sed='sed'
selecttype='fd_set *'
sendmail=''
sh=''
shar=''
shmattype=''
shrpdir='/usr/lib/perl5/CORE'
signal_t='void'
sitelib=''
sitelibexp=''
sizetype='size_t'
sleep=''
smail=''
small=''
sockethdr=''
socketlib=''
sort='sort'
spackage='Perl5'
spitshell='cat'
split=''
ssizetype='int'
stdchar='char'
stdio_base='((fp)->_base)'
stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)'
stdio_cnt='((fp)->_cnt)'
stdio_ptr='((fp)->_ptr)'
strings='/NextDeveloper/Headers/ansi/string.h'
submit=''
sysman='/usr/man/man1'
tail=''
tar=''
tbl=''
test='test'
timeincl='/NextDeveloper/Headers/bsd/sys/time.h '
timetype='time_t'
touch='touch'
tr='tr'
troff=''
uidtype='uid_t'
uname='uname'
uniq='uniq'
usedl='define'
usemymalloc='n'
usenm='true'
useposix='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
!END!OF!CONFIG!


tie %Config, Config;
sub TIEHASH { bless {} }
sub FETCH { 
    # check for cached value (which maybe undef so we use exists not defined)
    return $_[0]->{$_[1]} if (exists $_[0]->{$_[1]});
 
    my($value); # search for the item in the big $config_sh string
    return undef unless (($value) = $config_sh =~ m/^$_[1]='(.*)'\s*$/m);
 
    $value = undef if $value eq 'undef'; # So we can say "if $Config{'foo'}".
    $_[0]->{$_[1]} = $value; # cache it
    return $value;
}
 
sub FIRSTKEY {
    $prevpos = 0;
    my $key;
    ($key) = $config_sh =~ m/^(.*)=/;
    $key;
}

sub NEXTKEY {
    my ($pos, $len);
    $pos = $prevpos;
    $pos = index( $config_sh, "\n", $pos) + 1;
    $prevpos = $pos;
    $len = index( $config_sh, "=", $pos) - $pos;
    $len > 0 ? substr( $config_sh, $pos, $len) : undef;
}

sub EXISTS{ 
     exists($_[0]->{$_[1]})  or  $config_sh =~ m/^$_[1]=/m; 
}

sub readonly { die "\%Config::Config is read-only\n" }

sub myconfig {
	my($output);
	
	$output = <<'END';
Summary of my $package (patchlevel $PATCHLEVEL) configuration:
  Platform:
    osname=$osname, osver=$osvers, archname=$archname
    uname='$myuname'
    hint=$hint
  Compiler:
    cc='$cc', optimize='$optimize'
    cppflags='$cppflags'
    ccflags ='$ccflags'
    ldflags ='$ldflags'
    stdchar='$stdchar', d_stdstdio=$d_stdstdio, usevfork=$usevfork
    voidflags=$voidflags, castflags=$castflags, d_casti32=$d_casti32, d_castneg=$d_castneg
    intsize=$intsize, alignbytes=$alignbytes, usemymalloc=$usemymalloc, randbits=$randbits
  Libraries:
    so=$so
    libpth=$libpth
    libs=$libs
    libc=$libc
  Dynamic Linking:
    dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun
    cccdlflags='$cccdlflags', ccdlflags='$ccdlflags', lddlflags='$lddlflags'

END
	$output =~ s/\$(\w+)/$Config{$1}/ge;
	$output;
}

sub STORE { &readonly }
sub DELETE{ &readonly }
sub CLEAR { &readonly }


1;
