From af3461c774168b19333d970bb97a1591fef44e51 Mon Sep 17 00:00:00 2001 From: koennecke Date: Wed, 23 Jul 2008 12:15:06 +0000 Subject: [PATCH] Compiles and runs under Mac OS X VS: ---------------------------------------------------------------------- SKIPPED: psi/arrobj.c psi/pardef.c psi/polterwrite.c psi/tecs/tecs_cli.c --- SCinter.c | 1 + devexec.c | 2 +- macosx_def | 13 +++++++++++++ make_gen | 2 +- makefile_macosx | 42 ++++++++++++++++++++++++++++++++++++++++++ matrix/matcreat.c | 2 +- matrix/materr.c | 2 +- matrix/matinv.c | 2 +- matrix/matsolve.c | 2 +- network.c | 2 +- nxscript.c | 2 +- 11 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 macosx_def create mode 100644 makefile_macosx diff --git a/SCinter.c b/SCinter.c index 07f770fb..611fca13 100644 --- a/SCinter.c +++ b/SCinter.c @@ -60,6 +60,7 @@ #include #include #include +#include #include "fortify.h" #include "sics.h" #include "splitter.h" diff --git a/devexec.c b/devexec.c index 0a02f6ad..5fb75981 100644 --- a/devexec.c +++ b/devexec.c @@ -103,7 +103,7 @@ void DevexecLog(char *operation, char *device) { if(devLog != NULL){ gettimeofday(&tv,&tm); fprintf(devLog, "DEVEXEC:%s:%s:%ld:%ld\n",operation,device, - tv.tv_sec, tv.tv_usec); + (long)tv.tv_sec, (long)tv.tv_usec); fflush(devLog); } } diff --git a/macosx_def b/macosx_def new file mode 100644 index 00000000..0085c42a --- /dev/null +++ b/macosx_def @@ -0,0 +1,13 @@ +#-------------------------------------------------------------------------- +# general defines used within the PSI makefile hierarchy +# +# Mark Koennecke, July 2003 +#------------------------------------------------------------------------- + +#DFORTIFY= -DFORTIFY +#FORTIFYOBJ= fortify.o strdup.o +#DFORTIFY= -pg + +MFLAGS=-f makefile_linux$(DUMMY) + +HDFROOT=/Users/Shared diff --git a/make_gen b/make_gen index 52421db2..4d986c81 100644 --- a/make_gen +++ b/make_gen @@ -11,7 +11,7 @@ SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ sicsexit.o costa.o task.o $(FORTIFYOBJ) access.o\ macro.o ofac.o obpar.o obdes.o drive.o status.o intserv.o \ devexec.o mumo.o mumoconf.o selector.o selvar.o fupa.o lld.o \ - lld_blob.o strrepl.o lin2ang.o fomerge.o napi4.o napi5.o \ + lld_blob.o strrepl.o lin2ang.o fomerge.o napi5.o napi4.o\ script.o o2t.o alias.o napi.o nxdata.o stringdict.o sdynar.o \ histmem.o histdriv.o histsim.o interface.o callback.o nxio.o \ event.o emon.o evcontroller.o evdriver.o simev.o perfmon.o \ diff --git a/makefile_macosx b/makefile_macosx new file mode 100644 index 00000000..2dc98c99 --- /dev/null +++ b/makefile_macosx @@ -0,0 +1,42 @@ +#--------------------------------------------------------------------------- +# Makefile for SICS +# machine-dependent part for Mac OS X +# +# Mark Koennecke 1996-2001 +# Markus Zolliker, March 2003 +# Mark Koennecke, July 2008 +#========================================================================== +# assign if the National Instrument GPIB driver is available +SINQDIR=/Users/Shared +#NI= -DHAVENI +#NIOBJ= nigpib.o +#NILIB=$(SINQDIR)/sl5/lib/cib.o + +include macosx_def + +CC = gcc +CFLAGS = -I$(HDFROOT)/include -I/sw/include -DNXXML -DHDF5 -DHDF4 $(NI) -DMACOSX \ + -Ipsi/hardsup -I. \ + -Werror -DNONINTF -g $(DFORTIFY) \ + -Wall -Wno-unused -Wno-comment -Wno-switch + +BINTARGET = bin +EXTRA=nintf.o +SUBLIBS = psi/libpsi.a psi/hardsup/libhlib.a matrix/libmatrix.a \ + psi/tecs/libtecsl.a +LIBS = -L$(HDFROOT)/lib -L/sw/lib $(SUBLIBS) $(NILIB)\ + -ltcl $(HDFROOT)/lib/libhdf5.a -lmfhdf -ldf \ + $(HDFROOT)/lib/libsz.a \ + $(HDFROOT)/lib/libjson.a -ljpeg \ + -ldl -lz -lmxml $(HDFROOT)/lib/libghttp.a -lm -lc + +include make_gen + + + + + + + + + diff --git a/matrix/matcreat.c b/matrix/matcreat.c index 50812345..f2a539f7 100644 --- a/matrix/matcreat.c +++ b/matrix/matcreat.c @@ -20,7 +20,7 @@ #ifdef __TURBOC__ #include #else -#include +#include #endif #include "matrix.h" diff --git a/matrix/materr.c b/matrix/materr.c index 827b73ac..26bc3174 100644 --- a/matrix/materr.c +++ b/matrix/materr.c @@ -19,7 +19,7 @@ #ifdef __TURBOC__ #include #else -#include +#include #endif #include "matrix.h" diff --git a/matrix/matinv.c b/matrix/matinv.c index 645d3798..ca344186 100644 --- a/matrix/matinv.c +++ b/matrix/matinv.c @@ -20,7 +20,7 @@ #ifdef __TURBOC__ #include #else -#include +#include #endif #include "matrix.h" diff --git a/matrix/matsolve.c b/matrix/matsolve.c index 9a2f61e8..9972ff2a 100644 --- a/matrix/matsolve.c +++ b/matrix/matsolve.c @@ -20,7 +20,7 @@ #ifdef __TURBOC__ #include #else -#include +#include #endif #include "matrix.h" diff --git a/network.c b/network.c index 37825153..c8ae7ead 100644 --- a/network.c +++ b/network.c @@ -511,7 +511,7 @@ CreateSocketAdress( self->iType = 0; if (!disconnected) { /* do not write an error message on disconnect */ snprintf(buf, sizeof buf, "NETWrite: timeout, only %ld of %ld bytes sent (socket %d) %ld.%6.6ld", - lLen - l, lLen, self->sockid, tmo.tv_sec, tmo.tv_usec); + lLen - l, lLen, self->sockid, (long)tmo.tv_sec, (long)tmo.tv_usec); NetError(buf); } return 0; diff --git a/nxscript.c b/nxscript.c index f5b2a6aa..f7a50fcf 100644 --- a/nxscript.c +++ b/nxscript.c @@ -1065,7 +1065,7 @@ static int handlePut(SConnection *pCon, SicsInterp *pSics, pNXScript self, } if(strlen(defString) < 900){ strcat(defString," -dim {"); - sprintf(numBuf,"%d",strlen(buffer)+1); + sprintf(numBuf,"%ld",strlen(buffer)+1); strcat(defString,numBuf); strcat(defString," }"); } else {