rpms/cernlib/devel 115-rsrtnt64-goto-outer-block.dpatch, NONE, 1.1 116-fix-fconc64-spaghetti-code.dpatch, NONE, 1.1 117-fix-optimizer-bug-in-gphot.dpatch, NONE, 1.1 211-fix-comis-on-amd64.dpatch, NONE, 1.1 211-fix-comis-on-ia64.dpatch, NONE, 1.1 304-update-Imake-config-files.dpatch, 1.2, 1.3 307-use-canonical-cfortran.dpatch, 1.1, 1.2 315-fixes-for-MacOSX.dpatch, 1.2, 1.3 701-patch-hbook-comis-Imakefiles.dpatch, 1.1, 1.2 cernlib.m4, 1.1, 1.2 cernlib.spec, 1.8, 1.9 paw.README, 1.2, 1.3 211-fix-comis-on-64-bit-arches.dpatch, 1.1, NONE cernlib-rsrtnt64_goto_outer_block.diff, 1.1, NONE cernlib_2005.05.09.dfsg-2.diff, 1.1, NONE

Patrice Dumas (pertusus) fedora-extras-commits at redhat.com
Wed Dec 14 16:52:28 UTC 2005


Author: pertusus

Update of /cvs/extras/rpms/cernlib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8457

Modified Files:
	304-update-Imake-config-files.dpatch 
	307-use-canonical-cfortran.dpatch 315-fixes-for-MacOSX.dpatch 
	701-patch-hbook-comis-Imakefiles.dpatch cernlib.m4 
	cernlib.spec paw.README 
Added Files:
	115-rsrtnt64-goto-outer-block.dpatch 
	116-fix-fconc64-spaghetti-code.dpatch 
	117-fix-optimizer-bug-in-gphot.dpatch 
	211-fix-comis-on-amd64.dpatch 211-fix-comis-on-ia64.dpatch 
Removed Files:
	211-fix-comis-on-64-bit-arches.dpatch 
	cernlib-rsrtnt64_goto_outer_block.diff 
	cernlib_2005.05.09.dfsg-2.diff 
Log Message:
- use new debian patchset 




--- NEW FILE 115-rsrtnt64-goto-outer-block.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 115-rsrtnt64-goto-outer-block.dpatch by  <kmccarty at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch from Patrice Dumas <pertusus at free.fr> to fix spaghetti code in
## DP: rsrtnt64.F that breaks linking step on Itanium.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/b/rsrtnt64.F cernlib-2005.05.09.dfsg/src/mathlib/gen/b/rsrtnt64.F
--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/b/rsrtnt64.F	1996-04-01 10:01:51.000000000 -0500
+++ cernlib-2005.05.09.dfsg/src/mathlib/gen/b/rsrtnt64.F	2005-12-06 11:22:08.500724891 -0500
@@ -117,8 +117,15 @@
         ENDIF
        ELSE
         IF(N .EQ. 1) THEN
-         ASSIGN 11 TO JMP1
-         GO TO 10
+      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
    11    IF(K .EQ. 0) THEN
           H=H
          ELSEIF(K .EQ. 1) THEN
@@ -174,14 +181,28 @@
            H=2*((H1+B*U)/RT(U)-(H1+B*V)/RT(V))/DELTA
            LB1=11
           ELSEIF(K .EQ. 2) THEN
-           ASSIGN 12 TO JMP1
-           GO TO 10
+      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
    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
-           ASSIGN 13 TO JMP1
-           GO TO 10
+      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
    13      H1=C*DELTA
            G1=A*C
            G2=3*B**2
@@ -217,8 +238,32 @@
         ENDIF
        ELSE
         IF(N .EQ. 1) THEN
-         ASSIGN 21 TO JMP2
-         GO TO 20
+      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
    21    IF(K .EQ. -1) THEN
           H=H
          ELSEIF(K .EQ. -2) THEN
@@ -257,8 +302,32 @@
            IF(U. LT. -X0) H=-H
           ENDIF
          ELSE
-          ASSIGN 22 TO JMP2
-          GO TO 20
+      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
    22     IF(K .EQ. -1) THEN
            H1=B*C
            H2=B**2-2*A*C
@@ -287,46 +356,7 @@
         ENDIF
        ENDIF
       ENDIF
-      GO TO 9
-
-   10 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
-      GO TO JMP1, (11,12,13)
 
-   20 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
-      GO TO JMP2, (21,22)
 
     9 RES=SIGN(R1,V1-U1)*H
       LRL=LLL


--- NEW FILE 116-fix-fconc64-spaghetti-code.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 116-fix-fconc64-spaghetti-code.dpatch by  <kmccarty at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Work around FTBFS on ia64 with recent binutils, apparently caused
## DP: by assignment of goto labels in this file.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/c/fconc64.F cernlib-2005.05.09.dfsg/src/mathlib/gen/c/fconc64.F
--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/c/fconc64.F	1996-04-01 10:02:04.000000000 -0500
+++ cernlib-2005.05.09.dfsg/src/mathlib/gen/c/fconc64.F	2005-12-12 12:58:23.885981128 -0500
@@ -190,15 +190,167 @@
       A=HF*((HF-FM)-TI)
       B=HF*((HF-FM)+TI)
       C=HF
-      ASSIGN 1 TO JP
-      GO TO 20
+   20 IF(LTA) THEN
+       Y=-X1
+       Y2=Y**2
+       Y3=Y*Y2
+       W(1)=A+1
+       W(2)=A+2
+       W(3)=B+1
+       W(4)=B+2
+       W(5)=C+1
+       W(6)=C*W(5)
+       W(7)=A+B
+       W(8)=A*B
+       W(9)=(W(8)/C)*Y
+       W(10)=W(1)*W(3)
+       W(11)=W(2)*W(4)
+       W(12)=1+(W(11)/(W(5)+W(5)))*Y
+       W(13)=W(7)-6
+       W(14)=W(7)+6
+       W(15)=2-W(8)
+       W(16)=W(15)-W(7)-W(7)
+
+       V(0)=1
+       V(1)=1+(W(10)/(C+C))*Y
+       V(2)=W(12)+(W(10)*W(11)/(12*W(6)))*Y2
+       U(0)=1
+       U(1)=V(1)-W(9)
+       U(2)=V(2)-W(9)*W(12)+(W(8)*W(10)/(W(6)+W(6)))*Y2
+
+       R=1
+       DO 21 N = 3,NMAX
+       FN=N
+       RR=R
+       H(1)=FN-1
+       H(2)=FN-2
+       H(3)=FN-3
+       H(4)=FN+FN
+       H(5)=H(4)-3
+       H(6)=H(5)+H(5)
+       H(7)=4*(H(4)-1)*H(5)
+       H(8)=8*H(5)**2*(H(4)-5)
+       H(9)=3*FN**2
+       W(1)=A+H(1)
+       W(2)=A+H(2)
+       W(3)=B+H(1)
+       W(4)=B+H(2)
+       W(5)=C+H(1)
+       W(6)=C+H(2)
+       W(7)=C+H(3)
+       W(8)=H(2)-A
+       W(9)=H(2)-B
+       W(10)=H(1)-C
+       W(11)=W(1)*W(3)
+       W(12)=W(5)*W(6)
+
+       W(17)=1+((H(9)+W(13)*FN+W(16))/(H(6)*W(5)))*Y
+       W(18)=-((W(11)*W(10)/H(6)+(H(9)-W(14)*FN+W(15))*W(11)*Y/H(7))/
+     1          W(12))*Y
+       W(19)=(W(2)*W(11)*W(4)*W(8)*W(9)/(H(8)*W(7)*W(12)))*Y3
+       V(3)=W(17)*V(2)+W(18)*V(1)+W(19)*V(0)
+       U(3)=W(17)*U(2)+W(18)*U(1)+W(19)*U(0)
+       R=U(3)/V(3)
+       IF(ABS(R-RR) .LT. EPS) GO TO 1
+       DO 22 J = 1,3
+       V(J-1)=V(J)
+   22  U(J-1)=U(J)
+   21  CONTINUE
+      ELSE
+       W(1)=X1*A*B/C
+       R=1+W(1)
+       DO 23 N = 1,NMAX
+       FN=N
+       RR=R
+       W(1)=W(1)*X1*(A+FN)*(B+FN)/((C+FN)*(FN+1))
+       R=R+W(1)
+       IF(ABS(R-RR) .LT. EPS) GO TO 1
+   23  CONTINUE
+      END IF
+      GO TO 24
     1 R1=R
       R1=R1/ABS(CGM(A+HF))**2
       A=HF*((TH-FM)-TI)
       B=HF*((TH-FM)+TI)
       C=TH
-      ASSIGN 2 TO JP
-      GO TO 20
+  120 IF(LTA) THEN
+       Y=-X1
+       Y2=Y**2
+       Y3=Y*Y2
+       W(1)=A+1
+       W(2)=A+2
+       W(3)=B+1
+       W(4)=B+2
+       W(5)=C+1
+       W(6)=C*W(5)
+       W(7)=A+B
+       W(8)=A*B
+       W(9)=(W(8)/C)*Y
+       W(10)=W(1)*W(3)
+       W(11)=W(2)*W(4)
+       W(12)=1+(W(11)/(W(5)+W(5)))*Y
+       W(13)=W(7)-6
+       W(14)=W(7)+6
+       W(15)=2-W(8)
+       W(16)=W(15)-W(7)-W(7)
+
+       V(0)=1
+       V(1)=1+(W(10)/(C+C))*Y
+       V(2)=W(12)+(W(10)*W(11)/(12*W(6)))*Y2
+       U(0)=1
+       U(1)=V(1)-W(9)
+       U(2)=V(2)-W(9)*W(12)+(W(8)*W(10)/(W(6)+W(6)))*Y2
+
+       R=1
+       DO 121 N = 3,NMAX
+       FN=N
+       RR=R
+       H(1)=FN-1
+       H(2)=FN-2
+       H(3)=FN-3
+       H(4)=FN+FN
+       H(5)=H(4)-3
+       H(6)=H(5)+H(5)
+       H(7)=4*(H(4)-1)*H(5)
+       H(8)=8*H(5)**2*(H(4)-5)
+       H(9)=3*FN**2
+       W(1)=A+H(1)
+       W(2)=A+H(2)
+       W(3)=B+H(1)
+       W(4)=B+H(2)
+       W(5)=C+H(1)
+       W(6)=C+H(2)
+       W(7)=C+H(3)
+       W(8)=H(2)-A
+       W(9)=H(2)-B
+       W(10)=H(1)-C
+       W(11)=W(1)*W(3)
+       W(12)=W(5)*W(6)
+
+       W(17)=1+((H(9)+W(13)*FN+W(16))/(H(6)*W(5)))*Y
+       W(18)=-((W(11)*W(10)/H(6)+(H(9)-W(14)*FN+W(15))*W(11)*Y/H(7))/
+     1          W(12))*Y
+       W(19)=(W(2)*W(11)*W(4)*W(8)*W(9)/(H(8)*W(7)*W(12)))*Y3
+       V(3)=W(17)*V(2)+W(18)*V(1)+W(19)*V(0)
+       U(3)=W(17)*U(2)+W(18)*U(1)+W(19)*U(0)
+       R=U(3)/V(3)
+       IF(ABS(R-RR) .LT. EPS) GO TO 2
+       DO 122 J = 1,3
+       V(J-1)=V(J)
+  122  U(J-1)=U(J)
+  121  CONTINUE
+      ELSE
+       W(1)=X1*A*B/C
+       R=1+W(1)
+       DO 123 N = 1,NMAX
+       FN=N
+       RR=R
+       W(1)=W(1)*X1*(A+FN)*(B+FN)/((C+FN)*(FN+1))
+       R=R+W(1)
+       IF(ABS(R-RR) .LT. EPS) GO TO 2
+  123  CONTINUE
+      END IF
+      GO TO 24
     2 R2=R
       FC=RPI*(R1-2*X*R2/ABS(CGM(A-HF))**2)
       IF(LM1) FC=2*FC/SQRT(1-X1)
@@ -209,8 +361,84 @@
       A=(HF+FM)-TI
       B=(HF+FM)+TI
       C=FM+1
-      ASSIGN 3 TO JP
-      GO TO 20
+  220 IF(LTA) THEN
+       Y=-X1
+       Y2=Y**2
+       Y3=Y*Y2
+       W(1)=A+1
+       W(2)=A+2
+       W(3)=B+1
+       W(4)=B+2
+       W(5)=C+1
+       W(6)=C*W(5)
+       W(7)=A+B
+       W(8)=A*B
+       W(9)=(W(8)/C)*Y
+       W(10)=W(1)*W(3)
+       W(11)=W(2)*W(4)
+       W(12)=1+(W(11)/(W(5)+W(5)))*Y
+       W(13)=W(7)-6
+       W(14)=W(7)+6
+       W(15)=2-W(8)
+       W(16)=W(15)-W(7)-W(7)
+
+       V(0)=1
+       V(1)=1+(W(10)/(C+C))*Y
+       V(2)=W(12)+(W(10)*W(11)/(12*W(6)))*Y2
+       U(0)=1
+       U(1)=V(1)-W(9)
+       U(2)=V(2)-W(9)*W(12)+(W(8)*W(10)/(W(6)+W(6)))*Y2
+
+       R=1
+       DO 221 N = 3,NMAX
+       FN=N
+       RR=R
+       H(1)=FN-1
+       H(2)=FN-2
+       H(3)=FN-3
+       H(4)=FN+FN
+       H(5)=H(4)-3
+       H(6)=H(5)+H(5)
+       H(7)=4*(H(4)-1)*H(5)
+       H(8)=8*H(5)**2*(H(4)-5)
+       H(9)=3*FN**2
+       W(1)=A+H(1)
+       W(2)=A+H(2)
+       W(3)=B+H(1)
+       W(4)=B+H(2)
+       W(5)=C+H(1)
+       W(6)=C+H(2)
+       W(7)=C+H(3)
+       W(8)=H(2)-A
+       W(9)=H(2)-B
+       W(10)=H(1)-C
+       W(11)=W(1)*W(3)
+       W(12)=W(5)*W(6)
+
+       W(17)=1+((H(9)+W(13)*FN+W(16))/(H(6)*W(5)))*Y
+       W(18)=-((W(11)*W(10)/H(6)+(H(9)-W(14)*FN+W(15))*W(11)*Y/H(7))/
+     1          W(12))*Y
+       W(19)=(W(2)*W(11)*W(4)*W(8)*W(9)/(H(8)*W(7)*W(12)))*Y3
+       V(3)=W(17)*V(2)+W(18)*V(1)+W(19)*V(0)
+       U(3)=W(17)*U(2)+W(18)*U(1)+W(19)*U(0)
+       R=U(3)/V(3)
+       IF(ABS(R-RR) .LT. EPS) GO TO 3
+       DO 222 J = 1,3
+       V(J-1)=V(J)
+  222  U(J-1)=U(J)
+  221  CONTINUE
+      ELSE
+       W(1)=X1*A*B/C
+       R=1+W(1)
+       DO 223 N = 1,NMAX
+       FN=N
+       RR=R
+       W(1)=W(1)*X1*(A+FN)*(B+FN)/((C+FN)*(FN+1))
+       R=R+W(1)
+       IF(ABS(R-RR) .LT. EPS) GO TO 3
+  223  CONTINUE
+      END IF
+      GO TO 24
     3 FC=R
       IF(LM1) FC=SIGN(HF,1-X)*(TAU**2+HF**2)*SQRT(ABS(X**2-1))*FC
       GO TO 99
