diff --git a/Makefile.in b/Makefile.in index c3e697113..f5e9fa87d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,7 @@ CC ?= @CC@ FFLAGS = @FFLAGS@ LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ # WSJT specific C flags @@ -28,7 +29,6 @@ FC=@FC@ COMPILER += @FC_LIB_PATH@ LDFLAGS += -L${COMPILER} -LDFLAGS += -lg2c PYTHON ?= @PYTHON@ RM ?= @RM@ @@ -112,7 +112,7 @@ wsjt6: @NEEDPORTAUDIO@ Audio.so #wsjt.spec Audio.so: $(OBJS2C) $(OBJS3C) $(OBJS2F77) $(SRCS2F90) $(AUDIOSRCS) ${F2PY} -c --quiet --opt="-O ${CFLAGS} \ -fno-second-underscore" $(OBJS2C) $(OBJS2F77) -m Audio \ - --f77exec=${FC} --f90exec=${FC} ${CPPFLAGS} ${LDFLAGS} \ + --f77exec=${FC} --f90exec=${FC} ${CPPFLAGS} ${LDFLAGS} ${LIBS} \ only: $(F2PYONLY) \ : $(SRCS2F90) \ ${SRCS3C} ${AUDIOSRCS} diff --git a/configure b/configure index cb1c9041a..53d881d91 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for wsjt 5.9.2. # -# $Id: configure.ac 239 2006-08-05 16:53:41Z va3db $ +# $Id: configure.ac 246 2006-08-09 19:51:29Z va3db $ # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -976,7 +976,7 @@ Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 239 2006-08-05 16:53:41Z va3db $ +$Id: configure.ac 246 2006-08-09 19:51:29Z va3db $ _ACEOF exit 0 fi @@ -2501,7 +2501,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$OLD_CFLAGS" CPPFLAGS="-Iportaudio-v19/include -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" -LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" +LDFLAGS="-L/usr/local/lib ${LDFLAGS}" +LIBS=" -lpthread ${LIBS}" echo "$as_me:$LINENO: checking uname -s for Cygwin, Solaris or HPUX" >&5 echo $ECHO_N "checking uname -s for Cygwin, Solaris or HPUX... $ECHO_C" >&6 @@ -4819,6 +4820,77 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for clock_gettime in -lrt" >&5 +echo $ECHO_N "checking for clock_gettime in -lrt... $ECHO_C" >&6 +if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char clock_gettime (); +int +main () +{ +clock_gettime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_rt_clock_gettime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_rt_clock_gettime=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_rt_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_lib_rt_clock_gettime" >&6 +if test $ac_cv_lib_rt_clock_gettime = yes; then + RTLIBS="" +else + RTLIBS="-lrt" +fi + + echo "$as_me:$LINENO: checking for int64_t" >&5 echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 if test "${ac_cv_type_int64_t+set}" = set; then @@ -6718,7 +6790,7 @@ _ACEOF AUDIO="start_alsa.c" - LDFLAGS="${LDFLAGS} -lasound" + LIBS="${LIBS} -lasound" fi if test "$oss" = yes; then @@ -6741,7 +6813,7 @@ _ACEOF NEEDPORTAUDIO="portaudio-v19/lib/.libs/libportaudio.a" - LDFLAGS="portaudio-v19/lib/.libs/libportaudio.a ${LDFLAGS} -lsamplerate" + LIBS="${LIBS} -lsamplerate ${RTLIBS} -lsamplerate ./portaudio-v19/lib/.libs/libportaudio.a" else NEEDPORTAUDIO="" @@ -6823,6 +6895,8 @@ CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +LIBS="${LIBS}" + cat >confcache <<\_ACEOF diff --git a/configure.ac b/configure.ac index 65fd1fd2b..f4ca6a333 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,8 @@ CFLAGS="$OLD_CFLAGS" dnl Lets guess at some likely places for extra libs/includes XXX -db CPPFLAGS="-Iportaudio-v19/include -I/usr/local/include -I/usr/include/alsa ${CPPFLAGS}" -LDFLAGS="-L/usr/local/lib -lpthread ${LDFLAGS}" +LDFLAGS="-L/usr/local/lib ${LDFLAGS}" +LIBS=" -lpthread ${LIBS}" AC_MSG_CHECKING([uname -s for Cygwin, Solaris or HPUX]) case `uname -s` in @@ -134,6 +135,8 @@ 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_LIB(rt, clock_gettime, [RTLIBS=""], [RTLIBS="-lrt"]) + AC_CHECK_SIZEOF(int64_t) AC_CHECK_SIZEOF(long long) @@ -295,7 +298,7 @@ fi if test "$alsa" = yes; then AC_DEFINE(USE_ALSA, 1, [Define if you want ALSA used.]) AC_SUBST(AUDIO, "start_alsa.c") - LDFLAGS="${LDFLAGS} -lasound" + LIBS="${LIBS} -lasound" fi if test "$oss" = yes; then @@ -307,7 +310,7 @@ if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c resample.c start_portaudio.c") AC_SUBST(NEEDPORTAUDIO, "portaudio-v19/lib/.libs/libportaudio.a") - LDFLAGS="portaudio-v19/lib/.libs/libportaudio.a ${LDFLAGS} -lsamplerate" + LIBS="${LIBS} -lsamplerate ${RTLIBS} -lsamplerate ./portaudio-v19/lib/.libs/libportaudio.a" else AC_SUBST(NEEDPORTAUDIO, "") fi @@ -366,6 +369,7 @@ fi dnl AC_SUBST(CPPFLAGS, "${CPPFLAGS}") AC_SUBST(LDFLAGS, "${LDFLAGS}") +AC_SUBST(LIBS, "${LIBS}") AC_SUBST(CFLAGS) AC_OUTPUT