+$! Check for _LARGEFILE capability.
+$!
+$ off_t_size = 4
+$ OS
+$ WS "#define _LARGEFILE"
+$ WS "#include <stdio.h>"
+$ WS "int main()"
+$ WS "{"
+$ WS "printf(""%d\n"", sizeof(off_t));"
+$ WS "return(0);"
+$ WS "}"
+$ CS
+$ GOSUB link_ok
+$ IF link_status .EQ. good_link
+$ THEN
+$ GOSUB just_mcr_it
+$ off_t_size = tmp
+$ ENDIF
+$ echo "Your off_t size is ''off_t_size' bytes when _LARGEFILE is defined."
+$ IF off_t_size .ne. 8 .AND. (uselargefiles .OR. uselargefiles .eqs. "define")
+$ THEN
+$ echo4 "You configured with -Duselargefiles but your CRTL does not support _LARGEFILE."
+$ echo4 "I'm disabling large file support."
+$ uselargefiles = "undef"
+$ ENDIF
+$!
+$! Tests for hard link, symbolic links, and 7.3 + CRTL features
+$!
+$ d_lchown = "undef"
+$ d_link = "undef"
+$ d_lstat = "undef"
+$ d_readlink = "undef"
+$ d_symlink = "undef"
+$ d_realpath = "undef"
+$!
+$! Hard link support has been present since 7.3-1 except for the
+$! easy to use DCL test to see if hardlinks are enabled on the build
+$! disk. That would require more work to test, and I am only testing
+$! this on 8.2, so that is why the 8.2 test.
+$!
+$ IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$ THEN
+$ IF f$getdvi("SYS$DISK","HARDLINKS_SUPPORTED")
+$ THEN
+$ echo "I Found 64 bit OpenVMS 8.2 or later, and hard links enabled on build disk."
+$ echo "I will build with hard link support"
+$ d_link = "define"
+$ ELSE
+$ echo "I Found 64 bit OpenVMS 8.2 or later, and hard links disabled on build disk."
+$ echo "I will not build with hard link support."
+$ ENDIF
+$ ELSE
+$ echo4 "I can not detect if your CRTL and build disk support hard links."
+$ echo4 "I am disabling hard link support."
+$ ENDIF
+$!
+$ IF uselargefiles .OR. uselargefiles .eqs. "define"
+$ THEN
+$ echo4 "Largefile support enabled (plus standard stat support on V8.2 and later)"
+$ usestdstat = "y"
+$ IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$ THEN
+$ echo4 -
+ "Looking for the realpath() function to indicate symbolic link support..."
+$ OS
+$! WS "#include <stdlib.h>"
+$ WS "void exit(int foo);"
+$ WS "char *realpath(const char *file_name, char * resolved_name, ...);"
+$ WS "int main()"
+$ WS "{"
+$ WS "char result[255];"
+$ WS "realpath(""foo"",result);"
+$ WS "exit(0);"
+$ WS "}"
+$ CS
+$ GOSUB link_ok
+$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
+$ THEN
+$ echo -
+ "Found realpath() which indicates symbolic link support is present."
+$ d_lchown = "define"
+$ d_lstat = "define"
+$ d_readlink = "define"
+$ d_symlink = "define"
+$! d_realpath = "define" ! Perl will not put it in the config.h file?
+$! Perl apparently does not use a built in realpath() on other platforms,
+$! but there is a severe performance penatly on OpenVMS to use the Perl
+$! script that implements a realpath(). The d_symlink symbol is used
+$! as a replacement for the d_realpath since they are related and both
+$! were activated by the CRTL at the same time.
+$!
+$ ELSE
+$ echo4 "Your system does not support symbolic links."
+$ echo4 "I am disabling symbolic link support."
+$ ENDIF
+$ ELSE
+$ echo4 "Your system does not support symbolic links."
+$ echo4 "I am disabling symbolic link support."
+$ ENDIF
+$ ELSE
+$ IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$ THEN
+$ echo4 "-Duselargefiles is required for symbolic link support."
+$ echo4 "You did not specify that, so I am disabling symbolic link support."
+$ ENDIF
+$ ENDIF
+$!
+$!
+$! Check for grp.h -- should be 7.3 and later, but test to be sure
+$!
+$ tmp = "grp.h"
+$ GOSUB inhdr
+$ i_grp = tmp
+$!
+$! VMS V7.3-2 powered options
+$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
+$!
+$ d_getgrgid_r = "undef"
+$ getgrgid_r_proto = "0"
+$ d_getgrnam_r = "undef"
+$ getgrnam_r_proto = "0"
+$ d_getpgid = "undef"
+$ d_getpgrp = "undef"
+$! N.B. We already have home-grown thread-safe versions of
+$! getpwnam and getpwuid -- no need to use CRTL versions
+$ d_getpwnam_r = "undef"
+$ getpwnam_r_proto = "0"
+$ d_getpwuid_r = "undef"
+$ getpwuid_r_proto = "0"
+$ d_setgrent = "undef"
+$ d_ttyname_r = "undef"
+$ ttyname_r_proto = "0"
+$ d_snprintf = "undef"
+$ d_vsnprintf = "undef"
+$ if (vms_ver .GES. "7.3-2") .AND. (archname .NES. "VMS_VAX")
+$ then
+$ echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 routines"
+$ d_getgrgid_r = "define"
+$ getgrgid_r_proto = "1"
+$ d_getgrnam_r = "define"
+$ getgrnam_r_proto = "1"
+$ if d_symlink .or. d_symlink .EQS. "define"
+$ then
+$! FIXME: Need to find how to activate this.
+$! d_getpgid = "define"
+$! d_getpgrp = "define"
+$ endif
+$ d_setgrent = "define"
+$ d_ttyname_r = "define"
+$ ttyname_r_proto = "1"
+$ d_snprintf = "define"
+$ d_vsnprintf = "define"
+$ endif
+$!
+$! VMS V7.3-2 powered options
+$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
+$! Only implementing right now on 8.2 because that is what I am testing
+$! These functions may require POSIX UIDs/GIDs to be active, so I am
+$! not activating the features at this time, just preparing this file
+$! to easily use them in the future.
+$!
+$ d_seteuid = "undef"
+$ d_setpgid = "undef"
+$ d_setpgrp = "undef"
+$ d_setregid = "undef"
+$ d_setreuid = "undef"
+$ d_setsid = "undef"
+$ ! Disable this section for now.
+$!$ if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$ if .NOT. 1
+$ then
+$ echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 UID setting routines"
+$ d_seteuid = "define"
+$ d_setpgid = "define"
+$ d_setpgrp = "define"
+$ d_setregid = "define"
+$ d_setreuid = "define"
+$ d_setsid = "define"
+$ endif
+$!
+$! VMS V8 powered options
+$! We know that it is only available for 8.2 and later on 64 bit platforms.
+$!
+$ d_fstatvfs = "undef"
+$! d_statvfs = "undef"
+$ i_sysstatvfs = "undef"
+$ if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$ then
+$ echo "Found 64 bit OpenVMS ''vms_ver' -- will build with 8.2 routines"
+$ d_fstatvfs = "define"
+$! d_statvfs = "define"
+$ i_sysstatvfs = "define"
+$ endif
+$!