Sophie

Sophie

distrib > Mandriva > mes5 > x86_64 > by-pkgid > 1323014b74e2c1977fa77fbe4093f7f1 > files > 1

sox-14.1.0-1mdv2009.0.src.rpm

diff -Naur sox-14.1.0/configure.ac sox-14.1.0.oden/configure.ac
--- sox-14.1.0/configure.ac	2008-07-21 05:42:24.000000000 +0200
+++ sox-14.1.0.oden/configure.ac	2008-08-05 13:35:14.000000000 +0200
@@ -213,6 +213,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],
@@ -481,6 +494,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
@@ -497,6 +516,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"
diff -Naur sox-14.1.0/lpc10/Makefile.am sox-14.1.0.oden/lpc10/Makefile.am
--- sox-14.1.0/lpc10/Makefile.am	2008-01-08 04:36:41.000000000 +0100
+++ sox-14.1.0.oden/lpc10/Makefile.am	2008-08-05 13:16:43.000000000 +0200
@@ -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 \
@@ -7,3 +14,4 @@
   prepro.c random.c rcchk.c synths.c tbdm.c voicin.c vparms.c
 AM_CPPFLAGS=-I../src
 EXTRA_DIST = CMakeLists.txt
+endif
diff -Naur sox-14.1.0/src/lpc10.c sox-14.1.0.oden/src/lpc10.c
--- sox-14.1.0/src/lpc10.c	2008-06-26 20:24:40.000000000 +0200
+++ sox-14.1.0.oden/src/lpc10.c	2008-08-05 13:20:50.000000000 +0200
@@ -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 {
diff -Naur sox-14.1.0/src/Makefile.am sox-14.1.0.oden/src/Makefile.am
--- sox-14.1.0/src/Makefile.am	2008-07-24 02:53:05.000000000 +0200
+++ sox-14.1.0.oden/src/Makefile.am	2008-08-05 13:23:54.000000000 +0200
@@ -108,7 +108,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
@@ -264,10 +264,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
diff -Naur sox-14.1.0/src/soxconfig.h.in sox-14.1.0.oden/src/soxconfig.h.in
--- sox-14.1.0/src/soxconfig.h.in	2008-07-21 05:53:03.000000000 +0200
+++ sox-14.1.0.oden/src/soxconfig.h.in	2008-08-05 13:24:26.000000000 +0200
@@ -3,6 +3,9 @@
 /* Define if you are using an external GSM library */
 #undef EXTERNAL_GSM
 
+/* Define if you are using an external LPC10 library */
+#undef EXTERNAL_LPC10
+
 /* Define to 1 if you have ALSA. */
 #undef HAVE_ALSA
 
@@ -48,6 +51,9 @@
 /* Define to 1 if you have the <gsm.h> header file. */
 #undef HAVE_GSM_H
 
+/* Define to 1 if you have the <lpc10.h> header file. */
+#undef HAVE_LPC10_H
+
 /* Define to 1 if you have id3tag. */
 #undef HAVE_ID3TAG