upgrade to speak freely 7.0

This commit is contained in:
brad 1999-06-20 21:05:35 +00:00
parent 4a98616c06
commit c619b52c98
13 changed files with 324 additions and 265 deletions

View File

@ -1,38 +1,34 @@
# $OpenBSD: Makefile,v 1.3 1999/01/16 04:30:40 angelos Exp $
#
# $OpenBSD: Makefile,v 1.4 1999/06/20 21:05:35 brad Exp $
DISTNAME= speak_freely-6.1e
DISTNAME= speak_freely-7.0
CATEGORIES= mbone audio security
MASTER_SITES= http://www.fourmilab.ch/speakfree/unix/
MAINTAINER= angelos@openbsd.org
LIB_DEPENDS= gsm.1.0:${PORTSDIR}/audio/gsm
UTILS= sfspeaker sfmike sflwl
DEMNS= sfecho sflwld
DDEMNS= sfvod sfreflect
SFLIB= ${PREFIX}/lib/speak_freely
MAN1= ${UTILS:S/$/.1/} ${DEMNS:S/$/.1/} ${DDEMNS:S/$/.1/}
do-install:
if [ ! -d ${SFLIB} ]; then \
@if [ ! -d ${SFLIB} ]; then \
install -d -o ${BINOWN} -g ${BINGRP} -m 755 ${SFLIB}; \
fi
cd ${WRKSRC}; \
$(INSTALL_DATA) busy.au ring.au ${SFLIB}
cd ${WRKSRC}; \
for p in ${UTILS}; do \
$(INSTALL_PROGRAM) $$p ${PREFIX}/bin; \
$(INSTALL_MAN) $$p.1 ${PREFIX}/man/man1; \
@$(INSTALL_DATA) ${WRKSRC}/busy.au ${WRKSRC}/ring.au ${SFLIB}
@for p in ${UTILS}; do \
$(INSTALL_PROGRAM) ${WRKSRC}/$$p ${PREFIX}/bin; \
$(INSTALL_MAN) ${WRKSRC}/$$p.1 ${PREFIX}/man/man1; \
done;
cd ${WRKSRC}; \
for p in ${DEMNS}; do \
$(INSTALL_PROGRAM) $$p ${PREFIX}/sbin; \
$(INSTALL_MAN) $$p.1 ${PREFIX}/man/man1; \
@for p in ${DEMNS}; do \
$(INSTALL_PROGRAM) ${WRKSRC}/$$p ${PREFIX}/sbin; \
$(INSTALL_MAN) ${WRKSRC}/$$p.1 ${PREFIX}/man/man1; \
done;
cd ${WRKSRC}; \
for p in ${DDEMNS}; do \
$(INSTALL_SCRIPT) $$p ${PREFIX}/sbin; \
$(INSTALL_MAN) $$p.1 ${PREFIX}/man/man1; \
@for p in ${DDEMNS}; do \
$(INSTALL_SCRIPT) ${WRKSRC}/$$p ${PREFIX}/sbin; \
$(INSTALL_MAN) ${WRKSRC}/$$p.1 ${PREFIX}/man/man1; \
done;
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
MD5 (speak_freely-6.1e.tar.gz) = cabc5976a082cf6707304fc799691b94
RMD160 (speak_freely-6.1e.tar.gz) = dbcf4bfe948cc80e52cf40c079197d0c60e6902b
SHA1 (speak_freely-6.1e.tar.gz) = 46b1bcbee5f3e12d8d6b9c8c495de50f4c20f93c
MD5 (speak_freely-7.0.tar.gz) = 4f78734809d961c036b6491b1a7fd229
RMD160 (speak_freely-7.0.tar.gz) = 6277c2d14a64dad7afb19236476af9b158f94c56
SHA1 (speak_freely-7.0.tar.gz) = 20bbaf98bba666356507ffb230b7f6d1e3b116ec

View File

