1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

Fix build on -current and respect CC and CFLAGS

This commit is contained in:
Kris Kennaway 2002-10-20 21:06:33 +00:00
parent 1e94abb0fc
commit 0e0d6fdbab
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=68435
10 changed files with 192 additions and 144 deletions

View File

@ -23,7 +23,7 @@ MANCOMPRESSED= no
LATEST_LINK= rat30
do-build:
(cd ${WRKSRC};${SETENV} MAKE=${GMAKE} ${SH} ./Build rat)
(cd ${WRKSRC};${SETENV} ${MAKE_ENV} MAKE=${GMAKE} ${SH} ./Build rat)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/rat ${PREFIX}/bin/rat30

View File

@ -1,5 +1,16 @@
--- Makefile.orig Tue Sep 14 19:39:00 1999
+++ Makefile Thu May 10 11:07:38 2001
--- Makefile.orig Tue Sep 14 03:39:00 1999
+++ Makefile Sun Oct 20 14:06:27 2002
@@ -10,8 +10,8 @@
# -DDEBUG_RTP -DREPEAT
DEFS += -D$(OSTYPE) -D$(OSTYPE)_$(OSMVER)
-CC = gcc
-CFLAGS = -Wall -Werror -Wno-implicit-int $(INCS) $(DEFS) -g -O -fsigned-char
+CC ?= cc
+CFLAGS += -Wall -Wno-implicit-int $(INCS) $(DEFS) -g -fsigned-char
LDFLAGS=
LDLIBS= $(LDLIBS) -lm
RANLIB = ranlib
@@ -82,6 +82,7 @@
$(BINDIR)/rat-$(OSTYPE)-$(OSVERS): $(OBJS) $(GSMOBJS) $(CRYPTOBJS) $(RATOBJS)
rm -f $(BINDIR)/rat-$(OSTYPE)-$(OSVERS)

View File

@ -0,0 +1,9 @@
--- Makefile_FreeBSD_5.orig Sun Oct 20 14:03:11 2002
+++ Makefile_FreeBSD_5 Sun Oct 20 14:03:06 2002
@@ -0,0 +1,6 @@
+TCL_INC = /usr/local/include/tcl8.2
+TK_INC = /usr/local/include/tk8.2
+INCS = -I/usr/X11R6/include \
+ -I$(TCL_INC)/generic -I$(TK_INC)/generic
+LDLIBS = -L/usr/local/lib \
+ -L/usr/X11R6/lib -ltk82 -ltcl82 -lXext -lX11 -lm

View File

@ -1,69 +1,62 @@
*** src/auddev_freebsd.c.orig Wed Mar 24 16:22:19 1999
--- src/auddev_freebsd.c Sat Sep 16 00:03:22 2000
***************
*** 89,102 ****
}
if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) {
printf("Device doesn't support 16bit linear format!\n");
return -1;
}
if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) {
printf("Device doesn't support mono!\n");
return -1;
}
! if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) {
printf("Device doesn't support 8kHz sampling!\n");
return -1;
}
--- 89,106 ----
}
if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) {
printf("Device doesn't support 16bit linear format!\n");
+ close(audio_fd);
return -1;
}
if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) {
printf("Device doesn't support mono!\n");
+ close(audio_fd);
return -1;
}
! // if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) {
! if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1){
printf("Device doesn't support 8kHz sampling!\n");
+ close(audio_fd);
return -1;
}
***************
*** 158,163 ****
--- 162,168 ----
* be open to do this, so if we're passed -1 as a file-descriptor we open
* the device, do the ioctl, and then close it again...
*/
+ /*
snd_chan_param scp;
if (audio_fd == -1) {
audio_fd = audio_open_rw(O_RDONLY);
***************
*** 174,179 ****
--- 179,197 ----
if (ioctl(audio_fd, AIOSFMT, 0) == -1) {
return FALSE;
}
+ */
+ int caps;
+ int was_defined = 1;
+ if (audio_fd == -1) {
+ audio_fd = audio_open_rw(O_RDWR);
+ was_defined = 0;
+ }
+ ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps);
+ if ((caps & DSP_CAP_DUPLEX) == 0) {
+ if( was_defined == 0 ) audio_close(audio_fd);
+ return FALSE;
+ }
+ if( was_defined == 0 ) audio_close(audio_fd);
return TRUE;
}
--- ./src/auddev_freebsd.c.orig Sun Oct 20 14:05:07 2002
+++ ./src/auddev_freebsd.c Sun Oct 20 14:05:16 2002
@@ -45,7 +45,7 @@
#include "bat_include.h"
#ifdef FreeBSD
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
int can_read = FALSE;
int can_write = FALSE;
@@ -204,18 +204,10 @@
if (audio_fd <= 0) {
return;
}
- switch (iport) {
- case AUDIO_MICROPHONE : if (ioctl(audio_fd, MIXER_WRITE(SOUND_MIXER_MIC), &volume) == -1) {
- perror("Setting gain");
- }
- return;
- case AUDIO_LINE_IN : if (ioctl(audio_fd, MIXER_WRITE(SOUND_MIXER_LINE), &volume) == -1) {
- perror("Setting gain");
- }
- return;
+ if (ioctl(audio_fd, SOUND_MIXER_WRITE_RECLEV, &volume) == -1) {
+ perror("Setting gain");
}
- printf("ERROR: Unknown iport in audio_set_gain!\n");
- abort();
+ return;
}
int
@@ -226,17 +218,8 @@
if (audio_fd <= 0) {
return (0);
}
- switch (iport) {
- case AUDIO_MICROPHONE : if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_MIC), &volume) == -1) {
- perror("Getting gain");
- }
- break;
- case AUDIO_LINE_IN : if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_LINE), &volume) == -1) {
- perror("Getting gain");
- }
- break;
- default : printf("ERROR: Unknown iport in audio_set_gain!\n");
- abort();
+ if (ioctl(audio_fd, SOUND_MIXER_READ_RECLEV, &volume) == -1) {
+ perror("Setting gain");
}
return device_to_bat(volume & 0xff);
}
@@ -263,7 +246,7 @@
if (audio_fd <= 0) {
return (0);
}
- if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_VOLUME), &volume) == -1) {
+ if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_PCM), &volume) == -1) {
perror("Getting volume");
}
return device_to_bat(volume & 0x000000ff); /* Extract left channel volume */

