Cleaned up VMS builds using various versions of the Dec/Compaq/HP C compilers

This commit is contained in:
Mark Pizzolato 2011-06-04 04:29:00 -07:00
parent 89a27e0816
commit 9e220f1138
4 changed files with 33 additions and 67 deletions

View file

@ -57,6 +57,13 @@
# #
# On AXP the AXP PCAP components are built and used to provide network # On AXP the AXP PCAP components are built and used to provide network
# support for the VAX and PDP11 simulators. # support for the VAX and PDP11 simulators.
#
# The AXP PCAP components can only be built using a version of the
# DEC/Compaq/HP Compiler version V6.5-001 or later. To build using an
# older compiler, networking support must be disabled. Use...
#
# MMK/MACRO=(NONETWORK=1)
#
# The PCAP-VMS components are presumed (by this procedure) to be located # The PCAP-VMS components are presumed (by this procedure) to be located
# in a directory at the same level as the directory containing the # in a directory at the same level as the directory containing the
# simh source files. For example, if these exist here: # simh source files. For example, if these exist here:
@ -156,14 +163,25 @@ BLD_DIR = SYS$DISK:[.BIN.VMS.LIB.BLD-$(ARCH)]
# Check To Make Sure We Have SYS$DISK:[.BIN] & SYS$DISK:[.LIB] Directory. # Check To Make Sure We Have SYS$DISK:[.BIN] & SYS$DISK:[.LIB] Directory.
# #
.FIRST .FIRST
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(F$GETSYI("VERSION").LES."V8.0").AND.("$(NOASYNCH)".EQS."")) THEN WRITE SYS$OUTPUT "*** WARNING **** Build should be invoked with /MACRO=NOASYNCH=1 on this platform" @ IF "".NES."''CC'" THEN DELETE/SYMBOL/GLOBAL CC
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(F$GETSYI("VERSION").LES."V8.0").AND.("$(NOASYNCH)".EQS."")) THEN EXIT %x10000000 @ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(F$GETSYI("VERSION").LTS."V8.0").AND.("$(NOASYNCH)".EQS."")) THEN WRITE SYS$OUTPUT "*** WARNING **** Build should be invoked with /MACRO=NOASYNCH=1 on this platform"
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(F$GETSYI("VERSION").LTS."V8.0").AND.("$(NOASYNCH)".EQS."")) THEN EXIT %x10000000
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN DEFINE/USER SYS$OUTPUT CC_VERSION.DAT
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN CC/VERSION
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN OPEN /READ VERSION CC_VERSION.DAT
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN READ VERSION CC_VERSION
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN CLOSE VERSION
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN DELETE CC_VERSION.DAT;
@ IF (F$GETSYI("ARCH_NAME").EQS."Alpha") THEN CC_VERSION = F$ELEMENT(2," ",CC_VERSION)
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(CC_VERSION.LTS."V6.5-001").AND.("$(NONETWORK)".EQS."")) THEN WRITE SYS$OUTPUT "*** WARNING **** C Compiler is: ''CC_VERSION'"
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(CC_VERSION.LTS."V6.5-001").AND.("$(NONETWORK)".EQS."").AND.(F$GETSYI("VERSION").GES."V8.0")) THEN WRITE SYS$OUTPUT "*** WARNING **** Build should be invoked with /MACRO=NONETWORK=1 with this compiler"
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(CC_VERSION.LTS."V6.5-001").AND.("$(NONETWORK)".EQS."").AND.(F$GETSYI("VERSION").LTS."V8.0")) THEN WRITE SYS$OUTPUT "*** WARNING **** Build should be invoked with /MACRO=(NONETWORK=1,NOASYNCH=1) with this compiler"
@ IF ((F$GETSYI("ARCH_NAME").EQS."Alpha").AND.(CC_VERSION.LTS."V6.5-001").AND.("$(NONETWORK)".EQS."")) THEN EXIT %x10000000
@ IF (F$SEARCH("SYS$DISK:[]BIN.DIR").EQS."") THEN CREATE/DIRECTORY $(BIN_DIR) @ IF (F$SEARCH("SYS$DISK:[]BIN.DIR").EQS."") THEN CREATE/DIRECTORY $(BIN_DIR)
@ IF (F$SEARCH("SYS$DISK:[.BIN]VMS.DIR").EQS."") THEN CREATE/DIRECTORY $(LIB_DIR) @ IF (F$SEARCH("SYS$DISK:[.BIN]VMS.DIR").EQS."") THEN CREATE/DIRECTORY $(LIB_DIR)
@ IF (F$SEARCH("SYS$DISK:[.BIN.VMS]LIB.DIR").EQS."") THEN CREATE/DIRECTORY $(LIB_DIR) @ IF (F$SEARCH("SYS$DISK:[.BIN.VMS]LIB.DIR").EQS."") THEN CREATE/DIRECTORY $(LIB_DIR)
@ IF (F$SEARCH("SYS$DISK:[.BIN.VMS.LIB]BLD-$(ARCH).DIR").EQS."") THEN CREATE/DIRECTORY $(BLD_DIR) @ IF (F$SEARCH("SYS$DISK:[.BIN.VMS.LIB]BLD-$(ARCH).DIR").EQS."") THEN CREATE/DIRECTORY $(BLD_DIR)
@ IF (F$SEARCH("$(BLD_DIR)*.*").NES."") THEN DELETE/NOLOG/NOCONFIRM $(BLD_DIR)*.*;* @ IF (F$SEARCH("$(BLD_DIR)*.*").NES."") THEN DELETE/NOLOG/NOCONFIRM $(BLD_DIR)*.*;*
@ IF "".NES."''CC'" THEN DELETE/SYMBOL/GLOBAL CC
# Core SIMH File Definitions. # Core SIMH File Definitions.
# #
@ -200,6 +218,9 @@ PCAP_VCI = SYS$COMMON:[SYS$LDR]PCAPVCM.EXE
# PCAP is not available on OpenVMS VAX or IA64 right now # PCAP is not available on OpenVMS VAX or IA64 right now
# #
.IFDEF MMSALPHA .IFDEF MMSALPHA
.IFDEF NONETWORK
# Network Capabilities disabled
.ELSE
PCAP_EXECLET = $(PCAP_VCI) PCAP_EXECLET = $(PCAP_VCI)
PCAP_INC = ,$(PCAP_DIR) PCAP_INC = ,$(PCAP_DIR)
PCAP_LIBD = $(PCAP_LIB) PCAP_LIBD = $(PCAP_LIB)
@ -207,6 +228,7 @@ PCAP_LIBR = ,$(PCAP_LIB)/LIB/SYSEXE
PCAP_DEFS = ,"USE_NETWORK=1" PCAP_DEFS = ,"USE_NETWORK=1"
PCAP_SIMH_INC = /INCL=($(PCAP_DIR)) PCAP_SIMH_INC = /INCL=($(PCAP_DIR))
.ENDIF .ENDIF
.ENDIF
# MITS Altair Simulator Definitions. # MITS Altair Simulator Definitions.
# #