@ -1,91 +1,106 @@
*** Makefile.orig Fri Jan 15 22:57:47 1999
--- Makefile Fri Jan 15 23:02:03 1999
***************
*** 21,28 ****
# option may speed up certain compression modes. If you get a
# warning about -float being ignored in non -cckr compiles, it
# has no effect on your system.
! CC = cc -signed
! LFLAGS = -laudio -lcurses -lm
# SunOS 4.1.x
#CC = cc -fsingle -DOLDCC
--- 21,28 ----
# option may speed up certain compression modes. If you get a
# warning about -float being ignored in non -cckr compiles, it
# has no effect on your system.
! #CC = cc -signed
! #LFLAGS = -laudio -lcurses -lm
# SunOS 4.1.x
#CC = cc -fsingle -DOLDCC
***************
*** 52,59 ****
# Depending on how your driver handles non-blocking I/O,
# you may also have to add -DAUDIO_BLOCKING to the
# CCFLAGS line.
! #CCFLAGS = -DM_LITTLE_ENDIAN
! #LFLAGS = -lcurses -ltermcap -lcompat -lm
# ** Linux users please note: many Linux audio drivers are
# half-duplex, even through your sound card may actually
--- 52,60 ----
# Depending on how your driver handles non-blocking I/O,
# you may also have to add -DAUDIO_BLOCKING to the
# CCFLAGS line.
! PREFIX=/usr/local
! CCFLAGS = -DM_LITTLE_ENDIAN
! LFLAGS = -lcurses -ltermcap -lcompat -lm -lossaudio
# ** Linux users please note: many Linux audio drivers are
# half-duplex, even through your sound card may actually
***************
*** 98,107 ****
# Where Perl is located on your system. This is used to make
# a directly-executable version of sfvod.
! PERL = /usr/local/bin/perl
# If your audio hardware is half duplex, uncomment the next line
! #DUPLEX = -DHALF_DUPLEX
# If your getdomainname() does not return the DNS domainname, define:
#DOMAIN=-DMYDOMAIN=\"somedomain.net\"
--- 99,108 ----
# Where Perl is located on your system. This is used to make
# a directly-executable version of sfvod.
! PERL = /usr/bin/perl
# If your audio hardware is half duplex, uncomment the next line
! DUPLEX = -DHALF_DUPLEX
# If your getdomainname() does not return the DNS domainname, define:
#DOMAIN=-DMYDOMAIN=\"somedomain.net\"
***************
*** 127,138 ****
CARGS = -DInternet_Port=$(INTERNET_PORT)
! DEBUG = -g -DHEXDUMP
! #DEBUG = -O
# Compiler flags
! CFLAGS = $(DEBUG) -Iadpcm -Ilpc -Igsm/inc -Imd5 -Iidea -Ilibdes $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
PROGRAMS = sfspeaker sfmike sflwld sflwl sfecho sfreflect sfvod
--- 128,139 ----
CARGS = -DInternet_Port=$(INTERNET_PORT)
! #DEBUG = -g -DHEXDUMP
! DEBUG = -O
# Compiler flags
! CFLAGS = $(DEBUG) -I${PREFIX}/include -Iadpcm -Ilpc -Igsm/inc -Imd5 -Iidea -Ilibdes $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
PROGRAMS = sfspeaker sfmike sflwld sflwl sfecho sfreflect sfvod
--- Makefile.orig Sun May 2 10:38:44 1999
+++ Makefile Sat Jun 19 22:55:17 1999
@@ -3,8 +3,8 @@
# Debugging options
-DEBUG = -g -DHEXDUMP
-#DEBUG = -O
+#DEBUG = -g -DHEXDUMP
+DEBUG =
# Uncomment the appropriate LFLAGS statement below according
# to your machine type.
@@ -26,8 +26,8 @@
# option may speed up certain compression modes. If you get a
# warning about -float being ignored in non -cckr compiles, it
# has no effect on your system.
-CC = cc -signed
-LFLAGS = -laudio -lcurses -lm
+#CC = cc -signed
+#LFLAGS = -laudio -lcurses -lm
# ** Linux users please note: many Linux audio drivers are
# half-duplex, even through your sound card may actually
@@ -108,12 +108,15 @@
#CCFLAGS = -DHEWLETT_PACKARD -DOLDCC
#LFLAGS = -lAlib -lcurses -ltermcap -lm
+# OpenBSD
+LFLAGS = -L${LOCALBASE}/lib -lcurses -ltermcap -lcompat -lm -lossaudio
+
# Where Perl is located on your system. This is used to make
# a directly-executable version of sfvod.
-PERL = /usr/local/bin/perl
+PERL = /usr/bin/perl
# If your audio hardware is half duplex, uncomment the next line
-#DUPLEX = -DHALF_DUPLEX
+DUPLEX = -DHALF_DUPLEX
# If your getdomainname() does not return the DNS domainname, define:
#DOMAIN=-DMYDOMAIN=\"somedomain.net\"
@@ -141,7 +144,7 @@
# Compiler flags
-CFLAGS = $(DEBUG) -Iadpcm -Ilpc -Igsm/inc -Imd5 -Iidea -Ilibdes -Iblowfish $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
+CFLAGS += $(DEBUG) -Iadpcm -Ilpc -Iidea -Imd5 -Iblowfish -I/usr/include -I${LOCALBASE}/include $(CARGS) $(DUPLEX) $(CCFLAGS) $(DOMAIN)
PROGRAMS = sfspeaker sfmike sflwld sflwl sfecho sfreflect sfvod
@@ -150,12 +153,12 @@
SPKROBJS = speaker.o codecs.o deskey.o g711.o rate.o rtpacket.o soundbyte.o ulaw.o usleep.o vatpkt.o vox.o hp_audio.o
sfspeaker: $(SPKROBJS) adpcmlib.o libblowfish.o lpclib.o lpc10lib.o gsmlib.o deslib.o md5lib.o idealib.o libdes.o xdsub.o
- $(CC) $(SPKROBJS) adpcm/adpcm-u.o blowfish/libblowfish.a des/des.o md5/md5.o idea/idea.o lpc10/liblpc10.a gsm/lib/libgsm.a lpc/lpc.o xdsub.o libdes/libdes.a $(LFLAGS) -o sfspeaker
+ $(CC) $(SPKROBJS) adpcm/adpcm-u.o blowfish/libblowfish.a des/des.o md5/md5.o idea/idea.o lpc10/liblpc10.a -lgsm lpc/lpc.o xdsub.o -ldes $(LFLAGS) -o sfspeaker
MIKEOBJS = mike.o codecs.o deskey.o g711.o rate.o rtpacket.o soundbyte.o ulaw.o usleep.o vatpkt.o xdsub.o hp_audio.o
sfmike: $(MIKEOBJS) adpcmlib.o libblowfish.o lpclib.o lpc10lib.o gsmlib.o deslib.o md5lib.o idealib.o libdes.o
- $(CC) $(MIKEOBJS) adpcm/adpcm-u.o des/des.o md5/md5.o idea/idea.o -lm blowfish/libblowfish.a lpc10/liblpc10.a gsm/lib/libgsm.a lpc/lpc.o libdes/libdes.a $(LFLAGS) -o sfmike
+ $(CC) $(MIKEOBJS) adpcm/adpcm-u.o des/des.o md5/md5.o idea/idea.o -lm blowfish/libblowfish.a lpc10/liblpc10.a -lgsm lpc/lpc.o -ldes $(LFLAGS) -o sfmike
LWLDOBJS = lwld.o html.o xdsub.o
@@ -191,11 +194,11 @@
chmod 755 sfvod
adpcmlib.o:
- ( echo "Building ADPCM library."; cd adpcm ; make CC="$(CC)" )
+ ( echo "Building ADPCM library."; cd adpcm ; make CC="$(CC) $(CCFLAGS) $(DEBUG)" )
echo "ADPCM" >adpcmlib.o
deslib.o:
- ( echo "Building DES library."; cd des ; make CC="$(CC) $(CCFLAGS)" )
+ ( echo "Building DES library."; cd des ; make CC="$(CC) $(CCFLAGS) $(DEBUG)" )
echo "DES" >deslib.o
libblowfish.o:
@@ -203,7 +206,6 @@
echo "BLOWFISH" >libblowfish.o
libdes.o:
- ( echo "Building LIBDES library."; cd libdes ; make -f Makefile.sf CC="$(CC) $(CCFLAGS) $(DEBUG)" )
echo "LIBDES" >libdes.o
lpclib.o:
@@ -215,15 +217,14 @@
echo "LPC" >lpc10lib.o
gsmlib.o:
- ( echo "Building GSM library."; cd gsm ; make CC="$(CC)" )
echo "GSM" >gsmlib.o
md5lib.o:
- ( echo "Building MD5 library."; cd md5 ; make CC="$(CC)" )
+ ( echo "Building MD5 library."; cd md5 ; make CC="$(CC) $(CCFLAGS) $(DEBUG)" )
echo "MD5" >md5lib.o
idealib.o:
- ( echo "Building IDEA library."; cd idea ; make CC="$(CC)" )
+ ( echo "Building IDEA library."; cd idea ; make CC="$(CC) $(CCFLAGS) $(DEBUG)" )
echo "IDEA" >idealib.o
codecs.o: codecs.c speakfree.h

