From 736ae61850659efb5b6e469ea4638d073bf64732 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Tue, 4 Mar 2008 08:02:41 +0000 Subject: [PATCH] sox/configure, Makefile: try to make sox build smarter about library dependencies (pending Darwin compatibilty) git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1093 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/sox/Makefile | 2 -- src/modules/sox/configure | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/modules/sox/Makefile b/src/modules/sox/Makefile index a64fc74..a02e0ec 100644 --- a/src/modules/sox/Makefile +++ b/src/modules/sox/Makefile @@ -9,8 +9,6 @@ OBJS = factory.o \ CFLAGS += -I../../ LDFLAGS += -L../../framework -lmlt -# NOTE: Ubuntu may require -lsamplerate -lsndfile as well -# since they are not in libst-config --libs SRCS := $(OBJS:.o=.c) diff --git a/src/modules/sox/configure b/src/modules/sox/configure index c29d40a..104e874 100755 --- a/src/modules/sox/configure +++ b/src/modules/sox/configure @@ -7,8 +7,17 @@ then if [ $? -eq 0 ] then disable_sox=0 + + # determine if we need libsndfile + ldd $(which sox) | grep libsndfile > /dev/null + [ $? -eq 0 ] && libsndfile="-lsndfile" + + # determine if we need libsamplerate + ldd $(which sox) | grep libsamplerate > /dev/null + [ $? -eq 0 ] && libsamplerate="-lsamplerate" + echo "CFLAGS += $(libst-config --cflags) -I../../" > config.mak - echo "LDFLAGS += -lst $(libst-config --libs)" >> config.mak + echo "LDFLAGS += -lst $(libst-config --libs) $libsndfile $libsamplerate" >> config.mak else sox --version 2> /dev/null | grep 'v14.' > /dev/null disable_sox=$? @@ -30,8 +39,13 @@ then soxdir=$(dirname $sox) # chop bin soxdir=$(dirname $soxdir) + + # determine if we need libsamplerate + ldd "$sox" | grep libsamplerate > /dev/null + [ $? -eq 0 ] && libsamplerate="-lsamplerate" + echo "CFLAGS += -DSOX14 -I$soxdir/include" > config.mak - echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox -lsfx" >> config.mak + echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox -lsfx $libsamplerate" >> config.mak fi fi -- 1.7.4.4