We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3574

Summary: Can't use libsamplerate statically (tested on automake)
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: admin
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   

Description Vitaly Novichkov 2017-01-30 21:14:41 UTC
Just wanted to review how libresample works, but I'v got failed to build SDL and use libsamplerate statically:

I have been built libsamplerate (downloaded from here http://www.mega-nerd.com/SRC/) and built it statically (with the --enable-static=yes --enable-shared=no configure flags)

However, SDL's configure can't detect header and don't wanna use it.

Configure arguments of SDL:

./configure \
   --prefix=/home/me/project/_Libs/_build/linux \
   --includedir=/home/me/project/_Libs/_build/linux/include \
   --libdir=/home/me/project/_Libs/_build/linux/lib \
   --enable-libsamplerate=yes --disable-libsamplerate-shared

In the referred include path is the samplerate.h file.
In the referred library path is the libsamplerate.a, libsamplerate.la and pkgconfig/samplerate.pc.

libsamplerate itself built with next arguments:
./configure \
   --prefix=/home/me/project/_Libs/_build/linux \
   --includedir=/home/me/project/_Libs/_build/linux/include \
   --libdir=/home/me/project/_Libs/_build/linux/lib \
   CFLAGS=-fPIC CXXFLAGS=-fPIC --enable-static=yes --enable-shared=no

In result:
...
checking audio/audiolib.h usability... no
checking audio/audiolib.h presence... no
checking for audio/audiolib.h... no
...
and then:
Using libsamplerate : NO
Comment 1 Vitaly Novichkov 2017-01-30 21:43:23 UTC
Okay, adding next global variables are fixing trouble:

export CFLAGS='-I/home/me/project/_Libs/_build/linux/include'
export LDFLAGS='-L/home/me/project/_Libs/_build/linux/lib'

and SDL has been successfully linked with static build of libsamplerate (which installed into the custom prefix)