Added support for building on Solaris with the Sun C compiler

This commit is contained in:
Mark Pizzolato 2013-03-17 16:50:57 -07:00
parent 97bbd34828
commit 0605b6dff4
7 changed files with 17 additions and 9 deletions

View file

@ -3069,7 +3069,6 @@ for ( ;; ) {
break;
} /* end case op */
} /* end for */
ABORT (STOP_UNKNOWN);
} /* end sim_instr */
/* Prefetch buffer routine

View file

@ -2,7 +2,7 @@
# This GNU make makefile has been tested on:
# Linux (x86 & Sparc & PPC)
# OS X
# Solaris (x86 & Sparc)
# Solaris (x86 & Sparc) (gcc and Sun C)
# OpenBSD
# NetBSD
# FreeBSD
@ -74,6 +74,14 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep 'clang'))
GCC_VERSION = $(shell $(GCC) -v /dev/null 2>&1 | grep 'gcc version' | awk '{ print $$3 }')
COMPILER_NAME = GCC Version: $(GCC_VERSION)
ifeq (,$(GCC_VERSION))
ifeq (SunOS,$(OSTYPE))
ifneq (,$(shell $(GCC) -V | grep 'Sun C'))
SUNC_VERSION = $(shell $(GCC) -V | grep 'Sun C' | awk '{ print $$4 }')
COMPILER_NAME = Sun C $(SUNC_VERSION)
endif
endif
endif
else
ifeq (Apple,$(shell $(GCC) -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 }'))
COMPILER_NAME = $(shell $(GCC) -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }')
@ -469,7 +477,9 @@ endif
ifeq (HP-UX,$(OSTYPE))
CC_STD = -std=gnu99
else
CC_STD = -std=c99
ifeq (,$(SUNC_VERSION))
CC_STD = -std=c99
endif
endif
CC_OUTSPEC = -o $@
CC = $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) $(CFLAGS_GIT) -I . $(OS_CCDEFS) $(ROMS_OPT)

View file

@ -1871,7 +1871,7 @@ _set_errno_from_status (GetLastError ());
return SCPE_IOERR;
}
#elif defined (__linux) || defined (__linux__) || defined (__sun__) || defined (__hpux)
#elif defined (__linux) || defined (__linux__) || defined (__sun) || defined (__sun__) || defined (__hpux)
#include <sys/types.h>
#include <sys/stat.h>

View file

@ -82,7 +82,7 @@
#define DONT_USE_READER_THREAD
#endif
#if (((defined(__sun__) && defined(__i386__)) || defined(__linux)) && !defined(DONT_USE_READER_THREAD))
#if ((((defined(__sun) || defined(__sun__)) && defined(__i386__)) || defined(__linux)) && !defined(DONT_USE_READER_THREAD))
#define USE_READER_THREAD 1
#endif

View file

@ -233,7 +233,8 @@ return fopen (file, mode);
/* 64b VMS */
#if ((defined (__ALPHA) || defined (__ia64)) && defined (VMS) && (__DECC_VER >= 60590001)) || (defined(__sun__) && defined(_LARGEFILE_SOURCE))
#if ((defined (__ALPHA) || defined (__ia64)) && defined (VMS) && (__DECC_VER >= 60590001)) || \
((defined(__sun) || defined(__sun__)) && defined(_LARGEFILE_SOURCE))
#define S_SIM_IO_FSEEK_EXT_ 1
int sim_fseeko (FILE *st, t_offset offset, int whence)
{

View file

@ -40,7 +40,7 @@
int32 sim_finit (void);
#if defined (__linux) || defined (__linux__) || defined (__hpux) || \
(defined (VMS) && (defined (__ALPHA) || defined (__ia64)) && (__DECC_VER >= 60590001)) || \
(defined(__sun__) && defined(_LARGEFILE_SOURCE)) || \
((defined(__sun) || defined(__sun__)) && defined(_LARGEFILE_SOURCE)) || \
defined (_WIN32) || defined (__APPLE__) || defined (__FreeBSD__)
typedef t_int64 t_offset;
#else

View file

@ -541,8 +541,6 @@ fprintf (st, " -E Must Exist (if not specified an attempt to create
fprintf (st, " virtual tape will be attempted).\n");
fprintf (st, " -F Open the indicated tape container in a specific format (default\n");
fprintf (st, " is SIMH, alternatives are E11, TPC and P7B)\n");
return SCPE_OK;
return SCPE_OK;
}