diff -Naur src/Imakefile src.new/Imakefile --- src/Imakefile 2005-10-31 14:28:10.000000000 -0600 +++ src.new/Imakefile 2005-10-31 15:02:12.000000000 -0600 @@ -7,8 +7,12 @@ SUBDIRS= $(LIBDIRS) patchy cfortran #ifdef CERNLIB_UNIX +#ifdef CERNLIB_MACOSX +SUBDIRS:= $(SUBDIRS) scripts +#else SUBDIRS:= $(SUBDIRS) scripts mgr #endif +#endif InstallLibSubdirs($(LIBDIRS)) diff -Naur src/config/Imake.cf src.new/config/Imake.cf --- src/config/Imake.cf 2005-10-31 14:25:55.000000000 -0600 +++ src.new/config/Imake.cf 2005-10-31 15:02:12.000000000 -0600 @@ -217,6 +217,13 @@ #define MacIIArchitecture #endif /* macII */ +#ifdef __APPLE__ +# define MacroIncludeFile +# define MacroFile MacOSX.cf +# define MacOSXArchitecture +# define DarwinArchitecture +#endif + #ifdef _CRAY #define MacroIncludeFile #define MacroFile cray.cf diff -Naur src/config/Imake.rules src.new/config/Imake.rules --- src/config/Imake.rules 2005-10-31 14:25:55.000000000 -0600 +++ src.new/config/Imake.rules 2005-10-31 15:02:12.000000000 -0600 @@ -2171,7 +2171,7 @@ #define CppScriptTarget(dst,src,defs,deplist) @@\ dst:: src deplist @@\ RemoveFile($@) @@\ - $(CPP) defs $@ @@\ + $(CPP) defs src | CppSedMagic >$@ @@\ chmod a+x $@ @@\ @@\ clean:: @@\ @@ -2203,7 +2203,7 @@ #define CppFileTarget(dst,src,defs,deplist) @@\ dst:: src deplist @@\ RemoveFile($@) @@\ - $(CPP) defs $@ @@\ + $(CPP) defs src | CppSedMagic >$@ @@\ @@\ clean:: @@\ RemoveFiles(dst) diff -Naur src/config/MacOSX.cf src.new/config/MacOSX.cf --- src/config/MacOSX.cf 1969-12-31 18:00:00.000000000 -0600 +++ src.new/config/MacOSX.cf 2005-10-31 15:02:12.000000000 -0600 @@ -0,0 +1,159 @@ +XCOMM platform: $SFO: MOSXS.cf,v 1.0 95/11/19 23:21:00 sl Exp $ + +#define OSVendor Apple Computer, Inc. +#ifdef MacOSXArchitecture +#define OSName MacOSX +#define OSMajorVersion DefaultOSMajorVersion +#define OSMinorVersion DefaultOSMinorVersion +#define OSTeenyVersion 0 +#endif + +XCOMM #define ProjectRulesFile +XCOMM #define ProjectTmplFile + +#define InstKmemFlags -m 2755 -g kmem +/* #define ConstructMFLAGS NO */ + +#define HasNdbm YES +#define SetTtyGroup YES +#define HasBsearch YES +#ifdef MacOSXArchitecture +#define HasPutenv YES +#define MathLibrary /**/ +#define DBMLibrary /**/ +#define TermcapLibrary /**/ +#define HasBSD44Sockets YES +#define HAS_SNPRINTF YES +#endif + +#define NeedConstPrototypes YES +#define NeedVarargsPrototypes YES +#define NeedFunctionPrototypes YES +#define NeedWidePrototypes NO + +#define GzipFontCompression YES +#define CompressAllFonts YES + +#ifndef HasShm +# define HasShm YES +#endif +#ifndef BuildGlxExt +# define BuildGlxExt YES +# define GlxUseNSGL YES +#endif +#define BuildServer YES +#define BuildXprint NO +#define BuildFonts YES +#define BuildDPMS NO + +#define TenonServer YES +#define XprtServer NO +#define XVendorString "Tenon Intersystems Xtools" +#define XVendorRelease 1000 +#ifndef UseRgbTxt +#define UseRgbTxt YES +#endif + +#define BuildPexExt NO + +#ifndef BuildGLXLibrary +# define BuildGLXLibrary YES +#endif + +/* no direct graphics extension */ +#define BuildXF86DGA NO + +/* no extra tablets and weird input devices */ +#define BuildXInputExt NO + +/* Build Xinerama (aka panoramiX) extension */ +#define BuildXinerama YES + +/* no Display Power Management extension */ +#define BuildDPMSExt NO + +# define BuildXvExt NO +#define OptimizedCDebugFlags -O -fPIC -pipe +#define ExtraLoadFlags -L/usr/X11R6/lib -L@PREFIX@/lib -L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A + +#define BuildExamples YES + +#define StandardDefines -DCERNLIB_LINUX -DCERNLIB_PPC -DCERNLIB_MACOSX \ + -Dunix=unix -D__powerpc__ -D__DARWIN__ +/* -DX_NOT_POSIX -DX_LOCALE */ + +#define HasVoidSignalReturn YES + +#ifndef DependFlags +#define DependFlags -I/usr/include/ansi -I/usr/include/bsd -I@PREFIX@/include +#endif + +#define StandardIncludes -I@PREFIX@/include + +#define InstallCmd install /* unlink old */ + +/* #define ArCmd libtool -a -o */ +#define ArCmd ar -r + +#ifndef RanlibCmd +#define RanlibCmd ranlib -c -s +#endif + +/* see below for ServerDefines */ + +#define PrimaryScreenResolution 95 /* for 17 inch screen */ + +#define ServerCDebugFlags -O -g -pipe + +#undef CcCmd +#undef CplusplusCmd +#ifdef MacOSXArchitecture +#define CcCmd cc -arch "ppc" -no-cpp-precomp -ftree-vectorize +#define CplusplusCmd c++ -no-cpp-precomp -ftree-vectorize +#endif +#ifndef CcCmd +#define CcCmd cc +#endif + +#define CppCmd cpp + +#include +#include +#undef XFree86Server +/* #define GLX_DIRECT_RENDERING */ + +#define f2cFortran YES +#define MakeCmd make +#define FortranCmd g77 +#define XargsCmd xargs +#define FortranSaveFlags /* */ /* Everything static !? */ +#define OptimisedFortranFlags -O -funroll-loops -fomit-frame-pointer +#define DefaultFCOptions -fno-second-underscore -fno-automatic \ + -fno-f90 -fugly-complex -fno-globals \ + -fugly-init -Wno-globals +#define CernlibSystem -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX \ + -DCERNLIB_PPC -DCERNLIB_QMGLIBC \ + -DCERNLIB_MACOSX + +#undef CERNLIB_SHIFT + +#define CERNLIB_LINUX +#define CERNLIB_UNIX +#define CERNLIB_LNX +#define CERNLIB_PPC +#define CERNLIB_QMGLIBC +#define CERNLIB_MACOSX + +#define X11Includes -I/usr/X11R6/include + +/* + * Create a Make Variable to allow building with/out Motif + */ +#undef MotifDependantMakeVar +#define MotifDependantMakeVar(variable,value) @@\ +ifneq ($(strip $(HAVE_MOTIF)),) @@\ + variable=value @@\ +endif @@\ +/* End CERNLIB changes */ + + diff -Naur src/config/MacOSX.rules src.new/config/MacOSX.rules --- src/config/MacOSX.rules 1969-12-31 18:00:00.000000000 -0600 +++ src.new/config/MacOSX.rules 2005-10-31 15:02:12.000000000 -0600 @@ -0,0 +1,117 @@ +XCOMM $XConsortium: MOSXS.rules,v 1.1 97/12/12 15:34:45 sl Exp $ + +/* + * MacOSX shared library rules + */ + +#define HasSharedLibraries YES + +#define ForceNormalLib NO + +#ifndef SharedDataSeparation +#define SharedDataSeparation YES +#endif +#ifndef SharedCodeDef +#define SharedCodeDef +#endif +#ifndef SharedLibraryDef +#define SharedLibraryDef -fno-common +#endif + +#define ShLibIncludeFile + +#ifndef SharedLibraryLoadFlags +#define SharedLibraryLoadFlags +#endif +#ifndef PositionIndependentCFlags +#define PositionIndependentCFlags +#endif + + + + +/* + * InstallSharedLibrary - generate rules to install the shared library. + */ +#ifndef InstallSharedLibrary +#define InstallSharedLibrary(libname,rev,dest) @@\ +install:: Concat(lib,libname.dylib) @@\ + MakeDir($(DESTDIR)dest) @@\ + $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) Concat(lib,libname.dylib) $(DESTDIR)dest +@@\ + +#endif /* InstallSharedLibrary */ + +/* + * NormalSharedLibraryTarget - generate rules to create a shared library; + * build it into a different name so that the we do not hose people by having + * the library gone for long periods. + */ +#ifndef SharedLibraryTarget +#define SharedLibraryTarget(libname,rev,solist,down,up) @@\ +AllTarget(Concat(lib,libname.dylib)) @@\ + @@\ +Concat(lib,libname.dylib): solist $(EXTRALIBRARYDEPS) @@\ + $(RM) $@~ @@\ + (cd down; $(CC) -I/usr/X11R6/lib -dynamiclib -undefined suppress -install_name /usr/X11R6/lib/$@ -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\ + $(MV) $@~ $@ @@\ + LinkBuildLibrary($@) @@\ + @@\ +clean:: @@\ + $(RM) Concat(lib,libname.dylib) + +#endif /* SharedLibraryTarget */ + +/* + * SharedDepLibraryTarget - generate rules to create a shared library. + */ +#ifndef SharedDepLibraryTarget +#define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up) @@\ +AllTarget(Concat(lib,libname.dylib)) @@\ + @@\ +Concat(lib,libname.dylib): deplist $(EXTRALIBRARYDEPS) @@\ + $(RM) $@~ @@\ + (cd down; $(CC) -I/usr/X11R6/lib -dynamiclib -undefined suppress -install_name /usr/X11R6/lib/$@ -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\ + $(RM) $@ @@\ + $(MV) $@~ $@ @@\ + LinkBuildLibrary($@) @@\ + @@\ +clean:: @@\ + $(RM) Concat(lib,libname.dylib) + +#endif /* SharedDepLibraryTarget */ + +/* + * SharedLibraryDataTarget - generate rules to create shlib data file; + */ +#ifndef SharedLibraryDataTarget +#define SharedLibraryDataTarget(libname,rev,salist) +#endif /* SharedLibraryDataTarget */ + +#ifndef InstallSharedLibraryData +#define InstallSharedLibraryData(libname,rev,dest) +#endif /* InstallSharedLibraryData */ + +/* + * SharedLibReferences - variables for shared libraries + */ +#ifndef SharedLibReferences +#define SharedLibReferences(varname,libname,libsource,revname,rev) @@\ +revname = rev @@\ +Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\ +Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) @@\ +LintLibReferences(varname,libname,libsource) +#endif + +/* + * SharedDSLibReferences - variables for shared libraries + */ +#ifndef SharedDSLibReferences +#define SharedDSLibReferences(varname,libname,libsource,revname,rev) @@\ +revname = rev @@\ +Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\ +Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs) @@\ +LintLibReferences(varname,libname,libsource) +#endif + + diff -Naur src/config/MacOSX.tmpl src.new/config/MacOSX.tmpl --- src/config/MacOSX.tmpl 1969-12-31 18:00:00.000000000 -0600 +++ src.new/config/MacOSX.tmpl 2005-10-31 15:02:12.000000000 -0600 @@ -0,0 +1,67 @@ +XCOMM $XConsortium: MOSXS.tmpl,v 1.2 97/12/12 19:07:12 sl Exp $ + +/* + * Xnext shared library template + */ + + + +#ifndef SharedXtReqs +#define SharedXtReqs /**/ +#endif +#ifndef SharedXawReqs +#define SharedXawReqs /**/ +#endif +#ifndef SharedXmuReqs +#define SharedXmuReqs $(LDPRELIB) $(XTOOLONLYLIB) $(XONLYLIB) +#endif + +#define SharedLibX11 YES +#define SharedX11Rev F +SharedLibReferences(XONLY,X11,$(XLIBSRC),SOXLIBREV,SharedX11Rev) + +#define SharedLibXau NO /* don't need shared form */ +#define SharedLibXdmcp NO /* don't need shared form */ + +#define SharedLibXmu YES +#define SharedXmuRev F + +#define SharedOldXRev F + +#define SharedLibXext YES +#define SharedXextRev F + +#define SharedLibXt YES +#define SharedXtRev F +SharedDSLibReferences(XTOOLONLY,Xt,$(TOOLKITSRC),SOXTREV,SharedXtRev) + +#define SharedXawRev F + +#define SharedXtfRev A + +#define SharedLibXi YES +#define SharedXiRev F +SharedLibReferences(XI,Xi,$(XILIBSRC),SOXINPUTREV,SharedXiRev) + +#define SharedLibXtst YES +#define SharedXtstRev F +SharedLibReferences(XTEST,Xtst,$(XTESTLIBSRC),SOXTESTREV,SharedXtstRev) + + +#define SharedPexRev F +SharedLibReferences(PEX,PEX5,$(PEXLIBSRC),SOPEXREV,SharedPexRev) + +#define SharedLibXie YES +#define SharedXieRev F + +#define SharedLibICE YES +#define SharedICERev F +SharedLibReferences(ICE,ICE,$(ICESRC),SOICEREV,SharedICERev) + +#define SharedLibSM YES +#define SharedSMRev F +SharedLibReferences(SM,SM,$(SMSRC),SOSMREV,SharedSMRev) + +#define SharedFSRev F +SharedLibReferences(FS,FS,$(FSLIBSRC),SOFSREV,SharedFSRev) + diff -Naur src/config/site.def src.new/config/site.def --- src/config/site.def 2005-10-31 14:25:55.000000000 -0600 +++ src.new/config/site.def 2005-10-31 15:02:12.000000000 -0600 @@ -99,9 +99,7 @@ /* if it is already defined and false, undef it! */ /* do not use shift by default #if defined(CERNLIB_UNIX) && !defined(CERNLIB_WINNT) -#if ! defined(CERNLIB_SHIFT) -#define CERNLIB_SHIFT -#elif ! CERNLIB_SHIFT +#if defined(CERNLIB_SHIFT) && !CERNLIB_SHIFT #undef CERNLIB_SHIFT #endif #endif @@ -109,11 +107,7 @@ /* gmake does like ConstructMFLAGS to be YES(?) */ #undef MakeCmd -#ifndef WIN32 -# define MakeCmd gmake -#else -# define MakeCmd make -#endif +#define MakeCmd make #define ConstructMFLAGS YES #ifndef WIN32 diff -Naur src/geant321/Imakefile src.new/geant321/Imakefile --- src/geant321/Imakefile 2005-10-31 14:26:14.000000000 -0600 +++ src.new/geant321/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -37,7 +37,11 @@ install.lib:: $(CERN_LIBDIR)/xsneut95.dat $(CERN_LIBDIR)/xsneut95.dat: +#if defined(CERNLIB_MACOSX) + $(CP) -f data/$(@F) $(@D) +#else cd $(@D);$(LN) ../share/lib/$(@F) $(@F) +#endif #endif #if defined(CERNLIB_VAXVMS) diff -Naur src/geant321/gxint/Imakefile src.new/geant321/gxint/Imakefile --- src/geant321/gxint/Imakefile 2005-10-31 14:26:14.000000000 -0600 +++ src.new/geant321/gxint/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -30,7 +30,7 @@ gxint321.f: gxint.F RemoveFile($@) - $(CPP) $(FORTRANALLDEFMDEPEND) < $^ | sed -e '/^$$/d' | CppSedMagic >$@ + FortranCmd -E $(FORTRANALLDEFMDEPEND) $^ | sed -e '/^$$/d' | CppSedMagic >$@ install.lib:: $(CERN_LIBDIR)/gxint.f diff -Naur src/geant321/peanut/bimsel.F src.new/geant321/peanut/bimsel.F --- src/geant321/peanut/bimsel.F 2005-10-31 14:26:14.000000000 -0600 +++ src.new/geant321/peanut/bimsel.F 2005-10-31 15:02:13.000000000 -0600 @@ -46,7 +46,7 @@ & AUSFL , ZUSFL , BNDSAV, RADHLP, BFCHLP, BIMCLM, PRCOLP, & PRCOLN, IBTOLD, ICTOLD, KPROJ , NTRIAL, ITFRMI SAVE SBHAL0, SBSKI0, SBCEN0, SBCEN1, SBSKI1, SBHAL1 -#ifndef CERNLIB_WINNT +#if !defined(CERNLIB_WINNT) && !defined(CERNLIB_GFORTRAN) SAVE #endif DATA IBTOLD, ICTOLD / 2*0 / diff -Naur src/mathlib/bvsl/test/tsbvsl.F src.new/mathlib/bvsl/test/tsbvsl.F --- src/mathlib/bvsl/test/tsbvsl.F 2005-10-31 14:27:57.000000000 -0600 +++ src.new/mathlib/bvsl/test/tsbvsl.F 2005-10-31 15:02:13.000000000 -0600 @@ -42,6 +42,12 @@ CALL NRANIN(54321.) CALL NRAN(VEC,ILENG) * +#if defined(CERNLIB_GFORTRAN) + do kkk=1, leng + iy (kkk) = 0 + iy1(kkk) = 0 + end do +#endif CALL WHENEQ(ILENG,VEC,1,TSVAL,IY,NFOUND) CALL YLOSB(ILENG,VEC,TSVAL,YB,IFOUND,'EQ') CALL BINVEC(ILENG,YB,IY1) diff -Naur src/mathlib/gen/b/rsrtnt64.F src.new/mathlib/gen/b/rsrtnt64.F --- src/mathlib/gen/b/rsrtnt64.F 2005-10-31 14:27:57.000000000 -0600 +++ src.new/mathlib/gen/b/rsrtnt64.F 2005-10-31 15:02:13.000000000 -0600 @@ -117,8 +117,12 @@ ENDIF ELSE IF(N .EQ. 1) THEN +#if !defined(CERNLIB_GFORTRAN) ASSIGN 11 TO JMP1 GO TO 10 +#else +#include "rsrtnt64p1.inc" +#endif 11 IF(K .EQ. 0) THEN H=H ELSEIF(K .EQ. 1) THEN @@ -174,14 +178,22 @@ H=2*((H1+B*U)/RT(U)-(H1+B*V)/RT(V))/DELTA LB1=11 ELSEIF(K .EQ. 2) THEN +#if !defined(CERNLIB_GFORTRAN) ASSIGN 12 TO JMP1 GO TO 10 +#else +#include "rsrtnt64p1.inc" +#endif 12 H1=DELTA-B**2 H2=2*A*B H=(((H1*U-H2)/RT(U)-(H1*V-H2)/RT(V))/DELTA+H)/C ELSEIF(K .EQ. 3) THEN +#if !defined(CERNLIB_GFORTRAN) ASSIGN 13 TO JMP1 GO TO 10 +#else +#include "rsrtnt64p1.inc" +#endif 13 H1=C*DELTA G1=A*C G2=3*B**2 @@ -217,8 +229,12 @@ ENDIF ELSE IF(N .EQ. 1) THEN +#if !defined(CERNLIB_GFORTRAN) ASSIGN 21 TO JMP2 GO TO 20 +#else +#include "rsrtnt64p2.inc" +#endif 21 IF(K .EQ. -1) THEN H=H ELSEIF(K .EQ. -2) THEN @@ -257,8 +273,12 @@ IF(U. LT. -X0) H=-H ENDIF ELSE +#if !defined(CERNLIB_GFORTRAN) ASSIGN 22 TO JMP2 GO TO 20 +#else +#include "rsrtnt64p2.inc" +#endif 22 IF(K .EQ. -1) THEN H1=B*C H2=B**2-2*A*C @@ -287,6 +307,7 @@ ENDIF ENDIF ENDIF +#if !defined(CERNLIB_GFORTRAN) GO TO 9 10 C2=2*C @@ -327,6 +348,7 @@ ENDIF ENDIF GO TO JMP2, (21,22) +#endif 9 RES=SIGN(R1,V1-U1)*H LRL=LLL diff -Naur src/mathlib/gen/b/rsrtnt64p1.inc src.new/mathlib/gen/b/rsrtnt64p1.inc --- src/mathlib/gen/b/rsrtnt64p1.inc 1969-12-31 18:00:00.000000000 -0600 +++ src.new/mathlib/gen/b/rsrtnt64p1.inc 2005-10-31 15:02:13.000000000 -0600 @@ -0,0 +1,9 @@ + C2=2*C + IF(DELTA .GT. 0 .OR. DELTA .LT. 0 .AND. C .GT. 0) THEN + H=LOG(ABS((2*SQRT(C*P(V))+C2*V+B)/ + 1 (2*SQRT(C*P(U))+C2*U+B)))/SQRT(C) + ELSEIF(DELTA .EQ. 0) THEN + H=ABS(LOG(ABS((C2*V+B)/(C2*U+B))))/SQRT(C) + ELSE + H=(ASIN((C2*U+B)/RTD)-ASIN((C2*V+B)/RTD))/SQRT(-C) + ENDIF diff -Naur src/mathlib/gen/b/rsrtnt64p2.inc src.new/mathlib/gen/b/rsrtnt64p2.inc --- src/mathlib/gen/b/rsrtnt64p2.inc 1969-12-31 18:00:00.000000000 -0600 +++ src.new/mathlib/gen/b/rsrtnt64p2.inc 2005-10-31 15:02:13.000000000 -0600 @@ -0,0 +1,26 @@ + IF(C .EQ. 0) THEN + IF(B .EQ. 0) THEN + H=LOG(ABS(V/U))/SQRT(A) + ELSE + IF(A .LT. 0) THEN + H=2*(ATAN(SQRT(-(A+B*V)/A))-ATAN(SQRT(-(A+B*U)/A)))/SQRT(-A) + ELSE + WA=SQRT(A) + WU=SQRT(A+B*U) + WV=SQRT(A+B*V) + H=LOG(ABS((WV-WA)*(WU+WA)/((WV+WA)*(WU-WA))))/WA + ENDIF + ENDIF + ELSE + A2=2*A + IF(DELTA .GT. 0 .OR. DELTA .LT. 0 .AND. A .GT. 0) THEN + H=LOG(ABS((-2*SQRT(A*P(V))+B*V+A2)*U/ + 1 ((-2*SQRT(A*P(U))+B*U+A2)*V)))/SQRT(A) + ELSEIF(DELTA .EQ. 0) THEN + H=LOG(ABS((B*U+A2)*V/((B*V+A2)*U)))/SQRT(A) + IF(U*V .GT. 0) H=SIGN(H,U) + ELSE + H=(ASIN((B*V+A2)/(V*RTD))-ASIN((B*U+A2)/(U*RTD)))/SQRT(-A) + IF(U .LT. 0 .AND. V .LT. 0) H=-H + ENDIF + ENDIF diff -Naur src/mathlib/gen/c/celfun64.F src.new/mathlib/gen/c/celfun64.F --- src/mathlib/gen/c/celfun64.F 2005-10-31 14:27:57.000000000 -0600 +++ src.new/mathlib/gen/c/celfun64.F 2005-10-31 15:02:13.000000000 -0600 @@ -64,7 +64,11 @@ #if ! defined(CERNLIB_QFPGF77) DATA AM0 /-1D20/ +#if !defined(CERNLIB_GFORTRAN) SAVE AM0,C,A,L,BIGK +#else + SAVE +#endif #endif #if !defined(CERNLIB_QF2C) diff -Naur src/mathlib/gen/c/wpsipg.F src.new/mathlib/gen/c/wpsipg.F --- src/mathlib/gen/c/wpsipg.F 2005-10-31 14:27:58.000000000 -0600 +++ src.new/mathlib/gen/c/wpsipg.F 2005-10-31 15:02:13.000000000 -0600 @@ -62,7 +62,11 @@ H=0 WRITE(ERRTXT,101) K CALL MTLPRT(NAME,'C317.1',ERRTXT) +#if !defined(CERNLIB_GFORTRAN) ELSEIF(ABS(IMAG(U)) .LT. DELTA .AND. ABS(X+NINT(A)) .LT. DELTA) +#else + ELSEIF(ABS(AIMAG(U)) .LT. DELTA .AND. ABS(X+NINT(A)) .LT. DELTA) +#endif 1 THEN H=0 WRITE(ERRTXT,102) X @@ -88,7 +92,11 @@ IF(X .LT. 0) THEN V=PI*U X=V +#if !defined(CERNLIB_GFORTRAN) Y=IMAG(V) +#else + Y=AIMAG(V) +#endif A=SIN(X) B=COS(X) T=TANH(Y) diff -Naur src/mathlib/gen/d/cfstft.F src.new/mathlib/gen/d/cfstft.F --- src/mathlib/gen/d/cfstft.F 2005-10-31 14:27:58.000000000 -0600 +++ src.new/mathlib/gen/d/cfstft.F 2005-10-31 15:02:13.000000000 -0600 @@ -43,7 +43,7 @@ W=CMPLX(C,S) U=W C=SQRT(0.5*C+0.5) -#if defined(CERNLIB_QFPGF77) +#if defined(CERNLIB_QFPGF77) || defined(CERNLIB_GFORTRAN) S=AIMAG(W)/(C+C) #else S=IMAG(W)/(C+C) diff -Naur src/mathlib/gen/tests/b300m.F src.new/mathlib/gen/tests/b300m.F --- src/mathlib/gen/tests/b300m.F 2005-10-31 14:28:03.000000000 -0600 +++ src.new/mathlib/gen/tests/b300m.F 2005-10-31 15:02:13.000000000 -0600 @@ -66,9 +66,15 @@ #endif D=RES-TST LTEST = LTEST .AND. ABS(D) .LE.1D-7 +#if 0 IF(ABS(D) .GT. 1D-7) 1 WRITE(LOUT,'(1X,2I5,F10.1,3F7.1,2F8.4,3F15.8,'' LB'',I2,L2)') 2 K,N,DELTA,A,B,C,U,V,RES,TST,D,LRL +#else + IF(ABS(D) .GT. 1D-7) + 1 WRITE(LOUT,'(1X,2I5,F10.1,3F7.1,2F8.4,3F15.8,'' LB'',L2)') + 2 K,N,DELTA,A,B,C,U,V,RES,TST,D,LRL +#endif ENDIF 2 CONTINUE ENDIF diff -Naur src/mathlib/gen/tests/c209m.F src.new/mathlib/gen/tests/c209m.F --- src/mathlib/gen/tests/c209m.F 2005-10-31 14:28:04.000000000 -0600 +++ src.new/mathlib/gen/tests/c209m.F 2005-10-31 15:02:13.000000000 -0600 @@ -31,6 +31,9 @@ + ( 2 , 1 ),( 6 , 3 ) / DATA (TEST(J,4),J=1,4) / (-1 ,-3 ),( 1 , 3 ), + (-1 , 3 ),( 3 , 1 ) / +#if defined(CERNLIB_GFORTRAN) + save test +#endif CALL HEADER('C209',0) C Initialise maximum residues as zero diff -Naur src/mathlib/gen/tests/c327m.F src.new/mathlib/gen/tests/c327m.F --- src/mathlib/gen/tests/c327m.F 2005-10-31 14:28:04.000000000 -0600 +++ src.new/mathlib/gen/tests/c327m.F 2005-10-31 15:02:13.000000000 -0600 @@ -92,7 +92,11 @@ #endif ENDIF WRITE(Z,'(2D26.16)') H,T +#if defined(CERNLIB_MACOSX) + READ(Z,'(2(4X,D22.16))') H1,T1 +#else READ(Z,'(2(D22.16,4X))') H1,T1 +#endif IF(IDS .EQ. 1) THEN ERRMAX=MAX(ERRMAX,ABS(H1-T1)) LTEST= LTEST .AND. ERRMAX .LE. TSTERR diff -Naur src/mathlib/gen/tests/c342m.F src.new/mathlib/gen/tests/c342m.F --- src/mathlib/gen/tests/c342m.F 2005-10-31 14:28:04.000000000 -0600 +++ src.new/mathlib/gen/tests/c342m.F 2005-10-31 15:02:13.000000000 -0600 @@ -70,7 +70,11 @@ #endif END IF WRITE(Z,'(2D26.16)') R,T +#if defined(CERNLIB_MACOSX) + READ(Z,'(2(4X,D22.16))') R1,T1 +#else READ(Z,'(2(D22.16,4X))') R1,T1 +#endif ERMAX= MAX(ERMAX,ABS(R1-T1)) IF(IDS .EQ. 3 .OR. IDS .EQ. 4) THEN WRITE(LOUT,'(1X,F10.3,2F25.16,1P,D10.1)') SX,R,T,ABS(R1-T1) diff -Naur src/mathlib/gen/v/v107z0.inc src.new/mathlib/gen/v/v107z0.inc --- src/mathlib/gen/v/v107z0.inc 2005-10-31 14:28:00.000000000 -0600 +++ src.new/mathlib/gen/v/v107z0.inc 2005-10-31 15:02:23.000000000 -0600 @@ -17,7 +17,11 @@ * #if defined(CERNLIB_LNX)||defined(CERNLIB_ALLIANT)||defined(CERNLIB_DECS)||defined(CERNLIB_MACMPW)||defined(CERNLIB_SGI) +#if !defined(CERNLIB_GFORTRAN) DATA IZ0/'33000000'X/ +#else + DATA IZ0/X'33000000'/ +#endif #elif defined(CERNLIB_APOLLO) DATA IZ0/16#33000000/ diff -Naur src/mclibs/ariadne/test/test.F src.new/mclibs/ariadne/test/test.F --- src/mclibs/ariadne/test/test.F 2005-10-31 14:26:26.000000000 -0600 +++ src.new/mclibs/ariadne/test/test.F 2005-10-31 15:02:23.000000000 -0600 @@ -15,7 +15,17 @@ C...Performs various tests on Ariadne EXTERNAL LUDATA,PYDATA +#if defined(CERNLIB_GFORTRAN) + call dummysub(ludata) + call dummysub(pydata) + call dummysub(ardata) +#endif IPRINT=0 CALL ARTEST(IPRINT) END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/cojets/test/test.F src.new/mclibs/cojets/test/test.F --- src/mclibs/cojets/test/test.F 2005-10-31 14:26:23.000000000 -0600 +++ src.new/mclibs/cojets/test/test.F 2005-10-31 15:02:23.000000000 -0600 @@ -2,12 +2,20 @@ PROGRAM COJETST CHARACTER*(*) DFILE +#if !defined(CERNLIB_GFORTRAN) EXTERNAL COJDAT +#else + EXTERNAL COJDAT, COJVER +#endif #if defined(CERNLIB_IBMVM) PARAMETER (DFILE='/COJETS DATA *') #else PARAMETER (DFILE='cojets.dat') #endif +#if defined(CERNLIB_GFORTRAN) + call dummysub(cojdat) + call dummysub(cojver) +#endif C C MAIN PROGRAM FOR COJETS C @@ -25,3 +33,8 @@ CALL COJETS(-1,-2,5,6) C END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/fritiof/test/fritioft.F src.new/mclibs/fritiof/test/fritioft.F --- src/mclibs/fritiof/test/fritioft.F 2005-10-31 14:26:25.000000000 -0600 +++ src.new/mclibs/fritiof/test/fritioft.F 2005-10-31 15:02:23.000000000 -0600 @@ -1,3 +1,16 @@ external ludata, pydata +#if defined(CERNLIB_GFORTRAN) + external frdata, ardata + + call dummysub(ludata) + call dummysub(pydata) + call dummysub(frdata) + call dummysub(ardata) +#endif call frsample end +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/herwig/code/hwhiga.F src.new/mclibs/herwig/code/hwhiga.F --- src/mclibs/herwig/code/hwhiga.F 2005-10-31 14:26:20.000000000 -0600 +++ src.new/mclibs/herwig/code/hwhiga.F 2005-10-31 15:02:23.000000000 -0600 @@ -73,7 +73,11 @@ TAMP(7)=HWHIG5(U,T,S,EMH2,EMQ2,3,0,6,0,0,0) DO 20 I=1,7 TAMPI(I)= REAL(TAMP(I)) +#if !defined(CERNLIB_GFORTRAN) 20 TAMPR(I)=-IMAG(TAMP(I)) +#else + 20 TAMPR(I)=-AIMAG(TAMP(I)) +#endif C Square and add prefactors WTGG=0.03125*FLOAT(NCOLO*(NCOLO**2-1)) & *(TAMPR(1)**2+TAMPI(1)**2+TAMPR(2)**2+TAMPI(2)**2 diff -Naur src/mclibs/herwig/code/hwuli2.F src.new/mclibs/herwig/code/hwuli2.F --- src/mclibs/herwig/code/hwuli2.F 2005-10-31 14:26:20.000000000 -0600 +++ src.new/mclibs/herwig/code/hwuli2.F 2005-10-31 15:02:23.000000000 -0600 @@ -19,7 +19,11 @@ PROD(Y,Y2)=Y*(ONE+A1*Y*(ONE+A2*Y*(ONE+A3*Y2*(ONE+A4*Y2*(ONE+A5*Y2* & (ONE+A6*Y2*(ONE+A7*Y2*(ONE+A8*Y2*(ONE+A9*Y2*(ONE+A10*Y2)))))))))) XR=REAL(X) +#if !defined(CERNLIB_GFORTRAN) XI=IMAG(X) +#else + XI=AIMAG(X) +#endif R2=XR*XR+XI*XI IF (R2.GT.ONE.AND.(XR/R2).GT.HALF) THEN Z=-LOG(ONE/X) diff -Naur src/mclibs/herwig/test/test.F src.new/mclibs/herwig/test/test.F --- src/mclibs/herwig/test/test.F 2005-10-31 14:26:21.000000000 -0600 +++ src.new/mclibs/herwig/test/test.F 2005-10-31 15:02:23.000000000 -0600 @@ -5,6 +5,9 @@ C force inclusion of black data EXTERNAL HWUDAT +#if defined(CERNLIB_GFORTRAN) + call dummysub(hwudat) +#endif C C---MAX NUMBER OF EVENTS THIS RUN MAXEV=100 @@ -77,3 +80,8 @@ C---------------------------------------------------------------------- END C----------------------------------------------------------------------- +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/isajet/code/sigqcd.F src.new/mclibs/isajet/code/sigqcd.F --- src/mclibs/isajet/code/sigqcd.F 2005-10-31 14:26:28.000000000 -0600 +++ src.new/mclibs/isajet/code/sigqcd.F 2005-10-31 15:02:23.000000000 -0600 @@ -213,7 +213,11 @@ 250 CONTINUE C C Gluon + heavy quark +#if !defined(CERNLIB_GFORTRAN) DO 300 IQ=8,13. +#else + DO 300 IQ=8,13 +#endif IF(.NOT.(GOQ(1,1).AND.GOQ(IQ,2))) GO TO 310 AMQ=AMASS(IQ/2) AM2=AMQ**2 diff -Naur src/mclibs/isajet/test/isajett.F src.new/mclibs/isajet/test/isajett.F --- src/mclibs/isajet/test/isajett.F 2005-10-31 14:26:28.000000000 -0600 +++ src.new/mclibs/isajet/test/isajett.F 2005-10-31 15:02:24.000000000 -0600 @@ -14,6 +14,9 @@ C C MAIN PROGRAM FOR ISAJET C +#if defined(CERNLIB_GFORTRAN) + call dummysub(aldata) +#endif OPEN(1,FILE=DFILE,STATUS='OLD') #if defined(CERNLIB_IBMVM) OPEN(2,STATUS='SCRATCH',FORM='UNFORMATTED') @@ -33,3 +36,8 @@ END SUBROUTINE EXIT END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/jetset/pythia/Imakefile src.new/mclibs/jetset/pythia/Imakefile --- src/mclibs/jetset/pythia/Imakefile 2005-10-31 14:26:30.000000000 -0600 +++ src.new/mclibs/jetset/pythia/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -15,4 +15,8 @@ FDEBUGFLAGS := $(FDEBUGFLAGS) -Nn15000 #endif +#if defined(CERNLIB_PPC) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/mclibs/jetset/test/test.F src.new/mclibs/jetset/test/test.F --- src/mclibs/jetset/test/test.F 2005-10-31 14:26:31.000000000 -0600 +++ src.new/mclibs/jetset/test/test.F 2005-10-31 15:02:24.000000000 -0600 @@ -1,6 +1,10 @@ PROGRAM JETTST C EXTERNAL LUDATA,PYDATA +#if defined(CERNLIB_GFORTRAN) + call dummysub(ludata) + call dummysub(pydata) +#endif MPAR = 1 C @@ -8,3 +12,8 @@ CALL PYTEST(MPAR) C END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/lepto63/test/demo.F src.new/mclibs/lepto63/test/demo.F --- src/mclibs/lepto63/test/demo.F 2005-10-31 14:26:31.000000000 -0600 +++ src.new/mclibs/lepto63/test/demo.F 2005-10-31 15:02:24.000000000 -0600 @@ -42,7 +42,7 @@ DATA PE/20*820.0/ DATA LE/20*-27.5/ C - EXTERNAL LUDATA,PYDATA + EXTERNAL LUDATA,PYDATA,LEPTOD C...Set cuts LST(3)=0 CUT(7)=100. @@ -108,3 +108,8 @@ RETURN END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/lepto63/test/demo2.F src.new/mclibs/lepto63/test/demo2.F --- src/mclibs/lepto63/test/demo2.F 2005-10-31 14:26:31.000000000 -0600 +++ src.new/mclibs/lepto63/test/demo2.F 2005-10-31 15:02:24.000000000 -0600 @@ -7,7 +7,7 @@ COMMON/LUJETS/N,K(4000,5),P(4000,5),V(4000,5) DATA NPRINT/10/,NEVENT/100/ C - EXTERNAL LUDATA,PYDATA + EXTERNAL LUDATA,PYDATA,LEPTOD C...Settings CUT(5)=10. CUT(7)=25. @@ -45,3 +45,8 @@ RETURN END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/mclibs/pdf/pdf/w5051p3.inc src.new/mclibs/pdf/pdf/w5051p3.inc --- src/mclibs/pdf/pdf/w5051p3.inc 2005-10-31 14:26:35.000000000 -0600 +++ src.new/mclibs/pdf/pdf/w5051p3.inc 2005-10-31 15:02:24.000000000 -0600 @@ -24,7 +24,7 @@ PARAMETER (ND11=10,ND12= 9,ND13=100,ND14=56,ND15=14,ND16= 1, + ND17=2,ND18= 0,ND19= 0) PARAMETER (ND21= 2,ND22= 0,ND23= 3,ND24= 0,ND25= 2,ND26= 3, - + NND27=0,D28= 0,ND29= 0) + + ND27=0,ND28= 0,ND29= 0) PARAMETER (ND31= 2,ND32= 4,ND33= 4,ND34= 5,ND35= 4,ND36= 3, + ND37=0,ND38= 6,ND39= 8) PARAMETER (ND41= 1) diff -Naur src/mclibs/pythia/code/Imakefile src.new/mclibs/pythia/code/Imakefile --- src/mclibs/pythia/code/Imakefile 2005-10-31 14:26:26.000000000 -0600 +++ src.new/mclibs/pythia/code/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -36,4 +36,9 @@ FDEBUGFLAGS := $(FDEBUGFLAGS) -Nn15000 #endif +#if defined(CERNLIB_PPC) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + SubdirLibraryTarget(NullParameter,NullParameter) + diff -Naur src/mclibs/pythia/code/visaje.F src.new/mclibs/pythia/code/visaje.F --- src/mclibs/pythia/code/visaje.F 2005-10-31 14:26:27.000000000 -0600 +++ src.new/mclibs/pythia/code/visaje.F 2005-10-31 15:02:24.000000000 -0600 @@ -7,7 +7,9 @@ FUNCTION VISAJE() IMPLICIT DOUBLE PRECISION(A-H, O-Z) IMPLICIT INTEGER(I-N) +#if !defined(CERNLIB_GFORTRAN) CHARACTER*40 VISAJE +#endif C...Commonblocks. COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200) diff -Naur src/mclibs/pythia/test/test.F src.new/mclibs/pythia/test/test.F --- src/mclibs/pythia/test/test.F 2005-10-31 14:26:27.000000000 -0600 +++ src.new/mclibs/pythia/test/test.F 2005-10-31 15:02:24.000000000 -0600 @@ -1,9 +1,17 @@ PROGRAM PYTST C EXTERNAL PYDATA +#if defined(CERNLIB_GFORTRAN) + call dummysub(pydata) +#endif MPAR = 1 C CALL PYTEST(MPAR) C END +#if defined(CERNLIB_GFORTRAN) + subroutine dummysub(a) + return + end +#endif diff -Naur src/packlib/Imakefile src.new/packlib/Imakefile --- src/packlib/Imakefile 2005-10-31 14:27:46.000000000 -0600 +++ src.new/packlib/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -6,11 +6,11 @@ LIBDIRS= cspack epio fatmen ffread hbook hepdb kapack kuip \ @@\ minuit zbook zebra kernlib -SUBDIRS= $(LIBDIRS) +SUBDIRS= $(LIBDIRS) cuserid TopOfPackage(packlib) -SubdirLibraryTarget(packlib,$(LIBDIRS)) +SubdirLibraryTarget(packlib,$(SUBDIRS)) InstallLibrary(packlib,$(CERN_LIBDIR)) InstallLibraryAlias(packlib,packlib-shift,$(CERN_LIBDIR)) diff -Naur src/packlib/cspack/sysreq/log.c src.new/packlib/cspack/sysreq/log.c --- src/packlib/cspack/sysreq/log.c 2005-10-31 14:26:57.000000000 -0600 +++ src.new/packlib/cspack/sysreq/log.c 2005-10-31 15:02:24.000000000 -0600 @@ -80,7 +80,7 @@ static int pid; /* process identifier */ static int logfd ; /* logging file descriptor */ #if !defined(SOLARIS) && !defined(linux) && !defined(_AIX) \ - && !defined(IRIX5) && !defined(apollo) + && !defined(IRIX5) && !defined(apollo) && !defined(__DARWIN__) extern int syslog(); #endif /* !SOLARIS && !IRIX5 && !apollo && !linux && !AIX */ extern char *getenv(); diff -Naur src/packlib/cspack/tcpaw/tcpaw.c src.new/packlib/cspack/tcpaw/tcpaw.c --- src/packlib/cspack/tcpaw/tcpaw.c 2005-10-31 14:26:57.000000000 -0600 +++ src.new/packlib/cspack/tcpaw/tcpaw.c 2005-10-31 15:02:24.000000000 -0600 @@ -2359,6 +2359,13 @@ } #endif + +#if defined(__APPLE__) +static rnetrc(char *host, char **aname, char **apass); +static token(); +static void catch(); +#endif + #include #include @@ -2370,11 +2377,9 @@ char *ku_pros( /* char *prompt, char *default */ ); char *ku_prop( /* char *prompt */ ); -/* Fails with gcc 3.4.3 #ifndef _WIN32 char *malloc(), *index(), *getpass(), *getuid(); #endif - */ static FILE *cfile; @@ -2541,7 +2546,7 @@ #if !defined(IBM) && !defined(_WIN32) /* I provide "getpass" myself as standard version truncates to 8 characters */ #include -#ifdef CBREAK +#if defined(CBREAK) || defined(__APPLE__) #define BSDTTY /* First find out if BSD or SYSV terminal handling.. */ #endif @@ -2551,10 +2556,9 @@ #include #endif -/* Fails with gcc 3.4.3 -#ifndef __convexc__ +#if !defined(__convexc__) && !defined(__APPLE__) extern int kill(), ioctl(), getpid(); -#endif */ /* __convexc__ */ +#endif /* __convexc__ */ static int intrupt; /*** NOTE MAXPASSWD IS DEFINED AS 8 IN ALL STANDARD UNIX SYSTEMS, BUT THIS @@ -2576,7 +2580,11 @@ register int c; FILE *fi; static char pbuf[ MAXPASSWD + 1 ]; +#if !defined(__APPLE__) void (*sig)(), catch(); +#else + void (*sig)(); +#endif if((fi = fopen("/dev/tty", "r")) == NULL) return((char*)NULL); diff -Naur src/packlib/cuserid/Imakefile src.new/packlib/cuserid/Imakefile --- src/packlib/cuserid/Imakefile 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/cuserid/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -0,0 +1,3 @@ +SRCS_C= cuserid.c + +SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/cuserid/cuserid.c src.new/packlib/cuserid/cuserid.c --- src/packlib/cuserid/cuserid.c 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/cuserid/cuserid.c 2005-10-31 15:02:13.000000000 -0600 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +#include +#include +#include + +char * +cuserid(s) + char *s; +{ + register struct passwd *pwd; + + if ((pwd = getpwuid(geteuid())) == NULL) { + if (s) + *s = '\0'; + return (s); + } + if (s) { + (void)strncpy(s, pwd->pw_name, L_cuserid); + return (s); + } + return (pwd->pw_name); +} diff -Naur src/packlib/hepdb/hepdb/l3bits.inc src.new/packlib/hepdb/hepdb/l3bits.inc --- src/packlib/hepdb/hepdb/l3bits.inc 2005-10-31 14:26:45.000000000 -0600 +++ src.new/packlib/hepdb/hepdb/l3bits.inc 2005-10-31 15:02:24.000000000 -0600 @@ -43,7 +43,8 @@ JBIT (IZW,IZP) = IBITS (IZW,IZP-1,1) JBYT (IZW,IZP,NZB) = IBITS (IZW,IZP-1,NZB) #endif -#if defined(CERNLIB_IBM)||defined(CERNLIB_IBMRT)||defined(CERNLIB_VAX) +#if defined(CERNLIB_IBM)||defined(CERNLIB_IBMRT)||defined(CERNLIB_VAX)\ + || defined(CERNLIB_GFORTRAN) IBITS (I,N,L) = ISHFT(ISHFT(I,32-L-N),L-32) * JBIT (IZW,IZP) = IBITS (IZW,IZP-1,1) @@ -58,7 +59,7 @@ * * l3bits.inc * -#if defined(CERNLIB_F2C) +#if defined(CERNLIB_F2C) && !defined(CERNLIB_GFORTRAN) C-- C-- Note: F2C-ish RSHIFT is arithmetic right shift. C-- This means sign bits are shifted in at the high end diff -Naur src/packlib/hepdb/hepdb/l3bitx.inc src.new/packlib/hepdb/hepdb/l3bitx.inc --- src/packlib/hepdb/hepdb/l3bitx.inc 2005-10-31 14:26:45.000000000 -0600 +++ src.new/packlib/hepdb/hepdb/l3bitx.inc 2005-10-31 15:02:24.000000000 -0600 @@ -53,7 +53,8 @@ * * l3bitx.inc * -#if defined(CERNLIB_IBM)||defined(CERNLIB_IBMRT)||defined(CERNLIB_VAX) +#if defined(CERNLIB_IBM)||defined(CERNLIB_IBMRT)||defined(CERNLIB_VAX)\ + || defined(CERNLIB_GFORTRAN) #include "hepdb/l3bits.inc" MSBIT (MZ,IZW,IZP) = IOR (IAND (IZW, NOT(ISHFT(1,IZP-1)) ) + , ISHFT(IAND(MZ,1),IZP-1)) @@ -72,7 +73,7 @@ * * l3bitx.inc * -#if defined(CERNLIB_F2C) +#if defined(CERNLIB_F2C) && !defined(CERNLIB_GFORTRAN) #include "hepdb/l3bits.inc" JBYTET (MZ,IZW,IZP,NZB) = AND (MZ, + ishftr (LSHIFT(IZW,33-IZP-NZB),32-NZB) ) diff -Naur src/packlib/kernlib/kernbit/z268/systems.c src.new/packlib/kernlib/kernbit/z268/systems.c --- src/packlib/kernlib/kernbit/z268/systems.c 2005-10-31 14:26:59.000000000 -0600 +++ src.new/packlib/kernlib/kernbit/z268/systems.c 2005-10-31 15:02:13.000000000 -0600 @@ -200,7 +200,7 @@ || defined(_IBMR2) \ || defined(__convexc__) \ || defined(_OSK) \ -|| defined(__linux) || defined(__FreeBSD__) +|| defined(__linux) || defined(__FreeBSD__) || defined(__DARWIN__) void systems_( command, buf, buflen, l, chars, rc, ovflw ) diff -Naur src/packlib/kernlib/kerngen/kerngen/q_cbyt.inc src.new/packlib/kernlib/kerngen/kerngen/q_cbyt.inc --- src/packlib/kernlib/kerngen/kerngen/q_cbyt.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_cbyt.inc 2005-10-31 15:02:27.000000000 -0600 @@ -9,7 +9,7 @@ * * q_cbyt.inc * -#if defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) MCBYT (MZ,IZQ,IZW,IZP,NZB) = OR ( + AND (IZW, NOT(LSHIFT (ISHFTR(NOT(0),32-NZB),IZP-1))) + ,ISHFTR (LSHIFT(LSHIFT(MZ,IZQ-1),32-NZB), 33-IZP-NZB)) @@ -21,4 +21,8 @@ MCBYT (MZ,IZQ,IZW,IZP,NZB) = IOR ( + IAND (IZW, NOT(ISHFT (ISHFT(NOT(0),-32+NZB), IZP-1))) + , ISHFT (ISHFT(ISHFT(MZ,-IZQ+1),32-NZB), -33+IZP+NZB) ) +#elif defined(CERNLIB_GFORTRAN) + MCBYT (MZ,IZQ,IZW,IZP,NZB) = IOR ( + + IAND (IZW, NOT(ISHFT (ISHFT(NOT(0),-32+NZB), IZP-1))) + + , ISHFT (ISHFT(ISHFT(MZ,IZQ-1),32-NZB), -33+IZP+NZB) ) #endif diff -Naur src/packlib/kernlib/kerngen/kerngen/q_isabit.inc src.new/packlib/kernlib/kerngen/kerngen/q_isabit.inc --- src/packlib/kernlib/kerngen/kerngen/q_isabit.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_isabit.inc 2005-10-31 15:02:27.000000000 -0600 @@ -9,9 +9,14 @@ * * q_isabit.inc * -#if defined(CERNLIB_QMLNX)||(defined(CERNLIB_QMDOS)&&defined(CERNLIB_QF_F2C)) +#if (defined(CERNLIB_QMLNX)&&!defined(CERNLIB_GFORTRAN))||(defined(CERNLIB_QMDOS)&&defined(CERNLIB_QF_F2C)) BTEST(IZW,IZP) = AND (IZW,LSHIFT(1,IZP)) .NE. 0 IBSET(IZW,IZP) = OR (IZW,LSHIFT(1,IZP)) IBCLR(IZW,IZP) = AND (IZW,NOT(LSHIFT(1,IZP))) IBITS (IZW,IZP,NZB) = ISHFTR (LSHIFT(IZW,32-IZP-NZB), 32-NZB) +#elsif defined(CERNLIB_GFORTRAN) + BTEST(IZW,IZP) = IAND (IZW,ISHFT(1,IZP)) .NE. 0 + IBSET(IZW,IZP) = IOR (IZW,ISHFT(1,IZP)) + IBCLR(IZW,IZP) = IAND (IZW,NOT(ISHFT(1,IZP))) + IBITS (IZW,IZP,NZB) = ISHFT(ISHFT(IZW,32-NZB-IZP),NZB-32) #endif diff -Naur src/packlib/kernlib/kerngen/kerngen/q_jbit.inc src.new/packlib/kernlib/kerngen/kerngen/q_jbit.inc --- src/packlib/kernlib/kerngen/kerngen/q_jbit.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_jbit.inc 2005-10-31 15:02:27.000000000 -0600 @@ -15,7 +15,7 @@ * * q_jbit.inc * -#if defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) JBIT(IZW,IZP) = AND(ISHFTR(IZW,IZP-1),1) JBYT(IZW,IZP,NZB) = ISHFTR(LSHIFT(IZW,33-IZP-NZB),32-NZB) #elif defined(CERNLIB_QMDOS)&&defined(CERNLIB_QF_F2C) @@ -28,7 +28,8 @@ #elif defined(CERNLIB_QMOS9)||defined(CERNLIB_QMHPX) JBIT (IZW,IZP) = IBITS (IZW,IZP-1,1) JBYT (IZW,IZP,NZB) = IBITS (IZW,IZP-1,NZB) -#elif defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C)) || defined(CERNLIB_QFMSOFT) +#elif (defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT)\ + || defined(CERNLIB_GFORTRAN) JBIT (IZW,IZP) = IAND (ISHFT(IZW,1-IZP), 1) JBYT (IZW,IZP,NZB) = ISHFT (ISHFT(IZW,33-IZP-NZB), -32+NZB) #endif diff -Naur src/packlib/kernlib/kerngen/kerngen/q_jbytet.inc src.new/packlib/kernlib/kerngen/kerngen/q_jbytet.inc --- src/packlib/kernlib/kerngen/kerngen/q_jbytet.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_jbytet.inc 2005-10-31 15:02:28.000000000 -0600 @@ -25,7 +25,7 @@ + LSHIFT(NOT(MZ),32-NZB), 33-IZP-NZB))) MBYTOR (MZ,IZW,IZP,NZB) = OR (IZW, lrshft ( + LSHIFT(MZ,32-NZB), 33-IZP-NZB)) -#if defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) JBYTET (MZ,IZW,IZP,NZB) = AND (MZ, + ISHFTR (LSHIFT(IZW,33-IZP-NZB),32-NZB) ) JBYTOR (MZ,IZW,IZP,NZB) = OR (MZ, @@ -50,7 +50,8 @@ + ISHFT(NOT(MZ),32-NZB),-33+IZP+NZB)) ) MBYTOR (MZ,IZW,IZP,NZB) = IOR (IZW, ishft ( + ISHFT(MZ,32-NZB),-33+IZP+NZB) ) -#elif defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C)) || defined(CERNLIB_QFMSOFT) +#elif (defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT)\ + || defined(CERNLIB_GFORTRAN) JBYTET (MZ,IZW,IZP,NZB) = IAND (MZ, + ISHFT (ISHFT(IZW,33-IZP-NZB),-32+NZB) ) JBYTOR (MZ,IZW,IZP,NZB) = IOR (MZ, diff -Naur src/packlib/kernlib/kerngen/kerngen/q_sbit.inc src.new/packlib/kernlib/kerngen/kerngen/q_sbit.inc --- src/packlib/kernlib/kerngen/kerngen/q_sbit.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_sbit.inc 2005-10-31 15:02:28.000000000 -0600 @@ -15,7 +15,7 @@ * * q_sbit.inc * -#if defined(CERNLIB_QMSUN)||defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMSUN)||(defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) MSBIT0 (IZW,IZP) = AND (IZW, NOT(LSHIFT(1,IZP-1)) ) MSBIT1 (IZW,IZP) = OR (IZW, LSHIFT(1,IZP-1) ) MSBIT (MZ,IZW,IZP) = OR (AND (IZW, NOT(LSHIFT(1,IZP-1)) ) @@ -25,7 +25,7 @@ MSBIT1 (IZW,IZP) = OR (IZW, LSHIFT(1,IZP-1) ) MSBIT (MZ,IZW,IZP) = OR (AND (IZW, NOT(LSHIFT(1,IZP-1)) ) + , LSHIFT(AND(MZ,1),IZP-1)) -#elif defined(CERNLIB_QMOS9)||defined(CERNLIB_QMHPX)||(defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT) +#elif defined(CERNLIB_QMOS9)||defined(CERNLIB_QMHPX)||(defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT) || defined(CERNLIB_GFORTRAN) MSBIT0 (IZW,IZP) = IAND (IZW, NOT(ISHFT(1,IZP-1)) ) MSBIT1 (IZW,IZP) = IOR (IZW, ISHFT(1,IZP-1) ) MSBIT (MZ,IZW,IZP) = IOR (IAND (IZW, NOT(ISHFT(1,IZP-1)) ) diff -Naur src/packlib/kernlib/kerngen/kerngen/q_sbyt.inc src.new/packlib/kernlib/kerngen/kerngen/q_sbyt.inc --- src/packlib/kernlib/kerngen/kerngen/q_sbyt.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_sbyt.inc 2005-10-31 15:02:28.000000000 -0600 @@ -18,7 +18,7 @@ * * q_sbyt.inc * -#if defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) MSBYT (MZ,IZW,IZP,NZB) = OR ( + AND (IZW, NOT(LSHIFT (ISHFTR(NOT(0),32-NZB),IZP-1))) + ,ISHFTR (LSHIFT(MZ,32-NZB), 33-IZP-NZB) ) @@ -26,7 +26,7 @@ C MSBYT (MZ,IZW,IZP,NZB) = OR ( C + AND (IZW, NOT(LSHIFT (ISHFTR(NOT(0),32-NZB), IZP-1))) C + , ISHFTR (LSHIFT(MZ,32-NZB), 33-IZP-NZB) ) -#elif defined(CERNLIB_QMOS9)||defined(CERNLIB_QMHPX)||(defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT) || defined(CERNLIB_QFDEC) +#elif defined(CERNLIB_QMOS9)||defined(CERNLIB_QMHPX)||(defined(CERNLIB_QMDOS)&&(!defined(CERNLIB_QF_F2C))) || defined(CERNLIB_QFMSOFT) || defined(CERNLIB_QFDEC) || defined(CERNLIB_GFORTRAN) MSBYT (MZ,IZW,IZP,NZB) = IOR ( + IAND (IZW, NOT(ISHFT (ISHFT(NOT(0),-32+NZB), IZP-1))) + , ISHFT (ISHFT(MZ,32-NZB), -33+IZP+NZB) ) diff -Naur src/packlib/kernlib/kerngen/kerngen/q_shift.inc src.new/packlib/kernlib/kerngen/kerngen/q_shift.inc --- src/packlib/kernlib/kerngen/kerngen/q_shift.inc 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/kerngen/q_shift.inc 2005-10-31 15:02:28.000000000 -0600 @@ -26,7 +26,7 @@ ISHFTL(IZW,NZB) = LSHIFT(IZW,NZB) C ISHFTR(IZW,NZB) = RSHIFT(IZW,NZB) C ISHFT(IZW,NZB) = LSHIFT(IZW,NZB) -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) ISHFTL (IZW,NZB) = LSHIFT (IZW,NZB) #elif 1 ISHFTL (IZW,NZB) = ISHFT (IZW, NZB) diff -Naur src/packlib/kernlib/kerngen/tcgen/ibits.F src.new/packlib/kernlib/kerngen/tcgen/ibits.F --- src/packlib/kernlib/kerngen/tcgen/ibits.F 2005-10-31 14:27:34.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgen/ibits.F 2005-10-31 15:02:28.000000000 -0600 @@ -9,7 +9,7 @@ #include "kerngen/pilot.h" #if defined(CERNLIB_QMDOS) #include "dosgs/ibits.F" -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) #include "lnxgs/ibits.F" #elif !defined(CERNLIB_QMILSTD) FUNCTION IBITS(I,N,L) diff -Naur src/packlib/kernlib/kerngen/tcgen/kerngt.F src.new/packlib/kernlib/kerngen/tcgen/kerngt.F --- src/packlib/kernlib/kerngen/tcgen/kerngt.F 2005-10-31 14:27:34.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgen/kerngt.F 2005-10-31 15:02:28.000000000 -0600 @@ -19,7 +19,7 @@ #include "hpxgs/kerngt.F" #elif defined(CERNLIB_QMIRT)||defined(CERNLIB_QMIRTD) #include "irtgs/kerngt.F" -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) #include "lnxgs/kerngt.F" #elif defined(CERNLIB_QMSGI) #include "sgigs/kerngt.F" diff -Naur src/packlib/kernlib/kerngen/tcgen/utrans.F src.new/packlib/kernlib/kerngen/tcgen/utrans.F --- src/packlib/kernlib/kerngen/tcgen/utrans.F 2005-10-31 14:27:35.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgen/utrans.F 2005-10-31 15:02:28.000000000 -0600 @@ -7,7 +7,7 @@ * * #include "kerngen/pilot.h" -#if defined(CERNLIB_QMLNX) +#if defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) #include "lnxgs/utrans.F" #else SUBROUTINE UTRANS (AI,AJ,NCH,IP,JP) diff -Naur src/packlib/kernlib/kerngen/tcgens/cbyt.F src.new/packlib/kernlib/kerngen/tcgens/cbyt.F --- src/packlib/kernlib/kerngen/tcgens/cbyt.F 2005-10-31 14:27:36.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/cbyt.F 2005-10-31 15:02:28.000000000 -0600 @@ -9,7 +9,7 @@ #include "kerngen/pilot.h" #if defined(CERNLIB_QMSUN) #include "sungs/cbyt.F" -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) #include "lnxgs/cbyt.F" #else SUBROUTINE CBYT (M,LM,IX,LX,NB) diff -Naur src/packlib/kernlib/kerngen/tcgens/iucomh.F src.new/packlib/kernlib/kerngen/tcgens/iucomh.F --- src/packlib/kernlib/kerngen/tcgens/iucomh.F 2005-10-31 14:27:36.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/iucomh.F 2005-10-31 15:02:28.000000000 -0600 @@ -19,8 +19,10 @@ #include "dosgs/iucomh.F" #elif defined(CERNLIB_QMVAOS)||defined(CERNLIB_QMVMI) #include "allgs/iucomh.F" -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) #include "lnxgs/iucomh.F" #elif defined(CERNLIB_QMVAX) #include "vaxgs/iucomh.F" +#elif defined(CERNLIB_GFORTRAN) +#include "allgs/iucomh.F" #endif diff -Naur src/packlib/kernlib/kerngen/tcgens/lnxgs/rndm.F src.new/packlib/kernlib/kerngen/tcgens/lnxgs/rndm.F --- src/packlib/kernlib/kerngen/tcgens/lnxgs/rndm.F 2005-10-31 14:27:35.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/lnxgs/rndm.F 2005-10-31 15:02:28.000000000 -0600 @@ -25,7 +25,9 @@ C PARAMETER (MSK2 = '33000000'X) COMMON /MCGN/ MCGN DATA MCGN /12345/ - +#if defined(CERNLIB_GFORTRAN) + SAVE /MCGN/ +#endif MCGN = MCGN * 69069 MANT = ISHFT (MCGN,-8) diff -Naur src/packlib/kernlib/kerngen/tcgens/lnxppcgs/ublow.F src.new/packlib/kernlib/kerngen/tcgens/lnxppcgs/ublow.F --- src/packlib/kernlib/kerngen/tcgens/lnxppcgs/ublow.F 2005-10-31 14:27:36.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/lnxppcgs/ublow.F 2005-10-31 15:02:28.000000000 -0600 @@ -21,8 +21,13 @@ NCH = NCHP(1) IF (NCH) 91, 29, 11 +#if !defined(CERNLIB_GFORTRAN) 11 NWS = ishftr (NCH,2) NTRAIL = AND (NCH,3) +#else + 11 NWS = ishft (NCH,-2) + NTRAIL = iAND (NCH,3) +#endif JT = 0 IF (NWS.EQ.0) GO TO 26 @@ -30,10 +35,17 @@ DO 24 JS=1,NWS MWD = MS(JS) +#if !defined(CERNLIB_GFORTRAN) MT(JT+1) = OR (IBLAN1,AND(MASK1,MWD)) MT(JT+2) = OR (IBLAN1,AND(MASK1,LSHIFT(MWD,8))) MT(JT+3) = OR (IBLAN1,AND(MASK1,LSHIFT(MWD,16))) MT(JT+4) = OR (IBLAN1, LSHIFT(MWD,24) ) +#else + MT(JT+1) = iOR (IBLAN1,iAND(MASK1,MWD)) + MT(JT+2) = iOR (IBLAN1,iAND(MASK1,iSHFT(MWD,8))) + MT(JT+3) = iOR (IBLAN1,iAND(MASK1,iSHFT(MWD,16))) + MT(JT+4) = iOR (IBLAN1, iSHFT(MWD,24) ) +#endif 24 JT = JT + 4 IF (NTRAIL.EQ.0) RETURN @@ -43,8 +55,13 @@ 26 MWD = MS(NWS+1) DO 28 JS=1,NTRAIL +#if !defined(CERNLIB_GFORTRAN) MT(JT+1) = OR (IBLAN1,AND(MASK1,MWD)) MWD = LSHIFT (MWD,8) +#else + MT(JT+1) = iOR (IBLAN1,iAND(MASK1,MWD)) + MWD = iSHFT (MWD,8) +#endif 28 JT = JT + 1 29 RETURN diff -Naur src/packlib/kernlib/kerngen/tcgens/lnxppcgs/ubunch.F src.new/packlib/kernlib/kerngen/tcgens/lnxppcgs/ubunch.F --- src/packlib/kernlib/kerngen/tcgens/lnxppcgs/ubunch.F 2005-10-31 14:27:36.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/lnxppcgs/ubunch.F 2005-10-31 15:02:28.000000000 -0600 @@ -21,19 +21,32 @@ NCH = NCHP(1) IF (NCH) 91,39,11 +#if !defined(CERNLIB_GFORTRAN) 11 NWT = ishftr (NCH,2) NTRAIL = AND (NCH,3) +#else + 11 NWT = ishft (NCH,-2) + NTRAIL = iAND (NCH,3) +#endif JS = 0 IF (NWT.EQ.0) GO TO 31 C-- Pack the initial complete words DO 24 JT=1,NWT +#if !defined(CERNLIB_GFORTRAN) MT(JT) = OR (OR (OR ( + AND(MS(JS+1),MASK1), + ISHFTR (AND(MS(JS+2),MASK1), 8)), + ISHFTR (IAND(MS(JS+3),MASK1),16)), + ISHFTR (MS(JS+4), 24) ) +#else + MT(JT) = iOR (iOR (iOR ( + + iAND(MS(JS+1),MASK1), + + ISHFT (iAND(MS(JS+2),MASK1), -8)), + + ISHFT (IAND(MS(JS+3),MASK1),-16)), + + ISHFT (MS(JS+4), -24) ) +#endif 24 JS = JS + 4 IF (NTRAIL.EQ.0) RETURN @@ -44,7 +57,11 @@ JS = NCH DO 34 JT=1,NTRAIL +#if !defined(CERNLIB_GFORTRAN) MWD = OR (ISHFTR(MWD,8), AND(MS(JS),MASK1)) +#else + MWD = iOR (ISHFT(MWD,-8), iAND(MS(JS),MASK1)) +#endif 34 JS = JS - 1 MT(NWT+1) = MWD 39 RETURN diff -Naur src/packlib/kernlib/kerngen/tcgens/vblank.F src.new/packlib/kernlib/kerngen/tcgens/vblank.F --- src/packlib/kernlib/kerngen/tcgens/vblank.F 2005-10-31 14:27:36.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/tcgens/vblank.F 2005-10-31 15:02:28.000000000 -0600 @@ -14,6 +14,9 @@ C INTEGER A(*), BLANK DATA BLANK / 4H / +#if defined(CERNLIB_GFORTRAN) + save +#endif C IF (N.LE.0) RETURN DO 9 I= 1,N diff -Naur src/packlib/kernlib/kerngen/unix/Imakefile src.new/packlib/kernlib/kerngen/unix/Imakefile --- src/packlib/kernlib/kerngen/unix/Imakefile 2005-10-31 14:27:17.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/Imakefile 2005-10-31 15:02:28.000000000 -0600 @@ -7,12 +7,15 @@ #if defined(CERNLIB_SUN) || defined(CERNLIB_SOLARIS) LIBDIRS=sungs #else -#if defined(CERNLIB_LNX) +#if defined(CERNLIB_LNX) && !defined(CERNLIB_GFORTRAN) LIBDIRS=lnxgs #else #if defined(CERNLIB_IRTD) LIBDIRS=irtdgs #else +#if defined(CERNLIB_GFORTRAN) +LIBDIRS=gfortgs +#else #undef IHaveSubdirs all:: @@ -22,6 +25,7 @@ #endif #endif #endif +#endif #ifdef IHaveSubdirs diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/Imakefile src.new/packlib/kernlib/kerngen/unix/gfortgs/Imakefile --- src/packlib/kernlib/kerngen/unix/gfortgs/Imakefile 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/Imakefile 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,6 @@ + +SRCS_F= irndm.F qnext.F rdmin.F + +SRCS_C= lshift.c ishftr.c getarg.c + +SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/getarg.c src.new/packlib/kernlib/kerngen/unix/gfortgs/getarg.c --- src/packlib/kernlib/kerngen/unix/gfortgs/getarg.c 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/getarg.c 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,4 @@ +void getarg_(int *pos, char *val, int len) +{ + _gfortran_getarg_i4(pos, val, len); +} diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/irndm.F src.new/packlib/kernlib/kerngen/unix/gfortgs/irndm.F --- src/packlib/kernlib/kerngen/unix/gfortgs/irndm.F 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/irndm.F 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,18 @@ +* +* $Id: irndm.F,v 1.1.1.1 1996/02/15 17:50:07 mclareni Exp $ +* +* $Log: irndm.F,v $ +* Revision 1.1.1.1 1996/02/15 17:50:07 mclareni +* Kernlib +* +* +#include "kerngen/pilot.h" + FUNCTION IRNDM(ISEEK) + COMMON /MCGN/ MCGN + SAVE /MCGN/ + +C-- Integer random number + MCGN = MCGN * 69069 + IRNDM = ISHFT (MCGN,-1) + RETURN + END diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/ishftr.c src.new/packlib/kernlib/kerngen/unix/gfortgs/ishftr.c --- src/packlib/kernlib/kerngen/unix/gfortgs/ishftr.c 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/ishftr.c 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,21 @@ +/* + * $Id: ishftr.c,v 1.1.1.1 1996/02/15 17:50:07 mclareni Exp $ + * + * $Log: ishftr.c,v $ + * Revision 1.1.1.1 1996/02/15 17:50:07 mclareni + * Kernlib + * + */ +#include "kerngen/pilot.h" +/*> ROUTINE ISHFT + CERN PROGLIB# ISHFTR .VERSION KERNLNX 1.02 940511 + + Logical right shift by *len (+ve) places +*/ +unsigned int ishftr_(arg,len) +unsigned int *arg; +int *len; +{ + return(*arg >> *len); +} +/*> END <----------------------------------------------------------*/ diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/lshift.c src.new/packlib/kernlib/kerngen/unix/gfortgs/lshift.c --- src/packlib/kernlib/kerngen/unix/gfortgs/lshift.c 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/lshift.c 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,23 @@ +/* + * $Id: lshift.c,v 1.1.1.1 1996/02/15 17:50:07 mclareni Exp $ + * + * $Log: lshift.c,v $ + * Revision 1.1.1.1 1996/02/15 17:50:07 mclareni + * Kernlib + * + */ +#include "kerngen/pilot.h" +/*> ROUTINE ISHFT + CERN PROGLIB# ISHFT .VERSION KERNLNX 1.00 930507 + + Provides the value of the argument ARG with the bits shifted. + Bits shifted out to the left or right are lost, and zeros are shifted + in from the opposite end. CNL 210 +*/ +unsigned int lshift_(arg,len) +unsigned int *arg; +int *len; +{ + return((*len > 0)? *arg << *len: *arg >> (-*len)); +} +/*> END <----------------------------------------------------------*/ diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/qnext.F src.new/packlib/kernlib/kerngen/unix/gfortgs/qnext.F --- src/packlib/kernlib/kerngen/unix/gfortgs/qnext.F 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/qnext.F 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,12 @@ +* +* $Id: qnext.F,v 1.1.1.1 1996/02/15 17:50:08 mclareni Exp $ +* +* $Log: qnext.F,v $ +* Revision 1.1.1.1 1996/02/15 17:50:08 mclareni +* Kernlib +* +* +#include "kerngen/pilot.h" + SUBROUTINE QNEXT + RETURN + END diff -Naur src/packlib/kernlib/kerngen/unix/gfortgs/rdmin.F src.new/packlib/kernlib/kerngen/unix/gfortgs/rdmin.F --- src/packlib/kernlib/kerngen/unix/gfortgs/rdmin.F 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kernlib/kerngen/unix/gfortgs/rdmin.F 2005-10-31 15:02:28.000000000 -0600 @@ -0,0 +1,21 @@ +* +* $Id: rdmin.F,v 1.1.1.1 1996/02/15 17:50:07 mclareni Exp $ +* +* $Log: rdmin.F,v $ +* Revision 1.1.1.1 1996/02/15 17:50:07 mclareni +* Kernlib +* +* +#include "kerngen/pilot.h" + SUBROUTINE RDMIN(ISEED) + COMMON /MCGN/ MCGN + SAVE /MCGN/ + +C-- Set the seed + MCGN = ISEED + RETURN + +C-- Get the seed + ENTRY RDMOUT (ISEED) + ISEED = MCGN + END diff -Naur src/packlib/kernlib/kernnum/d704fort/Imakefile src.new/packlib/kernlib/kernnum/d704fort/Imakefile --- src/packlib/kernlib/kernnum/d704fort/Imakefile 2005-10-31 14:27:01.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/d704fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -4,6 +4,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kernlib/kernnum/f002fort/Imakefile src.new/packlib/kernlib/kernnum/f002fort/Imakefile --- src/packlib/kernlib/kernnum/f002fort/Imakefile 2005-10-31 14:27:16.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/f002fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -10,6 +10,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kernlib/kernnum/f003fort/Imakefile src.new/packlib/kernlib/kernnum/f003fort/Imakefile --- src/packlib/kernlib/kernnum/f003fort/Imakefile 2005-10-31 14:27:04.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/f003fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -11,6 +11,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kernlib/kernnum/f004fort/Imakefile src.new/packlib/kernlib/kernnum/f004fort/Imakefile --- src/packlib/kernlib/kernnum/f004fort/Imakefile 2005-10-31 14:27:05.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/f004fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -6,6 +6,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kernlib/kernnum/f010fort/Imakefile src.new/packlib/kernlib/kernnum/f010fort/Imakefile --- src/packlib/kernlib/kernnum/f010fort/Imakefile 2005-10-31 14:27:06.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/f010fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -7,6 +7,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags diff -Naur src/packlib/kernlib/kernnum/f011fort/Imakefile src.new/packlib/kernlib/kernnum/f011fort/Imakefile --- src/packlib/kernlib/kernnum/f011fort/Imakefile 2005-10-31 14:27:06.000000000 -0600 +++ src.new/packlib/kernlib/kernnum/f011fort/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -7,6 +7,10 @@ FDEBUGFLAGS=NoOpFortranDebugFlags #endif +#if defined(CERNLIB_MACOSX) +FDEBUGFLAGS := -O0 $(FDEBUGFLAGS) -O0 +#endif + FORTRANSAVEOPTION=FortranSaveFlags SubdirLibraryTarget(NullParameter,NullParameter) diff -Naur src/packlib/kuip/code_kuip/Imakefile src.new/packlib/kuip/code_kuip/Imakefile --- src/packlib/kuip/code_kuip/Imakefile 2005-10-31 14:27:39.000000000 -0600 +++ src.new/packlib/kuip/code_kuip/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -3,7 +3,7 @@ SRCS_C= getline.c kalias.c kbrow.c kedit.c kexec.c khash.c kicon.c \ @@\ kienbr.c kipiaf.c kkern.c kmacro.c kmath.c kmenu.c kmisc.c \ @@\ kmodel.c kmterm.c kuinit.c kutrue.c kuvers.c kuwhag.c \ @@\ - kuwhat.c kvect.c + kuwhat.c kvect.c re.c #ifdef CERNLIB_WINNT SRCS_C :=$(SRCS_C) kmutil0.c diff -Naur src/packlib/kuip/code_kuip/re.c src.new/packlib/kuip/code_kuip/re.c --- src/packlib/kuip/code_kuip/re.c 1969-12-31 18:00:00.000000000 -0600 +++ src.new/packlib/kuip/code_kuip/re.c 2005-10-31 15:02:13.000000000 -0600 @@ -0,0 +1,29 @@ +#include +#include + +static regex_t reg; + +char * +re_comp(s) +char *s; +{ + int i; + static char errbuf[81]; + i = regcomp(®, s, REG_BASIC|REG_NOSUB); + + if (!i) return (char *)0; + + regerror(i, ®, errbuf, sizeof(errbuf)); + return errbuf; +} + +int +re_exec(s) +char *s; +{ + int i; + + i = regexec(®, s, (size_t) 0, (regmatch_t *)0, 0); + + return !i; +} diff -Naur src/packlib/kuip/kuip/kfor.h src.new/packlib/kuip/kuip/kfor.h --- src/packlib/kuip/kuip/kfor.h 2005-10-31 14:27:40.000000000 -0600 +++ src.new/packlib/kuip/kuip/kfor.h 2005-10-31 15:02:28.000000000 -0600 @@ -1025,7 +1025,11 @@ #define Errrun F77_NAME(errrun,ERRRUN) #define Fmemcpy F77_NAME(fmemcpy,FMEMCPY) +#if !defined(CERNLIB_GFORTRAN) #define Getarg F77_NAME(getarg,GETARG) +#else +#define Getarg _gfortran_getarg_i4 +#endif extern SUBROUTINE Getarg; #define Goparm F77_NAME(goparm,GOPARM) extern SUBROUTINE Goparm; diff -Naur src/packlib/kuip/kuip/ksys.h src.new/packlib/kuip/kuip/ksys.h --- src/packlib/kuip/kuip/ksys.h 2005-10-31 14:27:40.000000000 -0600 +++ src.new/packlib/kuip/kuip/ksys.h 2005-10-31 15:02:28.000000000 -0600 @@ -188,6 +188,28 @@ #endif +#ifdef CERNLIB_MACOSX +# define MACOSX +# define MACHINE_NAME "MACOSX" +# define UNIX +# define HAVE_MEMMOVE +# define HAVE_STRCASECMP +# define HAVE_SELECT +# define MATCH_RE_COMP /* use re_comp/re_exec */ +#endif + + +#ifdef CERNLIB_MACOSX +# define MACOSX +# define MACHINE_NAME "MACOSX" +# define UNIX +# define HAVE_MEMMOVE +# define HAVE_STRCASECMP +# define HAVE_SELECT +# define MATCH_RE_COMP /* use re_comp/re_exec */ +#endif + + #ifdef MSDOS # define MACHINE_NAME "IBMPC" # define OS_NAME "MSDOS" diff -Naur src/packlib/minuit/examples/fcnk0.F src.new/packlib/minuit/examples/fcnk0.F --- src/packlib/minuit/examples/fcnk0.F 2005-10-31 14:27:40.000000000 -0600 +++ src.new/packlib/minuit/examples/fcnk0.F 2005-10-31 15:02:28.000000000 -0600 @@ -23,6 +23,9 @@ + / 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., + 0., 2., 1., 4., 4., 2., 4., 2., 2., 0., + 2., 3., 7., 2., 3., 6., 2., 4., 1., 5./ +#if defined(CERNLIB_GFORTRAN) + save +#endif C XRE = X(1) XIM = X(2) diff -Naur src/packlib/zbook/test/zexam5.F src.new/packlib/zbook/test/zexam5.F --- src/packlib/zbook/test/zexam5.F 2005-10-31 14:26:54.000000000 -0600 +++ src.new/packlib/zbook/test/zexam5.F 2005-10-31 15:02:28.000000000 -0600 @@ -54,7 +54,11 @@ C C NEW BRANCH C +#if !defined(CERNLIB_GFORTRAN) CALL ZBOOKN (Z,IZ(ID2-NLINKS-1),NDATA+MDATA,0,3HNEW,1) +#else + CALL ZBOOKN (Z,IZ(ID2-NLINKS-1),NDATA+MDATA,0,4HNEW ,1) +#endif IF (ZBUG (Z,100)) GO TO 999 C CALL ZPTREE (Z,ID2,5HTREE$,1HF) diff -Naur src/packlib/zebra/fq/fzdaeof.inc src.new/packlib/zebra/fq/fzdaeof.inc --- src/packlib/zebra/fq/fzdaeof.inc 2005-10-31 14:27:41.000000000 -0600 +++ src.new/packlib/zebra/fq/fzdaeof.inc 2005-10-31 15:02:28.000000000 -0600 @@ -30,7 +30,7 @@ *** PARAMETER (IOSEOF = 10) !* for xlf 2.2 *** PARAMETER (IOSEOF = 122) !* for xlf 2.3 PARAMETER (IOSEOF = 1) !* for xlf 3.2 -#elif defined(CERNLIB_QMLNX) +#elif defined(CERNLIB_QMLNX) && !defined(CERNLIB_GFORTRAN) PARAMETER (IOSEOF = 36) #elif defined(CERNLIB_QMOS9) PARAMETER (IOSEOF = 326) @@ -43,6 +43,8 @@ #elif defined(CERNLIB_WINDOWS) * only valid for dec fortran (e.g. not f2c + microsoft c) PARAMETER (IOSEOF = 36) +#elif defined(CERNLIB_GFORTRAN) + PARAMETER (IOSEOF = 3) #elif 1 PARAMETER (IOSEOF = -1) #endif diff -Naur src/packlib/zebra/zebra/q_and.inc src.new/packlib/zebra/zebra/q_and.inc --- src/packlib/zebra/zebra/q_and.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_and.inc 2005-10-31 15:02:28.000000000 -0600 @@ -24,7 +24,7 @@ #elif defined(CERNLIB_QMIBMSI) IAND (IZV,IZW) = LAND (IZV, IZW) -#elif defined(CERNLIB_LNX) +#elif defined(CERNLIB_LNX) && !defined(CERNLIB_GFORTRAN) IAND(IZV,IZW) = AND(IZV,IZW) #elif defined(CERNLIB_SUN) diff -Naur src/packlib/zebra/zebra/q_andor.inc src.new/packlib/zebra/zebra/q_andor.inc --- src/packlib/zebra/zebra/q_andor.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_andor.inc 2005-10-31 15:02:28.000000000 -0600 @@ -36,7 +36,7 @@ IEOR (IZV,IZW) = LXOR (IZV, IZW) NOT (IZW) = LCOMPL (IZW) -#elif defined(CERNLIB_LNX) +#elif defined(CERNLIB_LNX) && !defined(CERNLIB_GFORTRAN) IAND(IZV,IZW) = AND(IZV,IZW) IOR(IZV,IZW) = OR(IZV,IZW) IEOR(IZV,IZW) = XOR(IZV,IZW) diff -Naur src/packlib/zebra/zebra/q_jbit.inc src.new/packlib/zebra/zebra/q_jbit.inc --- src/packlib/zebra/zebra/q_jbit.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_jbit.inc 2005-10-31 15:02:28.000000000 -0600 @@ -47,7 +47,7 @@ #elif defined(CERNLIB_QF_SIEM) JBIT (IZW,IZP) = SHFTR (SHFTL(IZW,32-IZP), 31) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) JBIT(IZW,IZP) = AND(ISHFTR(IZW,IZP-1),1) #elif defined(CERNLIB_OS9) diff -Naur src/packlib/zebra/zebra/q_jbyt.inc src.new/packlib/zebra/zebra/q_jbyt.inc --- src/packlib/zebra/zebra/q_jbyt.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_jbyt.inc 2005-10-31 15:02:28.000000000 -0600 @@ -35,7 +35,7 @@ #if defined(CERNLIB_QF_NDP) JBYT (IZZW,IZZP,NZZB) = IBITS (IZZW,IZZP-1,NZZB) -#elif defined(CERNLIB_QF_F2C) +#elif defined(CERNLIB_QF_F2C) && !defined(CERNLIB_GFORTRAN) JBYT (IZW,IZP,NZB) = ISHFTR(LSHIFT(IZW,33-IZP-NZB),32-NZB) #endif diff -Naur src/packlib/zebra/zebra/q_jbytet.inc src.new/packlib/zebra/zebra/q_jbytet.inc --- src/packlib/zebra/zebra/q_jbytet.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_jbytet.inc 2005-10-31 15:02:28.000000000 -0600 @@ -52,7 +52,7 @@ JBYTET (MZ,IZW,IZP,NZB) = LAND (MZ, + SHFTR (SHFTL(IZW,33-IZP-NZB), 32-NZB) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) JBYTET (MZ,IZW,IZP,NZB) = AND (MZ, + ISHFTR (LSHIFT(IZW,33-IZP-NZB),32-NZB) ) diff -Naur src/packlib/zebra/zebra/q_jbytor.inc src.new/packlib/zebra/zebra/q_jbytor.inc --- src/packlib/zebra/zebra/q_jbytor.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_jbytor.inc 2005-10-31 15:02:28.000000000 -0600 @@ -50,7 +50,7 @@ JBYTOR (MZ,IZW,IZP,NZB) = LOR (MZ, + SHFTR (SHFTL(IZW,33-IZP-NZB), 32-NZB) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) JBYTOR (MZ,IZW,IZP,NZB) = OR (MZ, + ISHFTR (LSHIFT(IZW,33-IZP-NZB),32-NZB) ) diff -Naur src/packlib/zebra/zebra/q_mbytet.inc src.new/packlib/zebra/zebra/q_mbytet.inc --- src/packlib/zebra/zebra/q_mbytet.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_mbytet.inc 2005-10-31 15:02:28.000000000 -0600 @@ -51,7 +51,7 @@ MBYTET (MZ,IZW,IZP,NZB) = LAND (IZW, LCOMPL(SHFTR ( + SHFTL(LCOMPL(MZ),32-NZB), 33-IZP-NZB)) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MBYTET (MZ,IZW,IZP,NZB) = AND (IZW, + NOT(ISHFTR (LSHIFT(NOT(MZ),32-NZB),33-IZP-NZB)) ) diff -Naur src/packlib/zebra/zebra/q_mbytor.inc src.new/packlib/zebra/zebra/q_mbytor.inc --- src/packlib/zebra/zebra/q_mbytor.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_mbytor.inc 2005-10-31 15:02:28.000000000 -0600 @@ -51,7 +51,7 @@ MBYTOR (MZ,IZW,IZP,NZB) = LOR (IZW, SHFTR ( + SHFTL(MZ,32-NZB), 33-IZP-NZB) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MBYTOR (MZ,IZW,IZP,NZB) = OR (IZW, + ISHFTR (LSHIFT(MZ,32-NZB),33-IZP-NZB)) diff -Naur src/packlib/zebra/zebra/q_or.inc src.new/packlib/zebra/zebra/q_or.inc --- src/packlib/zebra/zebra/q_or.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_or.inc 2005-10-31 15:02:28.000000000 -0600 @@ -24,7 +24,7 @@ #elif defined(CERNLIB_QMIBMSI) IOR (IZV,IZW) = LOR (IZV, IZW) -#elif defined(CERNLIB_LNX) +#elif defined(CERNLIB_LNX) && !defined(CERNLIB_GFORTRAN) IOR(IZV,IZW) = OR(IZV,IZW) #elif defined(CERNLIB_SUN) diff -Naur src/packlib/zebra/zebra/q_sbit.inc src.new/packlib/zebra/zebra/q_sbit.inc --- src/packlib/zebra/zebra/q_sbit.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_sbit.inc 2005-10-31 15:02:28.000000000 -0600 @@ -46,7 +46,7 @@ MSBIT (MZ,IZW,IZP) = LOR (LAND (IZW, LCOMPL(SHFTL(1,IZP-1)) ) + , SHFTL(LAND(MZ,1),IZP-1) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MSBIT (MZ,IZW,IZP) = OR (AND (IZW, NOT(LSHIFT(1,IZP-1))) + ,LSHIFT(AND(MZ,1),IZP-1)) diff -Naur src/packlib/zebra/zebra/q_sbit0.inc src.new/packlib/zebra/zebra/q_sbit0.inc --- src/packlib/zebra/zebra/q_sbit0.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_sbit0.inc 2005-10-31 15:02:28.000000000 -0600 @@ -41,7 +41,7 @@ #elif defined(CERNLIB_QF_SIEM) MSBIT0 (IZW,IZP) = LAND (IZW, LCOMPL(SHFTL(1,IZP-1)) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MSBIT0 (IZW,IZP) = AND (IZW, NOT(LSHIFT(1,IZP-1))) #elif defined(CERNLIB_PDP) diff -Naur src/packlib/zebra/zebra/q_sbit1.inc src.new/packlib/zebra/zebra/q_sbit1.inc --- src/packlib/zebra/zebra/q_sbit1.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_sbit1.inc 2005-10-31 15:02:28.000000000 -0600 @@ -40,7 +40,7 @@ #elif defined(CERNLIB_QF_SIEM) MSBIT1 (IZW,IZP) = LOR (IZW, SHFTL(1,IZP-1) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MSBIT1 (IZW,IZP) = OR (IZW, LSHIFT(1,IZP-1)) #elif defined(CERNLIB_PDP) diff -Naur src/packlib/zebra/zebra/q_sbyt.inc src.new/packlib/zebra/zebra/q_sbyt.inc --- src/packlib/zebra/zebra/q_sbyt.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_sbyt.inc 2005-10-31 15:02:28.000000000 -0600 @@ -43,7 +43,7 @@ + LAND (IZW, LCOMPL(SHFTL (SHFTR(-1,32-NZB), IZP-1))) + , SHFTR (SHFTL(MZ,32-NZB), 33-IZP-NZB) ) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) MSBYT (MZ,IZW,IZP,NZB) = OR ( + AND (IZW, NOT(LSHIFT (ISHFTR(NOT(0),32-NZB),IZP-1))) + ,ISHFTR (LSHIFT(MZ,32-NZB), 33-IZP-NZB) ) diff -Naur src/packlib/zebra/zebra/q_shift.inc src.new/packlib/zebra/zebra/q_shift.inc --- src/packlib/zebra/zebra/q_shift.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_shift.inc 2005-10-31 15:02:28.000000000 -0600 @@ -36,7 +36,7 @@ ISHFTL (IZW,NZB) = SHFTL (IZW, NZB) ISHFTR (IZW,NZB) = SHFTR (IZW, NZB) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) ISHFTL (IZW,NZB) = LSHIFT (IZW,NZB) #elif (defined(CERNLIB_SUN))&&(!defined(CERNLIB_BUGLRSHFT)) diff -Naur src/packlib/zebra/zebra/q_shiftl.inc src.new/packlib/zebra/zebra/q_shiftl.inc --- src/packlib/zebra/zebra/q_shiftl.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_shiftl.inc 2005-10-31 15:02:28.000000000 -0600 @@ -28,7 +28,7 @@ #elif defined(CERNLIB_QF_SIEM) ISHFTL (IZW,NZB) = SHFTL (IZW, NZB) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) ISHFTL (IZW,NZB) = LSHIFT (IZW,NZB) #elif (defined(CERNLIB_SUN))&&(!defined(CERNLIB_BUGLRSHFT)) diff -Naur src/packlib/zebra/zebra/q_shiftr.inc src.new/packlib/zebra/zebra/q_shiftr.inc --- src/packlib/zebra/zebra/q_shiftr.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_shiftr.inc 2005-10-31 15:02:28.000000000 -0600 @@ -32,7 +32,7 @@ #elif defined(CERNLIB_QF_SIEM) ISHFTR (IZW,NZB) = SHFTR (IZW, NZB) -#elif defined(CERNLIB_LINUX) +#elif defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) #elif (defined(CERNLIB_SUN))&&(!defined(CERNLIB_BUGLRSHFT)) ISHFTR (IZW,NZB) = lrshft (IZW, NZB) diff -Naur src/packlib/zebra/zebra/q_xor.inc src.new/packlib/zebra/zebra/q_xor.inc --- src/packlib/zebra/zebra/q_xor.inc 2005-10-31 14:27:42.000000000 -0600 +++ src.new/packlib/zebra/zebra/q_xor.inc 2005-10-31 15:02:28.000000000 -0600 @@ -24,7 +24,7 @@ #elif defined(CERNLIB_QMIBMSI) IEOR (IZV,IZW) = LXOR (IZV, IZW) -#elif defined(CERNLIB_LNX) +#elif defined(CERNLIB_LNX) && !defined(CERNLIB_GFORTRAN) IEOR(IZV,IZW) = XOR(IZV,IZW) #elif defined(CERNLIB_SUN) diff -Naur src/pawlib/comis/code/csaddr.F src.new/pawlib/comis/code/csaddr.F --- src/pawlib/comis/code/csaddr.F 2005-10-31 14:27:48.000000000 -0600 +++ src.new/pawlib/comis/code/csaddr.F 2005-10-31 15:02:13.000000000 -0600 @@ -26,7 +26,11 @@ I=CSLTGP(IPVS) IF(I.GT.0)THEN IF(IFCS.EQ.0)THEN +#if defined(CERNLIB_MACOSX) + IADGP=CS_GET_FUNC('_'//NAME(1:NC)//'_') +#else IADGP=CS_GET_FUNC(NAME(1:NC)//'_') +#endif IF(IADGP.NE.0)THEN IFCS=-2 CALL CSRTGP(I) @@ -35,7 +39,11 @@ ENDIF ENDIF ELSE +#if defined(CERNLIB_MACOSX) + IADGP=CS_GET_FUNC('_'//NAME(1:NC)//'_') +#else IADGP=CS_GET_FUNC(NAME(1:NC)//'_') +#endif IF(IADGP.NE.0)THEN IFCS=-2 ITYPGP=-2 diff -Naur src/pawlib/comis/code/cscrexec.F src.new/pawlib/comis/code/cscrexec.F --- src/pawlib/comis/code/cscrexec.F 2005-10-31 14:27:48.000000000 -0600 +++ src.new/pawlib/comis/code/cscrexec.F 2005-10-31 15:02:28.000000000 -0600 @@ -175,10 +175,15 @@ + // NAME(:LN) //'.sl '// NAME(:LN) //'.o' ENDIF #endif -#if defined(CERNLIB_LINUX) +#if defined(CERNLIB_LINUX) && !defined(CERNLIB_MACOSX) CHLINE= 'ld -shared -o ' + // NAME(:LN) //'.sl '// NAME(:LN) //'.o' #endif +#if defined(CERNLIB_MACOSX) + CHLINE= 'g77 -bundle -bundle_loader `/usr/bin/which pawX11` ' + + // ' -bind_at_load -o ' + + // NAME(:LN) //'.sl '// NAME(:LN) //'.o' +#endif #if defined(CERNLIB_ALPHA_OSF) CHLINE= 'ld -shared -o ' + // NAME(:LN) //'.sl '// NAME(:LN) //'.o \\' diff -Naur src/pawlib/paw/demo/higz_windows.dat src.new/pawlib/paw/demo/higz_windows.dat --- src/pawlib/paw/demo/higz_windows.dat 2005-10-31 14:27:51.000000000 -0600 +++ src.new/pawlib/paw/demo/higz_windows.dat 2005-10-31 15:02:28.000000000 -0600 @@ -1,10 +1,10 @@ - 0000 0000 0600 0600 0.0 PAW tests - 0615 0000 0400 0400 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests - 0000 0000 0600 0600 0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0615 0000 0400 0400 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests + 0000 0000 0600 0600 :0.0 PAW tests diff -Naur src/pawlib/paw/fmotif/Imakefile src.new/pawlib/paw/fmotif/Imakefile --- src/pawlib/paw/fmotif/Imakefile 2005-10-31 14:27:52.000000000 -0600 +++ src.new/pawlib/paw/fmotif/Imakefile 2005-10-31 15:02:28.000000000 -0600 @@ -2,7 +2,7 @@ ntwini.F pamloc.F pbhist.F pbhlun.F pbpiaf.F pbplun.F \ @@\ plotisto.F pmhist.F pminit.F show_chain.F -#ifdef CERNLIB_LINUX +#if defined(CERNLIB_LINUX) && !defined(CERNLIB_GFORTRAN) FORTRANOPTIONS = -fno-backslash $(FORTRANSAVEOPTION) -fno-second-underscore #endif diff -Naur src/pawlib/paw/programs/Imakefile src.new/pawlib/paw/programs/Imakefile --- src/pawlib/paw/programs/Imakefile 2005-10-31 14:27:54.000000000 -0600 +++ src.new/pawlib/paw/programs/Imakefile 2005-10-31 15:02:13.000000000 -0600 @@ -9,7 +9,7 @@ EXTRA_LDOPTIONS=-Wl,-E #endif -#if defined(CERNLIB_LINUX) +#if defined(CERNLIB_LINUX) && !defined(CERNLIB_MACOSX) EXTRA_LDOPTIONS=-Wl,-E #endif diff -Naur src/pawlib/sigma/src/siallm.F src.new/pawlib/sigma/src/siallm.F --- src/pawlib/sigma/src/siallm.F 2005-10-31 14:27:56.000000000 -0600 +++ src.new/pawlib/sigma/src/siallm.F 2005-10-31 15:02:31.000000000 -0600 @@ -108,9 +108,20 @@ GO TO 37 21 IF(N.EQ.2)GO TO 2 22 MN1=M-N+1 +#if !defined(CERNLIB_GFORTRAN) IF(REAL(A(N,N)).NE.0..OR.AIMAG(A(N,N)).NE.0.) 1 IF(ABS(REAL(A(N,N-1)/A(N,N)))+ABS(AIMAG(A(N,N-1)/A(N,N)))-1.E-9) 2 24,24,23 +#else + IF (REAL(A(N,N)).NE.0..OR.AIMAG(A(N,N)).NE.0.) THEN + IF (ABS(REAL(A(N,N-1)/A(N,N)))+ABS(AIMAG(A(N,N-1)/A(N,N))) + + -1.E-9.LE.0.) THEN + GO TO 24 + ELSE + GO TO 23 + ENDIF + ENDIF +#endif 23 IF(ABS(REAL(A(N,N-1)))+ABS(AIMAG(A(N,N-1))).GE.EPS)GO TO 25 24 LAMBDA(MN1)=A(N,N)+SHIFT(1) ICOUNT=0 diff -Naur src/scripts/cernlib src.new/scripts/cernlib --- src/scripts/cernlib 2005-10-31 14:26:19.000000000 -0600 +++ src.new/scripts/cernlib 2005-10-31 15:02:13.000000000 -0600 @@ -31,7 +31,7 @@ - CERNLIB="" + CERNLIB="-L${CERN_ROOT}/lib" liblist=`echo $* | sed -e 's/,/ /g'` for lib in $liblist @@ -44,17 +44,16 @@ val=`echo $lib | sed -e "s?\/? ?g"` set - $val [ $# -eq 2 -a $1 != "graflib" ] && lver=$2 - dir=$CERN/$lver/lib ln=$1 if [ $1 = "kernlib" -o $1 = "packlib" ] ; then _p=1 fi - [ $1 = "genlib" ] && ln="mathlib.a $dir/libphtools" + [ $1 = "genlib" ] && ln="mathlib -lphtools" [ $1 = "bvsl" ] && ln="mathlib" [ $1 = "mpalib" ] && ln="mathlib" - [ $1 = "lapack" ] && ln="lapack3.a $dir/libblas" - [ $1 = "pawlib" ] && ln="pawlib.a $dir/liblapack3.a $dir/libblas" - [ $1 = "pythia" ] && ln="jetset" + [ $1 = "lapack" ] && ln="LAPACK -lBLAS -L/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/" + [ $1 = "pawlib" ] && ln="pawlib -lLAPACK -lBLAS -L/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/A/" + [ $1 = "pythia" ] && ln="jetset74" if [ $1 = "GKS" -o $1 = "gks" ] ; then drv="X11" ; glib="$1" ; dir="$CERN/gks/$lver/lib" fi @@ -67,11 +66,11 @@ fi [ $# -eq 3 ] && dir="$CERN/$3/lib" [ $drv = "Motif" ] && drv="X11" - ln="$ln.a $dir/libgraf$drv" + ln="$ln -lgraf$drv" fi - CERNLIB="$CERNLIB $dir/lib$ln.a" + CERNLIB="$CERNLIB -l$ln" done - [ $_p -eq 0 ] && CERNLIB="$CERNLIB $CERN/$gver/lib/libpacklib.a" + [ $_p -eq 0 ] && CERNLIB="$CERNLIB -lpacklib" # get system name [ -d /NextAdmin ] && Msys="NeXT" || Msys=`uname -s` @@ -116,6 +115,9 @@ [ -d /usr/X11R6/lib ] && SYSGMOTIF="-L/usr/X11R6/lib -lXm -lXt -lXp -lXext -lX11" [ `uname -m` = ppc ] && SYSGMOTIF="$SYSGMOTIF -lSM -lICE -lXpm" ;; + Darwin) [ -d /usr/X11R6/lib ] && SYSGX11="-L/usr/X11R6/lib -lX11" + [ -d /usr/X11R6/lib ] && SYSGMOTIF="-L/usr/X11R6/lib -lXm -lXt -lXp -lXext -lX11 -lSM -lICE -lXpm" + ;; NeXT) SYSGX11="/usr/lib/X11/libX11.r" ; SYSGMOTIF="-lXm -lXt /usr/lib/X11/libX11.r" ;; OSF1) SYSGX11="-lX11 -ldnet_stub" ; @@ -209,6 +211,9 @@ if [ "$Msys" = "Linux" ] ; then CERNLIB="$CERNLIB -lnsl -lcrypt -ldl" fi + if [ "$Msys" = "Darwin" ] ; then + CERNLIB="$CERNLIB -lSystem" + fi fi diff -Naur src/scripts/gxint src.new/scripts/gxint --- src/scripts/gxint 2005-10-31 14:26:19.000000000 -0600 +++ src.new/scripts/gxint 2005-10-31 15:02:13.000000000 -0600 @@ -78,7 +78,7 @@ fi fi -drv="/X11" ; ver="pro" ; OUT="${HOME}/GEANT$$" +drv="/X11" ; ver="" ; OUT="${HOME}/GEANT$$" gxint="" while [ $# -gt 0 ] @@ -156,7 +156,7 @@ $line EoD -$LDN -o $OUT $gxint $pgm $userpath $userlibs `cernlib -v $ver $CLIB`; cc=$? +$LDN -o $OUT $gxint $pgm $userpath $userlibs `cernlib $CLIB`; cc=$? [ $cc -ne 0 ] && exit $cc