$ ! more redundant scrubbing of values
$ prefix = prefix - "000000."
$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
-$ src = prefix
+$ src = prefix - "_ROOT."
$!: determine root of directory hierarchy where package will be installed.
$ dflt = prefix
$ IF .NOT.silent
$ GOSUB inlibc
$ d_setvbuf = tmp
$!
-$! see if sfio.h is available
-$! see if sfio library is available
-$! Ok, but do we want to use it.
-$! IF F$TYPE(usesfio) .EQS. "" THEN usesfio = "undef"
-$! IF val .EQS. "define"
-$! THEN
-$! IF usesfio .EQS. "define"
-$! THEN dflt = "y"
-$! ELSE dflt = "n"
-$! ENDIF
-$! echo "''package' can use the sfio library, but it is experimental."
-$! rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
-$! GOSUB myread
-$! IF ans .EQS. "" THEN ans = dflt
-$! IF ans
-$! THEN
-$! echo "Ok, turning on sfio then."
-$! val="define"
-$! ELSE
-$! echo "Ok, avoiding sfio this time. I'll use stdio instead."
-$! val="undef"
-$! ENDIF
-$! ELSE
-$! IF usesfio .EQS. "define"
-$! THEN
-$! echo4 "Sorry, cannot find sfio on this machine."
-$! echo4 "Ignoring your setting of usesfio=''usesfio'."
-$! val="undef"
-$! ENDIF
-$! ENDIF
-$!
-$!
$! Check for the shm* routines.
$!
$ OS
$ i_niin="undef"
$ ENDIF
$!
+$! Check for <arpa/inet.h>
+$!
+$ IF Has_Dec_C_Sockets
+$ THEN
+$ tmp = "arpa/inet.h"
+$ GOSUB inhdr
+$ i_arpainet = tmp
+$ ELSE
+$ i_arpainet="undef"
+$ ENDIF
+$!
+$! Check for <sys/un.h>
+$!
+$ IF Has_Dec_C_Sockets
+$ THEN
+$ tmp = "sys/un.h"
+$ GOSUB inhdr
+$ i_sysun = tmp
+$ ELSE
+$ i_sysun="undef"
+$ ENDIF
+$!
+$!
$! Check for <netinet/tcp.h>
$!
$ IF Has_Dec_C_Sockets
$!
$! Check rand48 and its ilk
$!
-$ echo4 "Looking for a random number function..."
-$ OS
-$ WS "#if defined(__DECC) || defined(__DECCXX)"
-$ WS "#include <stdlib.h>"
-$ WS "#endif"
-$ WS "#include <stdio.h>"
-$ WS "int main()"
-$ WS "{"
-$ WS "srand48(12L);"
-$ WS "exit(0);"
-$ WS "}"
-$ CS
-$ GOSUB link_ok
-$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
-$ THEN
-$ drand01 = "drand48()"
-$ randbits = "48"
-$ randfunc = "drand48"
-$ randseedtype = "long int"
-$ seedfunc = "srand48"
-$ echo4 "Good, found drand48()."
-$ d_drand48proto = "define"
-$ ELSE
-$ d_drand48proto = "undef"
-$ drand01="random()"
-$ randbits = "31"
-$ randfunc = "random"
-$ randseedtype = "unsigned"
-$ seedfunc = "srandom"
-$ OS
-$ WS "#if defined(__DECC) || defined(__DECCXX)"
-$ WS "#include <stdlib.h>"
-$ WS "#endif"
-$ WS "#include <stdio.h>"
-$ WS "int main()"
-$ WS "{"
-$ WS "srandom(12);"
-$ WS "exit(0);"
-$ WS "}"
-$ CS
-$ GOSUB link_ok
-$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
-$ THEN
-$ echo4 "OK, found random()."
-$ ELSE
-$ drand01="(((float)rand())*MY_INV_RAND_MAX)"
-$ randfunc = "rand"
-$ randseedtype = "unsigned"
-$ seedfunc = "srand"
-$ echo4 "Yick, looks like I have to use rand()."
-$ ENDIF
-$ ENDIF
+$ echo4 "Using our internal random number implementation..."
+$!
+$ randfunc = "Perl_drand48"
+$ drand01 = "Perl_drand48()"
+$ seedfunc = "Perl_drand48_init"
+$ randbits = "48"
+$ randseedtype = "U32"
+$ d_drand48proto = "define"
+$!
$! Done with compiler checks. Clean up.
$ IF F$SEARCH("try.c") .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
$ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
$ WC "d_futimes='undef'"
$ WC "d_gdbmndbm_h_uses_prototypes='undef'"
$ WC "d_gdbm_ndbm_h_uses_prototypes='undef'"
-$ WC "d_getaddrinfo='undef'"
+$ IF vms_ver .GES. "7.3"
+$ THEN
+$ WC "d_getaddrinfo='define'"
+$ ELSE
+$ WC "d_getaddrinfo='undef'"
+$ ENDIF
$ WC "d_getcwd='define'"
$ WC "d_getespwnam='undef'"
$ WC "d_getfsstat='undef'"
$ WC "d_getlogin='define'"
$ WC "d_getmnt='undef'"
$ WC "d_getmntent='undef'"
-$ WC "d_getnameinfo='undef'"
+$ IF vms_ver .GES. "7.3"
+$ THEN
+$ WC "d_getnameinfo='define'"
+$ ELSE
+$ WC "d_getnameinfo='undef'"
+$ ENDIF
$ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
$ WC "d_getnbyname='" + d_getnbyname + "'"
$ WC "d_getnent='" + d_getnent + "'"
$ WC "d_ilogbl='undef'"
$ WC "d_inc_version_list='undef'"
$ WC "d_index='" + d_index + "'"
-$ WC "d_inetaton='undef'"
-$ WC "d_inetntop='undef'"
-$ WC "d_inetpton='undef'"
+$ WC "d_inetaton='define'"
+$ WC "d_inetntop='define'"
+$ WC "d_inetpton='define'"
$ WC "d_int64_t='" + d_int64_t + "'"
$ WC "d_ip_mreq='define'"
$ WC "d_ip_mreq_source='undef'"
$ WC "d_setsent='" + d_setsent + "'"
$ WC "d_setsid='" + d_setsid + "'"
$ WC "d_setvbuf='" + d_setvbuf + "'"
-$ WC "d_sfio='undef'"
$ WC "d_shm='" + d_shm + "'"
$ WC "d_shmat='" + d_shmat + "'"
$ WC "d_shmatprototype='" + d_shmatprototype + "'"
$ WC "i64type='" + i64type + "'"
$ WC "i8size='" + i8size + "'"
$ WC "i8type='" + i8type + "'"
-$ WC "i_arpainet='undef'"
+$ WC "i_arpainet='" + i_arpainet + "'"
$ WC "i_assert='define'"
$ WC "i_bsdioctl='undef'"
$ WC "i_crypt='undef'"
$ WC "i_pthread='define'"
$ WC "i_pwd='undef'"
$ WC "i_rpcsvcdbm='undef'"
-$ WC "i_sfio='undef'"
$ WC "i_sgtty='undef'"
$ WC "i_shadow='" + i_shadow + "'"
$ WC "i_socks='" + i_socks + "'"
$ WC "i_systimes='undef'"
$ WC "i_systypes='define'"
$ WC "i_sysuio='" + i_sysuio + "'"
-$ WC "i_sysun='undef'"
+$ WC "i_sysun='" + i_sysun + "'"
$ WC "i_sysutsname='" + i_sysutsname + "'"
$ WC "i_sysvfs='undef'"
$ WC "i_syswait='undef'"
$ WC "stdio_stream_array=' " + "'"
$ WC "subversion='" + subversion + "'"
$ WC "targetarch='" + "'"
+$ WC "targetsh='MCR'"
$ WC "timetype='" + timetype + "'"
$ WC "u16size='" + u16size + "'"
$ WC "u16type='" + u16type + "'"
$ ELSE
$ DEBUG_REPLACE = "USEVMSDEBUG="
$ ENDIF
+$ PREFIX_REPLACE = "PREFIX=PREFIX=''prefix'"
$!
$! In order not to stress the tiny command buffer on pre-7.3-2 systems,
$! we put the following substitutions in a file and pass the file to
$ WC "''LARGEFILE_REPLACE'"
$ WC "ARCHNAME=ARCHNAME=''archname'"
$ WC "''DEBUG_REPLACE'"
+$ WC "''PREFIX_REPLACE'"
$ close CONFIG
$!
$ echo4 "Extracting ''defmakefile' (with variable substitutions)"
$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
$ ENDIF
$ WRITE CONFIG "$!"
-$! HP hack to make distributing binaries easier
-$!----------------------------------------------
-$ pcsi_producer = f$trnlnm("PCSI_PRODUCER")
-$ if pcsi_producer .eqs. ""
-$ then
-$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
-$ else
-$ WRITE CONFIG "$ myproc = f$environment(""PROCEDURE"")"
-$ WRITE CONFIG "$ myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
-$ WRITE CONFIG "$ myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
-$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
-$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
-$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""]["" - ""><"""
-$ WRITE CONFIG "$ myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
-$ WRITE CONFIG "$ if f$trnlnm(""HP_BUILD_PERL_BIN_KIT"",""LNM$PROCESS_TABLE"") .EQS. """""
-$ WRITE CONFIG "$ then"
-$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' 'myroot_dev'['myroot_dir'.]"
-$ WRITE CONFIG "$ endif"
-$ endif
+$ WRITE CONFIG "$ if P1 .EQS. """""
+$ WRITE CONFIG "$ then"
+$ WRITE CONFIG "$ myproc = f$environment(""PROCEDURE"")"
+$ WRITE CONFIG "$ myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
+$ WRITE CONFIG "$ myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
+$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
+$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
+$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""]["" - ""><"""
+$ WRITE CONFIG "$ myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
+$ WRITE CONFIG "$ root_spec = myroot_dev + ""["" + myroot_dir + "".]"""
+$ WRITE CONFIG "$ else"
+$ WRITE CONFIG "$ root_spec = P1"
+$ WRITE CONFIG "$ endif"
+$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' 'root_spec'"
$ WRITE CONFIG "$ ext = "".exe"""
$ IF sharedperl
$ THEN