shithub: sox

Download patch

ref: a3dd8e27f4bb5d6fbd6620e1e76520830c15b474
parent: a61d9e4ff440d04922fa42de23a01a91c0445d6d
author: robs <robs>
date: Wed Aug 6 03:35:53 EDT 2008

Apply [ 2038855 ] external lpc10 lib patch

--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,22 @@
 sox-14.1.1	2008-TBD
 ----------
 
+Previously deprecated features (to be removed in future):
+
+  Deprec-  Feature    [O(ption)]                           Removal
+  ated in  [F(ormat)] [E(ffect)]   Replacement             due after
+  -------  ----------------------  ----------------------  -------
+  14.0.0   E stretch               ~= tempo                2008-09-11
+  14.0.0   E pitch                 ~= key                  2008-09-11
+  14.1.0   F flac: libFLAC 1.1.1   libFLAC > 1.1.1         2009-01-29
+  14.1.0   F wve (native)          wve (libsndfile)        2009-07-29
+  14.1.0   E resample              ~= rate                 2009-07-29
+  14.1.0   E polyphase             ~= rate                 2009-07-29
+  14.1.0   E rabbit                ~= rate                 2009-07-29
+  14.1.0   Behaviour whereby       soxi                    2009-07-29
+           sox -V file(s) -n
+           doesn't read to EOF.
+
 Other bug fixes:
 
   o Bump library version because it was not binary compatible with
@@ -13,10 +29,12 @@
     SoX 14.0.1 (Pascal Giard)
   o Turn off versioning of special libsox_fmt* libraries since thats
     not really needed.  (kwizart)
-  o Fixed crash when running play with no arguements. (Dan Nelson)
+  o Fixed crash when running play with no arguments. (Dan Nelson)
   o Allow libpng to be found with -static option. (cbagwell)
   o Allow libsamplerate to be found if pkg-config is installed but
     no samplerate.pc exists. (cbagwell)
+  o [2038855] external lpc10 lib patch.  (Oden Eriksson, Mandriva)
+
 
 sox-14.1.0	2008-7-29
 ----------
--- a/configure.ac
+++ b/configure.ac
@@ -234,6 +234,19 @@
 AC_SUBST(GSM_LIBS)
 AM_CONDITIONAL(EXTERNAL_GSM, test x$found_libgsm = xyes)
 
+dnl Check for liblpc10
+AC_CHECK_HEADERS(lpc10.h, found_liblpc10=yes,
+    [AC_CHECK_HEADERS(lpc10.h, found_liblpc10=yes)])
+if test "$found_liblpc10" = yes; then
+    AC_CHECK_LIB(lpc10, create_lpc10_encoder_state, LPC10_LIBS="$LPC10_LIBS -llpc10")
+    AC_DEFINE(EXTERNAL_LPC10, 1, [Define if you are using an external LPC10 library])
+else
+    LIBLPC10_LIBADD=../lpc10/liblpc10.la
+fi
+AC_SUBST(LIBLPC10_LIBADD)
+AC_SUBST(LPC10_LIBS)
+AM_CONDITIONAL(EXTERNAL_LPC10, test x$found_liblpc10 = xyes)
+
 dnl Check for libsndfile
 AC_ARG_WITH(sndfile,
     AC_HELP_STRING([--without-sndfile],
@@ -502,6 +515,12 @@
    gsm_option="in-tree"
 fi
 
+if test "$found_liblpc10" = "yes"; then
+   lpc10_option="external"
+else
+   lpc10_option="in-tree"
+fi
+
 if test "$using_pkgconfig" = "no"; then
     pkgconfig_option="disabled"
 else
@@ -518,6 +537,7 @@
 echo "SUN audio driver.................. $enable_sun_audio"
 echo "play and rec symlinks............. $enable_playrec_symlinks"
 echo "libgsm............................ $gsm_option"
+echo "liblpc10.......................... $lpc10_option"
 echo "libsndfile formats................ $using_sndfile"
 echo "Ogg Vorbis format................. $using_ogg"
 echo "FLAC format....................... $using_flac"
--- a/lpc10/Makefile.am
+++ b/lpc10/Makefile.am
@@ -1,3 +1,10 @@
+if EXTERNAL_LPC10
+EXTRA_DIST = analys.c bsynz.c chanwr.c dcbias.c \
+  decode.c deemp.c difmag.c dyptrk.c encode.c energy.c f2c.h f2clib.c \
+  ham84.c hp100.c invert.c irc2pc.c ivfilt.c lpcdec.c lpcenc.c lpcini.c \
+  lpfilt.c median.c mload.c onset.c pitsyn.c placea.c placev.c preemp.c \
+  prepro.c random.c rcchk.c synths.c tbdm.c voicin.c vparms.c lpc10.h CMakeLists.txt
+else
 noinst_LTLIBRARIES = liblpc10.la
 noinst_HEADERS = lpc10.h
 liblpc10_la_SOURCES = analys.c bsynz.c chanwr.c dcbias.c \
@@ -10,3 +17,4 @@
 AM_LDFLAGS=-avoid-version -module
 endif
 EXTRA_DIST = CMakeLists.txt
+endif
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -117,7 +117,7 @@
 libsox_fmt_htk_la_SOURCES = htk.c
 libsox_fmt_htk_la_LIBADD = libsox.la
 libsox_fmt_lpc10_la_SOURCES = lpc10.c
-libsox_fmt_lpc10_la_LIBADD = ../lpc10/liblpc10.la libsox.la
+libsox_fmt_lpc10_la_LIBADD = libsox.la @LPC10_LIBS@ @LIBLPC10_LIBADD@
 libsox_fmt_maud_la_SOURCES = maud.c
 libsox_fmt_maud_la_LIBADD = libsox.la
 libsox_fmt_prc_la_SOURCES = prc.c
@@ -288,10 +288,10 @@
     sounder.c soundtool.c sphere.c tx16w.c voc.c vox-fmt.c ima-fmt.c adpcm.c adpcm.h \
     ima_rw.c ima_rw.h wav.c wve.c xa.c nulfile.c f4-fmt.c f8-fmt.c
 libsox_la_LIBADD = @GSM_LIBS@ @LIBGSM_LIBADD@
-libsox_la_LIBADD += ../lpc10/liblpc10.la
+libsox_la_LIBADD += @LPC10_LIBS@ @LIBLPC10_LIBADD@
 
 sox_LDADD += @GSM_LIBS@ @LIBGSM_LIBADD@
-sox_LDADD += ../lpc10/liblpc10.la
+sox_LDADD += @LPC10_LIBS@ @LIBLPC10_LIBADD@
 
 if HAVE_FLAC
     libsox_la_SOURCES += flac.c
--- a/src/lpc10.c
+++ b/src/lpc10.c
@@ -18,7 +18,16 @@
  */
 
 #include "sox_i.h"
+
+#ifdef EXTERNAL_LPC10
+
+#ifdef HAVE_LPC10_H
+#include <lpc10.h>
+#endif
+
+#else
 #include "../lpc10/lpc10.h"
+#endif
 
 /* Private data */
 typedef struct {