]> git.sesse.net Git - mlt/commitdiff
sox/configure, Makefile: try to make sox build smarter about library dependencies...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 4 Mar 2008 08:02:41 +0000 (08:02 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 4 Mar 2008 08:02:41 +0000 (08:02 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1093 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/sox/Makefile
src/modules/sox/configure

index a64fc749ada1395f0946f99866cd3f9b4619d36a..a02e0ec5f59be75194f65b6e730b0adfd224210c 100644 (file)
@@ -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)
 
index c29d40a1762d2a8eec829f18bc3b08b068276b64..104e874b15e33960f656892e0c24c9a5928d5dd3 100755 (executable)
@@ -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