View File

@ -1,15 +1,11 @@
*** speakfree.h.orig Fri Jan 15 23:12:44 1999
--- speakfree.h Fri Jan 15 23:13:02 1999
***************
*** 14,19 ****
--- 14,23 ----
#define BSD_like
#endif
+ #ifdef __OpenBSD__
+ #define BSD_like
+ #endif
+
#ifdef __FreeBSD__
#define BSD_like
#endif
--- adpcm/Makefile.orig Sat Jun 19 21:57:38 1999
+++ adpcm/Makefile Sat Jun 19 21:58:13 1999
@@ -1,7 +1,7 @@
#
# Makefile for adpcm and test programs
# -------------------
-CFLAGS=-O -I..
+CFLAGS +=-I..
# May need this on a sun:
#CFLAGS=-O -I/usr/demo/SOUND

View File

@ -1,14 +1,13 @@
*** mike.c.orig Fri Jan 15 23:10:04 1999
--- mike.c Fri Jan 15 23:11:40 1999
***************
*** 748,753 ****
--- 748,756 ----
(sb->buffer.buffer_len > 16)) {
pktlen += sizeof(sb->sendinghost);
}
+ /* must stay in network order for debugging output */
+ sb->compression = htonl(sb->compression);
+ sb->buffer.buffer_len = htonl(sb->buffer.buffer_len);
}
}
}
--- idea/Makefile.orig Sat Jun 19 21:59:52 1999
+++ idea/Makefile Sat Jun 19 22:00:06 1999
@@ -6,8 +6,8 @@
# Compiler flags
-CC = cc
-CFLAGS = -O
+#CC = cc
+#CFLAGS = -O
all: idea.o