2
scp.c
View file

@ -5172,7 +5172,7 @@ if (sim_deb && (dptr->dctrl & dbits)) {
#if defined (_WIN32) #if defined (_WIN32)
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#endif #endif
#if defined (__DECC) && defined (__VMS) && defined (__VAX) #if defined (__DECC) && defined (__VMS) && (defined (__VAX) || (__CRTL_VER <= 70311000))
#define NO_vsnprintf #define NO_vsnprintf
#endif #endif
#if defined( NO_vsnprintf) #if defined( NO_vsnprintf)

3
scp.h
View file

@ -122,6 +122,9 @@ t_stat sim_string_to_stat (char *cptr, t_stat *cond);
t_stat sim_cancel_step (void); t_stat sim_cancel_step (void);
void sim_debug_u16 (uint32 dbits, DEVICE* dptr, const char* const* bitdefs, void sim_debug_u16 (uint32 dbits, DEVICE* dptr, const char* const* bitdefs,
uint16 before, uint16 after, int terminate); uint16 before, uint16 after, int terminate);
#if defined (__DECC) && defined (__VMS) && (defined (__VAX) || (__DECC_VER < 60590001))
#define CANT_USE_MACRO_VA_ARGS 1
#endif
#ifdef CANT_USE_MACRO_VA_ARGS #ifdef CANT_USE_MACRO_VA_ARGS
#define _sim_debug sim_debug #define _sim_debug sim_debug
void sim_debug (uint32 dbits, DEVICE* dptr, const char* fmt, ...); void sim_debug (uint32 dbits, DEVICE* dptr, const char* fmt, ...);

View file

@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik. in this Software without prior written authorization from Robert M Supnik.
03-Jun-11 MP Simplified VMS 64b support and made more portable
02-Feb-11 MP Added sim_fsize_ex and sim_fsize_name_ex returning t_addr 02-Feb-11 MP Added sim_fsize_ex and sim_fsize_name_ex returning t_addr
Added export of sim_buf_copy_swapped and sim_buf_swap_data Added export of sim_buf_copy_swapped and sim_buf_swap_data
28-Jun-07 RMS Added VMS IA64 support (from Norm Lastovica) 28-Jun-07 RMS Added VMS IA64 support (from Norm Lastovica)
@ -227,77 +228,17 @@ return fopen (file, mode);
/* 64b VMS */ /* 64b VMS */
#if (defined (__ALPHA) || defined (__ia64)) && defined (VMS) /* 64b VMS */ #if (defined (__ALPHA) || defined (__ia64)) && defined (VMS) && (__DECC_VER >= 60590001)
#define _SIM_IO_FSEEK_EXT_ 1 #define _SIM_IO_FSEEK_EXT_ 1
static t_int64 fpos_t_to_int64 (fpos_t *pos)
{
unsigned short *w = (unsigned short *) pos; /* endian dep! */
t_int64 result;
result = w[1];
result <<= 16;
result += w[0];
result <<= 9;
result += w[2];
return result;
}
static void int64_to_fpos_t (t_int64 ipos, fpos_t *pos, size_t mbc)
{
unsigned short *w = (unsigned short *) pos;
int bufsize = mbc << 9;
w[3] = 0;
w[2] = (unsigned short) (ipos % bufsize);
ipos -= w[2];
ipos >>= 9;
w[0] = (unsigned short) ipos;
ipos >>= 16;
w[1] = (unsigned short) ipos;
if ((w[2] == 0) && (w[0] || w[1])) {
w[2] = bufsize;
w[0] -= mbc;
}
return;
}
int sim_fseek (FILE *st, t_addr offset, int whence) int sim_fseek (FILE *st, t_addr offset, int whence)
{ {
t_addr fileaddr; return fseeko (st, (off_t)offset, whence);
fpos_t filepos;
switch (whence) {
case SEEK_SET:
fileaddr = offset;
break;
case SEEK_END:
if (_fseeki64 (st, 0, SEEK_END))
return (-1);
case SEEK_CUR:
if (fgetpos (st, &filepos))
return (-1);
fileaddr = fpos_t_to_int64 (&filepos);
fileaddr = fileaddr + offset;
break;
default:
errno = EINVAL;
return (-1);
}
int64_to_fpos_t (fileaddr, &filepos, 127);
return fsetpos (st, &filepos);
} }
static t_addr _sim_ftell (FILE *st) static t_addr _sim_ftell (FILE *st)
{ {
fpos_t fileaddr; return (t_addr)(ftello (st));
if (fgetpos (st, &fileaddr))
return (-1);
return (t_addr)fpos_t_to_int64 (&fileaddr);
} }
#endif #endif