iozone: fix build.

This commit is contained in:
Jerome Duval
2017-08-26 13:35:15 +02:00
parent 81d016c7c0
commit 280b7b2420
2 changed files with 63 additions and 48 deletions

View File

@@ -13,15 +13,18 @@ random read, pread, mmap, aio_read, aio_write"
# this work.
HOMEPAGE="http://www.iozone.org/"
SOURCE_URI="http://www.iozone.org/src/current/iozone3_326.tar"
CHECKSUM_SHA256="bc0a40b2cc7f2e8c6dcfbbff82f1df82ad735f02c9a7db59f8364b76f43f7063"
LICENSE="iozone"
COPYRIGHT="
1991-2001 William D. Norcott
2010 Don Capps
"
LICENSE="iozone"
REVISION="1"
ARCHITECTURES="?x86 ?x86_gcc2"
SOURCE_URI="http://www.iozone.org/src/current/iozone3_326.tar"
CHECKSUM_SHA256="bc0a40b2cc7f2e8c6dcfbbff82f1df82ad735f02c9a7db59f8364b76f43f7063"
SOURCE_DIR="iozone3_326"
PATCHES="iozone-3.326.patchset"
ARCHITECTURES="x86_gcc2 ?x86 x86_64"
PROVIDES="
cmd:iozone = $portVersion
@@ -39,9 +42,6 @@ BUILD_PREREQUIRES="
haiku_devel
"
SOURCE_DIR="iozone3_326"
PATCHES="iozone-3.326.patch"
BUILD()
{
cd src/current/
@@ -50,10 +50,10 @@ BUILD()
INSTALL()
{
cd src/current/
cp iozone $binDir
cp fileop $binDir
mkdir -p $binDir $manDir/man1
cd src/current/
cp iozone $binDir
cp fileop $binDir
mkdir -p $manDir/man1
cp ../../docs/iozone.1 $manDir/man1
cp ../../docs/iozone.1 $manDir/man1
}

View File

@@ -1,7 +1,14 @@
diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop.c
--- iozone3_326/src/current/fileop.c 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/fileop.c 2011-01-06 08:22:28.000000000 -0600
@@ -116,7 +116,7 @@
From 0f41a2987ab4de6d04b395b88bd506e699a42d73 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 26 Aug 2017 13:21:47 +0200
Subject: Haiku patch
diff --git a/src/current/fileop.c b/src/current/fileop.c
index 57ddf68..d6fb79c 100644
--- a/src/current/fileop.c
+++ b/src/current/fileop.c
@@ -116,7 +116,7 @@ void file_unlink(int);
void file_read(int);
void splash(void);
void usage(void);
@@ -10,7 +17,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
void clear_stats();
int validate(char *, int , char );
@@ -138,14 +138,15 @@
@@ -138,14 +138,15 @@ int dirlen;
/************************************************************************/
void purge_buffer_cache()
{
@@ -28,7 +35,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
chdir("/");
strcpy(command,"umount ");
strcat(command, mountname);
@@ -242,7 +243,7 @@
@@ -242,7 +243,7 @@ int main(int argc, char **argv)
printf("\nFileop: Working in %s, File size is %d, Output is in Ops/sec. (A=Avg, B=Best, W=Worst)\n", thedir, sz);
if(!verbose)
{
@@ -37,7 +44,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
printf(" . %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %7s %10s\n",
"mkdir","chdir","rmdir","create","open","read","write","close","stat",
"access","chmod","readdir","delete"," Total_files");
@@ -450,7 +451,7 @@
@@ -450,7 +451,7 @@ int main(int argc, char **argv)
printf(" Worst readdir(s)/sec = %12.2f (%12.9f seconds/op)\n\n",
1/stats[_STAT_READDIR].worst,stats[_STAT_READDIR].worst);
}
@@ -46,7 +53,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
/*
* link test
*/
@@ -517,7 +518,7 @@
@@ -517,7 +518,7 @@ int main(int argc, char **argv)
printf("%7.0f ",stats[_STAT_ACCESS].counter/stats[_STAT_ACCESS].total_time);
printf("%7.0f ",stats[_STAT_CHMOD].counter/stats[_STAT_CHMOD].total_time);
printf("%7.0f ",stats[_STAT_READDIR].counter/stats[_STAT_READDIR].total_time);
@@ -55,7 +62,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
printf("%7.0f ",stats[_STAT_LINK].counter/stats[_STAT_LINK].total_time);
printf("%7.0f ",stats[_STAT_UNLINK].counter/stats[_STAT_UNLINK].total_time);
#endif
@@ -540,7 +541,7 @@
@@ -540,7 +541,7 @@ int main(int argc, char **argv)
printf("%7.0f ",1/stats[_STAT_ACCESS].best);
printf("%7.0f ",1/stats[_STAT_CHMOD].best);
printf("%7.0f ",1/stats[_STAT_READDIR].best);
@@ -64,7 +71,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
printf("%7.0f ",1/stats[_STAT_LINK].best);
printf("%7.0f ",1/stats[_STAT_UNLINK].best);
#endif
@@ -563,7 +564,7 @@
@@ -563,7 +564,7 @@ int main(int argc, char **argv)
printf("%7.0f ",1/stats[_STAT_ACCESS].worst);
printf("%7.0f ",1/stats[_STAT_CHMOD].worst);
printf("%7.0f ",1/stats[_STAT_READDIR].worst);
@@ -73,7 +80,7 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
printf("%7.0f ",1/stats[_STAT_LINK].worst);
printf("%7.0f ",1/stats[_STAT_UNLINK].worst);
#endif
@@ -589,9 +590,10 @@
@@ -589,9 +590,10 @@ dir_create(int x)
{
sprintf(buf,"fileop_L1_%d",i);
stats[_STAT_DIR_CREATE].starttime=time_so_far();
@@ -85,9 +92,10 @@ diff -Naur iozone3_326/src/current/fileop.c iozone3_326.haiku/src/current/fileop
printf("Mkdir failed\n");
exit(1);
}
diff -Naur iozone3_326/src/current/iozone.c iozone3_326.haiku/src/current/iozone.c
--- iozone3_326/src/current/iozone.c 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/iozone.c 2011-01-06 08:20:02.000000000 -0600
diff --git a/src/current/iozone.c b/src/current/iozone.c
index 90cee47..bcef6f5 100644
--- a/src/current/iozone.c
+++ b/src/current/iozone.c
@@ -57,7 +57,7 @@
#include <Windows.h>
int errno;
@@ -97,25 +105,25 @@ diff -Naur iozone3_326/src/current/iozone.c iozone3_326.haiku/src/current/iozone
#include <errno.h>
#else
extern int errno; /* imported for errors */
@@ -79,7 +79,7 @@
@@ -79,7 +79,7 @@ extern int h_errno; /* imported for errors */
#include <pthread.h>
#endif
-#if defined(HAVE_ANSIC_C) && defined(linux)
+#if defined(HAVE_ANSIC_C) && (defined(linux) || defined(haiku))
+#if defined(HAVE_ANSIC_C) && (defined(linux) || defined(Haiku))
#include <stdlib.h>
#include <sys/wait.h>
#endif
@@ -92,7 +92,7 @@
@@ -92,7 +92,7 @@ int close();
int unlink();
int main();
void record_command_line();
-#if !defined(linux)
+#if !defined(linux) || !defined(haiku)
+#if !defined(linux) && !defined(Haiku)
int wait();
#endif
int fsync();
@@ -271,6 +271,13 @@
@@ -271,6 +271,13 @@ THISVERSION,
#include <string.h>
#endif
@@ -129,7 +137,7 @@ diff -Naur iozone3_326/src/current/iozone.c iozone3_326.haiku/src/current/iozone
#if defined (__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__)
#ifndef O_SYNC
#define O_SYNC O_FSYNC
@@ -390,7 +397,7 @@
@@ -390,7 +397,7 @@ typedef long long off64_t;
#define MAP_ANONYMOUS MAP_ANON
#endif
@@ -138,18 +146,20 @@ diff -Naur iozone3_326/src/current/iozone.c iozone3_326.haiku/src/current/iozone
#define MAP_FILE (0)
#endif
diff -Naur iozone3_326/src/current/iozone_visualizer.pl iozone3_326.haiku/src/current/iozone_visualizer.pl
--- iozone3_326/src/current/iozone_visualizer.pl 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/iozone_visualizer.pl 2011-01-06 08:20:02.000000000 -0600
diff --git a/src/current/iozone_visualizer.pl b/src/current/iozone_visualizer.pl
index a5a7d2d..4e7ba23 100755
--- a/src/current/iozone_visualizer.pl
+++ b/src/current/iozone_visualizer.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/boot/common/bin/perl
use warnings;
use strict;
diff -Naur iozone3_326/src/current/libbif.c iozone3_326.haiku/src/current/libbif.c
--- iozone3_326/src/current/libbif.c 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/libbif.c 2011-01-06 08:20:02.000000000 -0600
diff --git a/src/current/libbif.c b/src/current/libbif.c
index 406d3c2..9c5ed32 100644
--- a/src/current/libbif.c
+++ b/src/current/libbif.c
@@ -14,7 +14,7 @@
#include <sys/types.h>
#include <stdio.h>
@@ -168,10 +178,11 @@ diff -Naur iozone3_326/src/current/libbif.c iozone3_326.haiku/src/current/libbif
#include <unistd.h>
#include <stdlib.h>
#endif
diff -Naur iozone3_326/src/current/makefile iozone3_326.haiku/src/current/makefile
--- iozone3_326/src/current/makefile 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/makefile 2011-01-06 08:20:02.000000000 -0600
@@ -30,6 +30,7 @@
diff --git a/src/current/makefile b/src/current/makefile
index 994a2b4..9c61709 100644
--- a/src/current/makefile
+++ b/src/current/makefile
@@ -30,6 +30,7 @@ all:
@echo " -> freebsd (32bit) <-"
@echo " -> generic (32bit) <-"
@echo " -> ghpux (32bit) <-"
@@ -179,7 +190,7 @@ diff -Naur iozone3_326/src/current/makefile iozone3_326.haiku/src/current/makefi
@echo " -> hpuxs-11.0 (simple) (32bit) <-"
@echo " -> hpux-11.0w (64bit) <-"
@echo " -> hpuxs-11.0w (64bit) <-"
@@ -83,6 +84,12 @@
@@ -83,6 +84,12 @@ rpm:
cp ../../iozone*.tar /usr/src/red*/SO*
rpmbuild -ba spec.in
@@ -192,7 +203,7 @@ diff -Naur iozone3_326/src/current/makefile iozone3_326.haiku/src/current/makefi
#
# Turn on the optimizer, largefiles, Posix async I/O and threads.
@@ -529,6 +536,16 @@
@@ -529,6 +536,16 @@ netbsd: iozone_netbsd.o libbif.o fileop_netbsd.o
# Now for the machine specific stuff
#
@@ -209,7 +220,7 @@ diff -Naur iozone3_326/src/current/makefile iozone3_326.haiku/src/current/makefi
iozone_hpux.o: iozone.c libbif.c
@echo ""
@echo "Building iozone for HP-UX (9.05)"
@@ -695,6 +712,13 @@
@@ -695,6 +712,13 @@ iozone_linux.o: iozone.c libbif.c libasync.c
$(CC) -Wall -c -O3 -Dunix -Dlinux -DHAVE_ANSIC_C -DASYNC_IO \
-D_LARGEFILE64_SOURCE $(CFLAGS) libasync.c -o libasync.o
@@ -223,12 +234,16 @@ diff -Naur iozone3_326/src/current/makefile iozone3_326.haiku/src/current/makefi
fileop_AIX.o: fileop.c
@echo ""
@echo "Building fileop for AIX"
diff -Naur iozone3_326/src/current/report.pl iozone3_326.haiku/src/current/report.pl
--- iozone3_326/src/current/report.pl 2009-06-19 09:00:44.000000000 -0500
+++ iozone3_326.haiku/src/current/report.pl 2011-01-06 08:20:02.000000000 -0600
diff --git a/src/current/report.pl b/src/current/report.pl
index 76943f3..d6976e2 100755
--- a/src/current/report.pl
+++ b/src/current/report.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/boot/common/bin/perl
#
# arguments: one of more report files
#
--
2.7.0