shithub: sox

Download patch

ref: 57802d4f61cec7b5ccc05c83260daf90e4e9fa7e
parent: ccfa7d0103c15d0de8248e4ed2863a93fb4dea98
author: rrt <rrt>
date: Fri Dec 8 14:06:47 EST 2006

Put missing libm test back.

--- a/configure
+++ b/configure
@@ -4978,6 +4978,164 @@
 fi
 
 
+{ echo "$as_me:$LINENO: checking if math library is required during link..." >&5
+echo "$as_me: checking if math library is required during link..." >&6;}
+{ echo "$as_me:$LINENO: checking for pow" >&5
+echo $ECHO_N "checking for pow... $ECHO_C" >&6; }
+if test "${ac_cv_func_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define pow to an innocuous variant, in case <limits.h> declares pow.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define pow innocuous_pow
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char pow (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef pow
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_pow || defined __stub___pow
+choke me
+#endif
+
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_pow" >&5
+echo "${ECHO_T}$ac_cv_func_pow" >&6; }
+
+if test "$ac_cv_func_pow" = no; then
+
+{ echo "$as_me:$LINENO: checking for pow in -lm" >&5
+echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; }
+if test "${ac_cv_lib_m_pow+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pow ();
+int
+main ()
+{
+return pow ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_m_pow=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_pow=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5
+echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; }
+if test $ac_cv_lib_m_pow = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+fi
+
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then
   enableval=$enable_largefile;
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,13 @@
 AC_REPLACE_FUNCS(getopt_long)
 AM_CONDITIONAL(GETOPT_LONG, test x$getopt_long = xtrue)
 
+dnl Check if math library is needed.
+AC_CHECKING(if math library is required during link)
+AC_CHECK_FUNC(pow)
+if test "$ac_cv_func_pow" = no; then
+  AC_CHECK_LIB(m, pow)
+fi
+
 dnl Large File Support
 AC_SYS_LARGEFILE
 AC_FUNC_FSEEKO
@@ -42,7 +49,7 @@
     AC_CHECK_LIB(asound, snd_pcm_open,, with_alsa=no)],
     with_alsa=no)
 if test "$with_alsa" = yes; then
-   AC_DEFINE(HAVE_ALSA, 1, [Set to 1 if you have ALSA.]),
+   AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if you have ALSA.]),
 fi
 
 dnl Check for OSS audio
@@ -50,7 +57,7 @@
 AC_CHECK_HEADERS(sys/soundcard.h, with_oss=yes)
 AC_CHECK_HEADERS(machine/soundcard.h, with_oss=yes)
 if test "$with_oss" = yes; then
-   AC_DEFINE(HAVE_OSS, 1, [Set to 1 if you have OSS.]),
+   AC_DEFINE(HAVE_OSS, 1, [Define to 1 if you have OSS.]),
 fi
 
 dnl Check for Sun-style audio
--- a/src/stconfig.h.in
+++ b/src/stconfig.h.in
@@ -1,6 +1,6 @@
 /* src/stconfig.h.in.  Generated from configure.ac by autoheader.  */
 
-/* Set to 1 if you have ALSA. */
+/* Define to 1 if you have ALSA. */
 #undef HAVE_ALSA
 
 /* Define to 1 if you have the <alsa/asoundlib.h> header file. */
@@ -27,6 +27,9 @@
 /* Define to 1 if you have the `FLAC' library (-lFLAC). */
 #undef HAVE_LIBFLAC
 
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
 /* Define to 1 if you have the `mad' library (-lmad). */
 #undef HAVE_LIBMAD
 
@@ -48,7 +51,7 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
-/* Set to 1 if you have OSS. */
+/* Define to 1 if you have OSS. */
 #undef HAVE_OSS
 
 /* Set to 1 if you have libsamplerate. */