ref: 28ff06bd59bad16019174e2b80eac7462745e11e
parent: b852af9353236719355f1d81d8787eea5c2d1136
author: cbagwell <cbagwell>
date: Mon Jan 27 14:15:49 EST 2003
Modified configure scripts to pass all #define's via stconfig.h instead of command line.
--- a/configure
+++ b/configure
@@ -3251,15 +3251,27 @@
if test "$enable_old_rate" = yes
then
- CFLAGS="$CFLAGS -DUSE_OLD_RATE"
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_OLD_RATE 1
+_ACEOF
+
fi
if test "$enable_fast_ulaw" = yes
then
- CFLAGS="$CFLAGS -DFAST_ULAW_CONVERSION"
+
+cat >>confdefs.h <<\_ACEOF
+#define FAST_ULAW_CONVERSION 1
+_ACEOF
+
fi
if test "$enable_fast_alaw" = yes
then
- CFLAGS="$CFLAGS -DFAST_ALAW_CONVERSION"
+
+cat >>confdefs.h <<\_ACEOF
+#define FAST_ALAW_CONVERSION 1
+_ACEOF
+
fi
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
@@ -4577,7 +4589,16 @@
if test "$alsa_type" = alsa9
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA9"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA9 1
+_ACEOF
+
NEED_ALSA=1
PLAY_SUPPORT=1
echo "$as_me:$LINENO: result: 0.9.X" >&5
@@ -4584,7 +4605,16 @@
echo "${ECHO_T}0.9.X" >&6
elif test "$alsa_type" = alsa5
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA5"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA5 1
+_ACEOF
+
NEED_ALSA=1
PLAY_SUPPORT=1
echo "$as_me:$LINENO: result: 0.5.X" >&5
@@ -4591,7 +4621,16 @@
echo "${ECHO_T}0.5.X" >&6
elif test "$alsa_type" = alsa4
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA4"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALSA4 1
+_ACEOF
+
NEED_ALSA=1
PLAY_SUPPORT=1
echo "$as_me:$LINENO: result: 0.4.X" >&5
@@ -4723,7 +4762,11 @@
if test "$found_oss_dsp" = yes
then
- CFLAGS="$CFLAGS -DOSS_PLAYER"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_OSS 1
+_ACEOF
+
NEED_OSS=1
PLAY_SUPPORT=1
else
@@ -4850,8 +4893,12 @@
if test "$found_sun_audio" = yes
-then
- CFLAGS="$CFLAGS -DSUNAUDIO_PLAYER"
+ then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SUNAUDIO 1
+_ACEOF
+
NEED_SUNAU=1
PLAY_SUPPORT=1
else
@@ -4861,8 +4908,11 @@
if test "$enable_gsm" = yes
then
- CFLAGS="$CFLAGS -DENABLE_GSM"
- LIBS="$LIBS -lgsm"
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_GSM 1
+_ACEOF
+
GSM_SUPPORT=1
fi
@@ -5946,9 +5996,11 @@
EOF
-ac_config_files="$ac_config_files libst-config play Makefile gsm/Makefile"
+ac_config_files="$ac_config_files libst-config Makefile gsm/Makefile"
+ac_config_files="$ac_config_files play"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -6421,9 +6473,9 @@
case "$ac_config_target" in
# Handling of arguments.
"libst-config" ) CONFIG_FILES="$CONFIG_FILES libst-config" ;;
- "play" ) CONFIG_FILES="$CONFIG_FILES play" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"gsm/Makefile" ) CONFIG_FILES="$CONFIG_FILES gsm/Makefile" ;;
+ "play" ) CONFIG_FILES="$CONFIG_FILES play" ;;
"stconfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS stconfig.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -6735,6 +6787,10 @@
rm -f $tmp/out
fi
+ # Run the commands associated with the file.
+ case $ac_file in
+ play ) chmod +x play ;;
+ esac
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
--- a/configure.in
+++ b/configure.in
@@ -87,15 +87,18 @@
if test "$enable_old_rate" = yes
then
- CFLAGS="$CFLAGS -DUSE_OLD_RATE"
+ AC_DEFINE([USE_OLD_RATE], 1,
+ [Define if you want to use old rate routines])
fi
if test "$enable_fast_ulaw" = yes
then
- CFLAGS="$CFLAGS -DFAST_ULAW_CONVERSION"
+ AC_DEFINE([FAST_ULAW_CONVERSION], 1,
+ [Define if you want to use fast ULAW conversions])
fi
if test "$enable_fast_alaw" = yes
then
- CFLAGS="$CFLAGS -DFAST_ALAW_CONVERSION"
+ AC_DEFINE([FAST_ALAW_CONVERSION], 1,
+ [Define if you want to use fast ALAW conversions])
fi
dnl Checks for header files.
@@ -135,7 +138,7 @@
AC_CHECK_LIB(vorbis, vorbis_analysis_init,
LIBS="$LIBS -logg -lvorbis -lvorbisfile -lvorbisenc"
AC_DEFINE([HAVE_LIBVORBIS], 1,
- [Define if you have Ogg Vorbis Library install]),
+ [Define if you have Ogg Vorbis Library installed]),
enable_ogg_vorbis=no)
fi
fi
@@ -193,19 +196,28 @@
if test "$alsa_type" = alsa9
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA9"
+ AC_DEFINE([HAVE_ALSA], 1,
+ [Define if you have ALSA installed])
+ AC_DEFINE([HAVE_ALSA9], 1,
+ [Define if you have ALSA 0.9 installed])
NEED_ALSA=1
PLAY_SUPPORT=1
AC_MSG_RESULT([0.9.X])
elif test "$alsa_type" = alsa5
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA5"
+ AC_DEFINE([HAVE_ALSA], 1,
+ [Define if you have ALSA installed])
+ AC_DEFINE([HAVE_ALSA5], 1,
+ [Define if you have ALSA 0.5 installed])
NEED_ALSA=1
PLAY_SUPPORT=1
AC_MSG_RESULT([0.5.X])
elif test "$alsa_type" = alsa4
then
- CFLAGS="$CFLAGS -DALSA_PLAYER -DUSE_ALSA4"
+ AC_DEFINE([HAVE_ALSA], 1,
+ [Define if you have ALSA installed])
+ AC_DEFINE([HAVE_ALSA4], 1,
+ [Define if you have ALSA 0.4 installed])
NEED_ALSA=1
PLAY_SUPPORT=1
AC_MSG_RESULT([0.4.X])
@@ -221,7 +233,8 @@
if test "$found_oss_dsp" = yes
then
- CFLAGS="$CFLAGS -DOSS_PLAYER"
+ AC_DEFINE([HAVE_OSS], 1,
+ [Define if you have OSS installed])
NEED_OSS=1
PLAY_SUPPORT=1
else
@@ -234,8 +247,9 @@
AC_CHECK_HEADERS(sys/audioio.h sun/audioio.h, found_sun_audio=yes)
if test "$found_sun_audio" = yes
-then
- CFLAGS="$CFLAGS -DSUNAUDIO_PLAYER"
+ then
+ AC_DEFINE([HAVE_SUNAUDIO], 1,
+ [Define if you have Sun /dev/audio installed])
NEED_SUNAU=1
PLAY_SUPPORT=1
else
@@ -245,8 +259,8 @@
if test "$enable_gsm" = yes
then
- CFLAGS="$CFLAGS -DENABLE_GSM"
- LIBS="$LIBS -lgsm"
+ AC_DEFINE([ENABLE_GSM], 1,
+ [Define if you want to use internal GSM library])
GSM_SUPPORT=1
fi
@@ -262,7 +276,8 @@
AC_CONFIG_HEADER(stconfig.h)
AC_CREATE_STDINT_H(ststdint.h)
-AC_CONFIG_FILES([libst-config play Makefile gsm/Makefile])
+AC_CONFIG_FILES([libst-config Makefile gsm/Makefile])
+AC_CONFIG_FILES([play], [chmod +x play])
AC_OUTPUT()
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -25,10 +25,13 @@
LN_S = @LN_S@
# Build macros.
+GSM_LIB_0 =
+GSM_LIB_1 = -lgsm
+GSM_SUPPORT = @GSM_SUPPORT@
-CFLAGS = @CFLAGS@ -I. -I$(srcdir)
-LDFLAGS = -L. @LDFLAGS@
-LIBS = -lst -Lgsm @LIBS@
+CFLAGS = @CFLAGS@ -I$(srcdir)
+LDFLAGS = -L. -L./gsm @LDFLAGS@
+LIBS = -lst $(GSM_LIB_$(GSM_SUPPORT)) @LIBS@
# Other macros.
@@ -35,7 +38,6 @@
NEED_OSS = @NEED_OSS@
NEED_SUNAU = @NEED_SUNAU@
NEED_ALSA = @NEED_ALSA@
-GSM_SUPPORT = @GSM_SUPPORT@
PLAY_SUPPORT = @PLAY_SUPPORT@
# Objects.
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -15,7 +15,7 @@
#include "st_i.h"
-#if defined(ALSA_PLAYER)
+#if defined(HAVE_ALSA)
#include <string.h>
#include <fcntl.h>
@@ -26,7 +26,7 @@
static int get_format(ft_t ft, int formats, int *fmt);
-#if USE_ALSA9
+#if HAVE_ALSA9
#include <limits.h>
#include <sound/asound.h>
@@ -309,11 +309,11 @@
return(st_rawstopwrite(ft));
}
-#else /* ! USE_ALSA9 */
+#else /* ! HAVE_ALSA9 */
#include <linux/asound.h>
-#if USE_ALSA4 /* Start 0.4.x API */
+#if HAVE_ALSA4 /* Start 0.4.x API */
int st_alsastartread(ft)
ft_t ft;
@@ -438,7 +438,7 @@
return(st_rawstopwrite(ft));
}
-#elif USE_ALSA5 /* Start 0.5.x API */
+#elif HAVE_ALSA5 /* Start 0.5.x API */
int st_alsastartread(ft)
ft_t ft;
@@ -572,9 +572,9 @@
return(st_rawstopwrite(ft));
}
-#endif /* USE_ALSA4/5 */
+#endif /* HAVE_ALSA4/5 */
-#endif /* USE_ALSA9 */
+#endif /* HAVE_ALSA9 */
#define EMSGFMT "ALSA driver does not support %s %s output"
@@ -653,7 +653,7 @@
len = st_rawread(ft, buf, nsamp);
-#if USE_ALSA9
+#if HAVE_ALSA9
/* ALSA 0.9 and above require that we detects underruns and
* reset the driver if it occurs.
*/
@@ -686,7 +686,7 @@
len = st_rawwrite(ft, buf, nsamp);
-#if USE_ALSA9
+#if HAVE_ALSA9
/* ALSA 0.9 and above require that we detects overruns and
* reset the driver if it occurs.
*/
@@ -712,4 +712,4 @@
return len;
}
-#endif /* ALSA_PLAYER */
+#endif /* HAVE_ALSA */
--- a/src/handlers.c
+++ b/src/handlers.c
@@ -29,7 +29,7 @@
(char *) 0
};
-#if defined(ALSA_PLAYER)
+#if defined(HAVE_ALSA)
/* /dev/snd/pcmXX */
static char *alsanames[] = {
"alsa",
@@ -124,7 +124,7 @@
(char *) 0,
};
-#if defined(OSS_PLAYER)
+#if defined(HAVE_OSS)
/* OSS /dev/dsp player */
static char *ossdspnames[] = {
"ossdsp",
@@ -179,7 +179,7 @@
(char *) 0
};
-#if defined(SUNAUDIO_PLAYER)
+#if defined(HAVE_SUNAUDIO)
/* Sun /dev/audio player */
static char *sunnames[] = {
"sunau",
@@ -256,7 +256,7 @@
{alnames, ST_FILE_STEREO,
st_alstartread, st_rawread, st_rawstopread,
st_alstartwrite, st_rawwrite, st_rawstopwrite, st_format_nothing_seek},
-#ifdef ALSA_PLAYER
+#ifdef HAVE_ALSA
{alsanames, ST_FILE_STEREO,
st_alsastartread, st_alsaread, st_rawstopread,
st_alsastartwrite, st_alsawrite, st_alsastopwrite,
@@ -314,7 +314,7 @@
{nulnames, ST_FILE_STEREO,
st_nulstartread, st_nulread, st_nulstopread,
st_nulstartwrite, st_nulwrite, st_nulstopwrite, st_format_nothing_seek},
-#ifdef OSS_PLAYER
+#ifdef HAVE_OSS
{ossdspnames, ST_FILE_STEREO,
st_ossdspstartread, st_rawread, st_rawstopread,
st_ossdspstartwrite, st_rawwrite, st_rawstopwrite, st_format_nothing_seek},
@@ -344,7 +344,7 @@
st_spherestartread, st_sphereread, st_rawstopread,
st_spherestartwrite, st_spherewrite, st_spherestopwrite,
st_format_nothing_seek},
-#ifdef SUNAUDIO_PLAYER
+#ifdef HAVE_SUNAUDIO
{sunnames, ST_FILE_STEREO,
st_sunstartread, st_rawread, st_rawstopread,
st_sunstartwrite, st_rawwrite, st_rawstopwrite, st_format_nothing_seek},
--- a/src/oss.c
+++ b/src/oss.c
@@ -27,7 +27,7 @@
#include "st_i.h"
-#if defined(OSS_PLAYER)
+#if defined(HAVE_OSS)
#include <unistd.h>
#include <stdlib.h>
--- a/src/play.in
+++ b/src/play.in
@@ -18,6 +18,10 @@
exec_prefix=@exec_prefix@
bindir=@bindir@
+# Look for sox in install directory first and then in current direction
+# if not found.
+PATH=$bindir:.
+
program_name=`basename $0`
program_version="2.0"
@@ -207,8 +211,8 @@
else
echo "Send break (control-c) to end recording"
fi
- $bindir/sox $volume $arch_defines $fopts $device $fopts2 "$filename" $effects
+ sox $volume $arch_defines $fopts $device $fopts2 "$filename" $effects
else
- $bindir/sox $volume $fopts $fopts2 "$filename" $arch_defines $device $effects
+ sox $volume $fopts $fopts2 "$filename" $arch_defines $device $effects
fi
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -157,7 +157,7 @@
int st_alstartread(ft_t ft);
int st_alstartwrite(ft_t ft);
-#ifdef ALSA_PLAYER
+#ifdef HAVE_ALSA
int st_alsastartread(ft_t ft);
st_ssize_t st_alsaread(ft_t ft, st_sample_t *buf, st_ssize_t len);
int st_alsastartwrite(ft_t ft);
@@ -246,7 +246,7 @@
st_ssize_t st_nulwrite(ft_t ft, st_sample_t *buf, st_ssize_t len);
int st_nulstopwrite(ft_t ft);
-#ifdef OSS_PLAYER
+#ifdef HAVE_OSS
int st_ossdspstartread(ft_t ft);
int st_ossdspstartwrite(ft_t ft);
#endif
@@ -295,7 +295,7 @@
st_ssize_t st_spherewrite(ft_t ft, st_sample_t *buf, st_ssize_t len);
int st_spherestopwrite(ft_t ft);
-#ifdef SUNAUDIO_PLAYER
+#ifdef HAVE_SUNAUDIO
int st_sunstartread(ft_t ft);
int st_sunstartwrite(ft_t ft);
#endif
--- a/src/stconfig.h.in
+++ b/src/stconfig.h.in
@@ -1,92 +1,137 @@
/* stconfig.h.in. Generated from configure.in by autoheader. */
-/* Define if you have the <byteswap.h> header file. */
+/* Define if you want to use internal GSM library */
+#undef ENABLE_GSM
+
+/* Define if you want to use fast ALAW conversions */
+#undef FAST_ALAW_CONVERSION
+
+/* Define if you want to use fast ULAW conversions */
+#undef FAST_ULAW_CONVERSION
+
+/* Define if you have ALSA installed */
+#undef HAVE_ALSA
+
+/* Define if you have ALSA 0.4 installed */
+#undef HAVE_ALSA4
+
+/* Define if you have ALSA 0.5 installed */
+#undef HAVE_ALSA5
+
+/* Define if you have ALSA 0.9 installed */
+#undef HAVE_ALSA9
+
+/* Define to 1 if you have the <byteswap.h> header file. */
#undef HAVE_BYTESWAP_H
-/* Define if you have the <errno.h> header file. */
+/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
-/* Define if you have the <fcntl.h> header file. */
+/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define if you have the `getopt' function. */
+/* Define to 1 if you have the `getopt' function. */
#undef HAVE_GETOPT
-/* Define if you have the <getopt.h> header file. */
+/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
-/* Define if you have the <inttypes.h> header file. */
+/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define if you have the `m' library (-lm). */
+/* Define if you have LAME (LAME Ain't an MP3 Encoder) library installed */
+#undef HAVE_LAME
+
+/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define if you have MAD (MP3 Audio Decoder) Library installed */
#undef HAVE_LIBMAD
-/* Define if you have LAME (LAME Ain't an MP3 Encoder) Library installed */
-#undef HAVE_LAME
-
/* Define if you have Ogg Vorbis Library installed */
#undef HAVE_LIBVORBIS
-/* Define if you have the <limits.h> header file. */
+/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
-/* Define if you have the <linux/asound.h> header file. */
+/* Define to 1 if you have the <linux/asound.h> header file. */
#undef HAVE_LINUX_ASOUND_H
-/* Define if you have the <machine/soundcard.h> header file. */
+/* Define to 1 if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H
-/* Define if you have the <malloc.h> header file. */
+/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
-/* Define if you have the `memmove' function. */
+/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
-/* Define if you have the <memory.h> header file. */
+/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define if you have the `rand' function. */
+/* Define if you have OSS installed */
+#undef HAVE_OSS
+
+/* Define to 1 if you have the `rand' function. */
#undef HAVE_RAND
-/* Define if you have the <stdint.h> header file. */
+/* Define to 1 if you have the <sound/asound.h> header file. */
+#undef HAVE_SOUND_ASOUND_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define if you have the `strcasecmp' function. */
+/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define if you have the `strerror' function. */
+/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the <strings.h> header file. */
+/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define if you have the <string.h> header file. */
+/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
-/* Define if you have the <sun/audioio.h> header file. */
+/* Define if you have Sun /dev/audio installed */
+#undef HAVE_SUNAUDIO
+
+/* Define to 1 if you have the <sun/audioio.h> header file. */
#undef HAVE_SUN_AUDIOIO_H
-/* Define if you have the <sys/audioio.h> header file. */
+/* Define to 1 if you have the <sys/audioio.h> header file. */
#undef HAVE_SYS_AUDIOIO_H
-/* Define if you have the <sys/soundcard.h> header file. */
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H
-/* Define if you have the <sys/stat.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
-/* Define if you have the <sys/types.h> header file. */
+/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
/* The number of bytes in type char */
#undef SIZEOF_CHAR
@@ -102,11 +147,14 @@
/* The number of bytes in type void* */
#undef SIZEOF_VOIDP
-/* Define if you have the ANSI C header files. */
+/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define if your processor stores words with the most significant byte first
- (like Motorola and SPARC, unlike Intel and VAX). */
+/* Define if you want to use old rate routines */
+#undef USE_OLD_RATE
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to empty if `const' does not conform to ANSI C. */
--- a/src/sunaudio.c
+++ b/src/sunaudio.c
@@ -17,7 +17,7 @@
#include "st_i.h"
-#if defined(SUNAUDIO_PLAYER)
+#if defined(HAVE_SUNAUDIO)
#include <sys/ioctl.h>
#if defined(__SVR4) || defined(__NetBSD__)