;;
esac
+: the newline for tr
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\n' x 2>/dev/null`" in
+ foox)
+ trnl='\n'
+ ;;
+ esac
+fi
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\012' x 2>/dev/null`" in
+ foox)
+ trnl='\012'
+ ;;
+ esac
+fi
+if test X"$trnl" = X; then
+ cat <<EOM >&2
+
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
+
+EOM
+ exit 1
+fi
+
: Proper separator for the PATH environment variable
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
+i_arpa_inet=''
d_htonl=''
d_inetaton=''
d_isascii=''
i_fcntl=''
i_float=''
i_gdbm=''
+d_grpasswd=''
+d_setgrent=''
+d_getgrent=''
+d_endgrent=''
i_grp=''
i_limits=''
i_locale=''
d_pwcomment=''
d_pwexpire=''
d_pwgecos=''
+d_pwpasswd=''
d_pwquota=''
+d_setpwent=''
+d_getpwent=''
+d_endpwent=''
i_pwd=''
i_sfio=''
i_stddef=''
usrinc=''
defvoidused=''
voidflags=''
+ebcdic=''
CONFIG=''
define='define'
y)
echo "*** Substitution done -- please confirm."
xxxm="\$ans"
- ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
+ ans=\`echo $n "\$ans$c" | tr $trnl ' '\`
xxxm="\$ans"
ans=!
;;
: see whether [:lower:] and [:upper:] are supported character classes
echo " "
-up='[A-Z]'
-low='[a-z]'
case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
ABYZ)
echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
up='[:upper:]'
low='[:lower:]'
;;
+*) # There is a discontinuity in EBCDIC between 'I' and 'J'
+ # (0xc9 and 0xd1), therefore that is a nice testing point.
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr '[I-J]' '[i-j]' 2>/dev/null`" in
+ ij) up='[A-Z]'
+ low='[a-z]'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr I-J i-j 2>/dev/null`" in
+ ij) up='A-Z'
+ low='a-z'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | od -x 2>/dev/null`" in
+ *C9D1*|*c9d1*)
+ echo "Hey, this might be EBCDIC." >&4
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
+ ij) up='[A-IJ-RS-Z]'
+ low='[a-ij-rs-z]'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
+ ij) up='A-IJ-RS-Z'
+ low='a-ij-rs-z'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ fi
+esac
+case "`echo IJ | tr \"$up\" \"$low\" 2>/dev/null`" in
+ij)
+ echo "Using $up and $low to convert case." >&4
+ ;;
*)
- echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
- ;;
+ echo "I don't know how to translate letters from upper to lower case." >&4
+ echo "Your tr is not acting any way I know of." >&4
+ exit 1
+ ;;
esac
: set up the translation script tr, must be called with ./tr of course
cat >tr <<EOSC
case "$config_sh" in
'')
myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
+# tr '[A-Z]' '[a-z]' would not work in EBCDIC
+# because the A-Z/a-z are not consecutive.
myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
- ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
+ ./tr '[A-Z]' '[a-z]' | tr $trnl ' '`
newmyuname="$myuname"
dflt=n
case "$knowitall" in
*) osvers="$3" ;;
esac
;;
- netbsd*) osname=netbsd
+ MiNT) osname=mint
+ ;;
+ netbsd*) osname=netbsd
osvers="$3"
;;
news-os) osvers="$3"
case "$fn" in
*\(*)
- expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
+ expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
fn=`echo $fn | sed 's/(.*)//'`
;;
esac
main() { printf("Ok\n"); exit(0); }
EOF
dflt=y
-if sh -c "$cc $optimize $ccflags $ldflags -o try try.c $libs" >>try.msg 2>&1; then
+if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
if sh -c './try' >>try.msg 2>&1; then
xxx=`./try`
case "$xxx" in
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+cat >tebcdic.c <<EOM
+int main()
+{
+ if ('M'==0xd4) return 0;
+ return 1;
+}
+EOM
+$cc $ccflags $ldflags -o tebcdic tebcdic.c $libs >/dev/null 2>&1
+if ./tebcdic; then
+ echo "You have EBCDIC. Adding -DEBCDIC to ccflags." >&4
+ ccflags="$ccflags -DEBCDIC"
+ val="$define"
+else
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
+ val="$undef"
+fi
+rm -f tebcdic.c tebcdic
+set ebcdic
+eval $setvar
+
+echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
#include <stdio.h>
: The messy sed command sorts on library version numbers.
$test -r $1 || \
set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
- tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
+ tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
h
s/[0-9][0-9]*/0000&/g
s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
EOM
else
dflt=''
- echo $libpth | tr ' ' '\012' | sort | uniq > libpath
+ echo $libpth | tr ' ' $trnl | sort | uniq > libpath
cat >&4 <<EOM
I can't seem to find your C library. I've looked in the following places:
libc="$ans"
echo " "
-echo $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
+echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
set X `cat libnames`
shift
xxx=files
eval $setvar
: Check how to convert floats to strings.
-echo " "
-echo "Checking for an efficient way to convert floats to strings."
-$cat >try.c <<'EOP'
+if test "X$d_Gconvert" = X; then
+ echo " "
+ echo "Checking for an efficient way to convert floats to strings."
+ $cat >try.c <<'EOP'
#ifdef TRY_gconvert
#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
char *myname = "gconvert";
exit(0);
}
EOP
-case "$d_Gconvert" in
-gconvert*) xxx_list='gconvert gcvt sprintf' ;;
-gcvt*) xxx_list='gcvt gconvert sprintf' ;;
-sprintf*) xxx_list='sprintf gconvert gcvt' ;;
-*) xxx_list='gconvert gcvt sprintf' ;;
-esac
+ case "$d_Gconvert" in
+ gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+ gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+ sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+ *) xxx_list='gconvert gcvt sprintf' ;;
+ esac
-for xxx_convert in $xxx_list; do
+ for xxx_convert in $xxx_list; do
echo "Trying $xxx_convert"
$rm -f try try$_o
set try -DTRY_$xxx_convert
else
echo "$xxx_convert NOT found." >&4
fi
-done
+ done
-case "$xxx_convert" in
-gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
-gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
-*) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
-esac
+ case "$xxx_convert" in
+ gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+ gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+ *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+ esac
+fi
: Initialize h_fcntl
h_fcntl=false
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
$ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
- $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
+ $cc $ccflags $ldflags $cccdlflags $ccdlflags -o fred fred.c $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
1) echo "Test program failed using dlopen." >&4
set d_getprotoprotos getprotoent $i_netdb netdb.h
eval $hasproto
-
: see if getservbyname exists
set getservbyname d_getsbyname
eval $inlibc
set netinet/in.h i_niin sys/in.h i_sysin
eval $inhdr
+: see if this is an arpa/inet.h
+set arpa/inet.h i_arpa_inet
+eval $inhdr
+
: see if htonl --and friends-- exists
val=''
set htonl val
#include <sys/types.h>
#$i_niin I_NETINET_IN
#$i_sysin I_SYS_IN
+#$i_arpainet I_ARPA_INET
#ifdef I_NETINET_IN
#include <netinet/in.h>
#endif
#ifdef I_SYS_IN
#include <sys/in.h>
#endif
+#ifdef I_ARPA_INET
+#include <arpa/inet.h>
+#endif
#ifdef htonl
printf("Defined as a macro.");
#endif
case "$i_pwd" in
$define)
+ : see if setpwent exists
+ set setpwent d_setpwent
+ eval $inlibc
+
+ : see if getpwent exists
+ set getpwent d_getpwent
+ eval $inlibc
+
+ : see if endpwent exists
+ set endpwent d_endpwent
+ eval $inlibc
+
xxx=`./findhdr pwd.h`
$cppstdin $cppflags $cppminus < $xxx >$$.h
set d_pwgecos
eval $setvar
+ if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+ set d_pwpasswd
+ eval $setvar
+
$rm -f $$.h
;;
-*)
+*) # Assume all is lost as far as the d_*pw* go.
val="$undef";
+ set d_setpwent; eval $setvar
+ set d_getpwent; eval $setvar
+ set d_endpwent; eval $setvar
set d_pwquota; eval $setvar
set d_pwage; eval $setvar
set d_pwchange; eval $setvar
set d_pwexpire; eval $setvar
set d_pwcomment; eval $setvar
set d_pwgecos; eval $setvar
+ set d_pwpasswd; eval $setvar
;;
esac
: see if strerror and/or sys_errlist[] exist
echo " "
-if set strerror val -f d_strerror; eval $csym; $val; then
+if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
+ if set strerror val -f d_strerror; eval $csym; $val; then
echo 'strerror() found.' >&4
d_strerror="$define"
d_strerrm='strerror(e)'
if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(You also have sys_errlist[], so we could roll our own strerror.)"
- d_syserrlst="$define"
+ echo "(You also have sys_errlist[], so we could roll our own strerror.)"
+ d_syserrlst="$define"
else
- echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
- d_syserrlst="$undef"
+ echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
+ d_syserrlst="$undef"
fi
-elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
+ elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
$contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
echo 'strerror() found in string header.' >&4
d_strerror="$define"
d_strerrm='strerror(e)'
if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
- d_syserrlst="$define"
+ echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
+ d_syserrlst="$define"
else
- echo "(You don't appear to have any sys_errlist[], how can this be?)"
- d_syserrlst="$undef"
+ echo "(You don't appear to have any sys_errlist[], how can this be?)"
+ d_syserrlst="$undef"
fi
-elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
+ elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
d_strerror="$undef"
d_syserrlst="$define"
d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
-else
+ else
echo 'strerror() and sys_errlist[] NOT found.' >&4
d_strerror="$undef"
d_syserrlst="$undef"
d_strerrm='"unknown"'
+ fi
fi
: see if strtod exists
: see if we should include time.h, sys/time.h, or both
echo " "
-echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
-$echo $n "I'm now running the test program...$c"
-$cat >try.c <<'EOCP'
+if test "X$timeincl" = X; then
+ echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
+ $echo $n "I'm now running the test program...$c"
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
#ifdef I_TIME
#include <time.h>
exit(1);
}
EOCP
-flags=''
-for s_timezone in '-DS_TIMEZONE' ''; do
-sysselect=''
-for s_timeval in '-DS_TIMEVAL' ''; do
-for i_systimek in '' '-DSYSTIMEKERNEL'; do
-for i_time in '' '-DI_TIME'; do
-for i_systime in '-DI_SYSTIME' ''; do
+ flags=''
+ for s_timezone in '-DS_TIMEZONE' ''; do
+ sysselect=''
+ for s_timeval in '-DS_TIMEVAL' ''; do
+ for i_systimek in '' '-DSYSTIMEKERNEL'; do
+ for i_time in '' '-DI_TIME'; do
+ for i_systime in '-DI_SYSTIME' ''; do
case "$flags" in
'') $echo $n ".$c"
set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
fi
;;
esac
-done
-done
-done
-done
-done
-timeincl=''
-echo " "
-case "$flags" in
-*SYSTIMEKERNEL*) i_systimek="$define"
+ done
+ done
+ done
+ done
+ done
+ timeincl=''
+ echo " "
+ case "$flags" in
+ *SYSTIMEKERNEL*) i_systimek="$define"
timeincl=`./findhdr sys/time.h`
echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
-*) i_systimek="$undef";;
-esac
-case "$flags" in
-*I_TIME*) i_time="$define"
+ *) i_systimek="$undef";;
+ esac
+ case "$flags" in
+ *I_TIME*) i_time="$define"
timeincl=`./findhdr time.h`" $timeincl"
echo "We'll include <time.h>." >&4;;
-*) i_time="$undef";;
-esac
-case "$flags" in
-*I_SYSTIME*) i_systime="$define"
+ *) i_time="$undef";;
+ esac
+ case "$flags" in
+ *I_SYSTIME*) i_systime="$define"
timeincl=`./findhdr sys/time.h`" $timeincl"
echo "We'll include <sys/time.h>." >&4;;
-*) i_systime="$undef";;
-esac
-$rm -f try.c try
+ *) i_systime="$undef";;
+ esac
+ $rm -f try.c try
+fi
: check for fd_set items
$cat <<EOM
EOCP
-echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
+echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
{
printf "#ifdef SIG"; printf $1; printf "\n"
printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
echo 'NSIG 50' > signal.nsg
fi
: Now look at all the signal names, one at a time.
- for xx in `echo $xxx | $tr ' ' '\012' | $sort | $uniq`; do
+ for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
$cat > signal.c <<EOCP
#include <sys/types.h>
#include <signal.h>
case $# in
0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
esac
- echo $@ | $tr ' ' '\012' | \
+ echo $@ | $tr ' ' $trnl | \
$awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
fi
$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
: see if time exists
echo " "
-if set time val -f d_time; eval $csym; $val; then
+if test "X$d_time" = X -o X"$timetype" = X; then
+ if set time val -f d_time; eval $csym; $val; then
echo 'time() found.' >&4
val="$define"
rp="What is the type returned by time() on this system?"
set time_t timetype long stdio.h sys/types.h
eval $typedef_ask
-else
+ else
echo 'time() not found, hope that will do.' >&4
val="$undef"
timetype='int';
+ fi
+ set d_time
+ eval $setvar
fi
-set d_time
-eval $setvar
: see what type uids are declared as in the kernel
echo " "
set grp.h i_grp
eval $inhdr
+case "$i_grp" in
+$define)
+ : see if setgrent exists
+ set setgrent d_setgrent
+ eval $inlibc
+
+ : see if getgrent exists
+ set getgrent d_getgrent
+ eval $inlibc
+
+ : see if endgrent exists
+ set endgrent d_endgrent
+ eval $inlibc
+
+ xxx=`./findhdr grp.h`
+ $cppstdin $cppflags $cppminus < $xxx >$$.h
+
+ if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+ set d_grpasswd
+ eval $setvar
+
+ $rm -f $$.h
+ ;;
+*) # Assume all is lost as far as the d_*gr* go.
+ val="$undef";
+ set d_setgrent; eval $setvar
+ set d_getgrent; eval $setvar
+ set d_endgrent; eval $setvar
+ set d_grpasswd; eval $setvar
+ ;;
+esac
+
: see if locale.h is available
set locale.h i_locale
eval $inhdr
: get C preprocessor symbols handy
echo " "
$echo $n "Hmm... $c"
-echo $al | $tr ' ' '\012' >Cppsym.know
+echo $al | $tr ' ' $trnl >Cppsym.know
$cat <<EOSS >Cppsym
$startsh
case "\$1" in
case \$# in
0) exit 1;;
esac
-echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
+echo \$* | $tr ' ' $trnl | $sed -e 's/\(.*\)/\\
#ifdef \1\\
exit 0; _ _ _ _\1\\ \1\\
#endif\\
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
d_dup2='$d_dup2'
+d_endgrent='$d_endgrent'
d_endhent='$d_endhent'
d_endnent='$d_endnent'
d_endpent='$d_endpent'
+d_endpwent='$d_endpwent'
d_endsent='$d_endsent'
d_eofnblk='$d_eofnblk'
d_eunice='$d_eunice'
d_fpathconf='$d_fpathconf'
d_fsetpos='$d_fsetpos'
d_ftime='$d_ftime'
+d_getgrent='$d_getgrent'
d_getgrps='$d_getgrps'
d_gethbyaddr='$d_gethbyaddr'
d_gethbyname='$d_gethbyname'
d_getppid='$d_getppid'
d_getprior='$d_getprior'
d_getprotoprotos='$d_getprotoprotos'
+d_getpwent='$d_getpwent'
d_getsbyname='$d_getsbyname'
d_getsbyport='$d_getsbyport'
d_getsent='$d_getsent'
d_getservprotos='$d_getservprotos'
d_gettimeod='$d_gettimeod'
d_gnulibc='$d_gnulibc'
+d_grpasswd='$d_grpasswd'
d_htonl='$d_htonl'
d_index='$d_index'
d_inetaton='$d_inetaton'
d_pwexpire='$d_pwexpire'
d_pwgecos='$d_pwgecos'
d_pwquota='$d_pwquota'
+d_pwpasswd='$d_pwpasswd'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_rename='$d_rename'
d_semop='$d_semop'
d_setegid='$d_setegid'
d_seteuid='$d_seteuid'
+d_setgrent='$d_setgrent'
d_setgrps='$d_setgrps'
d_sethent='$d_sethent'
d_setlinebuf='$d_setlinebuf'
d_setpgrp2='$d_setpgrp2'
d_setpgrp='$d_setpgrp'
d_setprior='$d_setprior'
+d_setpwent='$d_setpwent'
d_setregid='$d_setregid'
d_setresgid='$d_setresgid'
d_setresuid='$d_setresuid'
doublesize='$doublesize'
dynamic_ext='$dynamic_ext'
eagain='$eagain'
+ebcdic='$ebcdic'
echo='$echo'
egrep='$egrep'
emacs='$emacs'
hint='$hint'
hostcat='$hostcat'
huge='$huge'
+i_arpa_inet='$i_arpa_inet'
i_bsdioctl='$i_bsdioctl'
i_db='$i_db'
i_dbm='$i_dbm'
timetype='$timetype'
touch='$touch'
tr='$tr'
+trnl='$trnl'
troff='$troff'
uidtype='$uidtype'
uname='$uname'
: if this fails, just run all the .SH files by hand
. ./config.sh
+case "$ebcdic" in
+$define)
+ if test -d ebcdic; then
+ echo "This is an EBCDIC system, moving the right parser files in place." >&4
+ # Try to save the ASCII versions, just in case.
+ test -f perly.c.ascii || mv perly.c perly.c.ascii
+ test -f perly.h.ascii || mv perly.h perly.h.ascii
+
+ cp -pf ebcdic/perly.c perly.c
+ cp -pf ebcdic/perly.h perly.h
+
+ test -f x2p/a2p.c.ascii || mv x2p/a2p.c x2p/a2p.c.ascii
+
+ cp -pf ebcdic/a2p.c x2p/a2p.c
+ else
+ echo "This is an EBCDIC system but there's no ebcdic directory." >&4
+ echo "This will not do." >&4
+ exit 1
+ fi
+ ;;
+esac
+
echo " "
exec 1>&4
. ./UU/extract
# grrr
SHELL = $sh
+# how to tr(anslate) newlines
+TRNL = '$trnl'
+
!GROK!THIS!
## In the following dollars and backticks do not need the extra backslash.
case "$osname" in
aix)
$spitshell >>Makefile <<'!NO!SUBS!'
+ rm -f libperl$(OBJ_EXT)
mv $@ libperl$(OBJ_EXT)
$(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
!NO!SUBS!
sh mv-if-diff tmp lib/Config.pm
lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
- $(LDLIBPTH) ./miniperl minimod.pl > tmp && mv tmp $@
+ $(LDLIBPTH) ./miniperl minimod.pl > tmp && ( rm -f $@ ; mv tmp $@ )
lib/re.pm: ext/re/re.pm
cat ext/re/re.pm > $@
$(LBLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
clist: $(c)
- echo $(c) | tr ' ' '\012' >.clist
+ echo $(c) | tr ' ' $(TRNL) >.clist
hlist: $(h)
- echo $(h) | tr ' ' '\012' >.hlist
+ echo $(h) | tr ' ' $(TRNL) >.hlist
shlist: $(sh)
- echo $(sh) | tr ' ' '\012' >.shlist
+ echo $(sh) | tr ' ' $(TRNL) >.shlist
pllist: $(pl)
- echo $(pl) | tr ' ' '\012' >.pllist
+ echo $(pl) | tr ' ' $(TRNL) >.pllist
Makefile: Makefile.SH ./config.sh
$(SHELL) Makefile.SH
*/
#$d_wctomb HAS_WCTOMB /**/
+/* I_ARPA_INET:
+ * This symbol, if defined, indicates that <arpa/inet.h> exists and should
+ * be included.
+ */
+#$i_arpa_inet I_ARPA_INET /**/
+
/* I_DBM:
* This symbol, if defined, indicates that <dbm.h> exists and should
* be included.
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
*/
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * contains gr_passwd.
+ */
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
#$i_grp I_GRP /**/
+#$d_grpasswd GRPASSWD /**/
+#$d_setgrent HAS_SETGRENT /**/
+#$d_getgrent HAS_GETGRENT /**/
+#$d_endgrent HAS_ENDGRENT /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_gecos.
*/
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the getpwrent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the password database.
+ */
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
#$i_pwd I_PWD /**/
#$d_pwquota PWQUOTA /**/
#$d_pwage PWAGE /**/
#$d_pwexpire PWEXPIRE /**/
#$d_pwcomment PWCOMMENT /**/
#$d_pwgecos PWGECOS /**/
+#$d_pwpasswd PWPASSWD /**/
+#$d_setpwent HAS_SETPWENT /**/
+#$d_getpwent HAS_GETPWENT /**/
+#$d_endpwent HAS_ENDPWENT /**/
/* Free_t:
* This variable contains the return type of free(). It is usually
if (lcbuf->thousands_sep && *lcbuf->thousands_sep)
hv_store(RETVAL, "thousands_sep", 13,
newSVpv(lcbuf->thousands_sep, 0), 0);
+#ifndef NO_LOCALECONV_GROUPING
if (lcbuf->grouping && *lcbuf->grouping)
hv_store(RETVAL, "grouping", 8,
newSVpv(lcbuf->grouping, 0), 0);
+#endif
if (lcbuf->int_curr_symbol && *lcbuf->int_curr_symbol)
hv_store(RETVAL, "int_curr_symbol", 15,
newSVpv(lcbuf->int_curr_symbol, 0), 0);
hv_store(RETVAL, "mon_thousands_sep", 17,
newSVpv(lcbuf->mon_thousands_sep, 0), 0);
#endif
+#ifndef NO_LOCALECONV_MON_GROUPING
if (lcbuf->mon_grouping && *lcbuf->mon_grouping)
hv_store(RETVAL, "mon_grouping", 12,
newSVpv(lcbuf->mon_grouping, 0), 0);
+#endif
if (lcbuf->positive_sign && *lcbuf->positive_sign)
hv_store(RETVAL, "positive_sign", 13,
newSVpv(lcbuf->positive_sign, 0), 0);
# include <unixio.h>
#endif
-#if !defined(MSDOS) && !defined(WIN32) && !defined(VMS)
-# ifdef PARAM_NEEDS_TYPES
-# include <sys/types.h>
+#ifdef I_SYS_PARAM
+# if !defined(MSDOS) && !defined(WIN32) && !defined(VMS)
+# ifdef PARAM_NEEDS_TYPES
+# include <sys/types.h>
+# endif
+# include <sys/param.h>
# endif
-# include <sys/param.h>
#endif
#ifndef _TYPES_ /* If types.h defines this it's easy. */
}.$self->{MAKEFILE}.q{ : Makefile.PL $(CONFIGDEP)
}.$self->{NOECHO}.q{echo "Makefile out-of-date with respect to $?"
}.$self->{NOECHO}.q{echo "Cleaning current config before rebuilding Makefile..."
+ -}.$self->{NOECHO}.q{$(RM_F) }."$self->{MAKEFILE}.old".q{
-}.$self->{NOECHO}.q{$(MV) }."$self->{MAKEFILE} $self->{MAKEFILE}.old".q{
-$(MAKE) -f }.$self->{MAKEFILE}.q{.old clean $(DEV_NULL) || $(NOOP)
$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL }.join(" ",map(qq["$_"],@ARGV)).q{
# makedepend.SH
#
MAKE=$make
+trnl='$trnl'
!GROK!THIS!
$spitshell >>makedepend <<'!NO!SUBS!'
$test -d UU || mkdir UU
$MAKE clist || ($echo "Searching for .c files..."; \
- $echo *.c | $tr ' ' '\012' | $egrep -v '\*' >.clist)
+ $echo *.c | $tr ' ' $trnl | $egrep -v '\*' >.clist)
for file in `$cat .clist`; do
# for file in `cat /dev/null`; do
case "$file" in
$sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d'
$MAKE shlist || ($echo "Searching for .SH files..."; \
- $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
+ $echo *.SH | $tr ' ' $trnl | $egrep -v '\*' >.shlist)
# Now extract the dependencies on makedepend.SH and Makefile.SH
# (they should reside in the main Makefile):
+rm -f .shlist.old
mv .shlist .shlist.old
$egrep -v '^makedepend\.SH' <.shlist.old >.shlist
+rm -f .shlist.old
mv .shlist .shlist.old
$egrep -v '^Makefile\.SH' <.shlist.old >.shlist
+rm -f .shlist.old
mv .shlist .shlist.old
$egrep -v '^perl_exp\.SH' <.shlist.old >.shlist
+rm -f .shlist.old
mv .shlist .shlist.old
$egrep -v '^config_h\.SH' <.shlist.old >.shlist
rm .shlist.old
>>$mf.new
else
$MAKE hlist || ($echo "Searching for .h files..."; \
- $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist)
+ $echo *.h | $tr ' ' $trnl | $egrep -v '\*' >.hlist)
$echo "You don't seem to have a proper C preprocessor. Using grep instead."
$egrep '^#include ' `cat .clist` `cat .hlist` >.deptmp
$echo "Updating $mf..."
echo "File $2 not changed."
rm -f $1
else
+ rm -f $2
mv $1 $2
fi
# include <netinet/in.h>
#endif
+#ifdef I_ARPA_INET
+# include <arpa/inet.h>
+#endif
+
#if defined(SF_APPEND) && defined(USE_SFIO) && defined(I_SFIO)
/* <sfio.h> defines SF_APPEND and <sys/stat.h> might define SF_APPEND
* (the neo-BSD seem to do this). */
#define HAS_UTIME /**/
/* HAS_GROUP
- * This symbol, if defined, indicates that the getgrnam(),
- * getgrgid(), and getgrent() routines are available to
- * get group entries.
+ * This symbol, if defined, indicates that the getgrnam() and
+ * getgrgid() routines are available to get group entries.
+ * The getgrent() has a separate definition, HAS_GETGRENT.
*/
/*#define HAS_GROUP /**/
/* HAS_PASSWD
- * This symbol, if defined, indicates that the getpwnam(),
- * getpwuid(), and getpwent() routines are available to
- * get password entries.
+ * This symbol, if defined, indicates that the getpwnam() and
+ * getpwuid() routines are available to get password entries.
+ * The getpwent() has a separate definition, HAS_GETPWENT.
*/
/*#define HAS_PASSWD /**/
struct passwd *getpwnam _((char *));
struct passwd *getpwuid _((Uid_t));
# endif
+# ifdef HAS_GETPWENT
struct passwd *getpwent _((void));
+# endif
#endif
#ifdef HAS_GROUP
struct group *getgrnam _((char *));
struct group *getgrgid _((Gid_t));
# endif
+# ifdef HAS_GETGRENT
struct group *getgrent _((void));
+# endif
#endif
#ifdef I_UTIME
PP(pp_gpwent)
{
djSP;
-#ifdef HAS_PASSWD
+#if defined(HAS_PASSWD) && defined(HAS_GETPWENT)
I32 which = op->op_type;
register SV *sv;
struct passwd *pwent;
sv_setpv(sv, pwent->pw_name);
PUSHs(sv = sv_mortalcopy(&sv_no));
+#ifdef PWPASSWD
sv_setpv(sv, pwent->pw_passwd);
+#endif
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setiv(sv, (IV)pwent->pw_uid);
PP(pp_spwent)
{
djSP;
-#if defined(HAS_PASSWD) && !defined(CYGWIN32)
+#if defined(HAS_PASSWD) && defined(HAS_SETPWENT) && !defined(CYGWIN32)
setpwent();
RETPUSHYES;
#else
PP(pp_epwent)
{
djSP;
-#ifdef HAS_PASSWD
+#if defined(HAS_PASSWD) && defined(HAS_ENDPWENT)
endpwent();
RETPUSHYES;
#else
PP(pp_ggrent)
{
djSP;
-#ifdef HAS_GROUP
+#if defined(HAS_GROUP) && defined(HAS_GETGRENT)
I32 which = op->op_type;
register char **elem;
register SV *sv;
if (grent) {
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setpv(sv, grent->gr_name);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
+#ifdef GRPASSWD
sv_setpv(sv, grent->gr_passwd);
+#endif
+
PUSHs(sv = sv_mortalcopy(&sv_no));
sv_setiv(sv, (IV)grent->gr_gid);
+
PUSHs(sv = sv_mortalcopy(&sv_no));
for (elem = grent->gr_mem; elem && *elem; elem++) {
sv_catpv(sv, *elem);
PP(pp_sgrent)
{
djSP;
-#ifdef HAS_GROUP
+#if defined(HAS_GROUP) && defined(HAS_SETGRENT)
setgrent();
RETPUSHYES;
#else
PP(pp_egrent)
{
djSP;
-#ifdef HAS_GROUP
+#if defined(HAS_GROUP) && defined(HAS_ENDGRENT)
endgrent();
RETPUSHYES;
#else
#define HAS_UTIME / **/
/* HAS_GROUP
- * This symbol, if defined, indicates that the getgrnam(),
- * getgrgid(), and getgrent() routines are available to
- * get group entries.
+ * This symbol, if defined, indicates that the getgrnam() and
+ * getgrgid() routines are available to get group entries.
+ * The getgrent() has a separate definition, HAS_GETGRENT.
*/
#define HAS_GROUP / **/
/* HAS_PASSWD
- * This symbol, if defined, indicates that the getpwnam(),
- * getpwuid(), and getpwent() routines are available to
- * get password entries.
+ * This symbol, if defined, indicates that the getpwnam() and
+ * getpwuid() routines are available to get password entries.
+ * The getpwent() has a separate definition, HAS_GETPWENT.
*/
#define HAS_PASSWD / **/
$ perl_voidflags="15"
$ perl_d_eunice="undef"
$ perl_d_pwgecos="define"
+$ perl_d_pwpasswd="define"
+$ perl_d_setpwent="define"
+$ perl_d_getpwent="define"
+$ perl_d_endpwent="define"
+$ perl_d_grpasswd="undef"
+$ perl_d_setgrent="undef"
+$ perl_d_getgrent="undef"
+$ perl_d_endgrent="undef"
$ IF ("''Use_Threads'".eqs."T").and.("''VMS_VER'".LES."6.2")
$ THEN
$ perl_libs="SYS$SHARE:CMA$LIB_SHR.EXE/SHARE SYS$SHARE:CMA$RTL.EXE/SHARE SYS$SHARE:CMA$OPEN_LIB_SHR.exe/SHARE SYS$SHARE:CMA$OPEN_RTL.exe/SHARE"
$ ENDIF
$ WRITE_RESULT "i_niin is ''perl_i_niin'"
$!
+$! Check for <arpa/inet.h>
+$!
+$ if ("''Has_Dec_C_Sockets'".eqs."T").or.("''Has_Socketshr'".eqs."T")
+$ THEN
+$ OS
+$ WS "#ifdef __DECC
+$ WS "#include <stdlib.h>
+$ WS "#endif
+$ WS "#include <stdio.h>
+$ WS "#include <types.h>
+$ if ("''Has_Socketshr'".eqs."T")
+$ THEN
+$ WS "#include <socketshr.h>"
+$ else
+$ WS "#include <socket.h>
+$ endif
+$ WS "#include <arpa/inet.h>"
+$ WS "int main()
+$ WS "{"
+$ WS "exit(0);
+$ WS "}"
+$ CS
+$ DEFINE SYS$ERROR _NLA0:
+$ DEFINE SYS$OUTPUT _NLA0:
+$ on error then continue
+$ on warning then continue
+$ 'Checkcc' temp
+$ If (Needs_Opt.eqs."Yes")
+$ THEN
+$ link temp,temp/opt
+$ else
+$ link temp
+$ endif
+$ teststatus = f$extract(9,1,$status)
+$ DEASSIGN SYS$OUTPUT
+$ DEASSIGN SYS$ERROR
+$ if (teststatus.nes."1")
+$ THEN
+$ perl_i_arpa_inet="undef"
+$ ELSE
+$ perl_i_arpa_inet="define"
+$ ENDIF
+$ ELSE
+$ perl_i_arpa_inet="undef"
+$ ENDIF
+$ WRITE_RESULT "i_arpa_inet is ''perl_i_arpa_inet'"
+$!
$! Check for endhostent
$!
$ if ("''Has_Dec_C_Sockets'".eqs."T").or.("''Has_Socketshr'".eqs."T")
$ WC "d_getsent='" + perl_d_getsent + "'"
$ WC "d_select='" + perl_d_select + "'"
$ WC "i_niin='" + perl_i_niin + "'"
+$ WC "i_arpa_inet='" + perl_i_arpa_inet + "'"
$ WC "i_neterrno='" + perl_i_neterrno + "'"
$ WC "d_stdstdio='" + perl_d_stdstdio + "'"
$ WC "d_stdio_ptr_lval='" + perl_d_stdio_ptr_lval + "'"
$ WC "d_getprotoprotos='" + perl_d_getprotoprotos + "'"
$ WC "d_getservprotos='" + perl_d_getservprotos + "'"
$ WC "d_pwgecos='" + perl_d_pwgecos + "'"
+$ WC "d_pwpasswd='" + perl_d_pwpasswd + "'"
+$ WC "d_setpwent='" + perl_d_setpwent + "'"
+$ WC "d_getpwent='" + perl_d_getpwent + "'"
+$ WC "d_endpwent='" + perl_d_endpwent + "'"
+$ WC "d_grpasswd='" + perl_d_grpasswd + "'"
+$ WC "d_setgrent='" + perl_d_setgrent + "'"
+$ WC "d_getgrent='" + perl_d_getgrent + "'"
+$ WC "d_endgrent='" + perl_d_endgrent + "'"
$ WC "d_sched_yield='" + perl_d_sched_yield + "'"
$ WC "d_lchown='" + perl_d_lchown + "'"
$ WC "d_union_semun='" + perl_d_union_semun + "'"
#define HAS_UTIME /**/
/* HAS_GROUP
- * This symbol, if defined, indicates that the getgrnam(),
- * getgrgid(), and getgrent() routines are available to
- * get group entries.
+ * This symbol, if defined, indicates that the getgrnam() and
+ * getgrgid() routines are available to get group entries.
+ * The getgrent() has a separate definition, HAS_GETGRENT.
*/
#undef HAS_GROUP /**/
/* HAS_PASSWD
- * This symbol, if defined, indicates that the getpwnam(),
- * getpwuid(), and getpwent() routines are available to
- * get password entries.
+ * This symbol, if defined, indicates that the getpwnam() and
+ * getpwuid() routines are available to get password entries.
+ * The getpwent() has a separate definition, HAS_GETPWENT.
*/
#define HAS_PASSWD /**/
*/
#define HAS_WCTOMB /**/
+/* I_ARPA_INET:
+ * This symbol, if defined, indicates that <arpa/inet.h> exists and should
+ * be included.
+ */
+/#define I_ARPA_INET /**/
+
/* I_DBM:
* This symbol, if defined, indicates that <dbm.h> exists and should
* be included.
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
*/
-#define I_GRP /**/
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * contains gr_passwd.
+ */
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define I_GRP /**/
+/*#define GRPASSWD /**/
+/*#define HAS_SETGRENT /**/
+/*#define HAS_GETGRENT /**/
+/*#define HAS_ENDGRENT /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_gecos.
*/
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the getpwrent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the password database.
+ */
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
/*#define I_PWD /**/
/*#define PWQUOTA /**/
/*#define PWAGE /**/
/*#define PWEXPIRE /**/
/*#define PWCOMMENT /**/
/*#define PWGECOS /**/
+/*#define PWPASSWD /**/
+/*#define HAS_SETPWENT /**/
+/*#define HAS_GETPWENT /**/
+/*#define HAS_ENDPWENT /**/
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
*/
#define HAS_WCTOMB /**/
+/* I_ARPA_INET:
+ * This symbol, if defined, indicates that <arpa/inet.h> exists and should
+ * be included.
+ */
+/#define I_ARPA_INET /**/
+
/* I_DBM:
* This symbol, if defined, indicates that <dbm.h> exists and should
* be included.
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
*/
-#define I_GRP /**/
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * contains gr_passwd.
+ */
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define I_GRP /**/
+/*#define GRPASSWD /**/
+/*#define HAS_SETGRENT /**/
+/*#define HAS_GETGRENT /**/
+/*#define HAS_ENDGRENT /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_gecos.
*/
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the getpwrent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the password database.
+ */
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
/*#define I_PWD /**/
/*#define PWQUOTA /**/
/*#define PWAGE /**/
/*#define PWEXPIRE /**/
/*#define PWCOMMENT /**/
/*#define PWGECOS /**/
+/*#define PWPASSWD /**/
+/*#define HAS_SETPWENT /**/
+/*#define HAS_GETPWENT /**/
+/*#define HAS_ENDPWENT /**/
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
FIRSTMAKEFILE = $firstmakefile
+# how to tr(anslate) newlines
+
+TRNL = '$trnl'
+
.SUFFIXES: .c \$(OBJ_EXT)
!GROK!THIS!
$(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' $(plextract) -prog -verbose dcf -log ../compilelog;
a2p: $(obj) a2p$(OBJ_EXT)
- $(CC) $(LDFLAGS) $(obj) a2p$(OBJ_EXT) $(libs) -o a2p
+ $(CC) $(LDFLAGS) -o a2p $(obj) a2p$(OBJ_EXT) $(libs)
# I now supply a2p.c with the kits, so the following section is
# used only if you force byacc to run by saying
run_byacc: FORCE
@ echo Expect many shift/reduce and reduce/reduce conflicts
$(BYACC) a2p.y
+ rm -f a2p.c
mv y.tab.c a2p.c
# We don't want to regenerate a2p.c, but it might appear out-of-date
sh ../makedepend MAKE=$(MAKE)
clist:
- echo $(c) | tr ' ' '\012' >.clist
+ echo $(c) | tr ' ' $(TRNL) >.clist
hlist:
- echo $(h) | tr ' ' '\012' >.hlist
+ echo $(h) | tr ' ' $(TRNL) >.hlist
shlist:
- echo $(sh) | tr ' ' '\012' >.shlist
+ echo $(sh) | tr ' ' $(TRNL) >.shlist
# These should be automatically generated