#! /bin/sh /usr/share/dpatch/dpatch-run ## 309-define-dummy-herwig-routines.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Define stub functions for herwig routines that are supposed to be ## DP: provided by the user. Also, comment out the dummy functions pdfset ## DP: and structm; real versions are provided in pdflib. @DPATCH@ diff -urNad cernlib-2005.05.09.dfsg~/src/mclibs/herwig/code/Imakefile cernlib-2005.05.09.dfsg/src/mclibs/herwig/code/Imakefile --- cernlib-2005.05.09.dfsg~/src/mclibs/herwig/code/Imakefile 2005-11-28 19:46:53.619963660 +0000 +++ cernlib-2005.05.09.dfsg/src/mclibs/herwig/code/Imakefile 2005-11-28 19:46:58.890844233 +0000 @@ -24,8 +24,13 @@ hwulob.F hwulof.F hwulor.F hwumas.F hwupcm.F hwurap.F hwures.F \ @@\ hwurob.F hwurof.F hwurot.F hwusor.F hwusqr.F hwusta.F hwutab.F \ @@\ hwutim.F hwvdif.F hwvdot.F hwvequ.F hwvsca.F hwvsum.F hwvzro.F \ @@\ - hwwarn.F ieupdg.F ipdgeu.F pdfset.F qqinit.F qqlmat.F sasano.F \ @@\ - sasbeh.F sasdir.F sasgam.F sasvmd.F structm.F + hwwarn.F ieupdg.F ipdgeu.F /*pdfset.F*/ qqinit.F qqlmat.F sasano.F \ @@\ + sasbeh.F sasdir.F sasgam.F sasvmd.F /*structm.F*/ + /* comment out pdfset.F, structm.F; real versions are in pdflib */ + +/* add the following file to define dummy routines as weak symbols */ +/* --Kevin McCarty, for Debian */ +SRCS_C= dummy.c FORTRANSAVEOPTION = FortranSaveFlags diff -urNad cernlib-2005.05.09.dfsg~/src/mclibs/herwig/code/dummy.c cernlib-2005.05.09.dfsg/src/mclibs/herwig/code/dummy.c --- cernlib-2005.05.09.dfsg~/src/mclibs/herwig/code/dummy.c 1970-01-01 00:00:00.000000000 +0000 +++ cernlib-2005.05.09.dfsg/src/mclibs/herwig/code/dummy.c 2005-11-28 19:49:17.897320746 +0000 @@ -0,0 +1,34 @@ +/* Dummy file to avoid undefined symbols in the library */ +/* Kevin McCarty, 14 Jan 2003 */ + +#include +#include + +/* Want the dummy functions to be weakly defined so they may be overridden + * without error. */ + +#define kludge(x) #x +#define stringify(x) kludge(x) +#define underline(x) dummy_ ## x + +#define DUMMY(UPPERNAME, fortranname_, returntype) \ +static returntype underline(fortranname_)() { print_dummy(#UPPERNAME); } \ +void fortranname_() \ + __attribute__ ((weak, alias (stringify(underline(fortranname_))) )) + +static void print_dummy(const char *function) +{ + fprintf(stderr, "herwig59: Now in dummy %s routine.\n", function); + fprintf(stderr, + "If you see this message, you should define your own such routine.\n" +#if defined (CERNLIB_DEBIAN) + "For details, see the file /usr/share/doc/libherwig59-2-dev/herwig59.txt.gz\n" +#endif + ); + exit(EXIT_FAILURE); +} + +DUMMY(HWABEG, hwabeg_, void); +DUMMY(HWANAL, hwanal_, void); +DUMMY(HWAEND, hwaend_, void); +