ref: f6cb823170d75133d29d25f8119ba44405832859
parent: a9bfd57f807d18ad4a35b5a9a8fd3efaee4759a8
author: Mans Rullgard <mans@mansr.com>
date: Fri Aug 14 12:12:28 EDT 2020
build: simplify lpc10 library selection
--- a/configure.ac
+++ b/configure.ac
@@ -416,12 +416,12 @@
[AC_CHECK_HEADERS(lpc10.h, ,found_liblpc10=no)])
AC_CHECK_LIB(lpc10, create_lpc10_encoder_state, LPC10_LIBS="$LPC10_LIBS -llpc10", found_liblpc10=no)
if test "$found_liblpc10" = yes; then
- AC_DEFINE(EXTERNAL_LPC10, 1, [Define if you are using an external LPC10 library])
+ AC_DEFINE(HAVE_LIBLPC10, 1, [Define if you are using an external liblpc10])
else
- LIBLPC10_LIBADD=../lpc10/liblpc10.la
+ LPC10_CFLAGS='-I${top_srcdir}/lpc10'
+ LPC10_LIBS=../lpc10/liblpc10.la
fi
-AM_CONDITIONAL(EXTERNAL_LPC10, test x$found_liblpc10 = xyes)
-AC_SUBST(LIBLPC10_LIBADD)
+AM_CONDITIONAL(HAVE_LIBLPC10, test x$found_liblpc10 = xyes)
--- a/lpc10/Makefile.am
+++ b/lpc10/Makefile.am
@@ -1,4 +1,4 @@
-if EXTERNAL_LPC10
+if HAVE_LIBLPC10
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 \
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -113,8 +113,6 @@
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 gsrt.c
-libsox_la_LIBADD += @LPC10_LIBS@ @LIBLPC10_LIBADD@
-
pkglib_LTLIBRARIES =
include optional-fmts.am
--- a/src/lpc10.c
+++ b/src/lpc10.c
@@ -19,11 +19,7 @@
#include "sox_i.h"
-#ifdef EXTERNAL_LPC10
#include <lpc10.h>
-#else
-#include "../lpc10/lpc10.h"
-#endif
/* Private data */
typedef struct {
--- a/src/optional-fmts.am
+++ b/src/optional-fmts.am
@@ -108,6 +108,7 @@
if HAVE_LPC10
if STATIC_LPC10
libsox_la_SOURCES += lpc10.c
+ libsox_la_CFLAGS += @LPC10_CFLAGS@
if STATIC_LIBSOX_ONLY
sox_LDADD += @LPC10_LIBS@
else
@@ -115,6 +116,7 @@
endif
else
libsox_fmt_lpc10_la_SOURCES = lpc10.c
+ libsox_fmt_lpc10_la_CFLAGS = @LPC10_CFLAGS@
libsox_fmt_lpc10_la_LIBADD = libsox.la @LPC10_LIBS@
pkglib_LTLIBRARIES += libsox_fmt_lpc10.la
endif