1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-24 21:01:20 +00:00

- changes MAINTAINER,

- fixes a bug in shared memory handling where SYSVSHM segments wouldn't
  be destroyed on program exit,
- prefers memory sharing by mmap() over SYSVSHM,
- bumps PORTREVISION due to the fix above,
- contains miscellaneous clean-ups and autoconf-related changes.

PR:		25942
Submitted by:	Christian Weisgerber <naddy@mips.inka.de>
Approved by:	Theo van Klaveren <t.vanklaveren@student.utwente.nl>
This commit is contained in:
James E. Housley 2001-03-23 18:07:44 +00:00
parent 30f9deb06d
commit 1e5186ff94
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=40281
4 changed files with 77 additions and 39 deletions

View File

@ -7,36 +7,26 @@
PORTNAME= vorbis-tools
PORTVERSION= 1.0b4
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= audio
MASTER_SITES= http://www.vorbis.com/files/beta4/unix/ \
http://home.student.utwente.nl/t.vanklaveren/distfiles/
DISTNAME= ${PORTNAME}-${PORTVERSION:S/b/beta/}
MAINTAINER= t.vanklaveren@student.utwente.nl
MAINTAINER= naddy@mips.inka.de
LIB_DEPENDS= ao.1:${PORTSDIR}/audio/libao \
ogg.1:${PORTSDIR}/audio/libogg \
vorbis.0:${PORTSDIR}/audio/libvorbis
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_AUTOCONF= yes
USE_LIBTOOL= yes
CFLAGS+= -I${LOCALBASE}/include
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --with-ogg=${LOCALBASE} \
--with-ao=${LOCALBASE}
CONFIGURE_ARGS= --with-ao=${LOCALBASE} \
--with-ogg=${LOCALBASE} \
--with-vorbis=${LOCALBASE}
MAN1= ogg123.1 oggenc.1
#post-build:
# This is probably evil, and should be in a Makefile.
# cd ${WRKSRC}/oggenc && ${CC} ${CFLAGS} -c getopt1.c
# cd ${WRKSRC}/ogg123 && ${CC} ${CFLAGS} -c ogg123.c -I../oggenc -I${LOCALBASE}/include
# cd ${WRKSRC}/ogg123 && ${CC} ${LDFLAGS} -o ogg123 ogg123.o ../oggenc/getopt.o ../oggenc/getopt1.o -L${LOCALBASE}/lib -logg -lvorbis -lao -lvorbisfile
#
#post-install:
# ${INSTALL_PROGRAM} ${WRKSRC}/ogg123/ogg123 ${PREFIX}/bin/
# ${INSTALL_MAN} ${WRKSRC}/ogg123/ogg123.1 ${PREFIX}/man/man1/
.include <bsd.port.mk>

View File

@ -1,11 +1,11 @@
--- configure.old Tue Feb 27 14:55:50 2001
+++ configure Tue Feb 27 14:55:57 2001
@@ -1822,7 +1822,7 @@
AO_LIBS="-L$ao_prefix/lib"
fi
--- configure.in.orig Mon Feb 26 06:51:00 2001
+++ configure.in Sun Mar 18 23:21:51 2001
@@ -67,7 +68,7 @@ dnl ------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
- AO_LIBS="$AO_LIBS -lao -ldl"
+ AO_LIBS="$AO_LIBS -lao"
-dnl none
+AC_FUNC_SMMAP
echo $ac_n "checking for ao""... $ac_c" 1>&6
echo "configure:1829: checking for ao" >&5
dnl --------------------------------------------------
dnl Work around FHS stupidity

View File

@ -1,14 +1,65 @@
--- ogg123/buffer.c.orig Tue Feb 27 14:57:30 2001
+++ ogg123/buffer.c Tue Feb 27 14:58:25 2001
@@ -14,7 +14,11 @@
--- 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 <sys/types.h>
+#if HAVE_SMMAP
+#include <sys/mman.h>
+#else
#include <sys/ipc.h>
#include <sys/shm.h>
-#include <sys/stat.h>
+#endif
#include <sys/time.h>
#include <unistd.h> /* for fork and pipe*/
#include <fcntl.h>
#ifndef DARWIN
+#ifdef __FreeBSD__
+#include <stdlib.h>
+#else
#include <malloc.h>
+#endif
#endif
-#ifndef DARWIN
-#include <malloc.h>
-#endif
-
#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

View File

@ -10,6 +10,3 @@ This package contains utilities to encode and decode vorbis streams, and to
add comments to them.
WWW: http://www.vorbis.com
- Theo van Klaveren
t.vanklaveren@student.utwente.nl