Blame cernlib-805-expunge-missing-mathlib-kernlib-symbols.dpatch

6ea53b2
#! /bin/sh /usr/share/dpatch/dpatch-run
6ea53b2
## 805-expunge-missing-mathlib-kernlib-symbols.dpatch by  <kmccarty@debian.org>
6ea53b2
##
6ea53b2
## All lines beginning with `## DP:' are a description of the patch.
6ea53b2
## DP: Remove some unreferenced symbols from mathlib and kernlib and add
6ea53b2
## DP: dummy symbols where needed.
6ea53b2
6ea53b2
@DPATCH@
6ea53b2
diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/d/Imakefile cernlib-2005.05.09.dfsg/src/mathlib/gen/d/Imakefile
6ea53b2
--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/d/Imakefile	2006-05-16 10:42:32.921420791 -0400
6ea53b2
+++ cernlib-2005.05.09.dfsg/src/mathlib/gen/d/Imakefile	2006-05-16 10:46:11.446026937 -0400
6ea53b2
@@ -2,7 +2,13 @@
6ea53b2
 #include "pilot.h"
6ea53b2
 
6ea53b2
 /* rgmlt*.F have been moved into packlib/hbook to remove circular dependencies.
6ea53b2
+   old506.F is removed since it is equivalent to obsolete code under
6ea53b2
+   packlib/minuit.  dummy.c contains dummy callback functions so the code
6ea53b2
+   can function when built as a shared library.
6ea53b2
    --Kevin McCarty, for Debian. */
6ea53b2
+
6ea53b2
+SRCS_C= dummy.c
6ea53b2
+
6ea53b2
 SRCS_F=	arithm.F c128.F c256.F c512.F c64.F cauchy64.F cft.F cfstft.F \ @@\
6ea53b2
 	rfstft.F cgauss.F d107d1.F d107r1.F d501l1.F d501l2.F d501n1.F \ @@\
6ea53b2
         d501n2.F d501p1.F d501p2.F d501sf.F d700su.F d701bd.F \ @@\
6ea53b2
@@ -11,7 +17,7 @@
6ea53b2
         epdchn.F epdcj.F epde1.F epdecc.F epdfix.F epdin.F \ @@\
6ea53b2
         epditr.F epdje.F epdloc.F epdsrt.F epdtab.F errorf.F esolve.F \ @@\
6ea53b2
 	fcn1.F fftrc.F fumili.F gauss.F i128.F i32.F i64.F linsq.F \ @@\
6ea53b2
-	mconv.F mft.F minfc.F minsq.F monito.F newro.F old506.F radapt.F \ @@\
6ea53b2
+	mconv.F mft.F minfc.F minsq.F monito.F newro.F          radapt.F \ @@\
6ea53b2
 	radmul.F rca.F rfrdh164.F rfrdh264.F rft.F           rgquad.F \ @@\
6ea53b2
 	rgs56p.F rgset.F riwiad.F riwibd.F rknys64.F rknysd.F rkstp.F \ @@\
6ea53b2
 	rpa.F rps.F rrkstp.F rsa.F rtriint.F s128.F s256.F s512.F \ @@\
6ea53b2
diff -urNad cernlib-2005.05.09.dfsg~/src/mathlib/gen/d/dummy.c cernlib-2005.05.09.dfsg/src/mathlib/gen/d/dummy.c
6ea53b2
--- cernlib-2005.05.09.dfsg~/src/mathlib/gen/d/dummy.c	1969-12-31 19:00:00.000000000 -0500
6ea53b2
+++ cernlib-2005.05.09.dfsg/src/mathlib/gen/d/dummy.c	2006-05-16 11:36:09.331168663 -0400
6ea53b2
@@ -0,0 +1,54 @@
6ea53b2
+/* Dummy file to avoid undefined symbols in the library */
6ea53b2
+/* Kevin McCarty, 16 May 2006 */
6ea53b2
+
6ea53b2
+#include <stdio.h>
6ea53b2
+#include <stdlib.h>
6ea53b2
+
6ea53b2
+/* Want the dummy functions to be weakly defined so they may be overridden
6ea53b2
+ * without error. */
6ea53b2
+
6ea53b2
+#define kludge(x)    #x
6ea53b2
+#define stringify(x) kludge(x)
6ea53b2
+#define underline(x) dummy_ ## x
6ea53b2
+
6ea53b2
+#define DUMMY(UPPERNAME, fortranname_, returntype, exitcode, docs) \
6ea53b2
+static returntype underline(fortranname_)() \
6ea53b2
+        { print_dummy(#UPPERNAME, docs, exitcode); } \
6ea53b2
+void fortranname_() \
6ea53b2
+	__attribute__ ((weak, alias (stringify(underline(fortranname_))) ))
6ea53b2
+
6ea53b2
+static void print_dummy(const char *function, const char * docs, int exitcode)
6ea53b2
+{
6ea53b2
+  fprintf(stderr, "mathlib: Now in dummy %s routine.\n", function);
6ea53b2
+  fprintf(stderr,
6ea53b2
+          "If you see this message, you %s define your own such routine.\n",
6ea53b2
+	  exitcode ? "must" : "may wish to");
6ea53b2
+  if (docs)
6ea53b2
+    fprintf(stderr,
6ea53b2
+	  "For details, the CERN writeup that can be found at\n"
6ea53b2
+	  "%s\n"
6ea53b2
+	  "may be helpful.\n", docs);
6ea53b2
+  if (exitcode)
6ea53b2
+    exit(exitcode);
6ea53b2
+}
6ea53b2
+
6ea53b2
+static char d151docs[] = "http://preprints.cern.ch/cgi-bin/setlink?base=preprint&categ=cern&id=IT-ASD-D151";
6ea53b2
+static char d300docs[] = "http://preprints.cern.ch/cgi-bin/setlink?base=preprint&categ=cern&id=IT-ASD-D300";
6ea53b2
+static char d510docs[] = "http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/d510/top.html";
6ea53b2
+
6ea53b2
+/* User-defined callback functions and subroutines */
6ea53b2
+
6ea53b2
+/* D151: DIVONNE: multidimensional integration */
6ea53b2
+DUMMY(DFUN, dfun_, double, EXIT_FAILURE, d151docs);
6ea53b2
+
6ea53b2
+/* D300: elliptic partial differential equation callbacks */
6ea53b2
+DUMMY(GETCO, getco_, void, EXIT_FAILURE, d300docs);
6ea53b2
+DUMMY(USER1, user1_, void, 0, d300docs);
6ea53b2
+DUMMY(USER2, user2_, void, 0, d300docs);
6ea53b2
+
6ea53b2
+/* D510: fitting likelihood functions (obsolete; use MINUIT instead!) */
6ea53b2
+DUMMY(FUNCT, funct_, double, EXIT_FAILURE, d510docs);
6ea53b2
+
6ea53b2
+/* No docs for MINSQ / LINSQ?  Not clear what CERN package they come from. */
6ea53b2
+DUMMY(FCN, fcn_, void, EXIT_FAILURE, 0);
6ea53b2
+