@@ -220,15 +448,7 @@
       A=HF*((HF-FM)-TI)
       B=HF*((TH-FM)-TI)
       C=1-TI
-      ASSIGN 4 TO JP
-      GO TO 20
-    4 R1=EXP((TI-HF)*LOG(X+X)+CLG(1+TI)-CLG((TH-FM)+TI))*
-     1        R*((HF-FM)+TI)/TI
-      FC=RPW*R1
-      IF(LM1) FC=FC/SQRT(1-X1)
-      GO TO 99
-
-   20 IF(LTA) THEN
+  320 IF(LTA) THEN
        Y=-X1
        Y2=Y**2
        Y3=Y*Y2
@@ -257,7 +477,7 @@
        U(2)=V(2)-W(9)*W(12)+(W(8)*W(10)/(W(6)+W(6)))*Y2
 
        R=1
-       DO 21 N = 3,NMAX
+       DO 321 N = 3,NMAX
        FN=N
        RR=R
        H(1)=FN-1
@@ -289,23 +509,29 @@
        V(3)=W(17)*V(2)+W(18)*V(1)+W(19)*V(0)
        U(3)=W(17)*U(2)+W(18)*U(1)+W(19)*U(0)
        R=U(3)/V(3)
-       IF(ABS(R-RR) .LT. EPS) GO TO JP, (1,2,3,4)
-       DO 22 J = 1,3
+       IF(ABS(R-RR) .LT. EPS) GO TO 4
+       DO 322 J = 1,3
        V(J-1)=V(J)
-   22  U(J-1)=U(J)
-   21  CONTINUE
+  322  U(J-1)=U(J)
+  321  CONTINUE
       ELSE
        W(1)=X1*A*B/C
        R=1+W(1)
-       DO 23 N = 1,NMAX
+       DO 323 N = 1,NMAX
        FN=N
        RR=R
        W(1)=W(1)*X1*(A+FN)*(B+FN)/((C+FN)*(FN+1))
        R=R+W(1)
-       IF(ABS(R-RR) .LT. EPS) GO TO JP, (1,2,3,4)
-   23  CONTINUE
+       IF(ABS(R-RR) .LT. EPS) GO TO 4
+  323  CONTINUE
       END IF
-      FC=0
+      GO TO 24
+    4 R1=EXP((TI-HF)*LOG(X+X)+CLG(1+TI)-CLG((TH-FM)+TI))*
+     1        R*((HF-FM)+TI)/TI
+      FC=RPW*R1
+      IF(LM1) FC=FC/SQRT(1-X1)
+      GO TO 99
+   24 FC=0
       WRITE(ERRTXT,102) X
       CALL MTLPRT(NAME,'C331.2',ERRTXT)
 #if defined(CERNLIB_DOUBLE)


--- NEW FILE 117-fix-optimizer-bug-in-gphot.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 117-fix-optimizer-bug-in-gphot.dpatch by  <kmccarty at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch by Harald Vogt <hvogt at ifh.de> to work around compiler
## DP: optimization problems in src/geant321/gphys/gphot.F.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/geant321/gphys/gphot.F cernlib-2005.05.09.dfsg/src/geant321/gphys/gphot.F
--- cernlib-2005.05.09.dfsg~/src/geant321/gphys/gphot.F	1995-10-24 06:21:29.000000000 -0400
+++ cernlib-2005.05.09.dfsg/src/geant321/gphys/gphot.F	2005-12-07 15:01:52.558184613 -0500
@@ -240,7 +240,7 @@
                   ELSE
 C Radiative shell decay
                      JS = JFN+1+2*NSHELL+ISHELL
-                     JS = JPHFN+Q(JS)
+                     JS = JPHFN + INT (Q(JS))    ! compiler optimiztion problem H. Vogt 2004/04/29
                      NPOINT = Q(JS)
                      DO 40 I = 1,NPOINT
                         IF(RN05.LT.Q(JS+I)) THEN
@@ -296,7 +296,7 @@
                   ELSE
 c Nonradiative decay
                      JS = JFN+1+3*NSHELL+ISHELL
-                     JS = JPHFN+Q(JS)
+                     JS = JPHFN + INT (Q(JS))    ! compiler optimiztion problem H. Vogt 2004/04/29
                      NPOINT = Q(JS)
                      DO 60 I = 1,NPOINT
                         IF(RN05.LT.Q(JS+I)) THEN


--- NEW FILE 211-fix-comis-on-amd64.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 211-fix-comis-on-amd64.dpatch by  <kmccarty at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Large patch from Harald Vogt <hvogt at ifh.de> to make PAW and Paw++ work
## DP: (at least when statically linked) on 64-bit architectures.
## DP: Slightly modified in an attempt to keep ABI compatibility of the
## DP: dynamic libraries; not that it matters much as they don't work well
## DP: when dynamically linked on 64-bit anyway.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/cfortran/hbook.h cernlib-2005.05.09.dfsg/src/cfortran/hbook.h
--- cernlib-2005.05.09.dfsg~/src/cfortran/hbook.h	1999-11-15 17:01:12.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/cfortran/hbook.h	2005-12-09 13:27:45.465589336 +0000
@@ -489,6 +489,10 @@
 #define HBALLOC(IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,IBASE,IOFF,NUSE)\
         CCALLSFSUB11(HBALLOC,hballoc,INT,STRING,STRING,STRING,INT,INT,INT,INT,INTV,PINT,PINT,IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,IBASE,IOFF,NUSE)
 
+PROTOCCALLSFSUB11(HBALLOC64,hballoc64,INT,STRING,STRING,STRING,INT,INT,INT,INT,INTV,PLONG,PINT)
+#define HBALLOC64(IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,IBASE,IOFF,NUSE)\
+        CCALLSFSUB11(HBALLOC64,hballoc64,INT,STRING,STRING,STRING,INT,INT,INT,INT,INTV,PLONG,PINT,IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,IBASE,IOFF,NUSE)
+
 PROTOCCALLSFSUB1(HBFREE,hbfree,INT)
 #define HBFREE(LUN) CCALLSFSUB1(HBFREE,hbfree,INT,LUN)
 
@@ -508,6 +512,13 @@
 #define HGNTBF(IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)\
         CCALLSFSUB6(HGNTBF,hgntbf,INT,ZTRINGV,INTV,INT,INT,PINT,IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)
 
+PROTOCCALLSFSUB6(HGNTBF64,hgntbf64,INT,ZTRINGV,LONGV,INT,INT,PINT)
+/* fix the element length of VAR to 32 */
+#define hgntbf64_ELEMS_2          ZTRINGV_ARGS(4)
+#define hgntbf64_ELEMLEN_2        ZTRINGV_NUM(32)
+#define HGNTBF64(IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)\
+        CCALLSFSUB6(HGNTBF64,hgntbf64,INT,ZTRINGV,LONGV,INT,INT,PINT,IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)
+
 PROTOCCALLSFSUB1(HGTDIR,hgtdir,PSTRING)
 #define HGTDIR(CHDIR) CCALLSFSUB1(HGTDIR,hgtdir,PSTRING,CHDIR)
 
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/cspack/cspack/hcntpar.inc cernlib-2005.05.09.dfsg/src/packlib/cspack/cspack/hcntpar.inc
--- cernlib-2005.05.09.dfsg~/src/packlib/cspack/cspack/hcntpar.inc	1996-03-08 15:44:16.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/cspack/cspack/hcntpar.inc	2005-12-09 13:27:45.465589336 +0000
@@ -22,7 +22,7 @@
      +          ZIFREA=7,  ZNWTIT=8,  ZITIT1=9,  ZNCHRZ=13, ZIFBIT=8,
      +          ZDESC=1,   ZLNAME=2,  ZNAME=3,   ZRANGE=4,  ZNADDR=12,
      +          ZARIND=11, ZIBLOK=8,  ZNBLOK=10, ZIBANK=9,  ZIFTMP=11,
-     +          ZITMP=10,  ZNTMP=5,   ZNTMP1=3,  ZLINK=6)
+     +          ZITMP=10,  ZNTMP=5,   ZNTMP1=4,  ZLINK=6)
 *
 
 #endif
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hbook/hcntpar.inc cernlib-2005.05.09.dfsg/src/packlib/hbook/hbook/hcntpar.inc
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hbook/hcntpar.inc	1996-01-16 17:07:52.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hbook/hcntpar.inc	2005-12-09 13:27:46.373451320 +0000
@@ -24,7 +24,7 @@
      +          ZIFREA=7,  ZNWTIT=8,  ZITIT1=9,  ZNCHRZ=13, ZIFBIT=8,
      +          ZDESC=1,   ZLNAME=2,  ZNAME=3,   ZRANGE=4,  ZNADDR=12,
      +          ZARIND=11, ZIBLOK=8,  ZNBLOK=10, ZIBANK=9,  ZIFTMP=11,
-     +          ZID=12,    ZITMP=10,  ZNTMP=6,   ZNTMP1=3,  ZLINK=6)
+     +          ZID=12,    ZITMP=10,  ZNTMP=6,   ZNTMP1=4,  ZLINK=6)
 *
 
 #endif
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hballoc.F cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hballoc.F
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hballoc.F	1996-01-16 17:07:56.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hballoc.F	2005-12-09 13:27:46.617414232 +0000
@@ -42,3 +42,26 @@
       ENDIF
 *
       END
+*
+*     64-bit version (separate to preserve ABI compatibility)
+      SUBROUTINE HBALLOC64(IDN,CHDIR,VAR,BLOCK,ITYPE,ISIZE,IFIRST,NELEM,
+     +                     IBASE,IOFF,NUSE)
+*
+      CHARACTER*(*)  CHDIR, VAR, BLOCK
+      INTEGER        IDN, ITYPE, ISIZE, NELEM, NUSE, IFIRST, IBASE(1)
+      INTEGER*8      IBUF(1), IOFF
+*
+      LC = LENOCC(CHDIR)
+      LV = LENOCC(VAR)
+      LB = LENOCC(BLOCK)
+*
+      CALL HBALLO1(IDN, CHDIR, LC, VAR, LV, BLOCK, LB, ITYPE, ISIZE,
+     +             IFIRST, NELEM, IBUF, NUSE)
+*
+      IF (NUSE .EQ. 0) THEN
+         IOFF = 0
+      ELSE
+         IOFF = IBUF(1) - %LOC(IBASE(1))/4
+      ENDIF
+*
+      END
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hbnt.F cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hbnt.F
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hbnt.F	1996-01-16 17:07:56.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hbnt.F	2005-12-09 13:27:46.644410128 +0000
@@ -269,11 +269,13 @@
  ************************************************************************
  *      *         *                                                     *
  *   1  *         *     Number of variables to be read out              *
- *      *         *     *** For every variable 3 words (ZNTMP1) ***     *
+ *      *         *     *** For every variable 4 words (ZNTMP1) ***     *
  *   2  *         *     Index of variable in LNAME bank                 *
  *   3  *         *     Offset of variable in LNAME bank (INDX-1)*ZNADDR*
  *   4  *         *     Offset in dynamically allocated buffer (only    *
  *      *         *     used via HGNTBF) otherwise 0                    *
+ *   5  *         *     spare (used in 64 bit architectures for upper   *
+ *      *         *     address part)                                   *
  ************************************************************************
 #endif
 *
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgnt2.F cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgnt2.F
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgnt2.F	1999-03-05 15:42:35.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgnt2.F	2005-12-09 13:27:46.644410128 +0000
@@ -34,7 +34,13 @@
 #include "hbook/hcrecv.inc"
 *
       CHARACTER*(*) VAR1(*)
+#if defined(CERNLIB_QMLXIA64)
+      INTEGER*8     IVOFF(*), IOFFST, IOFFSTT
+      INTEGER       IOFFSTV(2)
+      EQUIVALENCE   (IOFFSTV, IOFFSTT)
+#else
       INTEGER       IVOFF(*)
+#endif
       CHARACTER*32  VAR
       INTEGER       ILOGIC, HNMPTR
       LOGICAL       LOGIC, INDVAR, ALLVAR, USEBUF, CHKOFF
@@ -452,10 +458,15 @@
          IQ(LTMP1+JTMP+1)      = IOFF
          IF (USEBUF) THEN
             IF (IEDIF .EQ. 0) THEN
-               IQ(LTMP1+JTMP+2) = IOFFST
+               IOFFSTT = IOFFST
             ELSE
-               IQ(LTMP1+JTMP+2) = IOFFST + (IEDIF*ISHFT(ISIZE,-2))
+               IOFFSTT = IOFFST + (IEDIF*ISHFT(ISIZE,-2))
             ENDIF
+            IQ(LTMP1+JTMP+2) = IOFFSTT
+#if defined(CERNLIB_QMLXIA64)
+*           store upper part of 64 bit address
+            IQ(LTMP1+JTMP+3) = IOFFSTV(2)
+#endif
          ELSE
             IQ(LTMP1+JTMP+2)   = 0
          ENDIF
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgntbf.F cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgntbf.F
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgntbf.F	1996-01-16 17:07:57.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgntbf.F	2005-12-09 13:27:46.645409976 +0000
@@ -26,3 +26,13 @@
       CALL HGNT1(IDN, '*', VAR, IOFFST, NVAR1, IDNEVT, IERROR)
 *
       END
+*
+*     64-bit version (separate to preserve ABI compatibility)
+      SUBROUTINE HGNTBF64(IDN,VAR,IOFFST,NVAR,IDNEVT,IERROR)
+      CHARACTER*(*) VAR(*)
+      INTEGER*8     IOFFST(*)
+*
+      NVAR1 = -NVAR
+      CALL HGNT1(IDN, '*', VAR, IOFFST, NVAR1, IDNEVT, IERROR)
+*
+      END
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgntf.F cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgntf.F
--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/hntup/hgntf.F	1999-03-05 15:42:35.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/hbook/hntup/hgntf.F	2005-12-09 13:27:46.645409976 +0000
@@ -37,6 +37,13 @@
       INTEGER       ILOGIC
       LOGICAL       LOGIC, INDVAR, USEBUF
       EQUIVALENCE  (LOGIC, ILOGIC)
+
+#if defined(CERNLIB_QMLXIA64)
+      INTEGER*8     IOFFST, IOFFSTT
+      INTEGER       IOFFSTV(2)
+      EQUIVALENCE   (IOFFSTV, IOFFSTT)
+#endif
+
 *
 #include "hbook/jbyt.inc"
 *
@@ -76,6 +83,12 @@
          INDX   = IQ(LTMP1+JTMP)
          IOFF   = IQ(LTMP1+JTMP+1)
          IOFFST = IQ(LTMP1+JTMP+2)
