X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsox%2Fconfigure;h=9df730af6e8e259d65cef0820bc18cba7d7a68cd;hb=f4963a6aa07644399b273b5d2b1f9299c9047414;hp=5336c6906149c422f1f12479fe9c5186852b5cd8;hpb=79bca3394b546f7a0cc87d6ac3e1ef4e080956ab;p=melted diff --git a/src/modules/sox/configure b/src/modules/sox/configure index 5336c69..9df730a 100755 --- a/src/modules/sox/configure +++ b/src/modules/sox/configure @@ -8,34 +8,36 @@ then Darwin) LDD="otool -L" ;; - Linux) + Linux|FreeBSD) LDD="ldd" ;; *) ;; esac - which libst-config > /dev/null 2>&1 + pkg-config sox 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) $libsndfile $libsamplerate" >> config.mak + echo "CFLAGS += $(pkg-config --cflags sox) -I$(pkg-config --variable=prefix sox)" > config.mak + echo "LDFLAGS += $(pkg-config --libs sox)" >> config.mak + [ $(pkg-config --modversion sox | cut -d. -f1) -gt 13 ] && echo "CFLAGS += -DSOX14" >> config.mak else - pkg-config sox + which libst-config > /dev/null 2>&1 if [ $? -eq 0 ] then - echo "CFLAGS += $(pkg-config --cflags sox)" > config.mak - echo "LDFLAGS += $(pkg-config --libs sox)" > config.mak + 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) $libsndfile $libsamplerate" >> config.mak else sox --version 2> /dev/null | grep 'v14.' > /dev/null disable_sox=$? @@ -62,8 +64,12 @@ then $LDD "$sox" | grep libsamplerate > /dev/null [ $? -eq 0 ] && libsamplerate="-lsamplerate" + # determine if we need libsfx + $LDD $(which sox) | grep libsfx > /dev/null + [ $? -eq 0 ] && libsfx="-lsfx" + echo "CFLAGS += -DSOX14 -I$soxdir/include" > config.mak - echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox -lsfx $libsamplerate" >> config.mak + echo "LDFLAGS += -L$soxdir/$LIBDIR -lsox $libsfx $libsamplerate" >> config.mak fi fi fi