Skip to content

Instantly share code, notes, and snippets.

@matthiasr
Created December 29, 2011 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthiasr/1534351 to your computer and use it in GitHub Desktop.
Save matthiasr/1534351 to your computer and use it in GitHub Desktop.
pkgsrc patch for libaudiofile not checking for libm
commit 4ed7ddf1e3a30f65f8b5d4a63bcffe8317c42b10
Author: Matthias Rampke <matthias@rampke.de>
Date: Thu Dec 29 14:41:31 2011 +0100
audio/libaudiofile: add configure check for libm
diff --git a/audio/libaudiofile/distinfo b/audio/libaudiofile/distinfo
index e19de6b..86c54e0 100644
--- a/audio/libaudiofile/distinfo
+++ b/audio/libaudiofile/distinfo
@@ -3,4 +3,5 @@ $NetBSD: distinfo,v 1.18 2011/11/30 20:52:46 wiz Exp $
SHA1 (audiofile-0.3.2.tar.gz) = fb55a3c9153475daa8932d3626797e033d149c1d
RMD160 (audiofile-0.3.2.tar.gz) = b55598dd1d5a960599b485c966ef39dda2384c40
Size (audiofile-0.3.2.tar.gz) = 722101 bytes
-SHA1 (patch-configure) = 4e45468433bd0ee11b907ad117938f24b6a2b798
+SHA1 (patch-configure) = 947b6bd6981685ba6aaf978c23c898824c7fe117
+SHA1 (patch-configure.ac) = 50051941f2b7096af0e432f7252c56cda29a430e
diff --git a/audio/libaudiofile/patches/patch-configure b/audio/libaudiofile/patches/patch-configure
index 9fcd663..63f2f2d 100644
--- a/audio/libaudiofile/patches/patch-configure
+++ b/audio/libaudiofile/patches/patch-configure
@@ -3,9 +3,63 @@ $NetBSD: patch-configure,v 1.3 2011/11/30 20:52:46 wiz Exp $
Fix unportable test(1) construct.
Accepted by upstream, will be in next release.
---- configure.orig 2011-11-29 18:15:23.000000000 +0000
+Check for libm so it is included if need be.
+
+--- configure.orig 2011-12-29 13:09:11.633992000 +0000
+++ configure
-@@ -15246,7 +15246,7 @@ else
+@@ -14689,6 +14689,51 @@ fi
+
+ done
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
++$as_echo_n "checking for sqrt in -lm... " >&6; }
++if ${ac_cv_lib_m_sqrt+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lm $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* 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 sqrt ();
++int
++main ()
++{
++return sqrt ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_m_sqrt=yes
++else
++ ac_cv_lib_m_sqrt=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
++$as_echo "$ac_cv_lib_m_sqrt" >&6; }
++if test "x$ac_cv_lib_m_sqrt" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBM 1
++_ACEOF
++
++ LIBS="-lm $LIBS"
++
++fi
++
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+ $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+@@ -15246,7 +15291,7 @@ else
enable_werror=no
fi
@@ -14,7 +68,7 @@ Accepted by upstream, will be in next release.
ENABLE_WERROR_TRUE=
ENABLE_WERROR_FALSE='#'
else
-@@ -15255,7 +15255,7 @@ else
+@@ -15255,7 +15300,7 @@ else
fi
@@ -23,7 +77,7 @@ Accepted by upstream, will be in next release.
WERROR_CFLAGS="-Werror"
fi
-@@ -15267,7 +15267,7 @@ else
+@@ -15267,7 +15312,7 @@ else
enable_coverage=no
fi
@@ -32,7 +86,7 @@ Accepted by upstream, will be in next release.
ENABLE_COVERAGE_TRUE=
ENABLE_COVERAGE_FALSE='#'
else
-@@ -15276,7 +15276,7 @@ else
+@@ -15276,7 +15321,7 @@ else
fi
@@ -41,7 +95,7 @@ Accepted by upstream, will be in next release.
COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
COVERAGE_LIBS="-lgcov"
-@@ -15380,7 +15380,7 @@ else
+@@ -15380,7 +15425,7 @@ else
enable_valgrind=no
fi
@@ -50,7 +104,7 @@ Accepted by upstream, will be in next release.
ENABLE_VALGRIND_TRUE=
ENABLE_VALGRIND_FALSE='#'
else
-@@ -15389,7 +15389,7 @@ else
+@@ -15389,7 +15434,7 @@ else
fi
diff --git a/audio/libaudiofile/patches/patch-configure.ac b/audio/libaudiofile/patches/patch-configure.ac
new file mode 100644
index 0000000..d313bd0
--- /dev/null
+++ b/audio/libaudiofile/patches/patch-configure.ac
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Check for libm so it is included if need be.
+
+--- configure.ac.orig 2011-11-29 06:55:00.000000000 +0000
++++ configure.ac
+@@ -22,6 +22,9 @@ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(fcntl.h unistd.h)
+
++dnl Checks for libraries
++AC_CHECK_LIB([m],[sqrt])
++
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ AC_C_BIGENDIAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment