diff -uNr dis45.ORIG/2.04/Imakefile dis45/2.04/Imakefile --- dis45.ORIG/2.04/Imakefile 1999-05-13 07:29:15.000000000 +0900 +++ dis45/2.04/Imakefile 2005-11-24 13:32:31.000000000 +0900 @@ -27,6 +27,10 @@ OBJ = $(OBJ1) $(OBJ2) $(OBJ3) +ifeq ($(shell uname -s),Darwin) +OBJ += darwinadd.o myfnum.o +endif + /* Libraries */ SYS_LIBRARIES = $(CERN_LNK) $(COM_CLI_LNK) $(SYS_LIB) diff -uNr dis45.ORIG/2.04/Imakefile.def dis45/2.04/Imakefile.def --- dis45.ORIG/2.04/Imakefile.def 2005-11-14 23:30:18.000000000 +0900 +++ dis45/2.04/Imakefile.def 2005-11-25 18:22:03.000000000 +0900 @@ -14,19 +14,32 @@ ADSOFT = /adsoft /* COM + CLI [+ readline] link option */ +#if 0 COM_CLI_LNK = \ -L${ADSOFT}/com_cli/2.04/${EXT} -lCOM -lCLI /adsoft/readline/5.0/${EXT}/libreadline.a -ltermcap +#else +COM_CLI_LNK = \ +-L../../com_cli/2.04/com -lCOM -L../../com_cli/2.04/cli -lCLI -L/usr/local/lib -lreadline -ltermcap +#endif /* CERN libraries link option */ +#if 0 CERN_DIR = ${ADSOFT}/cern/v2002/${EXT} CERN_LNK = \ -L${CERN_DIR} -lgraflib -lgrafX11 -lpacklib -lkernlib -lmathlib ${XLIB} +#else +CERN_DIR = /cern/pro +CERN_LNK = \ +-L${CERN_DIR}/lib -lgraflib -lgrafX11 -lpacklib -lpacklib -lmathlib ${XLIB} +#endif /* select CORRECT hpl.inc according to the cernlib version */ HPL_INC = hpl-v98.inc /* hpl-v94a.inc hpl-v98.inc */ /* comment out for other versions of cernlib */ +#if 0 #define CERNLIB_v98_FIX_OBJ hpltab.o igcell.o /* fixed code */ #define CERNLIB_SHARED_HBOOK_OBJ hcreatem.o hlimap.o hmapm.o hmmap.o locf.o /* shared hbook with mmap() */ +#endif /* path to install binaries */ INSTALL_DIR = ${TOP}/${EXT} @@ -119,9 +132,15 @@ #define HPK_Fortran_Source_Files hpkdummy.f #define HROPEN_INC hropen-ok.inc CC = gcc +ifeq ($(shell which gfortran | grep -vc 'no gfortran'),1) +FC = gfortran +FFLAGS = -g -fno-second-underscore -I. +SYS_LIB = -flat_namespace +else FC = g77 FFLAGS = -g -fno-second-underscore -fno-f2c SYS_LIB = -flat_namespace -lcc_dynamic -ldl +endif INSTALLFLAGS = -c #endif diff -uNr dis45.ORIG/2.04/darwinadd.c dis45/2.04/darwinadd.c --- dis45.ORIG/2.04/darwinadd.c 2005-11-25 18:30:00.000000000 +0900 +++ dis45/2.04/darwinadd.c 2005-11-25 18:27:24.000000000 +0900 @@ -0,0 +1,18 @@ +#include +#include + +extern int myfnum_(int *lun); + +void flush_(int *lun) +{ + int fd = myfnum_(lun); + FILE *file = fdopen(fd, "a+"); + fflush(file); +} + +void fseek_(int *lun, int *off, int *whence) +{ + int fd = myfnum_(lun); + FILE *file = fdopen(fd, "a+"); + fseek(file, (long)*off, *whence); +} diff -uNr dis45.ORIG/2.04/myfnum.F dis45/2.04/myfnum.F --- dis45.ORIG/2.04/myfnum.F 2005-11-25 18:30:08.000000000 +0900 +++ dis45/2.04/myfnum.F 2005-11-24 13:32:31.000000000 +0900 @@ -0,0 +1,4 @@ + integer function myfnum(lun) + myfnum = fnum(lun) + return + end diff -uNr dis45.ORIG/2.04/src/dis45hutil.f dis45/2.04/src/dis45hutil.f --- dis45.ORIG/2.04/src/dis45hutil.f 2005-11-14 23:30:52.000000000 +0900 +++ dis45/2.04/src/dis45hutil.f 2005-11-24 13:32:31.000000000 +0900 @@ -217,11 +217,11 @@ Integer KBITS, IQ Parameter( KBITS = 1, IQ = 18 ) Integer MASK_ERRO, MASK_PERR, MASK_BARX, MASK_NEQB, MASK_PFUN - Parameter( MASK_ERRO = '00000400'X ) ! error - Parameter( MASK_PERR = '40000000'X ) ! print error - Parameter( MASK_BARX = '00000100'X ) ! BARX (has PAKE error) - Parameter( MASK_NEQB = '00000020'X ) ! NEQB (non-equidistant bins) - Parameter( MASK_PFUN = '00000800'X ) ! plot function + Parameter( MASK_ERRO = x'00000400' ) ! error + Parameter( MASK_PERR = x'40000000' ) ! print error + Parameter( MASK_BARX = x'00000100' ) ! BARX (has PAKE error) + Parameter( MASK_NEQB = x'00000020' ) ! NEQB (non-equidistant bins) + Parameter( MASK_PFUN = x'00000800' ) ! plot function C input Integer id Character * (*) opt @@ -272,11 +272,11 @@ Integer KBITS, IQ Parameter( KBITS = 1, IQ = 18 ) Integer MASK_ERRO, MASK_PERR, MASK_BARX, MASK_NEQB, MASK_PFUN - Parameter( MASK_ERRO = '00000400'X ) ! error - Parameter( MASK_PERR = '40000000'X ) ! print error - Parameter( MASK_BARX = '00000100'X ) ! BARX (has PAKE error) - Parameter( MASK_NEQB = '00000020'X ) ! NEQB (non-equidistant bins) - Parameter( MASK_PFUN = '00000800'X ) ! plot function + Parameter( MASK_ERRO = x'00000400' ) ! error + Parameter( MASK_PERR = x'40000000' ) ! print error + Parameter( MASK_BARX = x'00000100' ) ! BARX (has PAKE error) + Parameter( MASK_NEQB = x'00000020' ) ! NEQB (non-equidistant bins) + Parameter( MASK_PFUN = x'00000800' ) ! plot function C input Integer id Character * (*) opt diff -uNr dis45.ORIG/2.04/std/hlpackfun.f dis45/2.04/std/hlpackfun.f --- dis45.ORIG/2.04/std/hlpackfun.f 2005-11-14 01:08:29.000000000 +0900 +++ dis45/2.04/std/hlpackfun.f 2005-11-24 13:32:31.000000000 +0900 @@ -347,7 +347,7 @@ C Call Txtrd('Output file name', minfile) Call DIS45_GETLUN(lunout) - Open (Unit=lunout,name=minfile,Status='NEW',Err=999) + Open (Unit=lunout,File=minfile,Status='NEW',Err=999) c Write(lunout,'(A)') title DO i=1,numparam