View File

@ -1,123 +1,8 @@
*** soundbyte.c.orig Fri Jan 15 23:13:23 1999
--- soundbyte.c Fri Jan 15 23:17:36 1999
***************
*** 33,39 ****
#else /* FreeBSD / Linux */
#ifdef LINUX
#include <linux/soundcard.h>
! #else
#include <machine/soundcard.h>
#endif
#define AUDIO_MIN_GAIN 0
--- 33,41 ----
#else /* FreeBSD / Linux */
#ifdef LINUX
#include <linux/soundcard.h>
! #elif __OpenBSD__
! #include <soundcard.h>
! #else
#include <machine/soundcard.h>
#endif
#define AUDIO_MIN_GAIN 0
***************
*** 62,67 ****
--- 64,77 ----
#define MAX_GAIN 100
+ void soundplayvol();
+
+ #ifndef sun
+ #ifdef HALF_DUPLEX
+ static int oldvol = -1;
+ #endif
+ #endif
+
struct sound_buf {
struct sound_buf *snext; /* Next sound buffer */
int sblen; /* Length of this sound buffer */
***************
*** 157,162 ****
--- 167,187 ----
}
ioctl(Audio_fd, AUDIO_SETINFO, &Audio_info);
#endif
+ #ifndef sun
+ #ifdef HALF_DUPLEX
+ if (iomode == O_RDONLY) {
+ if (oldvol == -1)
+ oldvol = soundgetvol();
+ soundplayvol(0);
+ } else if ( iomode == O_WRONLY
+ && oldvol != -1
+ ) {
+ if (soundgetvol() == 0)
+ soundplayvol(oldvol);
+ oldvol = -1;
+ }
+ #endif
+ #endif
return TRUE;
}
if (errno != EINTR) {
***************
*** 172,177 ****
--- 197,211 ----
void soundterm()
{
if (audiof >= 0) {
+ #ifndef sun
+ #ifdef HALF_DUPLEX
+ if (oldvol != -1) {
+ if (soundgetvol() == 0)
+ soundplayvol(oldvol);
+ oldvol = -1;
+ }
+ #endif
+ #endif
if (close(audiof) < 0) {
perror("closing audio device");
}
***************
*** 222,231 ****
arg = (value << 8) | value;
! if (ioctl(Audio_fd, MIXER_WRITE(SOUND_MIXER_PCM), &arg) < 0)
! perror("SOUND_MIXER_PCM");
#endif
}
/* SOUNDRECGAIN -- Set recording gain from 0 (minimum) to 100 (maximum). */
--- 256,285 ----
arg = (value << 8) | value;
! if (ioctl(Audio_fd, SOUND_MIXER_WRITE_PCM, &arg) < 0)
! perror("SOUND_MIXER_WRITE_PCM");
#endif
}
+
+ #ifndef sun
+ #ifdef HALF_DUPLEX
+
+ /* SOUNDGETVOL -- Get current playback volume. */
+
+ int soundgetvol()
+ {
+ int arg, v1, v2;
+
+ if (ioctl(Audio_fd, SOUND_MIXER_READ_PCM, &arg) < 0) {
+ perror("SOUND_MIXER_READ_PCM");
+ return -1;
+ }
+ v1 = arg & 0xFF;
+ v2 = (arg >> 8) & 0xFF;
+ return (v1 > v2) ? v1 : v2;
+ }
+ #endif
+ #endif
/* SOUNDRECGAIN -- Set recording gain from 0 (minimum) to 100 (maximum). */
--- md5/Makefile.orig Sat Jun 19 22:01:01 1999
+++ md5/Makefile Sat Jun 19 22:01:05 1999
@@ -1,4 +1,4 @@
-CFLAGS=-O
+#CFLAGS=-O
all: md5.o

View File

@ -0,0 +1,19 @@
--- blowfish/Makefile.orig Sat Jun 19 22:02:15 1999
+++ blowfish/Makefile Sat Jun 19 22:04:25 1999
@@ -17,14 +17,14 @@
#OPTS= # use for pentium pro, Alpha and HP
MAKE=make -f Makefile
-CC=cc
+#CC=cc
CFLAG= -O
#CC=gcc
#CFLAG= -O4 -funroll-loops -fomit-frame-pointer
#CFLAG= -O3 -fomit-frame-pointer
-CFLAGS=$(OPTS) $(CFLAG)
+#CFLAGS=$(OPTS) $(CFLAG)
CPP=$(CC) -E
AS=as

View File

@ -0,0 +1,14 @@
--- lpc/Makefile.orig Sat Jun 19 22:10:11 1999
+++ lpc/Makefile Sat Jun 19 22:10:36 1999
@@ -1,9 +1,8 @@
-
lpc.o: lpc.c lpc.h
- $(CC) -c lpc.c
+ $(CC) $(CFLAGS) -c lpc.c
lpctest: lpctest.c lpc.o
- $(CC) lpctest.c lpc.o ../ulaw.o -o lpctest -lm
+ $(CC) $(CFLAGS) lpctest.c lpc.o ../ulaw.o -o lpctest -lm
clean:
rm -f *.bak *.o lpctest core

View File

@ -0,0 +1,8 @@
--- des/Makefile.orig Sat Jun 19 23:07:21 1999
+++ des/Makefile Sat Jun 19 23:07:28 1999
@@ -1,4 +1,4 @@
-CFLAGS=-O
+#CFLAGS=-O
all: des.o

View File

@ -0,0 +1,11 @@
--- speakfree.h.orig Sat Jun 19 22:24:36 1999
+++ speakfree.h Sat Jun 19 22:25:13 1999
@@ -12,7 +12,7 @@
#define BSD_like
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#define BSD_like
#endif

View File

@ -0,0 +1,18 @@
--- mike.c.orig Tue Apr 6 10:50:42 1999
+++ mike.c Sat Jun 19 22:50:40 1999
@@ -1,4 +1,4 @@
-/*#define USE_CURSES*/
+#define USE_CURSES
#define BYTE_SWAP_DEBUG
/*
@@ -845,6 +845,9 @@
(sb->buffer.buffer_len > 16)) {
pktlen += sizeof(sb->sendinghost);
}
+ /* must stay in network order for debugging output */
+ sb->compression = htonl(sb->compression);
+ sb->buffer.buffer_len = htonl(sb->buffer.buffer_len);
}
}
}

