mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-20 19:19:02 -04:00
- A few more cleanups to configure
Note for *now* you will have to expressly state ./configure --enable-alsa or --enable-oss etc. I'll fix it later to pick a default. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@61 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
e1c6930cda
commit
857a6a10cb
20
conf.h.in
20
conf.h.in
@ -46,6 +46,20 @@
|
||||
/* Define if you have /usr/include/sys/param.h */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
#undef HAVE_ALSA_ALSASOUND_H
|
||||
#undef HAVE_SYS_SOUNDCARD_H
|
||||
#undef HAVE_AUDIOFILE_H
|
||||
/* Define if you have alsasound.h */
|
||||
#undef HAS_ALSASOUND_H
|
||||
|
||||
/* Define if you want to use ALSA */
|
||||
#undef USE_ALSA
|
||||
|
||||
/* Define if you have soundcard.h */
|
||||
#undef HAS_SOUNDCARD_H
|
||||
|
||||
/* Define if you want to use OSS */
|
||||
#undef USE_OSS
|
||||
|
||||
/* Define if you have audiofile.h */
|
||||
#undef HAS_AUDIOFILE_H
|
||||
|
||||
/* Define if you want to use LIBAUDIO */
|
||||
#undef USE_LIBAUDIO
|
||||
|
112
configure.ac
112
configure.ac
@ -63,6 +63,7 @@ if test ! -z "$CFLAGS"; then
|
||||
WSJT_CFLAGS="$WSJT_CFLAGS $CFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
AC_ISC_POSIX
|
||||
AC_C_INLINE
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
@ -93,14 +94,10 @@ AC_SUBST(OS, "${OS}")
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_CHECK_HEADERS([crypt.h inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h link.h sys/soundcard.h linux/soundcard.h alsa/alsasound.h audiofile.h])
|
||||
|
||||
dnl use directory structure of cached as default (hack)
|
||||
if test "$libexecdir" = '${exec_prefix}/libexec' &&
|
||||
test "$localstatedir" = '${prefix}/var'; then
|
||||
libexecdir='${bindir}'
|
||||
localstatedir='${prefix}'
|
||||
fi
|
||||
AC_CHECK_HEADERS([inttypes.h stdint.h sys/resource.h sys/param.h errno.h sys/syslog.h stddef.h libgen.h sys/wait.h wait.h ])
|
||||
AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0])
|
||||
AC_CHECK_HEADER([alsa/alsasound.h], [HAS_ALSASOUND_H=1], [HAS_ALSASOUND_H=0])
|
||||
AC_CHECK_HEADER([audiofile.h], [HAS_AUDIOFILE_H=1], [HAS_AUDIOFILE_H=0])
|
||||
|
||||
dnl See whether we can include both string.h and strings.h.
|
||||
AC_CACHE_CHECK([whether string.h and strings.h may both be included],
|
||||
@ -117,17 +114,46 @@ if test "$gcc_cv_header_string" = "yes"; then
|
||||
AC_DEFINE(STRING_WITH_STRINGS, 1, [Define to 1 if string.h may be included along with strings.h])
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(int64_t)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
|
||||
if test "$ac_cv_sizeof_int64_t" = 8; then
|
||||
AC_CHECK_TYPE(uint64_t)
|
||||
AC_CHECK_TYPE(int64_t)
|
||||
elif test "$ac_cv_sizeof_long_long" = 8; then
|
||||
AC_CHECK_TYPE(uint64_t, unsigned long long)
|
||||
AC_CHECK_TYPE(int64_t, long long)
|
||||
fi
|
||||
|
||||
AC_CHECK_TYPE([u_int32_t], [],
|
||||
[
|
||||
AC_CHECK_TYPE([uint32_t],
|
||||
[
|
||||
AC_DEFINE(u_int32_t, [uint32_t], [If system does not define u_int32_t, define a reasonable substitute.])
|
||||
],
|
||||
[
|
||||
AC_MSG_WARN([system has no u_int32_t or uint32_t, default to unsigned long int])
|
||||
AC_DEFINE(u_int32_t, [unsigned long int], [If system does not define u_int32_t, define to unsigned long int here.])
|
||||
])
|
||||
])
|
||||
|
||||
AC_CHECK_TYPE([u_int16_t], [],
|
||||
[
|
||||
AC_CHECK_TYPE([uint16_t],
|
||||
[
|
||||
AC_DEFINE(u_int16_t, [uint16_t], [If system does not define u_int16_t, define a usable substitute])
|
||||
],
|
||||
[
|
||||
AC_MSG_WARN([system has no u_int16_t or uint16_t, default to unsigned short int])
|
||||
AC_DEFINE(u_int16_t, [unsigned short int], [If system does not define u_int16_t, define a usable substitute.])
|
||||
])
|
||||
])
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl Check for stdarg.h - if we can't find it, halt configure
|
||||
AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - wsjt will not compile without it **])])
|
||||
|
||||
dnl Checks for the existence of strlcat, strlcpy, basename...
|
||||
dnl This more reliable test only works with gcc though.
|
||||
|
||||
|
||||
AC_SUBST(SNPRINTF_C)
|
||||
|
||||
dnl Debug-related options
|
||||
dnl =====================
|
||||
|
||||
@ -166,6 +192,64 @@ AC_CONFIG_FILES( \
|
||||
Makefile
|
||||
)
|
||||
|
||||
dnl alsa soundsupport
|
||||
dnl =================
|
||||
|
||||
AC_ARG_ENABLE(alsa,
|
||||
AC_HELP_STRING([--enable-alsa],[Force ALSA SOUNDCARD usage.]),
|
||||
[alsa=$enableval] , [alsa=no])
|
||||
|
||||
dnl oss soundsupport
|
||||
dnl ================
|
||||
|
||||
AC_ARG_ENABLE(oss,
|
||||
AC_HELP_STRING([--enable-oss],[Force OSS SOUND usage.]),
|
||||
[oss=$enableval] , [oss=no])
|
||||
|
||||
dnl libaudio soundsupport
|
||||
dnl =====================
|
||||
|
||||
AC_ARG_ENABLE(libaudio,
|
||||
AC_HELP_STRING([--enable-libaudio],[Force LIBAUDIO SOUND usage.]),
|
||||
[libaudio=$enableval], [libaudio=no])
|
||||
|
||||
if test "$alsa" = yes; then
|
||||
AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.])
|
||||
fi
|
||||
|
||||
if test "$oss" = yes; then
|
||||
AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.])
|
||||
fi
|
||||
|
||||
if test "$libaudio" = yes; then
|
||||
AC_DEFINE(USE_LIBAUDIO, 1, [Define if you want LIBAUDIO used.])
|
||||
fi
|
||||
|
||||
dnl sanity tests.
|
||||
if test "$alsa" = yes; then
|
||||
if test $HAS_ALSASOUND_H -eq 0; then
|
||||
AC_MSG_ERROR([You need alsasound.h to use --enable-alsa])
|
||||
else
|
||||
AC_DEFINE(HAS_ALSASOUND_H, 1, )
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$oss" = yes; then
|
||||
if test $HAS_SOUNDCARD_H -eq 0; then
|
||||
AC_MSG_ERROR([You need soundcard.h to use --enable-oss])
|
||||
else
|
||||
AC_DEFINE(HAS_SOUNDCARD_H, 1, )
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$libaudio" = yes; then
|
||||
if test $HAS_AUDIOFILE_H -eq 0; then
|
||||
AC_MSG_ERROR([You need audiofile.h to use --enable-libaudio])
|
||||
else
|
||||
AC_DEFINE(HAS_AUDIOFILE_H, 1, )
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
|
@ -3,18 +3,21 @@
|
||||
#include <pthread.h>
|
||||
#include "conf.h"
|
||||
|
||||
/* XXX Change to
|
||||
* #if defined(WANT_ALSA) && defined(HAVE_ALSA_ALSASOUND_H)
|
||||
* when configure is done with options --db
|
||||
/*
|
||||
* XXX This should have been caught in the sanity tests in configure --db
|
||||
*/
|
||||
#ifdef HAVE_ALSA_ALSASOUND_H
|
||||
#if defined(USE_ALSA) && !defined(HAS_ALSASOUND_H)
|
||||
#error "You must have alsa support to use alsa"
|
||||
#endif
|
||||
|
||||
#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H)
|
||||
#include <alsa/asoundlib.h>
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef HAVE_ALSA_ALSASOUND_H
|
||||
#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H)
|
||||
|
||||
#if 1
|
||||
#define ALSA_LOG
|
||||
@ -516,7 +519,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[],
|
||||
int iarg1 = 1,iarg2 = 2;
|
||||
//int32_t rate=11025;
|
||||
int32_t rate=*nfsample;
|
||||
#ifdef HAVE_ALSA_ALSASOUND_H
|
||||
#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H)
|
||||
alsa_driver_capture.app_buffer_y1 = y1;
|
||||
alsa_driver_capture.app_buffer_y2 = y2;
|
||||
alsa_driver_capture.app_buffer_offset = iwrite;
|
||||
@ -536,7 +539,7 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[],
|
||||
#endif
|
||||
printf("start threads called\n");
|
||||
iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1);
|
||||
#ifdef HAVE_ALSA_ALSASOUND_H
|
||||
#if defined(USE_ALSA) && defined(HAS_ALSASOUND_H)
|
||||
/* Open audio card. */
|
||||
ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK);
|
||||
ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE);
|
||||
|
Loading…
Reference in New Issue
Block a user