shithub: sox

Download patch

ref: 1e2e146fe7ef2b968ab1d3acadd743e031833ece
parent: aeddf54a936c8a54b87dbbebf5092d16a0ef4096
author: cbagwell <cbagwell>
date: Thu Jul 1 21:57:33 EDT 1999

Updated FreeBSD support, GSM compile bug, and Makefile portability

--- a/Makefile.unx
+++ b/Makefile.unx
@@ -142,7 +142,7 @@
 # GSM_PRE_LIBS	= -L/usr/local/lib
 # GSM_POST_LIBS	= -lgsm
 # GSM_INCLUDES	= -I/usr/local/include/
-# GSM_DEFINES	= -DHAS_GSM
+# GSM_DEFINES	= -DHAVE_LIBGSM
 
 # For sound support on machines that include the OSS sound driver
 # (such as Linux) then uncomment the following line.
--- a/configure
+++ b/configure
@@ -1563,19 +1563,21 @@
 echo "$ac_t""$ac_cv_dev_oss_dsp" 1>&6
 	if test "$ac_cv_dev_oss_dsp" = yes
 	then
-		ac_safe=`echo "sys/soundcard.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for sys/soundcard.h""... $ac_c" 1>&6
-echo "configure:1569: checking for sys/soundcard.h" >&5
+		for ac_hdr in sys/soundcard.h machine/soundcard.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1571: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1574 "configure"
+#line 1576 "configure"
 #include "confdefs.h"
-#include <sys/soundcard.h>
+#include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1591,10 +1593,15 @@
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  oss_dsp=yes
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ oss_dsp=yes
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
 		if test "$oss_dsp" = auto
 		then
@@ -1611,7 +1618,7 @@
 if test "$sun_audio" = auto
 then
 	echo $ac_n "checking whether /dev/audio is functional (SUN style)""... $ac_c" 1>&6
-echo "configure:1615: checking whether /dev/audio is functional (SUN style)" >&5
+echo "configure:1622: checking whether /dev/audio is functional (SUN style)" >&5
 if eval "test \"`echo '$''{'ac_cv_dev_sun_audio'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1619,7 +1626,7 @@
   ac_cv_dev_sun_audio=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1623 "configure"
+#line 1630 "configure"
 #include "confdefs.h"
 
 			int
@@ -1635,7 +1642,7 @@
 				}
 			
 EOF
-if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_dev_sun_audio=yes
 else
@@ -1655,17 +1662,17 @@
 	then
 		ac_safe=`echo "sys/audioio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/audioio.h""... $ac_c" 1>&6
-echo "configure:1659: checking for sys/audioio.h" >&5
+echo "configure:1666: checking for sys/audioio.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1664 "configure"
+#line 1671 "configure"
 #include "confdefs.h"
 #include <sys/audioio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1688,17 +1695,17 @@
 
 		ac_safe=`echo "sun/audioio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sun/audioio.h""... $ac_c" 1>&6
-echo "configure:1692: checking for sun/audioio.h" >&5
+echo "configure:1699: checking for sun/audioio.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1697 "configure"
+#line 1704 "configure"
 #include "confdefs.h"
 #include <sun/audioio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1745,7 +1752,7 @@
 	CFLAGS="$CFLAGS -DFAST_ALAW_COMPRESSION"
 fi
 
-LIBS="$LIBS -L. -lst"
+LIBS="-L. -lst $LIBS"
 
 
 
--- a/configure.in
+++ b/configure.in
@@ -188,7 +188,7 @@
 		)
 	if test "$ac_cv_dev_oss_dsp" = yes
 	then
-		AC_CHECK_HEADER(sys/soundcard.h, oss_dsp=yes)
+		AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, oss_dsp=yes)
 		if test "$oss_dsp" = auto
 		then
 			AC_WARN([No soundcard.h to compile with OSS /dev/dsp])
@@ -255,7 +255,7 @@
 	CFLAGS="$CFLAGS -DFAST_ALAW_COMPRESSION"
 fi
 
-LIBS="$LIBS -L. -lst"
+LIBS="-L. -lst $LIBS"
 
 AC_SUBST(NEED_OSS)
 AC_SUBST(NEED_SUNAU)
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -81,11 +81,6 @@
 
 VPATH	= @srcdir@
 
-.SUFFIXES:
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c $<
-
 all: sox
 
 sox: libst.a sox.o
--- a/src/gsm.c
+++ b/src/gsm.c
@@ -1,4 +1,4 @@
-#if defined(HAS_GSM)
+#if defined(HAVE_LIBGSM)
 /*
  * Copyright 1991, 1992, 1993 Guido van Rossum And Sundry Contributors.
  * This source code is freely redistributable and may be used for
@@ -159,4 +159,4 @@
 	}
 	gsm_destroy(p->handle);
 }
-#endif /* HAS_GSM */
+#endif /* HAVE_LIBGSM */
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -105,7 +105,7 @@
 extern void dvmsstartwrite();
 extern void dvmsstopwrite();
 
-#ifdef HAS_GSM
+#ifdef HAVE_LIBGSM
 char *gsmnames[] = {
         "gsm",
 	(char *) 0
@@ -345,7 +345,7 @@
 	{dvmsnames, 0,
 	        dvmsstartread, cvsdread, cvsdstopread,	   /* Cont. Variable */
 	        dvmsstartwrite, cvsdwrite, dvmsstopwrite},   /* Slope Delta */
-#ifdef HAS_GSM
+#ifdef HAVE_LIBGSM
 	{gsmnames, 0,
 	        gsmstartread, gsmread, gsmstopread,            /* GSM 06.10 */
 	        gsmstartwrite, gsmwrite, gsmstopwrite},
--- a/src/oss.c
+++ b/src/oss.c
@@ -27,7 +27,12 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
+#ifdef HAVE_SYS_SOUNDCARD_H
 #include <sys/soundcard.h>
+#endif
+#ifdef HAVE_MACHINE_SOUNDCARD_H
+#include <machine/soundcard.h>
+#endif
 #include <sys/ioctl.h>
 #include "st.h"
 #include "libst.h"