+#if defined(CERNLIB_QMLXIA64)
+*        fetch full 64 bit address
+         IOFFSTV(1) = IQ(LTMP1+JTMP+2)
+         IOFFSTV(2) = IQ(LTMP1+JTMP+3)
+         IOFFST     = IOFFSTT
+#endif
          IF (IOFFST .EQ. 0) THEN
             USEBUF = .FALSE.
          ELSE
@@ -442,10 +455,15 @@
 *
          IF (USEBUF) THEN
             IF (IEDIF .EQ. 0) THEN
-               IQ(LTMP1+JTMP+2) = IOFFST
+               IOFFSTT = IOFFST
             ELSE
-               IQ(LTMP1+JTMP+2) = IOFFST + (IEDIF*ISHFT(ISIZE,-2))
+               IOFFSTT = IOFFST + (IEDIF*ISHFT(ISIZE,-2))
             ENDIF
+            IQ(LTMP1+JTMP+2) = IOFFSTT
+#if defined(CERNLIB_QMLXIA64)
+*           store upper part of 64 bit address
+            IQ(LTMP1+JTMP+3) = IOFFSTV(2)
+#endif
          ELSE
             IQ(LTMP1+JTMP+2) = 0
          ENDIF
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kerngen/ccgen/locb.c cernlib-2005.05.09.dfsg/src/packlib/kernlib/kerngen/ccgen/locb.c
--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kerngen/ccgen/locb.c	1997-09-02 14:26:37.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kerngen/ccgen/locb.c	2005-12-09 13:27:46.645409976 +0000
@@ -44,7 +44,25 @@
    DummyDef
 #endif
 {
+#if defined(CERNLIB_QMLXIA64)
+   const unsigned long long int mask=0x00000000ffffffff;
+   static unsigned long long int base=1;
+   unsigned long long int jadr=(unsigned long long int) iadr;
+   unsigned long long int jadrl = (mask & jadr);
+
+   if (base == 1) {
+     base = (~mask & jadr);
+   } else if(base != (~mask & jadr)) {
+     printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+     printf("locb_() Warning: changing base from %lx to %lx!!!\n",
+     	   base, (~mask & jadr));
+     printf("This may result in program crash or incorrect results\n");
+     printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+   }
+   return ((int) jadrl);
+#else
    return( (int) iadr );
+#endif
 }
 /*> END <----------------------------------------------------------*/
 #ifdef CERNLIB_TCGEN_LOCB
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/zbook/code/zjump.c cernlib-2005.05.09.dfsg/src/packlib/zbook/code/zjump.c
--- cernlib-2005.05.09.dfsg~/src/packlib/zbook/code/zjump.c	1996-03-08 12:01:12.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/zbook/code/zjump.c	2005-12-09 13:27:46.971360424 +0000
@@ -7,6 +7,9 @@
  *
  */
 #include "zbook/pilot_c.h"
+#if defined(CERNLIB_QMLXIA64)
+static void (*target)();
+#endif
 #if defined(CERNLIB_UNIX)
 #if defined(CERNLIB_QX_SC)
 zjump_(name,p1,p2,p3,p4)
@@ -18,8 +21,23 @@
 ZJUMP(name,p1,p2,p3,p4)
 #endif
 char *p1, *p2, *p3, *p4;
+
+/*  LP64 compatibility:
+    name is taken from a Fortran array and therefore its address is 32 bit
+    which has to be converted to a 64 bit address to satisfy void (*) (H. Vogt) */
+
+#if defined(CERNLIB_QMLXIA64)
+int *name;
+{
+  long jadr;
+  jadr   = *name;  /* convert int to long */
+  target = (void (*)())jadr;
+  (*target)(p1, p2, p3, p4);
+}
+#else
 void (**name)();
 {
    (**name)(p1, p2, p3, p4);
 }
 #endif
+#endif
diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/zebra/test/brztest/btest2.F cernlib-2005.05.09.dfsg/src/packlib/zebra/test/brztest/btest2.F
--- cernlib-2005.05.09.dfsg~/src/packlib/zebra/test/brztest/btest2.F	1997-09-02 15:16:16.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/packlib/zebra/test/brztest/btest2.F	2005-12-09 13:27:46.971360424 +0000
@@ -29,6 +29,15 @@
 ********************************************************************************
 *
       COMMON/CRZT/IXSTOR,IXDIV,IFENCE(2),LEV,LEVIN,BLVECT(30000)
+
+*     LP64 compatibility:
+*     For 64-bit pointer systems put local variables referenced by LOCF
+*     in a dummy named common block to keep addresses in the program region.
+*     see also: packlib/ffread/test/main.F (H. Vogt)
+
+#if defined(CERNLIB_QMLXIA64)
+      COMMON /TEST64/LBANK
+#endif
       DIMENSION LQ(999),IQ(999),Q(999)
       EQUIVALENCE (IQ(1),Q(1),LQ(9)),(LQ(1),LEV)
 C
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/Imakefile cernlib-2005.05.09.dfsg/src/pawlib/comis/code/Imakefile
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/Imakefile	2005-12-09 13:27:38.969576880 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/Imakefile	2005-12-09 13:27:46.971360424 +0000
@@ -50,6 +50,10 @@
 SRCS_F := $(SRCS_F) cscrexec.F
 #endif
 
+#if defined(CERNLIB_QMLXIA64)
+SRCS_F := $(SRCS_F) csrtgpl.F csitgpl.F
+#endif
+
 #if defined(CERNLIB_OLD)
 SRCS_F := $(SRCS_F) cspdir.F csrmbk.F
 #endif
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csaddr.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csaddr.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csaddr.F	1996-02-26 17:16:25.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csaddr.F	2005-12-09 13:27:46.972360272 +0000
@@ -17,8 +17,14 @@
       INTEGER CSLTGP,CSITGP
       CHARACTER*32 NAME
 #include "comis/cstab.inc"
-#if defined(CERNLIB_SHL)
+#if defined(CERNLIB_SHL)&&(!defined(CERNLIB_QMLXIA64))
       INTEGER CS_GET_FUNC
+#endif
+#if defined(CERNLIB_SHL)&&(defined(CERNLIB_QMLXIA64))
+#include "comis/cstab64.inc"
+      INTEGER*8 CS_GET_FUNC
+#endif
+#if defined(CERNLIB_SHL)
       NAME=CHNAME
       NC=LENOCC(NAME)
       CALL CSCHID(NAME(:NC))
@@ -26,21 +32,39 @@
       I=CSLTGP(IPVS)
       IF(I.GT.0)THEN
         IF(IFCS.EQ.0)THEN
+#if defined (CERNLIB_QMLXIA64)
+          IADGPL=CS_GET_FUNC(NAME(1:NC)//'_')
+          IF(IADGPL.NE.0)THEN
+            IFCS=-2
+            CALL CSRTGPL(I)
+#else
           IADGP=CS_GET_FUNC(NAME(1:NC)//'_')
           IF(IADGP.NE.0)THEN
             IFCS=-2
             CALL CSRTGP(I)
+#endif
+#endif
+#if defined(CERNLIB_SHL)
           ELSE
             I=0
           ENDIF
         ENDIF
       ELSE
+#if defined (CERNLIB_QMLXIA64)
+          IADGPL=CS_GET_FUNC(NAME(1:NC)//'_')
+        IF(IADGPL.NE.0)THEN
+          IFCS=-2
+          ITYPGP=-2
+          I=CSITGPL(IPVS)
+        ENDIF
+#else
         IADGP=CS_GET_FUNC(NAME(1:NC)//'_')
         IF(IADGP.NE.0)THEN
           IFCS=-2
           ITYPGP=-2
           I=CSITGP(IPVS)
         ENDIF
+#endif
       END IF
       CSADDR=I
 #endif
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csinit.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csinit.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csinit.F	2005-04-18 15:41:04.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csinit.F	2005-12-09 13:27:46.972360272 +0000
@@ -64,6 +64,9 @@
 #if defined(CERNLIB_SHL)
 #include "comis/cshlnm.inc"
 #endif
+#if defined(CERNLIB_SHL)&&(defined(CERNLIB_QMLXIA64))
+#include "comis/cstab64.inc"
+#endif
 #if defined(CERNLIB_PAW)
 #include "paw/pcmode.inc"
 #include "comis/cshfill.inc"
@@ -159,6 +162,9 @@
       ICHMINU=ICHAR('-')
       ICHPLUS=ICHAR('+')
       ICHCOMM=ICHAR(',')
+#if defined(CERNLIB_SHL)&&(defined(CERNLIB_QMLXIA64))
+      IPIADGV=0
+#endif
 #if defined(CERNLIB_PAW)
       CALL CSPAWI
       MODHFI=0
@@ -211,8 +217,8 @@
 #endif
 #if (defined(CERNLIB_LINUX))
       ITMPLEN=CSTMPD(CHPATH, 256)
-      CHF77 ='g77 -c'
-      CHCC  ='cc -c'
+      CHF77 ='g77 -c -fPIC'
+      CHCC  ='cc -c -fPIC'
 #endif
 #if (defined(CERNLIB_SGI))&&(defined(CERNLIB_SHL))
       ITMPLEN=CSTMPD(CHPATH, 256)
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csintx.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csintx.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csintx.F	1996-12-05 09:50:37.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csintx.F	2005-12-09 13:27:46.973360120 +0000
@@ -38,6 +38,9 @@
 #if defined(CERNLIB_PAW)
 #include "comis/cskucs.inc"
 #endif
+#if defined(CERNLIB_QMLXIA64)
+#include "comis/cstab64.inc"
+#endif
 #if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_ALPHA_OSF))
       INTEGER CSTRCMP
 #endif
@@ -1105,6 +1108,32 @@
       ENDIF
 #endif
 #if (!defined(CERNLIB_VAX))&&(!defined(CERNLIB_APOLLO))
+#if defined(CERNLIB_QMLXIA64)
+      IF(IQ(IP+KSIFCS).EQ.-2)THEN
+*Dynamic linker may give long addresses
+        IADGPL = IADGPLV(IADGP)
+        IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
+          ICSRES=CSCALI(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.2)THEN
+          RCSRES=CSCALR(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.5)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.7)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IDA(IOFSPL))
+        ENDIF
+      ELSE
+        IADGPL = IADGP
+        IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
+          ICSRES=CSCALI(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.2)THEN
+          RCSRES=CSCALR(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.5)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IDA(IOFSPL))
+        ELSEIF(ITP.EQ.7)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IDA(IOFSPL))
+        ENDIF
+      ENDIF
+#else
       IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
         ICSRES=CSCALI(IADGP,NPAR,IDA(IOFSPL))
       ELSEIF(ITP.EQ.2)THEN
@@ -1115,6 +1144,7 @@
         DCSRES=CSCALD(IADGP,NPAR,IDA(IOFSPL))
       ENDIF
 #endif
+#endif
       IPC=IPC+4
       GO TO 999
 *NUM I
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csitgpl.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csitgpl.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csitgpl.F	1970-01-01 00:00:00.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csitgpl.F	2005-12-09 13:27:46.973360120 +0000
@@ -0,0 +1,32 @@
+* Comis
+*
+*
+#if (defined(CERNLIB_QMLXIA64))
+#include "comis/pilot.h"
+*CMZU:  1.16/16 04/10/93  12.14.52  by  Vladimir Berezhnoi
+*-- Author : V.Berezhnoi
+* special for 64 bit addresses for dynamic linking (H. Vogt)
+      INTEGER FUNCTION CSITGPL(IP)
+***------------------------------
+*   it is last routine from the tables-set.
+***-----------------------------
+#include "comis/cspar.inc"
+#include "comis/mdpool.inc"
+#include "comis/cspnts.inc"
+#include "comis/cstabps.inc"
+#include "comis/cstab64.inc"
+      I=MHLOC(KSIDP+NWIDEN)
+      IQ(I)=0
+      IQ(I+1)=NCIDEN
+      DO 1 K=1,NWIDEN
+        IQ(I+KSIDP-1+K)=IDEN(K)
+   1  CONTINUE
+      CALL CSRTGPL(I)
+      IF(IP.EQ.0)THEN
+        IPGP=I
+      ELSE
+        IQ(IP)=I
+      ENDIF
+      CSITGP=I
+      END
+#endif
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cskcal.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cskcal.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cskcal.F	1996-12-05 09:50:39.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cskcal.F	2005-12-09 13:27:46.973360120 +0000
@@ -31,6 +31,9 @@
 #include "comis/cstab.inc"
 #include "comis/csfres.inc"
 #include "comis/cssysd.inc"
+#if defined(CERNLIB_QMLXIA64)
+#include "comis/cstab64.inc"
+#endif
       CHARACTER PRONAME*32
       INTEGER CSCALI
       DOUBLE PRECISION CSCALD
@@ -232,6 +235,34 @@
         I2=I2+KS
         I=I+1
  9203 CONTINUE
+#if defined(CERNLIB_QMLXIA64)
+*  Dynamic linker may give long addresses
+      IF (IFCS.EQ.-2)THEN
+        IADGPL = IADGPLV(IADGP)
+        IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
+          ICSRES=CSCALI(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.2)THEN
+          RCSRES=CSCALR(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.5)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.7)THEN
+*  I think it will works correctly
+          DCSRES=CSCALD(IADGPL,NPAR,IF77PL(1))
+        ENDIF
+      ELSE
+        IADGPL = IADGP
+        IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
+          ICSRES=CSCALI(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.2)THEN
+          RCSRES=CSCALR(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.5)THEN
+          DCSRES=CSCALD(IADGPL,NPAR,IF77PL(1))
+        ELSEIF(ITP.EQ.7)THEN
+*  I think it will works correctly
+          DCSRES=CSCALD(IADGPL,NPAR,IF77PL(1))
+        ENDIF
+      ENDIF
+#else
 *      IT=IABS(ITYPGP)
       IF(ITP.EQ.1.OR.ITP.EQ.4.OR.ITP.EQ.6)THEN
         ICSRES=CSCALI(IADGP,NOPAR,IF77PL(1))
@@ -245,6 +276,7 @@
       ENDIF
 *+SELF,IF=UNIX,IF=-SGI,IF=-IBMRT,IF=-DECS,IF=-HPUX,IF=-SUN,IF=-MSDOS.
 #endif
+#endif
 #if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_STDUNIX))
       I=1
       DO 9203 K=ITA-NPAR+1,ITA
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cslink.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cslink.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cslink.F	1996-02-26 17:16:17.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cslink.F	2005-12-09 13:27:46.973360120 +0000
@@ -21,10 +21,15 @@
 #include "comis/cstab.inc"
 #include "comis/cspnts.inc"
 #include "comis/cslun.inc"
-#if defined(CERNLIB_SHL)
+#if defined(CERNLIB_SHL)&&(!defined(CERNLIB_QMLXIA64))
       CHARACTER*(KLENID) FNNAME
       INTEGER CS_GET_FUNC
 #endif
+#if defined(CERNLIB_SHL)&&(defined(CERNLIB_QMLXIA64))
+#include "comis/cstab64.inc"
+      CHARACTER*(KLENID) FNNAME
+      INTEGER*8 CS_GET_FUNC
+#endif
          COMMON/CSGSCM/IGS,JGS,NGS,CSJUNK(3)
       IF(ISTLIB.EQ.0 .AND. ITBS.EQ.0)RETURN
    2  I=IPGP