View File

@ -0,0 +1,11 @@
--- src/config.h.orig Sun Oct 20 14:05:43 2002
+++ src/config.h Sun Oct 20 14:05:49 2002
@@ -47,7 +47,7 @@
#define OSNAME "FreeBSD"
#include <unistd.h>
#include <stdlib.h>
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
#define DIFF_BYTE_ORDER 1
#define AUDIO_SPEAKER 0
#define AUDIO_HEADPHONE 1

View File

@ -23,7 +23,7 @@ MANCOMPRESSED= no
LATEST_LINK= rat30
do-build:
(cd ${WRKSRC};${SETENV} MAKE=${GMAKE} ${SH} ./Build rat)
(cd ${WRKSRC};${SETENV} ${MAKE_ENV} MAKE=${GMAKE} ${SH} ./Build rat)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/rat ${PREFIX}/bin/rat30

View File

@ -1,5 +1,16 @@
--- Makefile.orig Tue Sep 14 19:39:00 1999
+++ Makefile Thu May 10 11:07:38 2001
--- Makefile.orig Tue Sep 14 03:39:00 1999
+++ Makefile Sun Oct 20 14:06:27 2002
@@ -10,8 +10,8 @@
# -DDEBUG_RTP -DREPEAT
DEFS += -D$(OSTYPE) -D$(OSTYPE)_$(OSMVER)
-CC = gcc
-CFLAGS = -Wall -Werror -Wno-implicit-int $(INCS) $(DEFS) -g -O -fsigned-char
+CC ?= cc
+CFLAGS += -Wall -Wno-implicit-int $(INCS) $(DEFS) -g -fsigned-char
LDFLAGS=
LDLIBS= $(LDLIBS) -lm
RANLIB = ranlib
@@ -82,6 +82,7 @@
$(BINDIR)/rat-$(OSTYPE)-$(OSVERS): $(OBJS) $(GSMOBJS) $(CRYPTOBJS) $(RATOBJS)
rm -f $(BINDIR)/rat-$(OSTYPE)-$(OSVERS)

View File

@ -0,0 +1,9 @@
--- Makefile_FreeBSD_5.orig Sun Oct 20 14:03:11 2002
+++ Makefile_FreeBSD_5 Sun Oct 20 14:03:06 2002
@@ -0,0 +1,6 @@
+TCL_INC = /usr/local/include/tcl8.2
+TK_INC = /usr/local/include/tk8.2
+INCS = -I/usr/X11R6/include \
+ -I$(TCL_INC)/generic -I$(TK_INC)/generic
+LDLIBS = -L/usr/local/lib \
+ -L/usr/X11R6/lib -ltk82 -ltcl82 -lXext -lX11 -lm

View File

