From 6528a3f9ff914310b50f9d4bec576a7773b6ee73 Mon Sep 17 00:00:00 2001 From: Ying-Chieh Liao Date: Thu, 10 Oct 2002 19:36:41 +0000 Subject: upgrade to 2.16.5 PR: 42333 Submitted by: maintainer --- emulators/hercules/Makefile | 33 ++-- emulators/hercules/distinfo | 2 +- emulators/hercules/files/patch-aa | 57 ------ emulators/hercules/files/patch-ab | 12 -- emulators/hercules/files/patch-ad | 50 ------ emulators/hercules/files/patch-ae | 11 -- emulators/hercules/files/patch-af | 64 ------- emulators/hercules/files/patch-ag | 276 ------------------------------ emulators/hercules/files/patch-ah | 18 -- emulators/hercules/files/patch-feature.h | 12 ++ emulators/hercules/files/patch-hercules.h | 12 ++ emulators/hercules/files/patch-tapecopy.c | 63 +++++++ emulators/hercules/files/patch-tapedev.c | 275 +++++++++++++++++++++++++++++ emulators/hercules/files/patch-version.c | 17 ++ 14 files changed, 395 insertions(+), 507 deletions(-) delete mode 100644 emulators/hercules/files/patch-aa delete mode 100644 emulators/hercules/files/patch-ab delete mode 100644 emulators/hercules/files/patch-ad delete mode 100644 emulators/hercules/files/patch-ae delete mode 100644 emulators/hercules/files/patch-af delete mode 100644 emulators/hercules/files/patch-ag delete mode 100644 emulators/hercules/files/patch-ah create mode 100644 emulators/hercules/files/patch-feature.h create mode 100644 emulators/hercules/files/patch-hercules.h create mode 100644 emulators/hercules/files/patch-tapecopy.c create mode 100644 emulators/hercules/files/patch-tapedev.c create mode 100644 emulators/hercules/files/patch-version.c (limited to 'emulators/hercules') diff --git a/emulators/hercules/Makefile b/emulators/hercules/Makefile index 72e8b082d761..637730cfadf4 100644 --- a/emulators/hercules/Makefile +++ b/emulators/hercules/Makefile @@ -6,36 +6,33 @@ # PORTNAME= hercules -PORTVERSION= 2.15 -PORTREVISION= 1 +PORTVERSION= 2.16.5 CATEGORIES= emulators MASTER_SITES= http://www.conmicro.cx/hercules/ MAINTAINER= adam@vectors.cx GNU_CONFIGURE= yes +USE_REINPLACE= yes post-patch: - - @${PERL} -pi -e 's@lpthread@pthread@g' ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's@-lpthread@${PTHREAD_LIBS}@g' ${WRKSRC}/configure do-install: - - @for i in hercules dasdinit dasdisup dasdload dasdls dasdpdsu \ - tapecopy tapemap tapesplt cckd2ckd cckdcdsk ckd2cckd \ - cckdcomp cckdswap hetget hetinit hetmap hetupd dmap2hrc; \ - do \ - ${INSTALL_PROGRAM} ${WRKSRC}/$$i ${PREFIX}/bin; \ - done +.for i in hercules dasdinit dasdisup dasdload dasdls dasdpdsu \ + tapecopy tapemap tapesplt cckd2ckd cckdcdsk ckd2cckd \ + cckdcomp cckdswap hetget hetinit hetmap hetupd dmap2hrc + ${INSTALL_PROGRAM} ${WRKSRC}/$i ${PREFIX}/bin +.endfor .if !defined(NOPORTDOCS) - @${MKDIR} ${PREFIX}/share/doc/hercules - @${RM} -f ${WRKSRC}/html/Makefile* - @for i in ${WRKSRC}/hercules.cnf ${WRKSRC}/html/* ; \ - do \ - ${INSTALL_DATA} $$i ${PREFIX}/share/doc/hercules; \ - done + @${MKDIR} ${DOCSDIR} +.for i in ../hercules.cnf cckddasd.html hercconf.html hercfaq.html \ + hercinst.html herclic.html hercload.html hercnew.html herctcp.html \ + hercules.css index.html + ${INSTALL_DATA} ${WRKSRC}/html/$i ${DOCSDIR} +.endfor .endif - @${CAT} pkg-message + @${CAT} ${PKGMESSAGE} .include diff --git a/emulators/hercules/distinfo b/emulators/hercules/distinfo index 96b7f70fb944..96762b2146d5 100644 --- a/emulators/hercules/distinfo +++ b/emulators/hercules/distinfo @@ -1 +1 @@ -MD5 (hercules-2.15.tar.gz) = 8eb98b2b5663607fda075fc57f019172 +MD5 (hercules-2.16.5.tar.gz) = 5c23268223e2e74a08fd7d148a159834 diff --git a/emulators/hercules/files/patch-aa b/emulators/hercules/files/patch-aa deleted file mode 100644 index fc6217273d18..000000000000 --- a/emulators/hercules/files/patch-aa +++ /dev/null @@ -1,57 +0,0 @@ -diff -uNr ckddasd.c ---- ckddasd.c Tue Nov 20 17:39:46 2001 -+++ ckddasd.c Tue Jan 15 22:03:48 2002 -@@ -786,7 +786,7 @@ - { - /* if lazy write, write the last track image */ - if (dev->ckdlazywrt) -- ckd_lseek (dev, -1, -1, -1); -+ ckd_lseek (dev, -1, (off_t)-1, -1); - - /* free the cache */ - for (i = 0; i < dev->ckdcachenbr; i++) -@@ -1240,7 +1240,7 @@ - - DEVTRACE("ckddasd: skipping %d bytes\n", skiplen); - -- rc = ckd_lseek (dev, dev->fd, skiplen, SEEK_CUR); -+ rc = ckd_lseek (dev, dev->fd, (off_t)skiplen, SEEK_CUR); - if (rc == -1) - { - #ifdef OPTION_SYNCIO -@@ -1734,7 +1734,7 @@ - ckdlen = CKDDASD_RECHDR_SIZE + keylen + datalen; - - /* Determine the current position in the file */ -- curpos = ckd_lseek (dev, dev->fd, 0, SEEK_CUR); -+ curpos = ckd_lseek (dev, dev->fd, (off_t)0, SEEK_CUR); - if (curpos == -1) - { - #ifdef OPTION_SYNCIO -@@ -1782,7 +1782,7 @@ - } - - /* Backspace over end of track marker */ -- rc = ckd_lseek (dev, dev->fd, -(CKDDASD_RECHDR_SIZE), SEEK_CUR); -+ rc = ckd_lseek (dev, dev->fd, -(off_t)(CKDDASD_RECHDR_SIZE), SEEK_CUR); - if (rc == -1) - { - #ifdef OPTION_SYNCIO -@@ -1854,7 +1854,7 @@ - ckdlen = CKDDASD_RECHDR_SIZE + keylen + datalen; - - /* Determine the current position in the file */ -- curpos = ckd_lseek (dev, dev->fd, 0, SEEK_CUR); -+ curpos = ckd_lseek (dev, dev->fd, (off_t)0, SEEK_CUR); - if (curpos == -1) - { - #ifdef OPTION_SYNCIO -@@ -1938,7 +1938,7 @@ - } - - /* Backspace over end of track marker */ -- rc = ckd_lseek (dev, dev->fd, -(CKDDASD_RECHDR_SIZE), SEEK_CUR); -+ rc = ckd_lseek (dev, dev->fd, -(off_t)(CKDDASD_RECHDR_SIZE), SEEK_CUR); - if (rc == -1) - { - #ifdef OPTION_SYNCIO diff --git a/emulators/hercules/files/patch-ab b/emulators/hercules/files/patch-ab deleted file mode 100644 index 60bc3a0fdf1f..000000000000 --- a/emulators/hercules/files/patch-ab +++ /dev/null @@ -1,12 +0,0 @@ ---- Makefile.am Tue Oct 30 16:44:39 2001 -+++ Makefile.am Mon Mar 11 02:44:03 2002 -@@ -93,8 +93,8 @@ - - tar: dist - -+install-exec-local: - if SETUID_HERCIFC --install-exec-local: - chown root $(DESTDIR)$(bindir)/hercifc - chmod 0751 $(DESTDIR)$(bindir)/hercifc - chmod +s $(DESTDIR)$(bindir)/hercifc diff --git a/emulators/hercules/files/patch-ad b/emulators/hercules/files/patch-ad deleted file mode 100644 index b1c7754a70b5..000000000000 --- a/emulators/hercules/files/patch-ad +++ /dev/null @@ -1,50 +0,0 @@ -diff -uNr configure.ac ---- configure.ac Wed Dec 19 07:20:00 2001 -+++ configure.ac Thu Jan 17 22:50:57 2002 -@@ -72,6 +72,19 @@ - - AM_CONDITIONAL(BUILD_FTHREADS, [test x$build_fthreads = xtrue]) - -+dnl AC_MSG_NOTICE([Checking to see if -pthread is needed to compile]) -+ -+AC_MSG_CHECKING([wether ${CC-cc} accepts -pthread]) -+ -+echo 'void f(){}' >conftest.c -+if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then -+ LIBS="-pthread $LIBS" -+ AC_MSG_RESULT([yes]) -+else -+ AC_MSG_RESULT([no]) -+fi -+rm -f conftest* -+ - # Headers - AC_CHECK_HEADERS(byteswap.h) - AC_CHECK_HEADER(fenv.h,,[AC_DEFINE([NO_IEEE_SUPPORT])]) -@@ -105,6 +118,16 @@ - [AC_DEFINE([HAVE_U_INT])], - [AC_MSG_ERROR([Unable to find fixed-size data types])] )] ) - -+dnl AC_MSG_NOTICE([Checking for SCSI tape support and what type]) -+AC_CHECK_HEADER(sys/mtio.h, -+ [AC_DEFINE([HAVE_MTIO_H])]) -+ -+AC_TRY_COMPILE([#include mtio.h], -+ [mtget test; -+ int result; -+ result = test.mt_gstat; ], -+ [AC_DEFINE([GNU_MTIO_SUPPORT])]) -+ - # Compiler characteristics - - AC_C_BIGENDIAN -@@ -306,5 +329,9 @@ - [Define to provide additional information about this build]) - AH_TEMPLATE([DEBUG], - [Define to enable extra debugging code]) -+AH_TEMPLATE([HAVE_MTIO_H], -+ [Define if your system has sys/mtio.h]) -+AH_TEMPLATE([GNU_MTIO_SUPPORT], -+ [Define if you have the GNU version of mtio.h (Linux)]) - - AC_OUTPUT(Makefile util/Makefile html/Makefile) diff --git a/emulators/hercules/files/patch-ae b/emulators/hercules/files/patch-ae deleted file mode 100644 index af4fb0c7869f..000000000000 --- a/emulators/hercules/files/patch-ae +++ /dev/null @@ -1,11 +0,0 @@ -diff -uNr hercules.h ---- hercules.h Wed Dec 19 07:18:17 2001 -+++ hercules.h Tue Jan 15 20:26:56 2002 -@@ -215,6 +215,7 @@ - pthread_cond_timedwait((pcond),(plk),(timeout)) - #define initialize_detach_attr(pat) \ - pthread_attr_init((pat)); \ -+ pthread_attr_setstacksize((pat),1048576); \ - pthread_attr_setdetachstate((pat),PTHREAD_CREATE_DETACHED) - typedef void*THREAD_FUNC(void*); - #define create_thread(ptid,pat,fn,arg) \ diff --git a/emulators/hercules/files/patch-af b/emulators/hercules/files/patch-af deleted file mode 100644 index ab64f9b2275a..000000000000 --- a/emulators/hercules/files/patch-af +++ /dev/null @@ -1,64 +0,0 @@ -diff -uNr tapecopy.c ---- tapecopy.c Thu Nov 29 07:53:46 2001 -+++ tapecopy.c Thu Jan 17 14:04:09 2002 -@@ -32,6 +32,7 @@ - static BYTE hdrlbl[] = "\xC8\xC4\xD9"; /* EBCDIC characters "HDR" */ - static BYTE eoflbl[] = "\xC5\xD6\xC6"; /* EBCDIC characters "EOF" */ - static BYTE eovlbl[] = "\xC5\xD6\xE5"; /* EBCDIC characters "EOV" */ -+#ifdef GNU_MTIO_SUPPORT - static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO; - static struct mt_tape_info densinfo[] = { - {0x01, "NRZI (800 bpi)"}, -@@ -59,6 +60,7 @@ - {0x8C, "EXB-8505 compressed"}, - {0x90, "EXB-8205 compressed"}, - {0, NULL}}; -+#endif - static BYTE buf[65500]; - - /*-------------------------------------------------------------------*/ -@@ -71,6 +73,7 @@ - /*-------------------------------------------------------------------*/ - static void print_status (BYTE *devname, long stat) - { -+#ifdef GNU_MTIO_SUPPORT - printf ("%s status: %8.8lX", devname, stat); - if (GMT_EOF(stat)) printf (" EOF"); - if (GMT_BOT(stat)) printf (" BOT"); -@@ -84,6 +87,7 @@ - if (GMT_D_800(stat)) printf (" 800"); - if (GMT_DR_OPEN(stat)) printf (" NOTAPE"); - printf ("\n"); -+#endif - - } /* end function print_status */ - -@@ -104,10 +108,12 @@ - return -1; - } - -+#ifdef GNU_MTIO_SUPPORT - print_status (devname, stblk.mt_gstat); - - if (GMT_EOD(stblk.mt_gstat)) return 1; - if (GMT_EOT(stblk.mt_gstat)) return 1; -+#endif - - return 0; - } /* end function print_status */ -@@ -174,6 +180,7 @@ - exit (7); - } - -+#ifdef GNU_MTIO_SUPPORT - /* Display tape status information */ - for (i = 0; tapeinfo[i].t_type != 0 - && tapeinfo[i].t_type != stblk.mt_type; i++); -@@ -201,6 +208,7 @@ - - /* Set the tape device to process variable length blocks */ - opblk.mt_op = MTSETBLK; -+#endif - opblk.mt_count = 0; - rc = ioctl (devfd, MTIOCTOP, (char*)&opblk); - if (rc < 0) diff --git a/emulators/hercules/files/patch-ag b/emulators/hercules/files/patch-ag deleted file mode 100644 index 5ed9d446f6dc..000000000000 --- a/emulators/hercules/files/patch-ag +++ /dev/null @@ -1,276 +0,0 @@ -diff -uNr tapedev.c ---- tapedev.c Tue Nov 20 17:39:47 2001 -+++ tapedev.c Thu Jan 17 15:07:35 2002 -@@ -194,6 +194,7 @@ - /*-------------------------------------------------------------------*/ - /* Static data areas */ - /*-------------------------------------------------------------------*/ -+#ifdef GNU_MTIO_SUPPORT - static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO; - static struct mt_tape_info densinfo[] = { - {0x01, "NRZI (800 bpi)"}, -@@ -221,6 +222,7 @@ - {0x8C, "EXB-8505 compressed"}, - {0x90, "EXB-8205 compressed"}, - {0, NULL}}; -+#endif - - static PARSER ptab[] = - { -@@ -1142,6 +1144,7 @@ - /*-------------------------------------------------------------------*/ - static U32 status_scsitape (DEVBLK *dev) - { -+#ifdef HAVE_MTIO_H - U32 stat; /* Tape status bits */ - int rc; /* Return code */ - struct mtget stblk; /* Area for MTIOCGET ioctl */ -@@ -1158,6 +1161,7 @@ - dev->filename, strerror(errno)); - return 0; - } -+#ifdef GNU_MTIO_SUPPORT - stat = stblk.mt_gstat; - - /* Display tape status */ -@@ -1190,10 +1194,14 @@ - dev->prvblkpos = -1; - dev->blockid = 0; - } -+#else -+ stat = 0; -+#endif - - /* Return tape status */ - return stat; - -+#endif - } /* end function status_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1204,6 +1212,7 @@ - /*-------------------------------------------------------------------*/ - static int open_scsitape (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - int i; /* Array subscript */ - struct mtop opblk; /* Area for MTIOCTOP ioctl */ -@@ -1248,6 +1257,7 @@ - return -1; - } - -+#ifdef GNU_MTIO_SUPPORT - /* Intervention required if no tape is mounted */ - if (GMT_DR_OPEN(stblk.mt_gstat)) - { -@@ -1283,6 +1293,7 @@ - - /* Set the tape device to process variable length blocks */ - opblk.mt_op = MTSETBLK; -+#endif - opblk.mt_count = 0; - rc = ioctl (dev->fd, MTIOCTOP, (char*)&opblk); - if (rc < 0) -@@ -1311,6 +1322,12 @@ - - return 0; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function open_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1323,6 +1340,7 @@ - /*-------------------------------------------------------------------*/ - static int read_scsitape (DEVBLK *dev, BYTE *buf, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - - /* Read data block from SCSI tape device */ -@@ -1346,6 +1364,12 @@ - /* Return block length or zero if tapemark */ - return rc; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function read_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1357,6 +1381,7 @@ - static int write_scsitape (DEVBLK *dev, BYTE *buf, U16 len, - BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - - /* Write data block to SCSI tape device */ -@@ -1376,6 +1401,12 @@ - /* Return normal status */ - return 0; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function write_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1386,6 +1417,7 @@ - /*-------------------------------------------------------------------*/ - static int write_scsimark (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - struct mtop opblk; /* Area for MTIOCTOP ioctl */ - -@@ -1408,6 +1440,12 @@ - /* Return normal status */ - return 0; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function write_scsimark */ - - /*-------------------------------------------------------------------*/ -@@ -1420,6 +1458,7 @@ - /*-------------------------------------------------------------------*/ - static int fsb_scsitape (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - int fsrerrno; /* Value of errno after MTFSR*/ - U32 stat; /* Tape status bits */ -@@ -1434,6 +1473,7 @@ - /* Obtain tape status after forward space */ - stat = status_scsitape (dev); - -+#ifdef GNU_MTIO_SUPPORT - /* If I/O error and status indicates EOF, then a tapemark - was detected, so increment the file number and return 0 */ - if (rc < 0 && fsrerrno == EIO && GMT_EOF(stat)) -@@ -1442,6 +1482,7 @@ - dev->blockid++; - return 0; - } -+#endif - - /* Handle MTFSR error condition */ - if (rc < 0) -@@ -1460,6 +1501,12 @@ - /* Return +1 to indicate forward space successful */ - return +1; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function fsb_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1472,6 +1519,7 @@ - /*-------------------------------------------------------------------*/ - static int bsb_scsitape (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - int bsrerrno; /* Value of errno after MTBSR*/ - U32 stat; /* Tape status bits */ -@@ -1480,6 +1528,7 @@ - /* Obtain tape status before backward space */ - stat = status_scsitape (dev); - -+#ifdef GNU_MTIO_SUPPORT - /* Unit check if already at start of tape */ - if (GMT_BOT(stat)) - { -@@ -1488,6 +1537,7 @@ - *unitstat = CSW_CE | CSW_DE | CSW_UC; - return -1; - } -+#endif - - /* Backspace block on SCSI tape */ - opblk.mt_op = MTBSR; -@@ -1526,6 +1576,12 @@ - /* Return +1 to indicate backspace successful */ - return +1; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function bsb_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1537,6 +1593,7 @@ - /*-------------------------------------------------------------------*/ - static int fsf_scsitape (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - struct mtop opblk; /* Area for MTIOCTOP ioctl */ - -@@ -1562,6 +1619,12 @@ - /* Return normal status */ - return 0; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function fsf_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -1573,6 +1636,7 @@ - /*-------------------------------------------------------------------*/ - static int bsf_scsitape (DEVBLK *dev, BYTE *unitstat) - { -+#ifdef HAVE_MTIO_H - int rc; /* Return code */ - struct mtop opblk; /* Area for MTIOCTOP ioctl */ - -@@ -1599,6 +1663,12 @@ - /* Return normal status */ - return 0; - -+#else -+ -+ logmsg ("HHC286I SCSI Support is disabled\n"); -+ return -1; -+ -+#endif - } /* end function bsf_scsitape */ - - /*-------------------------------------------------------------------*/ -@@ -2725,7 +2795,9 @@ - - case TAPEDEVT_SCSITAPE: - stat = status_scsitape (dev); -+#ifdef GNU_MTIO_SUPPORT - if (GMT_BOT(stat)) dev->sense[1] |= SENSE1_TAPE_LOADPT; -+#endif - break; - - case TAPEDEVT_OMATAPE: diff --git a/emulators/hercules/files/patch-ah b/emulators/hercules/files/patch-ah deleted file mode 100644 index 7af5d7cab74c..000000000000 --- a/emulators/hercules/files/patch-ah +++ /dev/null @@ -1,18 +0,0 @@ -diff -uNr version.c ---- version.c Thu Nov 29 08:05:47 2001 -+++ version.c Thu Jan 17 14:10:55 2002 -@@ -77,6 +77,14 @@ - "No HET BZIP2 support", - #endif - -+#if defined(GNU_MTIO_SUPPORT) -+ "Using GNU tape handling", -+#elif defined(HAVE_MTIO_H) -+ "Using generic Unix tape handling", -+#else -+ "No SCSI tape support", -+#endif -+ - #if defined(CUSTOM_BUILD_STRING) - CUSTOM_BUILD_STRING, - #endif diff --git a/emulators/hercules/files/patch-feature.h b/emulators/hercules/files/patch-feature.h new file mode 100644 index 000000000000..17885d5ad6c0 --- /dev/null +++ b/emulators/hercules/files/patch-feature.h @@ -0,0 +1,12 @@ +--- feature.h.orig Mon Sep 2 11:36:09 2002 ++++ feature.h Mon Sep 2 11:36:55 2002 +@@ -479,4 +479,9 @@ + #define XSTORE_PAGEMASK 0x7FFFF000 + #endif + ++#if defined(__FreeBSD__) ++ #define HAVE_MTIO_H ++#else ++ #define GNU_MTIO_SUPPORT ++#endif + /* end of FEATURES.H */ diff --git a/emulators/hercules/files/patch-hercules.h b/emulators/hercules/files/patch-hercules.h new file mode 100644 index 000000000000..25525c4a17a9 --- /dev/null +++ b/emulators/hercules/files/patch-hercules.h @@ -0,0 +1,12 @@ +--- hercules.h.orig Mon Sep 2 11:43:46 2002 ++++ hercules.h Mon Sep 2 11:44:56 2002 +@@ -333,6 +333,9 @@ + BYTE *iobuf, BYTE *more, BYTE *unitstat, U16 *residual); + typedef int DEVCF (struct _DEVBLK *dev); + ++#if defined(HAVE_MTIO_H) ++ #include ++#endif + + /*-------------------------------------------------------------------*/ + /* Structure definition for the Vector Facility */ diff --git a/emulators/hercules/files/patch-tapecopy.c b/emulators/hercules/files/patch-tapecopy.c new file mode 100644 index 000000000000..237c636de0c0 --- /dev/null +++ b/emulators/hercules/files/patch-tapecopy.c @@ -0,0 +1,63 @@ +--- tapecopy.c.orig Mon Sep 2 11:00:59 2002 ++++ tapecopy.c Mon Sep 2 11:03:21 2002 +@@ -32,6 +32,7 @@ + static BYTE hdrlbl[] = "\xC8\xC4\xD9"; /* EBCDIC characters "HDR" */ + static BYTE eoflbl[] = "\xC5\xD6\xC6"; /* EBCDIC characters "EOF" */ + static BYTE eovlbl[] = "\xC5\xD6\xE5"; /* EBCDIC characters "EOV" */ ++#ifdef GNU_MTIO_SUPPORT + static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO; + static struct mt_tape_info densinfo[] = { + {0x01, "NRZI (800 bpi)"}, +@@ -59,6 +60,7 @@ + {0x8C, "EXB-8505 compressed"}, + {0x90, "EXB-8205 compressed"}, + {0, NULL}}; ++#endif + static BYTE buf[65500]; + + /*-------------------------------------------------------------------*/ +@@ -71,6 +73,7 @@ + /*-------------------------------------------------------------------*/ + static void print_status (BYTE *devname, long stat) + { ++#ifdef GNU_MTIO_SUPPORT + printf ("%s status: %8.8lX", devname, stat); + if (GMT_EOF(stat)) printf (" EOF"); + if (GMT_BOT(stat)) printf (" BOT"); +@@ -84,6 +87,7 @@ + if (GMT_D_800(stat)) printf (" 800"); + if (GMT_DR_OPEN(stat)) printf (" NOTAPE"); + printf ("\n"); ++#endif + + } /* end function print_status */ + +@@ -104,10 +108,12 @@ + return -1; + } + ++#ifdef GNU_MTIO_SUPPORT + print_status (devname, stblk.mt_gstat); + + if (GMT_EOD(stblk.mt_gstat)) return 1; + if (GMT_EOT(stblk.mt_gstat)) return 1; ++#endif + + return 0; + } /* end function print_status */ +@@ -188,6 +194,7 @@ + exit (7); + } + ++#ifdef GNU_MTIO_SUPPORT + /* Display tape status information */ + for (i = 0; tapeinfo[i].t_type != 0 + && tapeinfo[i].t_type != stblk.mt_type; i++); +@@ -215,6 +222,7 @@ + + /* Set the tape device to process variable length blocks */ + opblk.mt_op = MTSETBLK; ++#endif + opblk.mt_count = 0; + rc = ioctl (devfd, MTIOCTOP, (char*)&opblk); + if (rc < 0) diff --git a/emulators/hercules/files/patch-tapedev.c b/emulators/hercules/files/patch-tapedev.c new file mode 100644 index 000000000000..1eb7d444e5b7 --- /dev/null +++ b/emulators/hercules/files/patch-tapedev.c @@ -0,0 +1,275 @@ +--- tapedev.c.orig Wed Jul 3 13:21:52 2002 ++++ tapedev.c Mon Sep 2 11:43:24 2002 +@@ -195,6 +195,7 @@ + /*-------------------------------------------------------------------*/ + /* Static data areas */ + /*-------------------------------------------------------------------*/ ++#ifdef GNU_MTIO_SUPPORT + static struct mt_tape_info tapeinfo[] = MT_TAPE_INFO; + static struct mt_tape_info densinfo[] = { + {0x01, "NRZI (800 bpi)"}, +@@ -222,6 +223,7 @@ + {0x8C, "EXB-8505 compressed"}, + {0x90, "EXB-8205 compressed"}, + {0, NULL}}; ++#endif + + static PARSER ptab[] = + { +@@ -1143,6 +1145,7 @@ + /*-------------------------------------------------------------------*/ + static U32 status_scsitape (DEVBLK *dev) + { ++#ifdef HAVE_MTIO_H + U32 stat; /* Tape status bits */ + int rc; /* Return code */ + struct mtget stblk; /* Area for MTIOCGET ioctl */ +@@ -1159,6 +1162,7 @@ + dev->filename, strerror(errno)); + return 0; + } ++#ifdef GNU_MTIO_SUPPORT + stat = stblk.mt_gstat; + + /* Display tape status */ +@@ -1191,10 +1195,14 @@ + dev->prvblkpos = -1; + dev->blockid = 0; + } ++#else ++ stat = 0; ++#endif + + /* Return tape status */ + return stat; + ++#endif + } /* end function status_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1205,6 +1213,7 @@ + /*-------------------------------------------------------------------*/ + static int open_scsitape (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + int i; /* Array subscript */ + struct mtop opblk; /* Area for MTIOCTOP ioctl */ +@@ -1249,6 +1258,7 @@ + return -1; + } + ++#ifdef GNU_MTIO_SUPPORT + /* Intervention required if no tape is mounted */ + if (GMT_DR_OPEN(stblk.mt_gstat)) + { +@@ -1284,6 +1294,7 @@ + + /* Set the tape device to process variable length blocks */ + opblk.mt_op = MTSETBLK; ++#endif + opblk.mt_count = 0; + rc = ioctl (dev->fd, MTIOCTOP, (char*)&opblk); + if (rc < 0) +@@ -1312,6 +1323,12 @@ + + return 0; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1 ++ ++#endif + } /* end function open_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1324,6 +1341,7 @@ + /*-------------------------------------------------------------------*/ + static int read_scsitape (DEVBLK *dev, BYTE *buf, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + + /* Read data block from SCSI tape device */ +@@ -1347,6 +1365,12 @@ + /* Return block length or zero if tapemark */ + return rc; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function read_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1358,6 +1382,7 @@ + static int write_scsitape (DEVBLK *dev, BYTE *buf, U16 len, + BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + + /* Write data block to SCSI tape device */ +@@ -1377,6 +1402,12 @@ + /* Return normal status */ + return 0; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function write_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1387,6 +1418,7 @@ + /*-------------------------------------------------------------------*/ + static int write_scsimark (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + struct mtop opblk; /* Area for MTIOCTOP ioctl */ + +@@ -1409,6 +1441,12 @@ + /* Return normal status */ + return 0; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function write_scsimark */ + + /*-------------------------------------------------------------------*/ +@@ -1421,6 +1459,7 @@ + /*-------------------------------------------------------------------*/ + static int fsb_scsitape (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + int fsrerrno; /* Value of errno after MTFSR*/ + U32 stat; /* Tape status bits */ +@@ -1435,6 +1474,7 @@ + /* Obtain tape status after forward space */ + stat = status_scsitape (dev); + ++#ifdef GNU_MTIO_SUPPORT + /* If I/O error and status indicates EOF, then a tapemark + was detected, so increment the file number and return 0 */ + if (rc < 0 && fsrerrno == EIO && GMT_EOF(stat)) +@@ -1443,6 +1483,7 @@ + dev->blockid++; + return 0; + } ++#endif + + /* Handle MTFSR error condition */ + if (rc < 0) +@@ -1461,6 +1502,12 @@ + /* Return +1 to indicate forward space successful */ + return +1; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function fsb_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1473,6 +1520,7 @@ + /*-------------------------------------------------------------------*/ + static int bsb_scsitape (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + int bsrerrno; /* Value of errno after MTBSR*/ + U32 stat; /* Tape status bits */ +@@ -1481,6 +1529,7 @@ + /* Obtain tape status before backward space */ + stat = status_scsitape (dev); + ++#ifdef GNU_MTIO_SUPPORT + /* Unit check if already at start of tape */ + if (GMT_BOT(stat)) + { +@@ -1489,6 +1538,7 @@ + *unitstat = CSW_CE | CSW_DE | CSW_UC; + return -1; + } ++#endif + + /* Backspace block on SCSI tape */ + opblk.mt_op = MTBSR; +@@ -1527,6 +1577,12 @@ + /* Return +1 to indicate backspace successful */ + return +1; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function bsb_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1538,6 +1594,7 @@ + /*-------------------------------------------------------------------*/ + static int fsf_scsitape (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + struct mtop opblk; /* Area for MTIOCTOP ioctl */ + +@@ -1563,6 +1620,12 @@ + /* Return normal status */ + return 0; + ++#else ++ ++ logmsg ("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function fsf_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -1574,6 +1637,7 @@ + /*-------------------------------------------------------------------*/ + static int bsf_scsitape (DEVBLK *dev, BYTE *unitstat) + { ++#ifdef HAVE_MTIO_H + int rc; /* Return code */ + struct mtop opblk; /* Area for MTIOCTOP ioctl */ + +@@ -1600,6 +1664,12 @@ + /* Return normal status */ + return 0; + ++#else ++ ++ logmsg("HHC286I SCSI Support is disabled\n"); ++ return -1; ++ ++#endif + } /* end function bsf_scsitape */ + + /*-------------------------------------------------------------------*/ +@@ -2726,7 +2796,9 @@ + + case TAPEDEVT_SCSITAPE: + stat = status_scsitape (dev); ++#ifdef GNU_MTIO_SUPPORT + if (GMT_BOT(stat)) dev->sense[1] |= SENSE1_TAPE_LOADPT; ++#endif + break; + + case TAPEDEVT_OMATAPE: diff --git a/emulators/hercules/files/patch-version.c b/emulators/hercules/files/patch-version.c new file mode 100644 index 000000000000..df908e14c311 --- /dev/null +++ b/emulators/hercules/files/patch-version.c @@ -0,0 +1,17 @@ +--- version.c.orig Mon Sep 2 11:15:53 2002 ++++ version.c Mon Sep 2 11:17:51 2002 +@@ -106,6 +106,14 @@ + "No HET BZIP2 support", + #endif + ++#if defined(GNU_MTIO_SUPPORT) ++ "Using GNU tape handling", ++#elif defined(HAVE_MTIO_H) ++ "Using generic Unix tape handling", ++#else ++ "No SCSI tape support", ++#endif ++ + " " + + }; -- cgit v1.2.3