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 - Can't use libsamplerate statically (tested on automake)
Summary: Can't use libsamplerate statically (tested on automake)
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-30 21:14 UTC by Vitaly Novichkov
Modified: 2017-01-30 21:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)