Skip to content

Commit

Permalink
build: simplify lpc10 library selection
Browse files Browse the repository at this point in the history
  • Loading branch information
mansr committed Sep 5, 2020
1 parent a9bfd57 commit f6cb823
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,12 @@ AC_CHECK_HEADERS(lpc10.h, ,
[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)



Expand Down
2 changes: 1 addition & 1 deletion lpc10/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
2 changes: 0 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ libsox_la_SOURCES += raw-fmt.c s1-fmt.c s2-fmt.c s3-fmt.c \
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
Expand Down
4 changes: 0 additions & 4 deletions src/lpc10.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

#include "sox_i.h"

#ifdef EXTERNAL_LPC10
#include <lpc10.h>
#else
#include "../lpc10/lpc10.h"
#endif

/* Private data */
typedef struct {
Expand Down
2 changes: 2 additions & 0 deletions src/optional-fmts.am
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ endif
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
libsox_la_LIBADD += @LPC10_LIBS@
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
Expand Down

0 comments on commit f6cb823

Please sign in to comment.