2006-01-07 15:14:23 -05:00
|
|
|
dnl $Id$
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
|
|
|
|
dnl AC_PREREQ(2.59)
|
|
|
|
|
|
|
|
dnl Sneaky way to get an Id tag into the configure script
|
|
|
|
AC_COPYRIGHT([$Id$])
|
|
|
|
|
2006-01-15 21:07:25 -05:00
|
|
|
AC_INIT([wsjt],[5.9.2])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
|
|
|
AC_PREFIX_DEFAULT(/usr/local/)
|
|
|
|
|
|
|
|
OLD_CFLAGS="$CFLAGS"
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_LANG(C)
|
|
|
|
AC_PROG_F77
|
|
|
|
|
|
|
|
dnl Make sure autoconf doesn't interfere with cflags -jmallett
|
|
|
|
CFLAGS="$OLD_CFLAGS"
|
|
|
|
|
2006-01-09 14:18:03 -05:00
|
|
|
dnl Lets guess at some likely places for extra libs/includes XXX -db
|
|
|
|
CPPFLAGS="-I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}"
|
2006-01-09 21:43:23 -05:00
|
|
|
LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}"
|
2006-01-09 14:18:03 -05:00
|
|
|
|
2006-01-07 15:14:23 -05:00
|
|
|
AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX])
|
|
|
|
case `uname -s` in
|
|
|
|
CYGWIN*)
|
|
|
|
AC_MSG_RESULT(Cygwin)
|
|
|
|
CYGWIN=yes
|
|
|
|
;;
|
|
|
|
SunOS*)
|
|
|
|
AC_MSG_RESULT(SunOS or Solaris)
|
|
|
|
AC_DEFINE(__EXTENSIONS__, 1, [This is needed to use strtok_r on Solaris.])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "$ac_cv_c_compiler_gnu" = yes; then
|
|
|
|
AC_MSG_CHECKING(if $CC is Apple GCC)
|
|
|
|
|
|
|
|
if expr "`$CC -v 2>&1 | tail -1`" : ".*Apple" >/dev/null; then
|
|
|
|
AppleGCC=yes
|
|
|
|
else
|
|
|
|
AppleGCC=no
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_RESULT($AppleGCC)
|
|
|
|
|
2006-01-09 21:43:23 -05:00
|
|
|
CFLAGS="$CFLAGS -Wall -O0"
|
2006-01-07 15:14:23 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl If we support -g, use it!
|
|
|
|
if test "$ac_cv_prog_cc_g" = yes; then
|
2006-01-09 21:43:23 -05:00
|
|
|
CFLAGS="$CFLAGS -g"
|
2006-01-07 15:14:23 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl jdc -- If CFLAGS is defined, best use it everywhere...
|
|
|
|
dnl NOTE: jv says it must be added to the *END*, because things like
|
|
|
|
dnl "gcc -O9 -O2" will result in -O2 getting preference. How stupid.
|
|
|
|
if test ! -z "$CFLAGS"; then
|
2006-01-09 21:43:23 -05:00
|
|
|
CFLAGS="$CFLAGS $CFLAGS"
|
2006-01-07 15:14:23 -05:00
|
|
|
fi
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
|
2006-01-07 15:14:23 -05:00
|
|
|
AC_ISC_POSIX
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_PROG_GCC_TRADITIONAL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PATH_PROG(RM, rm)
|
|
|
|
AC_PATH_PROG(CP, cp)
|
|
|
|
AC_PATH_PROG(MV, mv)
|
|
|
|
AC_PATH_PROG(LN, ln)
|
|
|
|
AC_PATH_PROG(SED, sed)
|
|
|
|
AC_PATH_PROG(AR, ar)
|
|
|
|
AC_PATH_PROG(LD, ld)
|
|
|
|
AC_PATH_PROG(TEST, [test], [test])
|
|
|
|
AC_PATH_PROG(PYTHON, python)
|
|
|
|
AC_PATH_PROG(F2PY, f2py)
|
2006-04-05 16:07:32 -04:00
|
|
|
AC_PATH_PROG(G95, gfortran)
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-07 16:24:49 -05:00
|
|
|
AC_MSG_CHECKING([g95 lib path])
|
|
|
|
G95_LIB_PATH=`${G95} -print-file-name=`
|
|
|
|
AC_MSG_RESULT(${G95_LIB_PATH})
|
|
|
|
AC_DEFINE_UNQUOTED(G95_LIB_PATH, "${G95_LIB_PATH}", [Path to G95 libs.])
|
|
|
|
AC_SUBST(G95_LIB_PATH, "${G95_LIB_PATH}")
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([OS])
|
|
|
|
OS=`uname`
|
|
|
|
AC_SUBST(OS, "${OS}")
|
|
|
|
|
2006-01-07 15:14:23 -05:00
|
|
|
dnl Checks for header files.
|
2006-01-15 21:07:25 -05:00
|
|
|
|
2006-01-07 15:14:23 -05:00
|
|
|
AC_HEADER_STDC
|
|
|
|
|
2006-01-15 21:07:25 -05:00
|
|
|
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 stdio.h termios.h \
|
|
|
|
sys/resource.h linux/ppdev.h dev/ppbus/ppi.h sys/stat.h fcntl.h sys/ioctl.h ])
|
|
|
|
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
AC_CHECK_HEADER([sys/soundcard.h], [HAS_SOUNDCARD_H=1], [HAS_SOUNDCARD_H=0])
|
2006-01-09 14:18:03 -05:00
|
|
|
AC_CHECK_HEADER([alsa/asoundlib.h], [HAS_ASOUNDLIB_H=1], [HAS_ASOUNDLIB_H=0])
|
|
|
|
AC_CHECK_HEADER([portaudio.h], [HAS_PORTAUDIO_H=1], [HAS_PORTAUDIO_H=0])
|
2006-01-10 11:36:04 -05:00
|
|
|
AC_CHECK_HEADER([samplerate.h], [HAS_SAMPLERATE_H=1], [HAS_SAMPLERATE_H=0])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
|
|
|
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],
|
|
|
|
gcc_cv_header_string,
|
|
|
|
[
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[#include <string.h>
|
|
|
|
#include <strings.h>],
|
|
|
|
[gcc_cv_header_string=yes],
|
|
|
|
[gcc_cv_header_string=no])
|
|
|
|
])
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
AC_CHECK_SIZEOF(int64_t)
|
|
|
|
AC_CHECK_SIZEOF(long long)
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
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.])
|
|
|
|
])
|
|
|
|
])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
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.])
|
|
|
|
])
|
|
|
|
])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
AC_C_BIGENDIAN
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
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 **])])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
|
|
|
dnl Debug-related options
|
|
|
|
dnl =====================
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(clobber,
|
|
|
|
AC_HELP_STRING([--enable-clobber], [Don't preserve old binaries on make install]),
|
|
|
|
[clobber=$enableval], [clobber=no])
|
|
|
|
|
|
|
|
if test "$clobber" = yes; then
|
|
|
|
AC_SUBST(CLOBBER, yes)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(assert,
|
|
|
|
AC_HELP_STRING([--enable-assert],[Enable assert().]),
|
|
|
|
[assert=$enableval], [assert=no])
|
|
|
|
|
|
|
|
if test "$assert" = no; then
|
|
|
|
AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test "$prefix" = "NONE"; then
|
2006-01-09 21:43:23 -05:00
|
|
|
AC_DEFINE_UNQUOTED(PREFIX, "$ac_default_prefix", [Prefix where wsjt is installed.])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
dnl Don't get bitten by Cygwin's stupidity if the user specified
|
|
|
|
dnl a custom prefix with a trailing slash
|
|
|
|
|
|
|
|
prefix=`echo $prefix | sed 's/\/$//'`
|
2006-01-09 21:43:23 -05:00
|
|
|
AC_DEFINE_UNQUOTED(PREFIX, "$prefix", [Prefix where wsjt is installed.])
|
2006-01-07 15:14:23 -05:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CONFIG_FILES( \
|
|
|
|
Makefile
|
|
|
|
)
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
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])
|
|
|
|
|
2006-01-08 13:19:01 -05:00
|
|
|
dnl portaudio soundsupport
|
|
|
|
dnl ======================
|
2006-01-07 20:40:30 -05:00
|
|
|
|
2006-01-08 13:19:01 -05:00
|
|
|
AC_ARG_ENABLE(portaudio,
|
|
|
|
AC_HELP_STRING([--enable-portaudio],[Force PORTAUDIO SOUND usage.]),
|
|
|
|
[portaudio=$enableval], [portaudio=no])
|
2006-01-07 20:40:30 -05:00
|
|
|
|
2006-01-15 21:07:25 -05:00
|
|
|
AC_ARG_ENABLE(parallel,
|
|
|
|
AC_HELP_STRING([--enable-parallel],[Force PARALLEL port usage for ptt.]),
|
|
|
|
[parallel=$enableval], [parallel=no])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(serial,
|
|
|
|
AC_HELP_STRING([--enable-serial],[Force SERIAL port usage for ptt.]),
|
|
|
|
[serial=$enableval], [serial=no])
|
|
|
|
|
2006-01-10 16:35:37 -05:00
|
|
|
dnl now set conf.h,, CPPFLAGS and CFLAGS flags as needed
|
|
|
|
dnl ====================================================
|
|
|
|
|
|
|
|
dnl set defaults
|
|
|
|
dnl ============
|
|
|
|
|
2006-01-15 21:07:25 -05:00
|
|
|
if test "$serial" != yes -a "$parallel" != yes; then
|
|
|
|
[serial=yes];
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$serial" = yes; then
|
|
|
|
AC_DEFINE(USE_SERIAL, 1, [Define if you want Serial port used.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$parallel" = yes; then
|
|
|
|
AC_DEFINE(USE_PARALLEL, 1, [Define if you want Serial port used.])
|
|
|
|
fi
|
|
|
|
|
2006-01-10 16:35:37 -05:00
|
|
|
if test "$alsa" != yes -a "$oss" != yes -a "$portaudio" != yes; then
|
|
|
|
if test $HAS_PORTAUDIO_H -eq 1; then
|
|
|
|
[portaudio=yes];
|
|
|
|
elif test $HAS_ASOUNDLIB_H -eq 1; then
|
|
|
|
[alsa=yes];
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
if test "$alsa" = yes; then
|
|
|
|
AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.])
|
2006-01-14 10:47:35 -05:00
|
|
|
AC_SUBST(AUDIO, "start_alsa.c")
|
2006-01-09 23:30:03 -05:00
|
|
|
LDFLAGS="${LDFLAGS} -lasound"
|
2006-01-07 20:40:30 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$oss" = yes; then
|
|
|
|
AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.])
|
2006-01-15 18:32:39 -05:00
|
|
|
AC_SUBST(AUDIO, "start_oss.c")
|
2006-01-07 20:40:30 -05:00
|
|
|
fi
|
|
|
|
|
2006-01-08 13:19:01 -05:00
|
|
|
if test "$portaudio" = yes; then
|
|
|
|
AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.])
|
2006-01-14 11:15:50 -05:00
|
|
|
AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c")
|
2006-01-10 00:00:34 -05:00
|
|
|
LDFLAGS="${LDFLAGS} -lportaudio -lsamplerate"
|
2006-01-08 13:19:01 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl set conf flags
|
|
|
|
|
2006-01-09 14:18:03 -05:00
|
|
|
if test $HAS_ASOUNDLIB_H -eq 1; then
|
|
|
|
AC_DEFINE(HAS_ASOUNDLIB_H, 1, )
|
2006-01-08 13:19:01 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test $HAS_SOUNDCARD_H -eq 1; then
|
|
|
|
AC_DEFINE(HAS_SOUNDCARD_H, 1, )
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $HAS_PORTAUDIO_H -eq 1; then
|
|
|
|
AC_DEFINE(HAS_PORTAUDIO_H, 1, )
|
2006-01-07 20:40:30 -05:00
|
|
|
fi
|
|
|
|
|
2006-01-10 11:36:04 -05:00
|
|
|
if test $HAS_SAMPLERATE_H -eq 1; then
|
|
|
|
AC_DEFINE(HAS_SAMPLERATE_H, 1, )
|
|
|
|
fi
|
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
dnl sanity tests.
|
2006-01-10 16:35:37 -05:00
|
|
|
dnl =============
|
2006-01-10 11:36:04 -05:00
|
|
|
|
2006-01-07 20:40:30 -05:00
|
|
|
if test "$alsa" = yes; then
|
2006-01-09 14:18:03 -05:00
|
|
|
if test $HAS_ASOUNDLIB_H -eq 0; then
|
|
|
|
AC_MSG_ERROR([You need asoundlib.h to use --enable-alsa])
|
2006-01-07 20:40:30 -05:00
|
|
|
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])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-01-08 13:19:01 -05:00
|
|
|
if test "$portaudio" = yes; then
|
|
|
|
if test $HAS_PORTAUDIO_H -eq 0; then
|
|
|
|
AC_MSG_ERROR([You need portaudio.h to use --enable-portaudio])
|
2006-01-07 20:40:30 -05:00
|
|
|
fi
|
2006-01-10 11:36:04 -05:00
|
|
|
if test $HAS_SAMPLERATE_H -eq 0; then
|
|
|
|
AC_MSG_ERROR([You need samplerate.h to use --enable-portaudio])
|
|
|
|
fi
|
2006-01-07 20:40:30 -05:00
|
|
|
fi
|
|
|
|
|
2006-02-20 15:46:33 -05:00
|
|
|
if test "$F2PY" = ""; then
|
|
|
|
AC_MSG_ERROR([You are missing f2py])
|
|
|
|
fi
|
2006-01-10 11:36:04 -05:00
|
|
|
|
2006-01-09 14:18:03 -05:00
|
|
|
dnl
|
|
|
|
AC_SUBST(CPPFLAGS, "${CPPFLAGS}")
|
|
|
|
AC_SUBST(LDFLAGS, "${LDFLAGS}")
|
2006-01-09 21:43:23 -05:00
|
|
|
AC_SUBST(CFLAGS)
|
2006-01-09 14:18:03 -05:00
|
|
|
|
2006-02-20 15:46:33 -05:00
|
|
|
AC_OUTPUT
|
2006-04-05 16:07:32 -04:00
|
|
|
dnl AC_CONFIG_FILES(Makefile)
|
2006-02-20 15:46:33 -05:00
|
|
|
|
2006-01-10 11:36:04 -05:00
|
|
|
dnl do summary
|
2006-01-07 15:14:23 -05:00
|
|
|
|
2006-01-10 16:35:37 -05:00
|
|
|
echo
|
|
|
|
echo
|
|
|
|
|
|
|
|
if test $portaudio == "yes"; then
|
2006-01-15 21:07:25 -05:00
|
|
|
echo "Using portaudio.";
|
2006-01-10 16:35:37 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test $alsa == "yes"; then
|
2006-01-15 21:07:25 -05:00
|
|
|
echo "Using alsa.";
|
2006-01-10 16:35:37 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test $oss == "yes"; then
|
2006-01-15 21:07:25 -05:00
|
|
|
echo "Using oss.";
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $serial == "yes"; then
|
|
|
|
echo "Using serial port for ptt.";
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $parallel == "yes"; then
|
|
|
|
echo "Using parallel port for ptt.";
|
2006-01-10 16:35:37 -05:00
|
|
|
fi
|
|
|
|
|
2006-01-07 15:14:23 -05:00
|
|
|
echo
|
|
|
|
echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION"
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "Installing into: $prefix"
|
|
|
|
|
|
|
|
echo
|