diff --git a/audio/vorbis-tools/patches/patch-acinclude_m4 b/audio/vorbis-tools/patches/patch-acinclude_m4 new file mode 100644 index 00000000000..367c049de4f --- /dev/null +++ b/audio/vorbis-tools/patches/patch-acinclude_m4 @@ -0,0 +1,69 @@ +$OpenBSD: patch-acinclude_m4,v 1.1 2001/03/17 17:07:10 naddy Exp $ +--- acinclude.m4.orig Sat Mar 17 16:28:41 2001 ++++ acinclude.m4 Sat Mar 17 16:36:54 2001 +@@ -280,3 +280,65 @@ int main () + AC_SUBST(AO_LIBS) + rm -f conf.aotest + ]) ++ ++dnl Shamelessly stolen from Joerg Schilling's star. ++dnl Copyright 1998 J. Schilling ++ ++dnl Checks if mmap() works to get shared memory ++dnl Defines HAVE_SMMAP on success. ++AC_DEFUN(AC_FUNC_SMMAP, ++[AC_CACHE_CHECK([if mmap works to get shared memory], ac_cv_func_smmap, ++ [AC_TRY_RUN([ ++#include ++#include ++ ++char * ++mkshare() ++{ ++ int size = 8192; ++ int f; ++ char *addr; ++ ++ if ((f = open("/dev/zero", 2)) < 0) ++ exit(1); ++ addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0); ++ if (addr == (char *)-1) ++ exit(1); ++ close(f); ++ ++ return (addr); ++} ++ ++main() ++{ ++ char *addr; ++ ++ addr = mkshare(8192); ++ *addr = 'I'; ++ ++ switch (fork()) { ++ ++ case -1: ++ printf("help\n"); exit(1); ++ ++ case 0: /* child */ ++ *addr = 'N'; ++ _exit(0); ++ break; ++ default: /* parent */ ++ wait(0); ++ sleep(1); ++ break; ++ } ++ ++ if (*addr != 'N') ++ exit(1); ++ exit(0); ++} ++], ++ [ac_cv_func_smmap=yes], ++ [ac_cv_func_smmap=no], ++ [ac_cv_func_smmap=no])]) ++if test $ac_cv_func_smmap = yes; then ++ AC_DEFINE(HAVE_SMMAP) ++fi]) diff --git a/audio/vorbis-tools/patches/patch-aclocal_m4 b/audio/vorbis-tools/patches/patch-aclocal_m4 index beb5849b9de..af180475304 100644 --- a/audio/vorbis-tools/patches/patch-aclocal_m4 +++ b/audio/vorbis-tools/patches/patch-aclocal_m4 @@ -1,6 +1,6 @@ -$OpenBSD: patch-aclocal_m4,v 1.1.1.1 2001/03/14 01:58:25 todd Exp $ ---- aclocal.m4.orig Wed Feb 28 19:33:40 2001 -+++ aclocal.m4 Wed Feb 28 19:33:47 2001 +$OpenBSD: patch-aclocal_m4,v 1.2 2001/03/17 17:07:11 naddy Exp $ +--- aclocal.m4.orig Mon Feb 26 06:51:03 2001 ++++ aclocal.m4 Sat Mar 17 17:06:03 2001 @@ -222,7 +222,7 @@ AC_ARG_ENABLE(aotest, [ --disable-aotes AO_LIBS="-L$ao_prefix/lib" fi @@ -10,3 +10,72 @@ $OpenBSD: patch-aclocal_m4,v 1.1.1.1 2001/03/14 01:58:25 todd Exp $ AC_MSG_CHECKING(for ao) no_ao="" +@@ -292,6 +292,68 @@ int main () + AC_SUBST(AO_LIBS) + rm -f conf.aotest + ]) ++ ++dnl Shamelessly stolen from Joerg Schilling's star. ++dnl Copyright 1998 J. Schilling ++ ++dnl Checks if mmap() works to get shared memory ++dnl Defines HAVE_SMMAP on success. ++AC_DEFUN(AC_FUNC_SMMAP, ++[AC_CACHE_CHECK([if mmap works to get shared memory], ac_cv_func_smmap, ++ [AC_TRY_RUN([ ++#include ++#include ++ ++char * ++mkshare() ++{ ++ int size = 8192; ++ int f; ++ char *addr; ++ ++ if ((f = open("/dev/zero", 2)) < 0) ++ exit(1); ++ addr = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, f, 0); ++ if (addr == (char *)-1) ++ exit(1); ++ close(f); ++ ++ return (addr); ++} ++ ++main() ++{ ++ char *addr; ++ ++ addr = mkshare(8192); ++ *addr = 'I'; ++ ++ switch (fork()) { ++ ++ case -1: ++ printf("help\n"); exit(1); ++ ++ case 0: /* child */ ++ *addr = 'N'; ++ _exit(0); ++ break; ++ default: /* parent */ ++ wait(0); ++ sleep(1); ++ break; ++ } ++ ++ if (*addr != 'N') ++ exit(1); ++ exit(0); ++} ++], ++ [ac_cv_func_smmap=yes], ++ [ac_cv_func_smmap=no], ++ [ac_cv_func_smmap=no])]) ++if test $ac_cv_func_smmap = yes; then ++ AC_DEFINE(HAVE_SMMAP) ++fi]) + + # Do all the work for Automake. This macro actually does too much -- + # some checks are only needed if your package does certain things. diff --git a/audio/vorbis-tools/patches/patch-configure_in b/audio/vorbis-tools/patches/patch-configure_in new file mode 100644 index 00000000000..89ba6964e56 --- /dev/null +++ b/audio/vorbis-tools/patches/patch-configure_in @@ -0,0 +1,12 @@ +$OpenBSD: patch-configure_in,v 1.1 2001/03/17 17:07:11 naddy Exp $ +--- configure.in.orig Sat Mar 17 16:50:29 2001 ++++ configure.in Sat Mar 17 16:52:47 2001 +@@ -67,7 +67,7 @@ dnl ------------------------------------ + dnl Check for library functions + dnl -------------------------------------------------- + +-dnl none ++AC_FUNC_SMMAP + + dnl -------------------------------------------------- + dnl Work around FHS stupidity diff --git a/audio/vorbis-tools/patches/patch-ogg123_Makefile_am b/audio/vorbis-tools/patches/patch-ogg123_Makefile_am new file mode 100644 index 00000000000..f1af288eddc --- /dev/null +++ b/audio/vorbis-tools/patches/patch-ogg123_Makefile_am @@ -0,0 +1,11 @@ +$OpenBSD: patch-ogg123_Makefile_am,v 1.1 2001/03/17 17:07:11 naddy Exp $ +--- ogg123/Makefile.am.orig Sat Mar 17 15:55:09 2001 ++++ ogg123/Makefile.am Sat Mar 17 15:55:13 2001 +@@ -5,7 +5,6 @@ AUTOMAKE_OPTIONS = foreign + bin_PROGRAMS = ogg123 + docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION) + doc_DATA = ogg123rc-example +-mandir = $(datadir)/man + man_MANS = ogg123.1 + + INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @AO_CFLAGS@ diff --git a/audio/vorbis-tools/patches/patch-ogg123_Makefile_in b/audio/vorbis-tools/patches/patch-ogg123_Makefile_in index ccc49763453..df487c5ed17 100644 --- a/audio/vorbis-tools/patches/patch-ogg123_Makefile_in +++ b/audio/vorbis-tools/patches/patch-ogg123_Makefile_in @@ -1,6 +1,6 @@ -$OpenBSD: patch-ogg123_Makefile_in,v 1.1.1.1 2001/03/14 01:58:25 todd Exp $ ---- ogg123/Makefile.in.orig Tue Mar 13 17:48:16 2001 -+++ ogg123/Makefile.in Tue Mar 13 17:49:35 2001 +$OpenBSD: patch-ogg123_Makefile_in,v 1.2 2001/03/17 17:07:11 naddy Exp $ +--- ogg123/Makefile.in.orig Sat Mar 17 17:55:34 2001 ++++ ogg123/Makefile.in Sat Mar 17 17:55:54 2001 @@ -85,7 +85,7 @@ AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = ogg123 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION) diff --git a/audio/vorbis-tools/patches/patch-ogg123_buffer_c b/audio/vorbis-tools/patches/patch-ogg123_buffer_c index 5867cc8fb6f..34543f6e7a0 100644 --- a/audio/vorbis-tools/patches/patch-ogg123_buffer_c +++ b/audio/vorbis-tools/patches/patch-ogg123_buffer_c @@ -1,7 +1,18 @@ -$OpenBSD: patch-ogg123_buffer_c,v 1.1.1.1 2001/03/14 01:58:25 todd Exp $ ---- ogg123/buffer.c.orig Tue Mar 13 17:35:55 2001 -+++ ogg123/buffer.c Tue Mar 13 17:36:36 2001 -@@ -13,10 +13,6 @@ +$OpenBSD: patch-ogg123_buffer_c,v 1.2 2001/03/17 17:07:11 naddy Exp $ +--- ogg123/buffer.c.orig Tue Jan 30 11:42:48 2001 ++++ ogg123/buffer.c Sat Mar 17 17:12:02 2001 +@@ -6,17 +6,16 @@ + */ + + #include ++#if HAVE_SMMAP ++#include ++#else + #include + #include +-#include ++#endif + #include #include /* for fork and pipe*/ #include @@ -12,3 +23,44 @@ $OpenBSD: patch-ogg123_buffer_c,v 1.1.1.1 2001/03/14 01:58:25 todd Exp $ #include "ogg123.h" #include "buffer.h" +@@ -73,10 +72,26 @@ buf_t *fork_writer (long size, devices_t + int childpid; + buf_t *buf; + ++#if HAVE_SMMAP ++ int fd; ++ ++ if ((fd = open("/dev/zero", O_RDWR)) < 0) ++ { ++ perror ("cannot open /dev/zero"); ++ exit (1); ++ } ++ if ((buf = (buf_t *) mmap (0, sizeof(buf_t) + sizeof (chunk_t) * (size - 1), ++ PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) < 0) ++ { ++ perror("mmap"); ++ exit(1); ++ } ++ close(fd); ++#else + /* Get the shared memory segment. */ + int shmid = shmget (IPC_PRIVATE, + sizeof(buf_t) + sizeof (chunk_t) * (size - 1), +- IPC_CREAT|S_IREAD|S_IWRITE); ++ IPC_CREAT|SHM_R|SHM_W); + + if (shmid == -1) + { +@@ -92,7 +107,11 @@ buf_t *fork_writer (long size, devices_t + perror ("shmat"); + exit (1); + } +- ++ ++ /* Remove segment after last process detaches it or terminates. */ ++ shmctl(shmid, IPC_RMID, 0); ++#endif /* HAVE_SMMAP */ ++ + buffer_init (buf, size); + + /* Create a pipe for communication between the two processes. Unlike