- Support MAKE properly

- Support install macros
- Apply to 'one file per patch' convention
- Add WWW: line

PR:		24667
Submitted by:	tkato@prontomail.ne.jp
This commit is contained in:
Ying-Chieh Liao 2001-01-28 03:50:57 +00:00
parent 9ad3d5aad5
commit e22dc21f08
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=37661
13 changed files with 214 additions and 161 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= s3mod
PORTVERSION= 1.09
PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SUNSITE}
MASTER_SITE_SUBDIR= apps/sound/players
@ -19,7 +20,7 @@ ALL_TARGET= freebsd
pre-patch:
@${CP} ${WRKSRC}/DspDrivers/linux_dsp.c ${WRKSRC}/dsp.c
post-install:
@strip ${PREFIX}/bin/s3mod
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/s3mod ${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -1,136 +0,0 @@
--- config.h.orig Sun Jun 8 00:11:14 1997
+++ config.h Sun Jun 8 00:12:37 1997
@@ -64,6 +64,14 @@
#define GUS
#endif /* GUS */
+#elif defined(__FreeBSD__)
+#define BIT_32
+#undef NEAR_FAR_PTR
+#define DSP
+#ifndef GUS
+#define GUS
+#endif /* GUS */
+
#elif defined(MSDOS)
#define NEAR_FAR_PTR
#define DSP
--- dsp.c.orig Sat Oct 21 14:40:29 1995
+++ dsp.c Sun Jun 8 00:21:50 1997
@@ -22,14 +22,14 @@
* linux_dsp.c - Support for the Linux DSP driver from the Voxware(C) Drivers.
*/
-#ifdef LINUX
+#ifdef __FreeBSD__
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
-#include <linux/soundcard.h>
-#include <bytesex.h>
+#include <machine/soundcard.h>
+#include <machine/endian.h>
#include "main.h"
#include "dsp.h"
@@ -93,5 +93,5 @@
return;
}
-#endif /* ?LINUX */
+#endif /* ?__FreeBSD__ */
--- gus.c.orig Sun Jun 8 00:05:28 1997
+++ gus.c Sun Jun 8 00:05:51 1997
@@ -25,8 +25,8 @@
#ifdef GUS
-#include <sys/soundcard.h>
-#include <sys/ultrasound.h>
+#include <machine/soundcard.h>
+#include <machine/ultrasound.h>
#include <unistd.h>
#include "gus.h"
#include "mod.h"
--- main.c.orig Sun Jun 8 00:05:59 1997
+++ main.c Sun Jun 8 00:10:46 1997
@@ -56,6 +56,10 @@
printf(" Linux Support by Daniel Marks \n");
printf(" GUS Support by David Jeske (jeske@uiuc.edu)\n");
#endif /* LINUX */
+#ifdef __FreeBSD__
+ printf(" FreeBSD Support by Vanilla I. Shu \n");
+ printf(" GUS Support by David Jeske (jeske@uiuc.edu\n");
+#endif /* __FreeBSD__ */
#if defined(__sgi)
printf(" SGI Support by Mike Muuss (Mike@arl.mil)\n\n");
#endif /* __sgi */
@@ -69,6 +73,9 @@
#ifdef LINUX
printf(" -b 16 bit samples\n");
#endif /* ?LINUX */
+#ifdef __FreeBSD__
+ printf(" -b 16 bit samples\n");
+#endif /* __FreeBSD__ */
printf(" -f set frequency\n");
printf(" -q quiet (don't print anything)\n");
printf(" -n don't loop\n");
@@ -76,6 +83,9 @@
#ifdef LINUX
printf(" -g do NOT use GUS native mode\n");
#endif /* ?LINUX */
+#ifdef __FreeBSD__
+ printf(" -g do NOT use GUS native mode\n");
+#endif /* __FreeBSD__ */
printf(" -p PAL speed adjustment (145bpm start)\n");
printf("s3mod -sbf 44100 foobar.mod\n");
printf(" plays in stereo, 16 bits, 44.1 kHz\n\n");
--- mod.c.orig Sun Jun 8 00:12:48 1997
+++ mod.c Sun Jun 8 00:14:30 1997
@@ -11,7 +11,7 @@
#ifdef GUS
-#include <sys/ultrasound.h>
+#include <machine/ultrasound.h>
#include "gus.h"
#endif /* GUS */
@@ -130,8 +130,10 @@
/* Portamento Down */
if ((track->period += track->port_down) > track->period_high_limit)
track->period = track->period_high_limit;
- track->pitch = track->finetune_rate / track->period;
-
+ if (track->period != 0)
+ track->pitch = track->finetune_rate / track->period;
+ else
+ track->pitch = 1;
track->playing_period = track->period;
}
--- play.c.orig Sun Jun 8 00:15:23 1997
+++ play.c Sun Jun 8 00:15:46 1997
@@ -36,7 +36,7 @@
#include "dsp.h"
#ifdef GUS
-#include <sys/ultrasound.h>
+#include <machine/ultrasound.h>
#include "gus.h"
#endif /* GUS */
--- gus.h.orig Sun Jun 8 00:31:14 1997
+++ gus.h Sun Jun 8 00:31:23 1997
@@ -26,7 +26,7 @@
#ifndef _GUS_H
#define _GUS_H
-#include <sys/soundcard.h>
+#include <machine/soundcard.h>
#define ERR_SEQUENCER 51
#define ERR_NOGUS 53