@ -1,69 +1,62 @@
*** src/auddev_freebsd.c.orig Wed Mar 24 16:22:19 1999
--- src/auddev_freebsd.c Sat Sep 16 00:03:22 2000
***************
*** 89,102 ****
}
if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) {
printf("Device doesn't support 16bit linear format!\n");
return -1;
}
if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) {
printf("Device doesn't support mono!\n");
return -1;
}
! if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) {
printf("Device doesn't support 8kHz sampling!\n");
return -1;
}
--- 89,106 ----
}
if ((ioctl(audio_fd, SNDCTL_DSP_SETFMT, &mode) == -1) || (mode != AFMT_S16_LE)) {
printf("Device doesn't support 16bit linear format!\n");
+ close(audio_fd);
return -1;
}
if ((ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) == -1) || (stereo != 0)) {
printf("Device doesn't support mono!\n");
+ close(audio_fd);
return -1;
}
! // if ((ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) || (speed != 8000)) {
! if (ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1){
printf("Device doesn't support 8kHz sampling!\n");
+ close(audio_fd);
return -1;
}
***************
*** 158,163 ****
--- 162,168 ----
* be open to do this, so if we're passed -1 as a file-descriptor we open
* the device, do the ioctl, and then close it again...
*/
+ /*
snd_chan_param scp;
if (audio_fd == -1) {
audio_fd = audio_open_rw(O_RDONLY);
***************
*** 174,179 ****
--- 179,197 ----
if (ioctl(audio_fd, AIOSFMT, 0) == -1) {
return FALSE;
}
+ */
+ int caps;
+ int was_defined = 1;
+ if (audio_fd == -1) {
+ audio_fd = audio_open_rw(O_RDWR);
+ was_defined = 0;
+ }
+ ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps);
+ if ((caps & DSP_CAP_DUPLEX) == 0) {
+ if( was_defined == 0 ) audio_close(audio_fd);
+ return FALSE;
+ }
+ if( was_defined == 0 ) audio_close(audio_fd);
return TRUE;
}
--- ./src/auddev_freebsd.c.orig Sun Oct 20 14:05:07 2002
+++ ./src/auddev_freebsd.c Sun Oct 20 14:05:16 2002
@@ -45,7 +45,7 @@
#include "bat_include.h"
#ifdef FreeBSD
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
int can_read = FALSE;
int can_write = FALSE;
@@ -204,18 +204,10 @@
if (audio_fd <= 0) {
return;
}
- switch (iport) {
- case AUDIO_MICROPHONE : if (ioctl(audio_fd, MIXER_WRITE(SOUND_MIXER_MIC), &volume) == -1) {
- perror("Setting gain");
- }
- return;
- case AUDIO_LINE_IN : if (ioctl(audio_fd, MIXER_WRITE(SOUND_MIXER_LINE), &volume) == -1) {
- perror("Setting gain");
- }
- return;
+ if (ioctl(audio_fd, SOUND_MIXER_WRITE_RECLEV, &volume) == -1) {
+ perror("Setting gain");
}
- printf("ERROR: Unknown iport in audio_set_gain!\n");
- abort();
+ return;
}
int
@@ -226,17 +218,8 @@
if (audio_fd <= 0) {
return (0);
}
- switch (iport) {
- case AUDIO_MICROPHONE : if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_MIC), &volume) == -1) {
- perror("Getting gain");
- }
- break;
- case AUDIO_LINE_IN : if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_LINE), &volume) == -1) {
- perror("Getting gain");
- }
- break;
- default : printf("ERROR: Unknown iport in audio_set_gain!\n");
- abort();
+ if (ioctl(audio_fd, SOUND_MIXER_READ_RECLEV, &volume) == -1) {
+ perror("Setting gain");
}
return device_to_bat(volume & 0xff);
}
@@ -263,7 +246,7 @@
if (audio_fd <= 0) {
return (0);
}
- if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_VOLUME), &volume) == -1) {
+ if (ioctl(audio_fd, MIXER_READ(SOUND_MIXER_PCM), &volume) == -1) {
perror("Getting volume");
}
return device_to_bat(volume & 0x000000ff); /* Extract left channel volume */

View File

@ -0,0 +1,11 @@
--- src/config.h.orig Sun Oct 20 14:05:43 2002
+++ src/config.h Sun Oct 20 14:05:49 2002
@@ -47,7 +47,7 @@
#define OSNAME "FreeBSD"
#include <unistd.h>
#include <stdlib.h>
-#include <machine/soundcard.h>
+#include <sys/soundcard.h>
#define DIFF_BYTE_ORDER 1
#define AUDIO_SPEAKER 0
#define AUDIO_HEADPHONE 1