View File

@ -0,0 +1,97 @@
--- soundbyte.c.orig Sat Jun 19 22:28:53 1999
+++ soundbyte.c Sat Jun 19 22:37:22 1999
@@ -33,6 +33,8 @@
#else /* FreeBSD / Linux */
#ifdef LINUX
#include <linux/soundcard.h>
+#elif __OpenBSD__
+#include <soundcard.h>
#else
#include <machine/soundcard.h>
#endif
@@ -62,6 +64,14 @@
#define MAX_GAIN 100
+void soundplayvol();
+
+#ifndef sun
+#ifdef HALF_DUPLEX
+static int oldvol = -1;
+#endif
+#endif
+
struct sound_buf {
struct sound_buf *snext; /* Next sound buffer */
int sblen; /* Length of this sound buffer */
@@ -178,6 +188,21 @@
}
ioctl(Audio_fd, AUDIO_SETINFO, &Audio_info);
#endif
+#ifndef sun
+#ifdef HALF_DUPLEX
+ if (iomode == O_RDONLY) {
+ if (oldvol == -1)
+ oldvol = soundgetvol();
+ soundplayvol(0);
+ } else if ( iomode == O_WRONLY
+ && oldvol != -1
+ ) {
+ if (soundgetvol() == 0)
+ soundplayvol(oldvol);
+ oldvol = -1;
+ }
+#endif
+#endif
return TRUE;
}
if (errno != EINTR) {
@@ -193,6 +218,15 @@
void soundterm()
{
if (audiof >= 0) {
+#ifndef sun
+#ifdef HALF_DUPLEX
+ if (oldvol != -1) {
+ if (soundgetvol() == 0)
+ soundplayvol(oldvol);
+ oldvol = -1;
+ }
+#endif
+#endif
if (close(audiof) < 0) {
perror("closing audio device");
}
@@ -243,10 +277,30 @@
arg = (value << 8) | value;
- if (ioctl(Audio_fd, MIXER_WRITE(SOUND_MIXER_PCM), &arg) < 0)
- perror("SOUND_MIXER_PCM");
+ if (ioctl(Audio_fd, SOUND_MIXER_WRITE_PCM, &arg) < 0)
+ perror("SOUND_MIXER_WRITE_PCM");
#endif
}
+
+#ifndef sun
+#ifdef HALF_DUPLEX
+
+/* SOUNDGETVOL -- Get current playback volume. */
+
+int soundgetvol()
+{
+ int arg, v1, v2;
+
+ if (ioctl(Audio_fd, SOUND_MIXER_READ_PCM, &arg) < 0) {
+ perror("SOUND_MIXER_READ_PCM");
+ return -1;
+ }
+ v1 = arg & 0xFF;
+ v2 = (arg >> 8) & 0xFF;
+ return (v1 > v2) ? v1 : v2;
+}
+#endif
+#endif
/* SOUNDRECGAIN -- Set recording gain from 0 (minimum) to 100 (maximum). */

View File

@ -14,3 +14,4 @@ man/man1/sfmike.1
man/man1/sfspeaker.1
man/man1/sfvod.1
man/man1/sfreflect.1
@dirrm lib/speak_freely