diff options
author | Sergey A. Osokin <osa@FreeBSD.org> | 2003-10-28 14:53:44 +0000 |
---|---|---|
committer | Sergey A. Osokin <osa@FreeBSD.org> | 2003-10-28 14:53:44 +0000 |
commit | 1dba9f3c91d89af3716d8cd2368c250fd41d48ea (patch) | |
tree | 11f84e69c5fbfbfbcf09d89449ef5354c99b69f6 /sysutils | |
parent | 31c8d3fc870e6dabce2afbf259d365a550c5bf90 (diff) | |
download | ports-1dba9f3c91d89af3716d8cd2368c250fd41d48ea.tar.gz ports-1dba9f3c91d89af3716d8cd2368c250fd41d48ea.zip |
Fix build on -CURRENT.
Also:
- replace <xxx> with <xxx.h> due to Standard C++.
- In my observation, when include "devstats.h",
- In 4.x or earlier version, we use checkversion(), getnumdevs() ...
But In 5.x, it should be repalce with devstat_checkversion(kvm_t *),
devstat_getnumdevs(kvm_t *) respectively.
In summary, function in 4.x's devstats.h can add prefix word "devstat
Submitted by: Cheng-Lung Sung <clsung@dragon2.net>
Maintainership to: submitter
PR: 58596
Notes
Notes:
svn path=/head/; revision=92452
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xosview/Makefile | 32 | ||||
-rw-r--r-- | sysutils/xosview/files/patch-Host.h | 10 | ||||
-rw-r--r-- | sysutils/xosview/files/patch-Xrm.h | 11 | ||||
-rw-r--r-- | sysutils/xosview/files/patch-bsd::cpumeter.cc | 21 | ||||
-rw-r--r-- | sysutils/xosview/files/patch-kernel.cc | 137 | ||||
-rw-r--r-- | sysutils/xosview/files/patch-xwin.h | 10 |
6 files changed, 210 insertions, 11 deletions
diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile index 0c627a319c23..6eb190349d17 100644 --- a/sysutils/xosview/Makefile +++ b/sysutils/xosview/Makefile @@ -12,17 +12,35 @@ CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= clsung@dragon2.net COMMENT= A graphical performance meter USE_X_PREFIX= yes GNU_CONFIGURE= yes +USE_REINPLACE= yes MAN1= xosview.1 -.include <bsd.port.pre.mk> +post-patch: + @${REINPLACE_CMD} -e 's,iostream.h,iostream,' \ + ${WRKSRC}/xwin.h \ + ${WRKSRC}/Host.h \ + ${WRKSRC}/Xrm.cc \ + ${WRKSRC}/llist.cc \ + ${WRKSRC}/timeval.h \ + ${WRKSRC}/xosview.cc + @${REINPLACE_CMD} -e 's,string.h,string,' \ + ${WRKSRC}/xwin.h \ + ${WRKSRC}/Host.cc \ + ${WRKSRC}/Xrm.cc \ + ${WRKSRC}/llist.cc \ + ${WRKSRC}/timeval.h \ + ${WRKSRC}/xosview.cc + @${REINPLACE_CMD} -e 's,fstream.h,fstream,' \ + ${WRKSRC}/bitfieldmeter.cc \ + ${WRKSRC}/fieldmeter.cc \ + ${WRKSRC}/fieldmeterdecay.cc \ + ${WRKSRC}/fieldmetergraph.cc + @${REINPLACE_CMD} -e 's,-O4 -pipe,,' \ + ${WRKSRC}/configure -.if ${OSVERSION} >= 500113 -BROKEN= "Does not compile (bad C++ code)" -.endif - -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/sysutils/xosview/files/patch-Host.h b/sysutils/xosview/files/patch-Host.h new file mode 100644 index 000000000000..e7430d0e7229 --- /dev/null +++ b/sysutils/xosview/files/patch-Host.h @@ -0,0 +1,10 @@ +--- Host.h.orig Sun Jan 24 06:20:39 1999 ++++ Host.h Mon Oct 27 21:31:31 2003 +@@ -19,6 +19,7 @@ + #include <arpa/inet.h> + #include <iostream.h> + #include "bool.h" ++using namespace std; + + class Host { + public: diff --git a/sysutils/xosview/files/patch-Xrm.h b/sysutils/xosview/files/patch-Xrm.h new file mode 100644 index 000000000000..06f2f8178760 --- /dev/null +++ b/sysutils/xosview/files/patch-Xrm.h @@ -0,0 +1,11 @@ +--- Xrm.h.orig Sun Jan 24 06:20:39 1999 ++++ Xrm.h Mon Oct 27 21:26:37 2003 +@@ -16,7 +16,7 @@ + #include <X11/Xlib.h> + #include <X11/Xresource.h> + +-class ostream; ++using namespace std; + + class Xrm { + public: diff --git a/sysutils/xosview/files/patch-bsd::cpumeter.cc b/sysutils/xosview/files/patch-bsd::cpumeter.cc new file mode 100644 index 000000000000..f96f23314c7e --- /dev/null +++ b/sysutils/xosview/files/patch-bsd::cpumeter.cc @@ -0,0 +1,21 @@ +--- bsd/cpumeter.cc.orig Tue Oct 28 17:42:56 2003 ++++ bsd/cpumeter.cc Tue Oct 28 17:43:20 2003 +@@ -123,12 +123,12 @@ + static int firstTime = 1; + if (firstTime) { + fprintf(stderr, +-" Warning: the CPU tick counters are not changing. This could +-be due to running a kernel besides /netbsd (or the equivalent for FreeBSD). +- If this is the case, re-run xosview with the -N kernel-name option. +- If not, then this is a bug. Please send a message to +-bgrayson@ece.utexas.edu, in addition to any send-pr bug reports +-(or in lieu of -- it ought to get fixed faster if you contact me ++" Warning: the CPU tick counters are not changing. This could \ ++be due to running a kernel besides /netbsd (or the equivalent for FreeBSD). \ ++ If this is the case, re-run xosview with the -N kernel-name option. \ ++ If not, then this is a bug. Please send a message to \ ++bgrayson@ece.utexas.edu, in addition to any send-pr bug reports \ ++(or in lieu of -- it ought to get fixed faster if you contact me \ + directly). Thanks!\n"); + firstTime = 0; + } diff --git a/sysutils/xosview/files/patch-kernel.cc b/sysutils/xosview/files/patch-kernel.cc index 9d2909e3d4a7..43121c712a1c 100644 --- a/sysutils/xosview/files/patch-kernel.cc +++ b/sysutils/xosview/files/patch-kernel.cc @@ -1,5 +1,5 @@ ---- bsd/kernel.cc.orig Mon Jul 17 11:52:31 2000 -+++ bsd/kernel.cc Tue Aug 21 12:23:41 2001 +--- bsd/kernel.cc.orig Tue Oct 9 10:40:51 2001 ++++ bsd/kernel.cc Mon Oct 27 20:03:03 2003 @@ -46,6 +46,7 @@ #endif @@ -30,7 +30,136 @@ int totalinuse, totalsize; int rnswap, nswap = swapctl(SWAP_NSWAP, 0, 0); struct swapent *swapiter; -@@ -828,25 +834,25 @@ +@@ -557,13 +563,21 @@ + * Make sure that the userland devstat version matches the kernel + * devstat version. + */ ++#if __FreeBSD_version >= 500000 ++ if (devstat_checkversion(kd) < 0) { ++#else + if (checkversion() < 0) { ++#endif + nodisk++; + return; + } + + /* find out how many devices we have */ ++#if __FreeBSD_version >= 500000 ++ if ((num_devices = devstat_getnumdevs(kd)) < 0) { ++#else + if ((num_devices = getnumdevs()) < 0) { ++#endif + nodisk++; + return; + } +@@ -578,7 +592,11 @@ + * changed here, since it almost certainly has. We only look for + * errors. + */ ++#if __FreeBSD_version >= 500000 ++ if (devstat_getdevs(kd,&cur) == -1) { ++#else + if (getdevs(&cur) == -1) { ++#endif + nodisk++; + return; + } +@@ -590,7 +608,11 @@ + + /* only interested in disks */ + matches = NULL; ++#if __FreeBSD_version >= 500000 ++ if (devstat_buildmatch("da", &matches, &num_matches) != 0) { ++#else + if (buildmatch("da", &matches, &num_matches) != 0) { ++#endif + nodisk++; + return; + } +@@ -605,7 +627,11 @@ + * device list has changed, so we don't look for return values of 0 + * or 1. If we get back -1, though, there is an error. + */ ++#if __FreeBSD_version >= 500000 ++ if (devstat_selectdevs(&dev_select, &num_selected, ++#else + if (selectdevs(&dev_select, &num_selected, ++#endif + &num_selections, &select_generation, + generation, cur.dinfo->devices, num_devices, + matches, num_matches, +@@ -632,7 +658,11 @@ + * the selection process again, in case a device that we + * were previously displaying has gone away. + */ ++#if __FreeBSD_version >= 500000 ++ switch (devstat_getdevs(kd,&cur)) { ++#else + switch (getdevs(&cur)) { ++#endif + case -1: + return (0); + case 1: { +@@ -640,7 +670,11 @@ + + num_devices = cur.dinfo->numdevs; + generation = cur.dinfo->generation; ++#if __FreeBSD_version >= 500000 ++ retval = devstat_selectdevs(&dev_select, &num_selected, ++#else + retval = selectdevs(&dev_select, &num_selected, ++#endif + &num_selections, &select_generation, + generation, cur.dinfo->devices, + num_devices, matches, num_matches, +@@ -664,14 +698,22 @@ + * Calculate elapsed time up front, since it's the same for all + * devices. + */ ++#if __FreeBSD_version >= 500000 ++ busy_seconds = cur.snap_time - last.snap_time; ++#else + busy_seconds = compute_etime(cur.busy_time, last.busy_time); ++#endif + + /* this is the first time thru so just copy cur to last */ + if (last.dinfo->numdevs == 0) { + tmp_dinfo = last.dinfo; + last.dinfo = cur.dinfo; + cur.dinfo = tmp_dinfo; ++#if __FreeBSD_version >= 500000 ++ last.snap_time = cur.snap_time; ++#else + last.busy_time = cur.busy_time; ++#endif + return (0); + } + +@@ -685,7 +727,11 @@ + + di = dev_select[dn].position; + ++#if __FreeBSD_version >= 500000 ++ if (devstat_compute_statistics(&cur.dinfo->devices[di], ++#else + if (compute_stats(&cur.dinfo->devices[di], ++#endif + &last.dinfo->devices[di], busy_seconds, + &total_bytes, &total_transfers, + NULL, NULL, +@@ -700,7 +746,11 @@ + last.dinfo = cur.dinfo; + cur.dinfo = tmp_dinfo; + ++#if __FreeBSD_version >= 500000 ++ last.snap_time = cur.snap_time; ++#else + last.busy_time = cur.busy_time; ++#endif + + } else { + /* no disks found ? */ +@@ -828,25 +878,25 @@ OpenKDIfNeeded(); nintr = (nlst[EINTRCNT_SYM_INDEX].n_value - nlst[INTRCNT_SYM_INDEX].n_value) / sizeof(int); @@ -63,7 +192,7 @@ /* FreeBSD has an array of interrupt counts, indexed by device number. These are also indirected by IRQ num with intr_countp: */ safe_kvm_read (nlst[INTRCOUNTP_SYM_INDEX].n_value, -@@ -875,8 +881,8 @@ +@@ -875,8 +925,8 @@ intrCount[i] = kvm_intrptrs[i]; #endif /* _BSDI_VERSION */ diff --git a/sysutils/xosview/files/patch-xwin.h b/sysutils/xosview/files/patch-xwin.h new file mode 100644 index 000000000000..bcec4c6f874f --- /dev/null +++ b/sysutils/xosview/files/patch-xwin.h @@ -0,0 +1,10 @@ +--- xwin.h.orig Mon Feb 25 03:52:00 2002 ++++ xwin.h Mon Oct 27 21:13:29 2003 +@@ -11,6 +11,7 @@ + #endif + #include <iostream.h> + #include <string.h> ++using namespace std; + + #define XWIN_H_CVSID "$Id$" + |