@@ -60,12 +65,20 @@
 #if defined(CERNLIB_SHL)
           CALL CSGTIDP(I,FNNAME,NC)
           CALL CUTOL(FNNAME(1:NC))
+#if defined (CERNLIB_QMLXIA64)
+          IADGPL=CS_GET_FUNC(FNNAME(1:NC)//'_')
+          IF(IADGPL.NE.0)THEN
+            IFCS=-2
+            CALL CSRTGPL(I)
+          ENDIF
+#else
           IADGP=CS_GET_FUNC(FNNAME(1:NC)//'_')
           IF(IADGP.NE.0)THEN
             IFCS=-2
             CALL CSRTGP(I)
           ENDIF
 #endif
+#endif
           IP=0
         ENDIF
       ENDIF
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csrtgpl.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csrtgpl.F
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csrtgpl.F	1970-01-01 00:00:00.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csrtgpl.F	2005-12-09 13:27:46.973360120 +0000
@@ -0,0 +1,31 @@
+* Comis
+*
+*
+#if (defined(CERNLIB_QMLXIA64))
+#include "comis/pilot.h"
+*CMZ :  1.18/14 10/01/95  15.41.06  by  Vladimir Berezhnoi
+*-- Author : V.Berezhnoi
+* special for 64 bit addresses for dynamic linking (H. Vogt)
+
+      SUBROUTINE CSRTGPL(I)
+***--------------------------
+#include "comis/cspar.inc"
+#include "comis/mdpool.inc"
+#include "comis/cstabps.inc"
+#include "comis/cstab.inc"
+#include "comis/cstab64.inc"
+
+      IPIADGV = IPIADGV + 1
+      IF (IPIADGV .GT. MAXIAD64)  THEN
+        WRITE (*,'(2a,I4)') 'to much addresses for dynamik linking, ',
+     &                      'limit is ', MAXIAD64
+        WRITE (*,'(2a)') 'increase MAXIAD64 in cstab64.inc and ',
+     &                    'recompile COMIS'
+
+        STOP
+      END IF
+      IADGPLV(IPIADGV) = IADGPL
+      IADGP            = IPIADGV
+      CALL CCOPYA(IADGP,IQ(I+2),KSIDP-2)
+      END
+#endif
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/comis/cstab64.inc cernlib-2005.05.09.dfsg/src/pawlib/comis/comis/cstab64.inc
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/comis/cstab64.inc	1970-01-01 00:00:00.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/comis/cstab64.inc	2005-12-09 13:27:46.973360120 +0000
@@ -0,0 +1,10 @@
+*
+*
+* cstab64.inc
+*
+      PARAMETER (MAXIAD64=100) !maximum number of shared objects
+      INTEGER*8 IADGPL,IADGPLV(MAXIAD64)
+      INTEGER   IADGPL1, IADGPL2
+      COMMON /CSTB64/ IADGPL,IADGPLV
+      COMMON /CSTB64I/ IPIADGV
+      EQUIVALENCE (IADGPL, IADGPL1)
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/ccopys.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/ccopys.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/ccopys.c	1997-09-02 15:50:38.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/ccopys.c	2005-12-09 13:27:46.974359968 +0000
@@ -33,11 +33,25 @@
 #else
 void ccopys_(ja,jb,nn)
 #endif
+
+/*
+ * 64-bit pointer systems require a special treatment of addresses - see below -
+ * using the CERNLIB_QMLXIA64 cpp flag (H. Vogt - Sep 2005)
+ */
+
+#if defined(CERNLIB_QMLXIA64)
+     int *ja, *jb;
+     int *nn;
+{
+  int i,n; char *a,*b;
+  n=*nn; a=*ja; b=*jb;
+#else
      char **ja, **jb;
      int *nn;
 {
   int i,n; char *a,*b;
   n=*nn; a=*ja; b=*jb;
+#endif
   if ( a >= b )
      for ( i=0; i<n; i++ )
           b[i]=a[i];
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cs_hlshl.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cs_hlshl.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cs_hlshl.c	1998-01-12 09:56:07.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cs_hlshl.c	2005-12-09 13:27:46.974359968 +0000
@@ -25,9 +25,21 @@
 #if (defined(CERNLIB_SUN)||defined(CERNLIB_SGI)||defined(CERNLIB_IBMRT)||defined(CERNLIB_ALPHA_OSF)||defined(CERNLIB_LINUX))&&(defined(CERNLIB_SHL))
 /*CMZ :          22/05/95  18.40.45  by  Julian Bunn*/
 /*-- Author :*/
-#if defined(CERNLIB_SUN)||defined(CERNLIB_LINUX)
+#if defined(CERNLIB_SUN)||defined(CERNLIB_LINUX)&&(!defined(CERNLIB_QMLXIA64))
 #define SUN
 #endif
+
+/*
+ * 64-bit pointer systems require a special treatment of addresses  
+ * using the CERNLIB_QMLXIA64 cpp flag (H. Vogt - Sep 2005)
+ * This code will be consistent with that of jumptn.c and jumpxn.c
+ * in packlib/kernlib/kerngen/ccgen (usage of jumpad_)
+ */
+
+#if defined(CERNLIB_LINUX)&&(defined(CERNLIB_QMLXIA64))
+#define ALPHA_OSF
+#endif
+
 #if defined(CERNLIB_SGI)
 #define SGI
 #endif
@@ -274,6 +286,7 @@
 #endif
          p->next = f->first_proc;
          f->first_proc = p;
+         if (debug_level > 0) printf("function pointer is: %p\n", p->funcptr);
          return (void *)(p->funcptr);
       }
      f = f->next;
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscald.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscald.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscald.c	2004-10-27 09:01:54.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscald.c	2005-12-09 13:27:46.974359968 +0000
@@ -32,8 +32,7 @@
 #ifdef CERNLIB_WINNT
 # include <stdio.h>
 #endif
-
-#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))
+#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))&&(!defined(CERNLIB_QMLXIA64))
 double cscald_ (name,n,p)
 #endif
 #if defined(CERNLIB_QXNO_SC)
@@ -46,10 +45,41 @@
     int CSCALD (name,n,p)
 #  endif
 #endif
+
+/*
+ * 64-bit pointer systems require a special treatment of addresses - see below 
+ * using the CERNLIB_QMLXIA64 macro definition (H. Vogt - Sep 2005)
+ * This code will be consistent with that of jumptn.c and jumpxn.c
+ * in packlib/kernlib/kerngen/ccgen (usage of jumpad_)
+ *
+ * for shared objects loaded by the dynamic linker content of the 1st arg
+ * in cscald_ is a pointer which may be above the 32 bit address space
+ * therefore *fptr has been changed to type long
+ * see changes in csintx.F, cskcal.F, ... (introduction of INTEGER*8 array for
+ * those pointers)
+ */
+
+#if defined(CERNLIB_QMLXIA64)
+double cscald_ (fptr,n,pin)
+ long *fptr;
+ int *n;
+ unsigned pin[16];
+{
+   int jumpad_();
+   double (*name)();
+   unsigned long ptr = *fptr + (unsigned long)jumpad_;
+   /* if ( *fptr > 0 ) ptr = 0; */
+   ptr += *fptr;
+   name = (double (*)())ptr;
+/*    printf ("cscald - *fptr,ptr,jumpad_ are: %p %p %p %p\n", *fptr, ptr, jumpad_); */
+   long p[16];
+   int  count;  for ( count=0; count<16; count++ )  p[count] = pin[count];
+#else
  double (type_of_call *(*name)) ();
  int *n;
- int *p[15];
+ int *p[16];
 {
+#endif
    double d;
    switch (*n)
    {
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscali.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscali.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscali.c	2004-10-22 12:42:40.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscali.c	2005-12-09 13:27:46.974359968 +0000
@@ -29,8 +29,7 @@
 #ifdef CERNLIB_WINNT
 # include <stdio.h>
 #endif
-
-#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))
+#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))&&(!defined(CERNLIB_QMLXIA64))
 int cscali_ (name,n,p)
 #endif
 #if defined(CERNLIB_QXNO_SC)
@@ -39,10 +38,41 @@
 #if defined(CERNLIB_QXCAPT)
 int type_of_call CSCALI (name,n,p)
 #endif
+
+/*
+ * 64-bit pointer systems require a special treatment of addresses - see below 
+ * using the CERNLIB_QMLXIA64 macro definition (H. Vogt - Sep 2005)
+ * This code will be consistent with that of jumptn.c and jumpxn.c
+ * in packlib/kernlib/kerngen/ccgen (usage of jumpad_)
+ *
+ * for shared objects loaded by the dynamic linker content of the 1st arg
+ * in cscali_ is a pointer which may be above the 32 bit address space
+ * therefore *fptr has been changed to type long
+ * see changes in csintx.F, cskcal.F, ... (introduction of INTEGER*8 array for
+ * those pointers)
+ */
+
+#if defined(CERNLIB_QMLXIA64)
+int cscali_ (fptr,n,pin)
+ long *fptr;
+ int *n;
+ unsigned pin[16];
+{
+   int jumpad_();
+   int (*name)();
+   unsigned long ptr = (unsigned long)jumpad_;
+   /* if ( *fptr > 0 ) ptr = 0; */
+   ptr += *fptr;
+   name = (int (*)())ptr;
+/*    printf ("cscali - *fptr,ptr,jumpad_ are: %p %p %p %p\n", *fptr, ptr, jumpad_); */
+   long p[16];
+   int  count;  for ( count=0; count<16; count++ )  p[count] = pin[count];
+#else
  int (type_of_call *(*name)) ();
  int *n;
- int *p[15];
+ int *p[16];
 {
+#endif
    int i;
    switch (*n)
    {
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscalr.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscalr.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cscalr.c	2004-10-22 12:03:16.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cscalr.c	2005-12-09 13:27:46.974359968 +0000
@@ -35,7 +35,7 @@
 #endif
 
 
-#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))
+#if (defined(CERNLIB_QX_SC))&&(!defined(CERNLIB_WINNT))&&(!defined(CERNLIB_QMLXIA64))
 float cscalr_ (name,n,p)
 #endif
 
@@ -51,11 +51,51 @@
 # endif
 #endif
 
+/*
+ * 64-bit pointer systems require a special treatment of addresses - see below 
+ * using the CERNLIB_QMLXIA64 macro definition (H. Vogt - Sep 2005)
+ * This code will be consistent with that of jumptn.c and jumpxn.c
+ * in packlib/kernlib/kerngen/ccgen (usage of jumpad_)
+ *
+ * for shared objects loaded by the dynamic linker content of the 1st arg
+ * in cscalr_ is a pointer which may be above the 32 bit address space
+ * therefore *fptr has been changed to type long
+ * see changes in csintx.F, cskcal.F, ... (introduction of INTEGER*8 array for
+ * those pointers)
+ */
+
+/* Additional note: g77 generates code such that it expects REAL functions
+ * to return "double".  Hence C functions to be used in FORTRAN as REAL
+ * must return "double", and declarations of REAL FORTRAN functions in C files
+ * must also return "double".  On most architectures one can get away with
+ * using "float" instead, but not on amd64 ... see
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15397
+ * 
+ * -- Kevin McCarty
+ */
+	
+#if defined(CERNLIB_QMLXIA64)
+double cscalr_ (fptr,n,pin)
+ long *fptr;
+ int *n;
+ int pin[16];
+{
+   int jumpad_();
+   double (*name)();
+   unsigned long ptr = (unsigned long)jumpad_;
+   ptr += *fptr;
+   name = (double (*)())ptr;
+/*    printf ("cscalr - *fptr,ptr,jumpad_ are: %p %p %p %p\n", *fptr, ptr, jumpad_); */
+   long p[16];
+   int  count;  for ( count=0; count<16; count++ )  p[count] = pin[count];
+   double r;
+#else
  float (type_of_call *(*name)) ();
  int *n;
- int *p[15];
+ int *p[16];
 {
    float r;
+#endif
    switch (*n)
    {
       case 0:
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cstrcmp.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cstrcmp.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cstrcmp.c	1997-09-02 15:50:44.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cstrcmp.c	2005-12-09 13:27:46.975359816 +0000
@@ -36,6 +36,27 @@
 #else
 int cstrcmp_(ja,na,jb,nb)
 #endif
+
+/*
+ * 64-bit pointer systems require a special treatment of addresses - see below -
+ * using the CERNLIB_QMLXIA64 cpp flag (H. Vogt - Sep 2005)
+ */
+
+#if defined(CERNLIB_QMLXIA64)
+     int *ja, *jb;
+     int *na, *nb;
+{
+
+  int i,la,lb,k; char *a,*b;
+  if ( *na >= *nb )
+     {
+      a=*ja; b=*jb; la=*na; lb=*nb; k=1;
+      }
+  else
+    {
+      a=*jb; b=*ja; la=*nb; lb=*na; k=-1;
+     }
+#else
      char **ja, **jb;
      int *na, *nb;
 {
@@ -48,6 +69,7 @@
     {
       a=*jb; b=*ja; la=*nb; lb=*na; k=-1;
      }
+#endif
   for ( i=0; i<lb; i++ )
     { if(a[i] != b[i])
       { return ( (a[i] > b[i]) ? k : -k ); }
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/c_hcntpar.h cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/c_hcntpar.h
--- cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/c_hcntpar.h	1996-04-23 18:37:45.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/c_hcntpar.h	2005-12-09 13:27:46.975359816 +0000
@@ -47,7 +47,7 @@
 #define ZID	12
 #define ZITMP	10
 #define ZNTMP	6
-#define ZNTMP1	3
+#define ZNTMP1	4
 #define ZLINK	6
 
 #endif	/*	CERN_C_HCNTPAR	*/
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/qp_execute.c cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/qp_execute.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/qp_execute.c	2001-09-18 13:41:35.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/qp_execute.c	2005-12-09 13:31:01.495788216 +0000
@@ -184,12 +184,19 @@
 					/* all definitions for the stack */
 #undef INIT_STACK_TO_NULL		/* are kept together in this file */
 
+#if defined(CERNLIB_QMLXIA64)
+# undef HBALLOC
+# undef HGNTBF
+# define HBALLOC HBALLOC64
+# define HGNTBF HGNTBF64
+#endif
+
 /* extern functions */
 extern void qp_exec_evt( QueryExe *, long, long, QPCmd *, int *);
 
 typedef		char	tName[MAX_NAME_LEN+1];
 tName		*namelist;
-int		*offsetlist;
+long		*offsetlist;
 int		*indexlist;
 
 
@@ -245,7 +252,23 @@
 	char		ntname[MAX_NAME_LEN+6];
 	int		i, ierr, indx, itype, isize, ielem;
 	Int32 *		addr;
-	int		ibase[1], ioff, nuse;
+
+	/* LP64 compatibility:
+	   - use static for ibase (at least) because its address is stored
+	     as Int32 in structure CWNBlock
+	     static takes ibase from the stack and puts it the code area.
+	   - use type long for ioff and offsetlist[i]
+	     (for 32 bit architectures type long is 4 Bytes as it is used
+	      also in packlib/hbook/chbook/halloc.c in hballo1 !)
+	   The x86-64 ABI has the code area in the 32 bit address space
+	   but addresses to the stack and to dynamically allocated areas
+	   may and will be above the 32 bit address space (below 0x80000000000).
+	   See also: http://www.x86-64.org/documentation/abi-0.96.pdf
+	   (H. Vogt, Oct. 2005) */
+
+	static int	ibase[1];
+	long		ioff;
+	int		nuse;
 	int		id = qe->id;
 	char *		path = qe->path;
 	char *		title;
@@ -286,7 +309,11 @@
 	CWNBlock = (RefCWN *) calloc( CWNCount + 1, sizeof( RefCWN ) );
 	qp_assert( MAX_NAME_LEN == 32 ); /* see hbook.h (HGNTBF) */
 	namelist = (tName *) calloc( CWNCount + 1, sizeof(tName) );
-	offsetlist = (int *) calloc( CWNCount + 1, sizeof(int) );
+
+	/* offsetlist should be of type long (see above) (H. Vogt, Oct. 2005) */
+
+	offsetlist = (long *) calloc( CWNCount + 1, sizeof(long) );
+
 	indexlist = (int *) calloc( CWNCount + 1, sizeof(int) );
 	qp_assert(
 		CWNBlock != 0 &&
@@ -381,6 +408,7 @@
 						offsetlist[nt_load_cnt]=
 						CWNBlock[index].p -
 						PAWC.iq_eqv;
+
 						strncpy(
 						namelist[nt_load_cnt],
 						vi->name,
@@ -871,8 +899,21 @@
 			if ( cmd->u.scan.pawpp ) {
 				char	buf[33];
 
+				/* for LP64 ABI matlab and matrow are 64 bit pointer, type is void*  
+				   but PCADDR.jmlab and PCADDR.jmrow are of type int
+				   see: c_pcaddr.h and qp_command.h
+				   it is related to CWNBlock -> see above (H. Vogt)*/
+
+#if defined(CERNLIB_QMLXIA64)
+				unsigned long long int	 myjmlab, myjmrow;
+				myjmlab = PCADDR.jmlab;
+				myjmrow = PCADDR.jmrow;
+				c->matlab = (TableCallBack) myjmlab;
+				c->matrow = (TableCallBack) myjmrow;
+#else
 				c->matlab = (TableCallBack) PCADDR.jmlab;
 				c->matrow = (TableCallBack) PCADDR.jmrow;
+#endif
 
 				qp_assert( qe->nexpr <= MAX_OUTSTR );
 
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/qp_hbook_if.c cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/qp_hbook_if.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/paw/ntuple/qp_hbook_if.c	1999-07-05 15:43:35.000000000 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/paw/ntuple/qp_hbook_if.c	2005-12-09 13:27:46.976359664 +0000
@@ -149,7 +149,15 @@
 	int	idn, idtmp;
 	int	icycle;
 	int	ierr;
-	int     izero = 0;
+
+	/* LP64 compatibility:
+	   use static for izero because its address is fetched by hbname_
+	   using locb and locb expects 32 bit addresses only.
+	   static takes izero from the stack and puts it the code area
+	   and the LP64 ABI has the code area in the 32 bit address space
+	   but the stack starts downward from 0x80000000000 (H. Vogt) */
+
+	static int     izero = 0;
 
 	/* split string into  path, id and cycle */
 


--- NEW FILE 211-fix-comis-on-ia64.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 211-fix-comis-on-ia64.dpatch by  <kmccarty at debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Further patch building on Harald Vogt's amd64 patch that should
## DP: fix PAW on Itanium Linux.

@DPATCH@
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/ccopys.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/ccopys.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/ccopys.c	2005-12-09 09:45:33.649333472 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/ccopys.c	2005-12-09 10:01:36.149011280 +0000
@@ -39,12 +39,32 @@
  * using the CERNLIB_QMLXIA64 cpp flag (H. Vogt - Sep 2005)
  */
 
+/* For Itanium, the situation is even worse.  Itanium architecture is such
+ * that the data section starts at 0x6000000000000000.  The stack is
+ * supposed to be between 0x80...0 and 0xa0...0 starting at the high end
+ * and growing downwards, although on a test machine (merulo.debian.org)
+ * it seemed instead to start at 0x6000100000000000 and grow downwards.
+ * The addresses we actually get are truncated to the lowest 32 bits,
+ * so we assume that those greater than 0x80000000 are in the stack.
+ *
+ * Constant strings are in the text section starting at 0x40...0; we hope
+ * this function doesn't receive any.
+ * -- Kevin McCarty
+ */
+	
 #if defined(CERNLIB_QMLXIA64)
      int *ja, *jb;
      int *nn;
 {
   int i,n; char *a,*b;
   n=*nn; a=*ja; b=*jb;
+# if defined (__ia64__)
+  unsigned long autobase = ((unsigned long)&i) & 0xffffffff00000000L;
+  a = (unsigned long)a +
+	  (((unsigned long)a > 0x80000000) ? autobase : 0x6000000000000000);
+  b = (unsigned long)b +
+	  (((unsigned long)b > 0x80000000) ? autobase : 0x6000000000000000);
+# endif
 #else
      char **ja, **jb;
      int *nn;
diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cstrcmp.c cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cstrcmp.c
--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/deccc/cstrcmp.c	2005-12-09 09:45:33.650333320 +0000
+++ cernlib-2005.05.09.dfsg/src/pawlib/comis/deccc/cstrcmp.c	2005-12-09 10:05:36.432482640 +0000
@@ -42,6 +42,19 @@
  * using the CERNLIB_QMLXIA64 cpp flag (H. Vogt - Sep 2005)
  */
 
+/* For Itanium, the situation is even worse.  Itanium architecture is such
+ * that the data section starts at 0x6000000000000000.  The stack is
+ * supposed to be between 0x80...0 and 0xa0...0 starting at the high end
+ * and growing downwards, although on a test machine (merulo.debian.org)
+ * it seemed instead to start at 0x6000100000000000 and grow downwards.
+ * The addresses we actually get are truncated to the lowest 32 bits,
+ * so we assume that those greater than 0x80000000 are in the stack.
+ *
+ * Constant strings are in the text section starting at 0x40...0; we hope
+ * this function doesn't receive any.
+ * -- Kevin McCarty
+ */
+
 #if defined(CERNLIB_QMLXIA64)
      int *ja, *jb;
      int *na, *nb;
@@ -56,6 +69,13 @@
     {
       a=*jb; b=*ja; la=*nb; lb=*na; k=-1;
      }
+# if defined (__ia64__)
+  unsigned long autobase = ((unsigned long)&i) & 0xffffffff00000000L;
+  a = (unsigned long)a +
+          (((unsigned long)a > 0x80000000) ? autobase : 0x6000000000000000);
+  b = (unsigned long)b +
+          (((unsigned long)b > 0x80000000) ? autobase : 0x6000000000000000);
+# endif
 #else
      char **ja, **jb;
      int *na, *nb;


Index: 304-update-Imake-config-files.dpatch
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/304-update-Imake-config-files.dpatch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 304-update-Imake-config-files.dpatch	30 Nov 2005 23:17:11 -0000	1.2
+++ 304-update-Imake-config-files.dpatch	14 Dec 2005 16:52:26 -0000	1.3
@@ -7,15 +7,15 @@
 ## DP: to support most Linux architectures.
 
 @DPATCH@
-diff -urNad cernlib-2005.05.09/src/config/Imake.cf /tmp/dpep.kbbTMH/cernlib-2005.05.09/src/config/Imake.cf
---- cernlib-2005.05.09/src/config/Imake.cf	2004-10-05 11:54:40.000000000 -0400
-+++ /tmp/dpep.kbbTMH/cernlib-2005.05.09/src/config/Imake.cf	2005-06-09 10:47:36.470829080 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/Imake.cf cernlib-2005.05.09.dfsg/src/config/Imake.cf
+--- cernlib-2005.05.09.dfsg~/src/config/Imake.cf	2004-10-05 11:54:40.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/config/Imake.cf	2005-12-12 09:42:08.529220732 -0500
 @@ -1,24 +1,10 @@
 -/* $Id$
 - *
 - * $Log$
-- * Revision 1.2  2005/11/30 23:17:11  pertusus
-- * Don't expand keywords
+- * Revision 1.3  2005/12/14 16:52:26  pertusus
+- * - use new debian patchset
 - *
 - * Revision 1.5  2004/10/05 15:54:40  mclareni
 - * Add configuration file linux-lp64 for Linux 64-bit pointer systems like AMD Opteron and Intel IA64.
@@ -1270,9 +1270,9 @@
  
  #ifndef MacroIncludeFile
  XCOMM WARNING:  Imake.cf not configured; guessing at definitions!!!
-diff -urNad cernlib-2005.05.09/src/config/linux.cf /tmp/dpep.kbbTMH/cernlib-2005.05.09/src/config/linux.cf
---- cernlib-2005.05.09/src/config/linux.cf	2004-10-05 11:56:45.000000000 -0400
-+++ /tmp/dpep.kbbTMH/cernlib-2005.05.09/src/config/linux.cf	2005-06-09 10:47:36.471828868 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/linux.cf cernlib-2005.05.09.dfsg/src/config/linux.cf
+--- cernlib-2005.05.09.dfsg~/src/config/linux.cf	2004-10-05 11:56:45.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/config/linux.cf	2005-12-12 09:42:42.505976387 -0500
 @@ -65,20 +65,20 @@
  #define OSVendor		/**/
  #define OSMajorVersion		2
@@ -1298,7 +1298,7 @@
  #endif
  #define HasPutenv		YES
  #define HasShm			YES
-@@ -94,38 +94,300 @@
+@@ -94,38 +94,302 @@
  #define NeedVarargsPrototypes	YES
  #define NeedWidePrototypes	NO
  
@@ -1589,6 +1589,8 @@
 +#  define OptimizedCDebugFlags  OptimizationLevel
 +# endif
 +# define LinuxMachineDefines    -D__x86_64__
++# define DefaultFCOptions       -fno-automatic \
++                                -fno-second-underscore -fugly-complex
 +# define ServerOSDefines        XFree86ServerOSDefines -DDDXTIME -DPART_NET
 +# define ServerExtraDefines     -DGCCUSESGAS XFree86ServerDefines -D_XSERVER64
 +# define CernlibMachineDefines  -DCERNLIB_QMLXIA64
@@ -1613,7 +1615,7 @@
  /* Some of these man page defaults are overriden in the above OS sections */
  #ifndef ManSuffix
  # define ManSuffix	1x
-@@ -160,7 +422,7 @@
+@@ -160,7 +424,7 @@
  #define FortranSaveFlags	/* */ /* Everything static !? */
  #define OptimisedFortranFlags   -g -pc 64 -tp p6
  #define DefaultFCOptions        -Msave -fpic -Kieee
@@ -1622,7 +1624,7 @@
  
  #else
  
-@@ -171,19 +433,18 @@
+@@ -171,19 +435,18 @@
  #  undef StandardDefines
  #  undef NeedFunctionPrototypes
  #  undef NeedWidePrototypes
@@ -1654,7 +1656,7 @@
   
  #else
  
-@@ -194,19 +455,18 @@
+@@ -194,19 +457,18 @@
  #  undef StandardDefines
  #  undef NeedFunctionPrototypes
  #  undef NeedWidePrototypes
@@ -1686,7 +1688,7 @@
  /*
   *  Create a Make Variable to allow building with/out Motif
   */
-@@ -221,17 +481,32 @@
+@@ -221,17 +483,32 @@
  /* Start CERNLIB changes A.Waananen 15. Apr. 1996 */
  /*  Adapted to CERN style GF. 20-Sep-96 */
  
@@ -1722,7 +1724,7 @@
  
  # endif
  # endif
-@@ -251,7 +526,7 @@
+@@ -251,7 +528,7 @@
  /*
   *  Create a Make Variable to allow building with/out Motif
   */


Index: 307-use-canonical-cfortran.dpatch
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/307-use-canonical-cfortran.dpatch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 307-use-canonical-cfortran.dpatch	30 Nov 2005 22:01:01 -0000	1.1
+++ 307-use-canonical-cfortran.dpatch	14 Dec 2005 16:52:26 -0000	1.2
@@ -6,10 +6,10 @@
 ## DP: Debian package of cfortran, version 4.4-6.
 
 @DPATCH@
-diff -urNad cernlib-2005.05.09/src/cfortran/cfortran.doc /tmp/dpep.haCnaO/cernlib-2005.05.09/src/cfortran/cfortran.doc
---- cernlib-2005.05.09/src/cfortran/cfortran.doc	1998-12-11 12:17:09.000000000 -0500
-+++ /tmp/dpep.haCnaO/cernlib-2005.05.09/src/cfortran/cfortran.doc	2004-12-10 10:47:33.000000000 -0500
-@@ -195,7 +195,7 @@
+diff -urNad cernlib-2005.05.09.dfsg~/src/cfortran/cfortran.doc cernlib-2005.05.09.dfsg/src/cfortran/cfortran.doc
+--- cernlib-2005.05.09.dfsg~/src/cfortran/cfortran.doc	1998-12-11 17:17:09.000000000 +0000
++++ cernlib-2005.05.09.dfsg/src/cfortran/cfortran.doc	2005-12-09 18:01:09.000000000 +0000
+@@ -195,13 +195,13 @@
  HP9000> f77 -c cfortex.f
  HP9000> CC -o cfortest cfortest.c cfortex.o -lI77 -lF77 && cfortest
  
@@ -18,7 +18,28 @@
  HP9000> # #define hpuxFortran800
  HP9000> cc -c -Aa -DhpuxFortran800 cfortest.c
  HP9000> f77 +800 -o cfortest cfortest.o cfortex.f
-@@ -643,7 +643,7 @@
+ 
+ f2c> # In the following, 'CC' is any C compiler.
+-f2c> f2c -R cfortex.f
++f2c> f2c cfortex.f
+ f2c> CC -o cfortest -Df2cFortran cfortest.c cfortex.c -lf2c  &&  cfortest
+ 
+ Portland Group $ # Presumably other C compilers also work.
+@@ -533,9 +533,10 @@
+ FORTRAN_REAL thus corresponds to FORTRAN's REAL on all machines, including t3e.
+ 
+ 
+-o f2c
+-  f2c, by default promotes REAL functions to double. cfortran.h does not (yet)
+-support this, so the f2c -R option must be used to turn this promotion off.
++o f2c / g77
++  f2c and g77 by default promote REAL functions to double.  As of December 9,
++2005, the Debian package of cfortran supports this behavior, so the f2c -R
++option must *NOT* be used to turn this promotion off.
+ 
+ o f2c
+ [Thanks to Dario Autiero for pointing out the following.]
+@@ -643,7 +644,7 @@
     [For an ancient math.h on a 386 or sparc, get similar from a new math.h.]
     #ifdef mc68000     /* 5 lines Copyright (c) 1988 by Sun Microsystems, Inc. */
     #define FLOATFUNCTIONTYPE	int
@@ -27,7 +48,7 @@
     #define ASSIGNFLOAT(x,y)	*(int *)(&x) = y
     #endif
  
-@@ -874,7 +874,7 @@
+@@ -874,7 +875,7 @@
  works everywhere and would seem to be an obvious choice.
  
  
@@ -36,7 +57,7 @@
  
  cfortran.h encourages the exact specification of the type and dimension of
  array parameters because it allows the C compiler to detect errors in the
-@@ -1835,7 +1835,7 @@
+@@ -1835,7 +1836,7 @@
  
  Unlike all other C compilers supported by cfortran.h,
  'gcc -traditional' promotes to double all functions returning float
@@ -45,7 +66,7 @@
  
  /* m.c */
  #include <stdio.h>
-@@ -2017,8 +2017,9 @@
+@@ -2017,8 +2018,9 @@
  
  THIS PACKAGE, I.E. CFORTRAN.H, THIS DOCUMENT, AND THE CFORTRAN.H EXAMPLE
  PROGRAMS ARE PROPERTY OF THE AUTHOR WHO RESERVES ALL RIGHTS. THIS PACKAGE AND
@@ -57,16 +78,16 @@
  - YOU MUST ACCOMPANY ANY COPIES OR DISTRIBUTION WITH THIS (UNALTERED) NOTICE.
  - YOU MAY NOT RECEIVE MONEY FOR THE DISTRIBUTION OR FOR ITS MEDIA 
    (E.G. TAPE, DISK, COMPUTER, PAPER.)
-diff -urNad cernlib-2005.05.09/src/cfortran/cfortran.h /tmp/dpep.haCnaO/cernlib-2005.05.09/src/cfortran/cfortran.h
---- cernlib-2005.05.09/src/cfortran/cfortran.h	2002-09-11 13:05:51.000000000 -0400
-+++ /tmp/dpep.haCnaO/cernlib-2005.05.09/src/cfortran/cfortran.h	2004-12-10 10:47:34.000000000 -0500
+diff -urNad cernlib-2005.05.09.dfsg~/src/cfortran/cfortran.h cernlib-2005.05.09.dfsg/src/cfortran/cfortran.h
+--- cernlib-2005.05.09.dfsg~/src/cfortran/cfortran.h	2002-09-11 17:05:51.000000000 +0000
++++ cernlib-2005.05.09.dfsg/src/cfortran/cfortran.h	2005-12-09 18:01:09.000000000 +0000
 @@ -1,4 +1,4 @@
 -/* cfortran.h  4.4_cernlib2002 */
 +/* cfortran.h  4.4 */
  /* http://www-zeus.desy.de/~burow/cfortran/                   */
  /* Burkhard Burow  burow at desy.de                 1990 - 2002. */
  
-@@ -11,6 +11,32 @@
+@@ -11,6 +11,35 @@
     MODIFYING, COPYING AND DISTRIBUTING THE CFORTRAN.H PACKAGE.
  */
  
@@ -94,12 +115,15 @@
 +
 +      Nov 2003: If __INTEL_COMPILER or INTEL_COMPILER defined, also define
 +                f2cFortran (KMCCARTY)
++      Dec 2005: If f2cFortran is defined, enforce REAL functions in FORTRAN
++                returning "double" in C.  This was one of the items on
++		Burkhard's TODO list. (KMCCARTY)
 + *******/
 +
  /* 
    Avoid symbols already used by compilers and system *.h:
    __ - OSF1 zukal06 V3.0 347 alpha, cc -c -std1 cfortest.c
-@@ -75,7 +101,8 @@
+@@ -75,7 +104,8 @@
  
  /* Remainder of cfortran.h depends on the Fortran compiler. */
  
@@ -109,7 +133,7 @@
  #define f2cFortran
  #endif
  
-@@ -90,6 +117,27 @@
+@@ -90,6 +120,27 @@
                             Support f2c or f77 with gcc, vcc with f2c. 
                             f77 with vcc works, missing link magic for f77 I/O.*/
  #endif
@@ -137,7 +161,7 @@
  #if defined(__hpux)             /* 921107: Use __hpux instead of __hp9000s300 */
  #define       hpuxFortran       /*         Should also allow hp9000s7/800 use.*/
  #endif
-@@ -131,6 +179,7 @@
+@@ -131,6 +182,7 @@
  #if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
  /* If your compiler barfs on ' #error', replace # with the trigraph for #     */
   #error "cfortran.h:  Can't find your environment among:\
@@ -145,7 +169,7 @@
      - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)     \
      - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000     \
      - VAX   VMS CC 3.1 and FORTRAN 5.4.                                  \
-@@ -151,7 +200,8 @@
+@@ -151,7 +203,8 @@
      - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran          \
      - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \
      - Absoft Pro Fortran: Use #define AbsoftProFortran \
@@ -155,7 +179,7 @@
  /* Compiler must throw us out at this point! */
  #endif
  #endif
-@@ -164,7 +214,8 @@
+@@ -164,7 +217,8 @@
  
  /* Throughout cfortran.h we use: UN = Uppercase Name.  LN = Lowercase Name.   */
  
@@ -165,7 +189,7 @@
  #define CFC_(UN,LN)            _(LN,_)      /* Lowercase FORTRAN symbols.     */
  #define orig_fcallsc(UN,LN)    CFC_(UN,LN)
  #else 
-@@ -268,7 +319,8 @@
+@@ -268,7 +322,8 @@
  #endif
  
  #ifndef apolloFortran
@@ -175,7 +199,7 @@
  #define CF_NULL_PROTO
  #else                                         /* HP doesn't understand #elif. */
  /* Without ANSI prototyping, Apollo promotes float functions to double.    */
-@@ -512,7 +564,7 @@
+@@ -512,7 +567,7 @@
                      *( (F).dsc$l_m[0]=(F).dsc$bounds[0].dsc$l_u=(ELEMNO)  ),   \
    (F).dsc$a_a0    =  ( (F).dsc$a_pointer=(C) ) - (F).dsc$w_length          ,(F))
  
@@ -184,7 +208,7 @@
  #define _NUM_ELEMS      -1
  #define _NUM_ELEM_ARG   -2
  #define NUM_ELEMS(A)    A,_NUM_ELEMS
-@@ -540,7 +592,8 @@
+@@ -540,7 +595,8 @@
  }
  return (int)num;
  }
@@ -194,3 +218,56 @@
  /*-------------------------------------------------------------------------*/
  
  /*           UTILITIES FOR C TO USE STRINGS IN FORTRAN COMMON BLOCKS       */
+@@ -1451,7 +1507,12 @@
+ #define      BYTE_cfPU(A)   CFextern INTEGER_BYTE      FCALLSC_QUALIFIER A
+ #define    DOUBLE_cfPU(A)   CFextern DOUBLE_PRECISION  FCALLSC_QUALIFIER A
+ #if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
++#if defined (f2cFortran)
++/* f2c/g77 return double from FORTRAN REAL functions. (KMCCARTY, 2005/12/09) */
++#define     FLOAT_cfPU(A)   CFextern DOUBLE_PRECISION  FCALLSC_QUALIFIER A
++#else
+ #define     FLOAT_cfPU(A)   CFextern FORTRAN_REAL      FCALLSC_QUALIFIER A
++#endif
+ #else				   	                   
+ #define     FLOAT_cfPU(A)   CFextern FLOATFUNCTIONTYPE FCALLSC_QUALIFIER A
+ #endif				   	                   
+@@ -2088,7 +2149,12 @@
+ #ifndef __CF__KnR
+ /* The void is req'd by the Apollo, to make this an ANSI function declaration.
+    The Apollo promotes K&R float functions to double. */
+-#define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(void
++#if defined (f2cFortran)
++/* f2c/g77 return double from FORTRAN REAL functions. (KMCCARTY, 2005/12/09) */
++#define FLOAT_cfFZ(UN,LN) DOUBLE_PRECISION FCALLSC_QUALIFIER fcallsc(UN,LN)(void
++#else
++#define FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(void
++#endif
+ #ifdef vmsFortran
+ #define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(fstring *AS
+ #else
+@@ -2104,7 +2170,12 @@
+ #endif
+ #else
+ #if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
++#if defined (f2cFortran)
++/* f2c/g77 return double from FORTRAN REAL functions. (KMCCARTY, 2005/12/09) */
++#define   FLOAT_cfFZ(UN,LN) DOUBLE_PRECISION  FCALLSC_QUALIFIER fcallsc(UN,LN)(
++#else
+ #define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL      FCALLSC_QUALIFIER fcallsc(UN,LN)(
++#endif
+ #else
+ #define   FLOAT_cfFZ(UN,LN) FLOATFUNCTIONTYPE FCALLSC_QUALIFIER fcallsc(UN,LN)(
+ #endif
+@@ -2118,7 +2189,12 @@
+ #define    BYTE_cfF(UN,LN)     BYTE_cfFZ(UN,LN)
+ #define  DOUBLE_cfF(UN,LN)   DOUBLE_cfFZ(UN,LN)
+ #ifndef __CF_KnR
++#if defined (f2cFortran)
++/* f2c/g77 return double from FORTRAN REAL functions. (KMCCARTY, 2005/12/09) */
++#define   FLOAT_cfF(UN,LN)  DOUBLE_PRECISION FCALLSC_QUALIFIER fcallsc(UN,LN)(
++#else
+ #define   FLOAT_cfF(UN,LN)  FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(
++#endif
+ #else
+ #define   FLOAT_cfF(UN,LN)    FLOAT_cfFZ(UN,LN)
+ #endif


Index: 315-fixes-for-MacOSX.dpatch
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/315-fixes-for-MacOSX.dpatch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 315-fixes-for-MacOSX.dpatch	9 Dec 2005 20:39:08 -0000	1.2
+++ 315-fixes-for-MacOSX.dpatch	14 Dec 2005 16:52:26 -0000	1.3
@@ -6,9 +6,25 @@
 ## DP: and run on OS X.
 
 @DPATCH@
-diff -urNad cernlib-2005.05.09/src/config/Imake.rules /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/Imake.rules
---- cernlib-2005.05.09/src/config/Imake.rules	2005-04-18 11:39:25.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/Imake.rules	2005-06-09 15:52:06.472072084 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/Imakefile cernlib-2005.05.09.dfsg/src/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/Imakefile	1996-12-16 10:08:41.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/Imakefile	2005-12-07 14:47:34.141148558 -0500
+@@ -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 -urNad cernlib-2005.05.09.dfsg~/src/config/Imake.rules cernlib-2005.05.09.dfsg/src/config/Imake.rules
+--- cernlib-2005.05.09.dfsg~/src/config/Imake.rules	2005-04-18 11:39:25.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/config/Imake.rules	2005-12-07 14:47:34.139148983 -0500
 @@ -2171,7 +2171,7 @@
  #define CppScriptTarget(dst,src,defs,deplist)				@@\
  dst::  src deplist							@@\
@@ -27,9 +43,9 @@
  									@@\
  clean::									@@\
  	RemoveFiles(dst)
-diff -urNad cernlib-2005.05.09/src/config/MacOSX.cf /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.cf
---- cernlib-2005.05.09/src/config/MacOSX.cf	1969-12-31 19:00:00.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.cf	2004-06-30 21:54:11.000000000 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/MacOSX.cf cernlib-2005.05.09.dfsg/src/config/MacOSX.cf
+--- cernlib-2005.05.09.dfsg~/src/config/MacOSX.cf	1969-12-31 19:00:00.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/config/MacOSX.cf	2005-12-07 14:47:34.140148771 -0500
 @@ -0,0 +1,170 @@
 +XCOMM platform:  $SFO: MOSXS.cf,v 1.0 95/11/19 23:21:00 sl Exp $
 +
@@ -201,9 +217,9 @@
 +/* End  CERNLIB changes */
 +
 +
-diff -urNad cernlib-2005.05.09/src/config/MacOSX.rules /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.rules
---- cernlib-2005.05.09/src/config/MacOSX.rules	1969-12-31 19:00:00.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.rules	2004-06-30 21:54:11.000000000 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/MacOSX.rules cernlib-2005.05.09.dfsg/src/config/MacOSX.rules
+--- cernlib-2005.05.09.dfsg~/src/config/MacOSX.rules	1969-12-31 19:00:00.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/config/MacOSX.rules	2005-12-07 14:47:34.140148771 -0500
 @@ -0,0 +1,123 @@
 +XCOMM $XConsortium: MOSXS.rules,v 1.1 97/12/12 15:34:45 sl Exp $
 +
@@ -328,9 +344,9 @@
 +#endif
 +
 +
-diff -urNad cernlib-2005.05.09/src/config/MacOSX.tmpl /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.tmpl
---- cernlib-2005.05.09/src/config/MacOSX.tmpl	1969-12-31 19:00:00.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/MacOSX.tmpl	2004-06-30 21:54:11.000000000 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/MacOSX.tmpl cernlib-2005.05.09.dfsg/src/config/MacOSX.tmpl
+--- cernlib-2005.05.09.dfsg~/src/config/MacOSX.tmpl	1969-12-31 19:00:00.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/config/MacOSX.tmpl	2005-12-07 14:47:34.140148771 -0500
 @@ -0,0 +1,67 @@
 +XCOMM $XConsortium: MOSXS.tmpl,v 1.2 97/12/12 19:07:12 sl Exp $
 +
@@ -399,9 +415,9 @@
 +#define SharedFSRev F
 +SharedLibReferences(FS,FS,$(FSLIBSRC),SOFSREV,SharedFSRev)
 +
-diff -urNad cernlib-2005.05.09/src/config/site.def /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/site.def
---- cernlib-2005.05.09/src/config/site.def	2002-04-26 10:46:04.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/config/site.def	2005-06-09 15:52:06.472072084 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/config/site.def cernlib-2005.05.09.dfsg/src/config/site.def
+--- cernlib-2005.05.09.dfsg~/src/config/site.def	2002-04-26 10:46:04.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/config/site.def	2005-12-07 14:47:34.140148771 -0500
 @@ -99,9 +99,7 @@
  /*   if it is already defined and false, undef it! */
  /* do not use shift by default
@@ -413,9 +429,9 @@
  #undef CERNLIB_SHIFT
  #endif
  #endif
-diff -urNad cernlib-2005.05.09/src/geant321/gxint/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/geant321/gxint/Imakefile
---- cernlib-2005.05.09/src/geant321/gxint/Imakefile	1997-01-29 11:37:40.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/geant321/gxint/Imakefile	2005-06-09 15:52:06.472072084 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/geant321/gxint/Imakefile cernlib-2005.05.09.dfsg/src/geant321/gxint/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/geant321/gxint/Imakefile	1997-01-29 11:37:40.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/geant321/gxint/Imakefile	2005-12-07 14:47:34.140148771 -0500
 @@ -30,7 +30,7 @@
  
  gxint321.f:  gxint.F
@@ -425,25 +441,9 @@
  
  install.lib:: $(CERN_LIBDIR)/gxint.f
  
-diff -urNad cernlib-2005.05.09/src/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/Imakefile
---- cernlib-2005.05.09/src/Imakefile	1996-12-16 10:08:41.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/Imakefile	2005-06-09 15:52:06.471072296 -0400
-@@ -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 -urNad cernlib-2005.05.09/src/mathlib/gen/tests/c327m.F /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mathlib/gen/tests/c327m.F
---- cernlib-2005.05.09/src/mathlib/gen/tests/c327m.F	1996-04-01 10:01:17.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mathlib/gen/tests/c327m.F	2005-06-09 15:52:06.483069745 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/tests/c327m.F cernlib-2005.05.09.dfsg/src/mathlib/gen/tests/c327m.F
+--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/tests/c327m.F	1996-04-01 10:01:17.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/mathlib/gen/tests/c327m.F	2005-12-07 14:47:34.141148558 -0500
 @@ -92,7 +92,11 @@
  #endif
        ENDIF
@@ -456,9 +456,9 @@
         IF(IDS .EQ. 1) THEN
        ERRMAX=MAX(ERRMAX,ABS(H1-T1))
        LTEST= LTEST .AND. ERRMAX .LE.  TSTERR
-diff -urNad cernlib-2005.05.09/src/mathlib/gen/tests/c342m.F /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mathlib/gen/tests/c342m.F
---- cernlib-2005.05.09/src/mathlib/gen/tests/c342m.F	1996-04-01 10:01:19.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mathlib/gen/tests/c342m.F	2005-06-09 15:52:06.483069745 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/tests/c342m.F cernlib-2005.05.09.dfsg/src/mathlib/gen/tests/c342m.F
+--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/tests/c342m.F	1996-04-01 10:01:19.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/mathlib/gen/tests/c342m.F	2005-12-07 14:47:34.141148558 -0500
 @@ -70,7 +70,11 @@
  #endif
        END IF
@@ -471,9 +471,9 @@
        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 -urNad cernlib-2005.05.09/src/mclibs/cojets/data/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mclibs/cojets/data/Imakefile
---- cernlib-2005.05.09/src/mclibs/cojets/data/Imakefile	1996-03-27 04:31:06.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mclibs/cojets/data/Imakefile	2005-06-09 15:52:06.483069745 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/mclibs/cojets/data/Imakefile cernlib-2005.05.09.dfsg/src/mclibs/cojets/data/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/mclibs/cojets/data/Imakefile	1996-03-27 04:31:06.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/mclibs/cojets/data/Imakefile	2005-12-07 14:47:34.141148558 -0500
 @@ -1,11 +1,11 @@
  
  .SUFFIXES:
@@ -488,9 +488,9 @@
  
  PackageDirFileTarget(cojets.dat)
  
-diff -urNad cernlib-2005.05.09/src/mclibs/isajet/data/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mclibs/isajet/data/Imakefile
---- cernlib-2005.05.09/src/mclibs/isajet/data/Imakefile	1996-03-27 04:33:19.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/mclibs/isajet/data/Imakefile	2005-06-09 15:52:06.483069745 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/mclibs/isajet/data/Imakefile cernlib-2005.05.09.dfsg/src/mclibs/isajet/data/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/mclibs/isajet/data/Imakefile	1996-03-27 04:33:19.000000000 -0500
++++ cernlib-2005.05.09.dfsg/src/mclibs/isajet/data/Imakefile	2005-12-07 14:47:34.141148558 -0500
 @@ -1,9 +1,9 @@
  
  .SUFFIXES:
@@ -503,9 +503,9 @@
  
  PackageDirFileTarget(isajet.dat)
  
-diff -urNad cernlib-2005.05.09/src/packlib/cspack/sysreq/log.c /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/cspack/sysreq/log.c
---- cernlib-2005.05.09/src/packlib/cspack/sysreq/log.c	2003-09-02 08:47:16.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/cspack/sysreq/log.c	2005-06-09 15:52:06.483069745 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/cspack/sysreq/log.c cernlib-2005.05.09.dfsg/src/packlib/cspack/sysreq/log.c
+--- cernlib-2005.05.09.dfsg~/src/packlib/cspack/sysreq/log.c	2003-09-02 08:47:16.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/cspack/sysreq/log.c	2005-12-07 14:47:34.142148345 -0500
 @@ -80,7 +80,7 @@
  static int pid;                 /* process identifier                   */
  static int logfd ;              /* logging file descriptor              */
@@ -515,9 +515,9 @@
  extern int syslog();
  #endif /* !SOLARIS && !IRIX5 && !apollo && !linux && !AIX */
  extern char *getenv();
-diff -urNad cernlib-2005.05.09/src/packlib/cspack/tcpaw/tcpaw.c /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/cspack/tcpaw/tcpaw.c
---- cernlib-2005.05.09/src/packlib/cspack/tcpaw/tcpaw.c	2005-06-09 15:51:53.621804393 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/cspack/tcpaw/tcpaw.c	2005-06-09 15:52:06.485069320 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/cspack/tcpaw/tcpaw.c cernlib-2005.05.09.dfsg/src/packlib/cspack/tcpaw/tcpaw.c
+--- cernlib-2005.05.09.dfsg~/src/packlib/cspack/tcpaw/tcpaw.c	2005-12-07 14:47:25.920897902 -0500
++++ cernlib-2005.05.09.dfsg/src/packlib/cspack/tcpaw/tcpaw.c	2005-12-07 14:47:34.146147494 -0500
 @@ -2569,7 +2569,7 @@
  #if !defined(IBM) && !defined(_WIN32)
  /* I provide "getpass" myself as standard version truncates to 8 characters */
@@ -559,9 +559,9 @@
 +  return result;
 +}
 +#endif /* CERNLIB_MACOSX */
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernbit/z268/systems.c /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernbit/z268/systems.c
---- cernlib-2005.05.09/src/packlib/kernlib/kernbit/z268/systems.c	1998-08-25 08:45:56.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernbit/z268/systems.c	2005-06-09 15:52:06.485069320 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernbit/z268/systems.c cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernbit/z268/systems.c
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernbit/z268/systems.c	1998-08-25 08:45:56.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernbit/z268/systems.c	2005-12-07 14:47:34.146147494 -0500
 @@ -200,7 +200,7 @@
  || defined(_IBMR2) \
  || defined(__convexc__) \
@@ -571,9 +571,9 @@
  
    void systems_( command, buf, buflen, l, chars, rc, ovflw )
  
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/d704fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/d704fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/d704fort/Imakefile	1996-06-12 06:03:53.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/d704fort/Imakefile	2005-06-09 15:52:06.485069320 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/d704fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/d704fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/d704fort/Imakefile	1996-06-12 06:03:53.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/d704fort/Imakefile	2005-12-07 14:47:34.146147494 -0500
 @@ -4,6 +4,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -585,9 +585,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  
  SubdirLibraryTarget(NullParameter,NullParameter)
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/f002fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f002fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/f002fort/Imakefile	1996-06-12 06:04:09.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f002fort/Imakefile	2005-06-09 15:52:06.485069320 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f002fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f002fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f002fort/Imakefile	1996-06-12 06:04:09.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f002fort/Imakefile	2005-12-07 14:47:34.146147494 -0500
 @@ -10,6 +10,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -599,9 +599,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  
  SubdirLibraryTarget(NullParameter,NullParameter)
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/f003fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f003fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/f003fort/Imakefile	1996-06-12 06:04:12.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f003fort/Imakefile	2005-06-09 15:52:06.486069107 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f003fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f003fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f003fort/Imakefile	1996-06-12 06:04:12.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f003fort/Imakefile	2005-12-07 14:47:34.147147281 -0500
 @@ -11,6 +11,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -613,9 +613,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  
  SubdirLibraryTarget(NullParameter,NullParameter)
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/f004fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f004fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/f004fort/Imakefile	1996-06-12 06:04:16.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f004fort/Imakefile	2005-06-09 15:52:06.486069107 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f004fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f004fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f004fort/Imakefile	1996-06-12 06:04:16.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f004fort/Imakefile	2005-12-07 14:47:34.147147281 -0500
 @@ -6,6 +6,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -627,9 +627,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  
  SubdirLibraryTarget(NullParameter,NullParameter)
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/f010fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f010fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/f010fort/Imakefile	1996-06-12 06:04:19.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f010fort/Imakefile	2005-06-09 15:52:06.486069107 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f010fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f010fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f010fort/Imakefile	1996-06-12 06:04:19.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f010fort/Imakefile	2005-12-07 14:47:34.147147281 -0500
 @@ -7,6 +7,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -641,9 +641,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  	 
  
-diff -urNad cernlib-2005.05.09/src/packlib/kernlib/kernnum/f011fort/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f011fort/Imakefile
---- cernlib-2005.05.09/src/packlib/kernlib/kernnum/f011fort/Imakefile	1996-06-12 06:04:24.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kernlib/kernnum/f011fort/Imakefile	2005-06-09 15:52:06.486069107 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f011fort/Imakefile cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f011fort/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/kernlib/kernnum/f011fort/Imakefile	1996-06-12 06:04:24.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kernlib/kernnum/f011fort/Imakefile	2005-12-07 14:47:34.147147281 -0500
 @@ -7,6 +7,10 @@
  FDEBUGFLAGS=NoOpFortranDebugFlags
  #endif
@@ -655,9 +655,9 @@
  FORTRANSAVEOPTION=FortranSaveFlags
  
  SubdirLibraryTarget(NullParameter,NullParameter)
-diff -urNad cernlib-2005.05.09/src/packlib/kuip/kuip/ksys.h /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kuip/kuip/ksys.h
---- cernlib-2005.05.09/src/packlib/kuip/kuip/ksys.h	1997-09-02 10:50:01.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/packlib/kuip/kuip/ksys.h	2005-06-09 15:52:06.487068895 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/kuip/kuip/ksys.h cernlib-2005.05.09.dfsg/src/packlib/kuip/kuip/ksys.h
+--- cernlib-2005.05.09.dfsg~/src/packlib/kuip/kuip/ksys.h	1997-09-02 10:50:01.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/kuip/kuip/ksys.h	2005-12-07 14:47:34.147147281 -0500
 @@ -188,6 +188,17 @@
  #endif
  
@@ -676,15 +676,15 @@
  #ifdef MSDOS
  #  define MACHINE_NAME "IBMPC"
  #  define OS_NAME "MSDOS"
-diff -urNad cernlib-2005.05.09/src/pawlib/comis/code/csaddr.F /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/comis/code/csaddr.F
---- cernlib-2005.05.09/src/pawlib/comis/code/csaddr.F	1996-02-26 12:16:25.000000000 -0500
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/comis/code/csaddr.F	2005-06-09 15:52:06.487068895 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csaddr.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csaddr.F
+--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/csaddr.F	2005-12-07 14:47:25.807921944 -0500
++++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/csaddr.F	2005-12-07 14:55:23.810167859 -0500
 @@ -38,7 +38,12 @@
              IFCS=-2
              CALL CSRTGPL(I)
  #else
-+c     thanks to Keisuke Fujii for this patch for OS X
-+#if defined(CERNLIB_MACOSX)
++c     thanks to Keisuke Fujii for this patch for OS X            
++#if defined (CERNLIB_MACOSX)
 +          IADGP=CS_GET_FUNC('_'//NAME(1:NC)//'_')
 +#else
            IADGP=CS_GET_FUNC(NAME(1:NC)//'_')
@@ -696,7 +696,7 @@
            I=CSITGPL(IPVS)
          ENDIF
  #else
-+#if defined(CERNLIB_MACOSX)
++#if defined (CERNLIB_MACOSX)
 +        IADGP=CS_GET_FUNC('_'//NAME(1:NC)//'_')
 +#else
          IADGP=CS_GET_FUNC(NAME(1:NC)//'_')
@@ -704,9 +704,9 @@
          IF(IADGP.NE.0)THEN
            IFCS=-2
            ITYPGP=-2
-diff -urNad cernlib-2005.05.09/src/pawlib/comis/code/cscrexec.F /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/comis/code/cscrexec.F
---- cernlib-2005.05.09/src/pawlib/comis/code/cscrexec.F	2005-06-09 15:51:53.524825013 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/comis/code/cscrexec.F	2005-06-09 15:57:50.699841388 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cscrexec.F cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cscrexec.F
+--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/cscrexec.F	2005-12-07 14:47:25.687947476 -0500
++++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/cscrexec.F	2005-12-07 14:47:34.148147068 -0500
 @@ -82,11 +82,19 @@
        IF(FEXT.EQ.'.c')THEN
          L=LENOCC(CHCC)
@@ -743,9 +743,9 @@
  #endif
  #if defined(CERNLIB_ALPHA_OSF)
          CHLINE=                   'ld -shared -o '
-diff -urNad cernlib-2005.05.09/src/pawlib/paw/programs/Imakefile /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/paw/programs/Imakefile
---- cernlib-2005.05.09/src/pawlib/paw/programs/Imakefile	2002-04-25 06:20:11.000000000 -0400
-+++ /tmp/dpep.kYNoLQ/cernlib-2005.05.09/src/pawlib/paw/programs/Imakefile	2005-06-09 15:52:06.486069107 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/paw/programs/Imakefile cernlib-2005.05.09.dfsg/src/pawlib/paw/programs/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/pawlib/paw/programs/Imakefile	2002-04-25 06:20:11.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/pawlib/paw/programs/Imakefile	2005-12-07 14:47:34.148147068 -0500
 @@ -9,7 +9,7 @@
  EXTRA_LDOPTIONS=-Wl,-E
  #endif


Index: 701-patch-hbook-comis-Imakefiles.dpatch
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/701-patch-hbook-comis-Imakefiles.dpatch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- 701-patch-hbook-comis-Imakefiles.dpatch	30 Nov 2005 22:01:01 -0000	1.1
+++ 701-patch-hbook-comis-Imakefiles.dpatch	14 Dec 2005 16:52:26 -0000	1.2
@@ -6,9 +6,9 @@
 ## DP: 701 dpatch (a shell script).
 
 @DPATCH@
-diff -urNad cernlib-2005.05.09/src/packlib/hbook/code/Imakefile /tmp/dpep.3VyhWr/cernlib-2005.05.09/src/packlib/hbook/code/Imakefile
---- cernlib-2005.05.09/src/packlib/hbook/code/Imakefile	1997-09-02 09:09:01.000000000 -0400
-+++ /tmp/dpep.3VyhWr/cernlib-2005.05.09/src/packlib/hbook/code/Imakefile	2005-06-10 17:04:08.866020136 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/packlib/hbook/code/Imakefile cernlib-2005.05.09.dfsg/src/packlib/hbook/code/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/packlib/hbook/code/Imakefile	1997-09-02 09:09:01.000000000 -0400
++++ cernlib-2005.05.09.dfsg/src/packlib/hbook/code/Imakefile	2005-12-07 14:59:31.519940694 -0500
 @@ -19,8 +19,8 @@
  	hgn.F hgnf.F hgnpar.F hgstat.F hhipar.F hhxye.F hi.F \ @@\
  	hictoi.F hid1.F hid2.F hidall.F hidopt.F hidpos.F hie.F  \ @@\
@@ -20,9 +20,9 @@
  	hkind.F hknul1.F hknuli.F hlabel.F hlabeq.F hlabnb.F \ @@\
  	hlattr.F hlccmp.F hldir.F hldir1.F hldir2.F hldirt.F \ @@\
  	hlgnxt.F hlhcmp.F hlimit.F hllsq.F hlnext.F hlocat.F \ @@\
-diff -urNad cernlib-2005.05.09/src/pawlib/comis/code/Imakefile /tmp/dpep.3VyhWr/cernlib-2005.05.09/src/pawlib/comis/code/Imakefile
---- cernlib-2005.05.09/src/pawlib/comis/code/Imakefile	2005-06-10 17:02:24.843306185 -0400
-+++ /tmp/dpep.3VyhWr/cernlib-2005.05.09/src/pawlib/comis/code/Imakefile	2005-06-10 17:05:09.955931988 -0400
+diff -urNad cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/Imakefile cernlib-2005.05.09.dfsg/src/pawlib/comis/code/Imakefile
+--- cernlib-2005.05.09.dfsg~/src/pawlib/comis/code/Imakefile	2005-12-07 14:59:22.782783593 -0500
++++ cernlib-2005.05.09.dfsg/src/pawlib/comis/code/Imakefile	2005-12-07 14:59:31.519940694 -0500
 @@ -37,7 +37,8 @@
  	csspar.F cssubr.F cssvpt.F cstadv.F cstarr.F csterr.F cstext.F \ @@\
  	cstfrf.F cstinf.F cstlgb.F cstlog.F cstpar.F cstran.F cstrer.F \ @@\


Index: cernlib.m4
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/cernlib.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cernlib.m4	16 Nov 2005 23:34:07 -0000	1.1
+++ cernlib.m4	14 Dec 2005 16:52:26 -0000	1.2
@@ -1,6 +1,6 @@
 dnl                                                      -*- Autoconf -*- 
 dnl  autoconf macros for the cernlib libraries
-dnl  Copyright (C) 2004 Patrice Dumas
+dnl  Copyright (C) 2004, 2005 Patrice Dumas
 dnl
 dnl  This program is free software; you can redistribute it and/or modify
 dnl  it under the terms of the GNU General Public License as published by
@@ -16,28 +16,33 @@
 dnl  along with this program; if not, write to the Free Software
 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-dnl A basic axample of the macros usage:
+dnl A basic axample of the macro usage:
 dnl 
-dnl AC_CERNLIB
-dnl AC_LIB_CERNLIB(kernlib,CLTOU)
-dnl AC_LIB_CERNLIB(mathlib,GAUSS)
-dnl LIBS="$CERNLIB_LIBS $LIBS"
-
-dnl The macro AC_CERNLIB tries to determine the cernlib location and
-dnl whether the linking should be static or not. It should be called once and
-dnl before a particular cernlib library is detected with the second macro.
+dnl AC_LIB_CERNLIB(kernlib,CLTOU,
+dnl [
+dnl    AC_LIB_CERNLIB(mathlib,GAUSS,[LIBS="$CERNLIB_LIBS $LIBS"])
+dnl ])
+
+dnl
 dnl --with-static-cernlib forces the static or dynamic linking.
 dnl --with-cernlib gives the location of cernlib.
 dnl
-dnl If the type of linking isn't forced it is detected as follow:
-dnl - if the environment variable CERNLIB exists it is assumed to be the
+dnl If the type of linking isn't specified it is assumed to be static.
+dnl
+dnl For static linking:
+dnl - if the binary program 'cernlib-static' or 'cernlib' is in the path it is 
+dnl   assumed that a static linking using the information reported by that 
+dnl   script is wanted.
+dnl - otherwise if the environment variable CERNLIB exists it is assumed to be the
 dnl   location of the static library.
 dnl - otherwise if the environment variable CERN_ROOT exists it is assumed 
 dnl   that CERN_ROOT/lib is the location of the static library.
-dnl - otherwise if the binary program 'cernlib' is in the path it is assumed 
-dnl   that a static linking using the information reported by that binary is 
-dnl   wanted.
-dnl - otherwise a dynamic linking is performed.
+dnl - otherwise a simple linking is performed.
+dnl 
+dnl If a dynamic linking is selected:
+dnl - if the binary program 'cernlib' is in the path it is assumed that it is the 
+dnl   debian script and it is called with -dy.
+dnl - otherwise a simple linking is performed.
 dnl
 dnl AC_LIB_CERNLIB ([LIBRARY = kernlib], [FUNCTION = CLTOU], [ACTION-IF-FOUND],
 dnl          [ACTION-IF-NOT-FOUND]) 
@@ -53,7 +58,7 @@
 # statically linked or not.
 AC_DEFUN([AC_CERNLIB], [
 CERNLIB_LIB_PATH=
-CERNLIB_STATIC=
+CERNLIB_STATIC=yes
 AC_ARG_WITH(static_cernlib,
 [  --with-static-cernlib             link statically with the cernlib],
 [  CERNLIB_STATIC=$withval      ])
@@ -64,27 +69,24 @@
 
 
 if test "z$CERNLIB_STATIC" != "zno"; then    
-    CERNLIB_BIN=no
+    CERNLIB_STATIC=yes
     if test "z$CERNLIB_LIB_PATH" = z; then
-        if test "z$CERNLIB" != z -a -d "$CERNLIB"; then
-            CERNLIB_LIB_PATH=$CERNLIB
-            CERNLIB_STATIC="yes"
-            AC_MSG_NOTICE([using the CERNLIB environment variable for cernlib location])
-        elif test "z$CERN_ROOT" != z -a -d "$CERN_ROOT/lib"; then
-            CERNLIB_LIB_PATH=$CERN_ROOT/lib
-            CERNLIB_STATIC="yes"
-            AC_MSG_NOTICE([using the CERN_ROOT environment variable for cernlib location])
-        fi
-        if test "z$CERNLIB_LIB_PATH" = "z"; then
+        AC_PATH_PROG(CERNLIB_BIN, cernlib-static, no)
+        if test $CERNLIB_BIN = no; then
             AC_PATH_PROG(CERNLIB_BIN, cernlib, no)
-            if test $CERNLIB_BIN != no; then
-                CERNLIB_STATIC="yes"
+        fi
+        if test $CERNLIB_BIN = no; then
+            if test "z$CERNLIB" != z -a -d "$CERNLIB"; then
+               CERNLIB_LIB_PATH=$CERNLIB
+               AC_MSG_NOTICE([using the CERNLIB environment variable for cernlib location])
+            elif test "z$CERN_ROOT" != z -a -d "$CERN_ROOT/lib"; then
+                CERNLIB_LIB_PATH=$CERN_ROOT/lib
+                AC_MSG_NOTICE([using the CERN_ROOT environment variable for cernlib location])
             fi
         fi
     fi
-fi
-
-if test "z$CERNLIB_STATIC" != "zyes"; then
+else
+    AC_PATH_PROG(CERNLIB_BIN, cernlib, no)
     if test "z$CERNLIB_LIB_PATH" != z; then
          LDFLAGS="$LDFLAGS -L$CERNLIB_LIB_PATH"
     fi
@@ -95,6 +97,7 @@
 #          [ACTION-IF-NOT-FOUND]) 
 # check for a function in a library of the cernlib
 AC_DEFUN([AC_LIB_CERNLIB], [
+AC_REQUIRE([AC_CERNLIB])
 
 cernlib_lib_ok="no"
 
@@ -110,10 +113,12 @@
     cern_func=$2
 fi
 
+save_CERNLIB_LIBS=$CERNLIB_LIBS
+save_LIBS=$LIBS
+
 if test "z$CERNLIB_STATIC" = "zyes"; then
     cernlib_lib_static_found=no
     AC_MSG_NOTICE([cernlib: linking with a static $cern_library])
-    save_CERNLIB_LIBS="$CERNLIB_LIBS"
     if test "z$CERNLIB_BIN" != "zno"; then
         cernlib_bin_out=`$CERNLIB_BIN $cern_library`
         CERNLIB_LIBS="$cernlib_bin_out $CERNLIB_LIBS"
@@ -127,37 +132,34 @@
     fi
     if test "z$cernlib_lib_static_found" = zno; then
         AC_MSG_WARN([cannot determine the cernlib location for static linking])
+    fi
+else
+    AC_MSG_NOTICE([trying a dynamical link with $cern_library])
+    if test "z$CERNLIB_BIN" != "zno"; then
+        # try link with debian cernlib script with -dy
+        cernlib_bin_out=`$CERNLIB_BIN -dy $cern_library`
+        CERNLIB_LIBS="$cernlib_bin_out $CERNLIB_LIBS"
     else
+        CERNLIB_LIBS="-l$cern_library $CERNLIB_LIBS"
+    fi
+fi
+
 dnl now try the link
-        AC_LANG_PUSH(Fortran 77)
-        save_LIBS="$LIBS"; LIBS="$CERNLIB_LIBS $LIBS"
-        AC_LINK_IFELSE([      program main
+LIBS="$CERNLIB_LIBS $LIBS"
+AC_LANG_PUSH(Fortran 77)
+AC_LINK_IFELSE([      program main
       call $cern_func
       end
 ], 
-        [ 
-            cernlib_lib_ok=yes
-        ],
-        [
-            CERNLIB_LIBS="$save_CERNLIB_LIBS"
-        ])
-        LIBS="$save_LIBS"
-        AC_LANG_POP(Fortran 77)
-    fi
-else
-    AC_MSG_NOTICE([trying a dynamical link with $cern_library])
-dnl FIXME ther could also be something like
-dnl save_LIBS="$LIBS"; LIBS="$CERNLIB_LIBS $LIBS"
-dnl CERNLIB_LIBS="-l$cern_library $CERNLIB_LIBS" 
-dnl LIBS="$save_LIBS"
-    AC_CHECK_LIB([$cern_library], [$cern_func],
-       [ 
-         AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
-         LIBS="-l$1 $LIBS"
-
-         cernlib_lib_ok=yes 
-       ])
-fi
+[ 
+    cernlib_lib_ok=yes
+],
+[
+    CERNLIB_LIBS=$save_CERNLIB_LIBS
+])
+AC_LANG_POP(Fortran 77)
+LIBS=$save_LIBS
+AC_SUBST([CERNLIB_LIBS])
 
 AS_IF([test x"$cernlib_lib_ok" = xyes],
       [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_CERNLIB_${cern_library}_${cern_func}))


Index: cernlib.spec
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/cernlib.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cernlib.spec	9 Dec 2005 20:39:08 -0000	1.8
+++ cernlib.spec	14 Dec 2005 16:52:26 -0000	1.9
@@ -1,6 +1,6 @@
 Name:          cernlib
 Version:       2005
-Release:       8%{?dist}.1
+Release:       9%{?dist}
 Summary:       General purpose CERN library and associated binaries
 Group:         Development/Libraries
 # As explained in the cernlib on debian FAQ, cfortran can be considered LGPL.
@@ -66,7 +66,7 @@
 Source201: cernlib-deadpool.txt
 
 # debian patchset
-Patch0: cernlib_2005.05.09.dfsg-2.diff
+Patch0: cernlib_2005.05.09.dfsg-3.diff
 # change file to directory to DATADIR
 Patch1100: cernlib-enforce-FHS.diff
 Patch1: 001-fix-missing-fluka.dpatch
@@ -89,6 +89,9 @@
 # a workaround for cups. Applied in doubt.
 Patch113: 113-cups-postscript-fix.dpatch
 Patch114: 114-install-scripts-properly.dpatch
+Patch115: 115-rsrtnt64-goto-outer-block.dpatch
+Patch116: 116-fix-fconc64-spaghetti-code.dpatch
+Patch117: 117-fix-optimizer-bug-in-gphot.dpatch
 Patch200: 200-comis-allow-special-chars-in-path.dpatch
 Patch201: 201-update-kuip-helper-apps.dpatch
 Patch202: 202-fix-includes-in-minuit-example.dpatch
@@ -102,8 +105,9 @@
 Patch208: 208-fix-redundant-packlib-dependencies.dpatch
 Patch209: 209-ignore-unneeded-headers-in-kmutil.c.dpatch
 Patch210: 210-improve-cfortran-header-files.dpatch
-# disabled in the debian patchset, enabled here
-Patch211: 211-fix-comis-on-64-bit-arches.dpatch
+# split in newer debian patchset
+Patch2110: 211-fix-comis-on-amd64.dpatch
+Patch2111: 211-fix-comis-on-ia64.dpatch
 Patch300: 300-skip-duplicate-lenocc.dpatch
 # Use another approach, see cernlib-enforce-FHS
 # Patch33: 301-datafiles-comply-with-FHS.dpatch
@@ -183,7 +187,6 @@
 Patch1203: cernlib-hwuli2_use_dimag.diff 
 Patch1204: cernlib-hwhiga_use_dimag.diff
 Patch1205: cernlib-gfortran.diff 
-Patch1206: cernlib-rsrtnt64_goto_outer_block.diff
 Patch1207: cernlib-v107z0_X_before_string.diff
 
 %description
@@ -313,6 +316,9 @@
 %patch -P 112 -p1
 %patch -P 113 -p1
 %patch -P 114 -p1
+%patch -P 115 -p1
+%patch -P 116 -p1
+%patch -P 117 -p1
 %patch -P 200 -p1
 %patch -P 201 -p1
 %patch -P 202 -p1
@@ -324,7 +330,8 @@
 %patch -P 208 -p1
 %patch -P 209 -p1
 %patch -P 210 -p1
-%patch -P 211 -p1
+%patch -P 2110 -p1
+%patch -P 2111 -p1
 %patch -P 300 -p1
 #%patch -P 301 -p1
 #%patch -P 302 -p1
@@ -458,7 +465,6 @@
 # use gfortran
 #%patch -P 1205
 # workaround gfortran bug
-%patch -P 1206
 %patch -P 1207
 
 # remove CVS directories
@@ -693,6 +699,9 @@
 %doc debian/debhelper/zftp.README.debian
 
 %changelog
+* Wed Dec 14 2005 Patrice Dumas <dumas at centre-cired.fr> - 2005-9
+- use new debian patchset
+
 * Fri Dec  9 2005 Patrice Dumas <dumas at centre-cired.fr> - 2005-8.1
 - use new debian patchset
 - enable 64 bit fixes patch


Index: paw.README
===================================================================
RCS file: /cvs/extras/rpms/cernlib/devel/paw.README,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- paw.README	30 Nov 2005 22:01:01 -0000	1.2
+++ paw.README	14 Dec 2005 16:52:26 -0000	1.3
@@ -41,11 +41,6 @@
 
 to the beginning of them.
 
-5) 64-bit issues
-
-Note that this package is not yet fully functional on 64-bit machines, as the
-COMIS portion of Pawlib does not yet work correctly on those architectures.
-
 -- Kevin McCarty <kmccarty at debian.org>, Tue, 22 Nov 2005
 
 Adapted to the rpm package by 


--- 211-fix-comis-on-64-bit-arches.dpatch DELETED ---


--- cernlib-rsrtnt64_goto_outer_block.diff DELETED ---


--- cernlib_2005.05.09.dfsg-2.diff DELETED ---




More information about the scm-commits mailing list