View File

@ -1,21 +1,20 @@
--- Makefile.orig Sat Oct 21 12:48:51 1995
+++ Makefile Sat Jun 19 02:56:40 1999
@@ -5,11 +5,10 @@
--- Makefile.orig Sun Oct 22 04:48:51 1995
+++ Makefile Sat Jan 27 15:52:13 2001
@@ -5,11 +5,11 @@
#
########
-CC = gcc
-RM = rm
-LN = ln -s
+CC ?= gcc
+RM ?= rm
+LN += -s
RM = rm
LN = ln -s
-CFLAGS = -O2
+CFLAGS ?= -O2
LFLAGS =
OBJS = mod.o s3m.o main.o play.o mix.o cmdline.o dsp.o gus.o
@@ -24,6 +23,7 @@
@@ -24,6 +24,7 @@
@echo " make sun - SunOS/Solaris"
@echo " make sgi - SGI Irix"
@echo " make linux - Voxware DSP/GUS"
@ -23,23 +22,13 @@
@echo " make dec - Dec OSF/1"
@echo " make clean - remove all .o files"
@echo " make clobber - remove all .o and targets"
@@ -51,6 +51,9 @@
@@ -50,6 +51,9 @@
$(RM) -f dsp.c
$(LN) DspDrivers/linux_dsp.c dsp.c
make CC=gcc CFLAGS=-O2 DEFINES="-DLINUX -DGUS" s3mod
+freebsd:
+ make CFLAGS="$(CFLAGS)" DEFINES="-DGUS" s3mod
+
+freebsd:
+ $(MAKE) CFLAGS="$(CFLAGS)" DEFINES="-DGUS" s3mod
s3mod: $(OBJS)
$(CC) $(CFLAGS) -o s3mod $(OBJS) $(LFLAGS) $(LIBS)
@@ -62,6 +65,9 @@
dep:
makedepend $(CFLAGS) $(LFLAGS) $(LIBS) $(CFILES)
+
+install:
+ install -c -m 555 s3mod ${PREFIX}/bin
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@ -0,0 +1,17 @@
--- config.h.orig Sun Oct 22 04:59:55 1995
+++ config.h Sat Jan 27 15:04:14 2001
@@ -64,6 +64,14 @@
#define GUS
#endif /* GUS */
+#elif defined(__FreeBSD__)
+#define BIT_32
+#undef NEAR_FAR_PTR
+#define DSP
+#ifndef GUS
+#define GUS
+#endif /* GUS */
+
#elif defined(MSDOS)
#define NEAR_FAR_PTR
#define DSP

View File

@ -0,0 +1,39 @@
--- dsp.c.orig Sat Oct 21 15:40:29 1995
+++ dsp.c Sat Jan 27 15:24:31 2001
@@ -22,14 +22,14 @@
* linux_dsp.c - Support for the Linux DSP driver from the Voxware(C) Drivers.
*/
-#ifdef LINUX
+#ifdef __FreeBSD__
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
-#include <linux/soundcard.h>
-#include <bytesex.h>
+#include <machine/soundcard.h>
+#include <machine/endian.h>
#include "main.h"
#include "dsp.h"
@@ -68,11 +68,6 @@
printf("Unable to get audio blocksize\n");
exit(1);
}
- if ((audio_buffer_size < 4096) || (audio_buffer_size > 131072))
- {
- printf("Invalid audio buffer size: %d\n",audio_buffer_size);
- exit(1);
- }
if (!(audio_start_buffer = (uint8 *) malloc(audio_buffer_size)))
{
printf("Could not get audio buffer memory!\n");
@@ -93,5 +88,5 @@
return;
}
-#endif /* ?LINUX */
+#endif /* ?__FreeBSD__ */

View File

@ -0,0 +1,13 @@
--- gus.c.orig Sun Oct 22 04:14:33 1995
+++ gus.c Sat Jan 27 15:04:15 2001
@@ -25,8 +25,8 @@
#ifdef GUS
-#include <sys/soundcard.h>
-#include <sys/ultrasound.h>
+#include <machine/soundcard.h>
+#include <machine/ultrasound.h>
#include <unistd.h>
#include "gus.h"
#include "mod.h"

View File

@ -0,0 +1,20 @@
--- gus.h.orig Sun Oct 22 05:06:38 1995
+++ gus.h Sat Jan 27 15:21:29 2001
@@ -26,7 +26,7 @@
#ifndef _GUS_H
#define _GUS_H
-#include <sys/soundcard.h>
+#include <machine/soundcard.h>
#define ERR_SEQUENCER 51
#define ERR_NOGUS 53
@@ -41,7 +41,7 @@
extern unsigned char _seqbuf[];
extern int _seqbuflen, _seqbufptr;
-unsigned short base_freq_table[];
+unsigned short base_freq_table[16];
extern unsigned int gus_total_mem;
int gus_mem_free(int dev);

View File

@ -0,0 +1,50 @@
--- main.c.orig Sun Oct 22 04:13:23 1995
+++ main.c Sat Jan 27 15:22:17 2001
@@ -56,6 +56,10 @@
printf(" Linux Support by Daniel Marks \n");
printf(" GUS Support by David Jeske (jeske@uiuc.edu)\n");
#endif /* LINUX */
+#ifdef __FreeBSD__
+ printf(" FreeBSD Support by Vanilla I. Shu \n");
+ printf(" GUS Support by David Jeske (jeske@uiuc.edu\n");
+#endif /* __FreeBSD__ */
#if defined(__sgi)
printf(" SGI Support by Mike Muuss (Mike@arl.mil)\n\n");
#endif /* __sgi */
@@ -69,6 +73,9 @@
#ifdef LINUX
printf(" -b 16 bit samples\n");
#endif /* ?LINUX */
+#ifdef __FreeBSD__
+ printf(" -b 16 bit samples\n");
+#endif /* __FreeBSD__ */
printf(" -f set frequency\n");
printf(" -q quiet (don't print anything)\n");
printf(" -n don't loop\n");
@@ -76,6 +83,9 @@
#ifdef LINUX
printf(" -g do NOT use GUS native mode\n");
#endif /* ?LINUX */
+#ifdef __FreeBSD__
+ printf(" -g do NOT use GUS native mode\n");
+#endif /* __FreeBSD__ */
printf(" -p PAL speed adjustment (145bpm start)\n");
printf("s3mod -sbf 44100 foobar.mod\n");
printf(" plays in stereo, 16 bits, 44.1 kHz\n\n");
@@ -109,7 +119,7 @@
}
-void main(int argc, char **argv)
+int main(int argc, char **argv)
{
uint32 j;
char *filename;
@@ -241,6 +251,7 @@
close_dsp_device();
free(audio_start_buffer);
+ return 0;
}

View File

@ -0,0 +1,11 @@
--- main.h.orig Sat Oct 21 15:56:32 1995
+++ main.h Sat Jan 27 15:30:30 2001
@@ -43,7 +43,7 @@
void help(void);
void get_audio_device(void);
-void main(int argc, char **argv);
+int main(int argc, char **argv);
#endif /* _MAIN_H */

View File

@ -0,0 +1,24 @@
--- mod.c.orig Sun Oct 22 04:13:23 1995
+++ mod.c Sat Jan 27 15:04:15 2001
@@ -11,7 +11,7 @@
#ifdef GUS
-#include <sys/ultrasound.h>
+#include <machine/ultrasound.h>
#include "gus.h"
#endif /* GUS */
@@ -130,8 +130,10 @@
/* Portamento Down */
if ((track->period += track->port_down) > track->period_high_limit)
track->period = track->period_high_limit;
- track->pitch = track->finetune_rate / track->period;
-
+ if (track->period != 0)
+ track->pitch = track->finetune_rate / track->period;
+ else
+ track->pitch = 1;
track->playing_period = track->period;
}

View File

@ -0,0 +1,11 @@
--- play.c.orig Sun Oct 22 04:13:35 1995
+++ play.c Sat Jan 27 15:04:15 2001
@@ -36,7 +36,7 @@
#include "dsp.h"
#ifdef GUS
-#include <sys/ultrasound.h>
+#include <machine/ultrasound.h>
#include "gus.h"
#endif /* GUS */

View File

@ -0,0 +1,12 @@
--- tables.h.orig Sat Oct 21 15:59:26 1995
+++ tables.h Sat Jan 27 15:31:20 2001
@@ -13,7 +13,8 @@
unsigned short base_freq_table[] =
{
8448, 8508, 8568, 8629, 8692, 8755, 8819, 8884,
- 7982, 8035, 8089, 8144, 8199, 8274, 8331, 8389};
+ 7982, 8035, 8089, 8144, 8199, 8274, 8331, 8389
+};
unsigned short period_table[] =
{

View File

@ -5,3 +5,5 @@ Soundtracker modules originated on the Amiga, where several composing
playing programs are available that give results mostly compatible
with each other. s3mod just plays the specified files in sequence
according to the current options.
WWW: http://www.chat.net/~jeske/s3mod.html