1

I have built SDL in a folder ~/project/extra/SDL/ and I'm trying to build SDL_image in ~project/extra/SDL_image. SDL is not installed, the project is statically linking to the ~/project/extra/SDL/build/.libs/*.a library.

How do I configure SDL_image to build with built version of SDL?

./configure --with-sdl-prefix=../SDL/build/.libs --with-sdl-exec-prefix=../SDL/build is not workin.

Justin808
  • 20,859
  • 46
  • 160
  • 265

1 Answers1

2

Lean on SDL's pkg-config tooling to help it find itself in the non-system location:

# install SDL2
cd /tmp/SDL2-2.0.10
./configure --prefix=/tmp/sdl-local
make install

# install SDL2_image
cd /tmp/SDL2_image-2.0.5/
PKG_CONFIG_PATH=/tmp/sdl-local/lib/pkgconfig ./configure --prefix=/tmp/sdl-local
make install
genpfault
  • 51,148
  • 11
  • 85
  • 139
  • I can’t install SDL. I just want to use the compiled lib from the peer directory. – Justin808 Aug 07 '19 at 22:01
  • Thanks, this answer worked for me. @Justin808 you probably have solved this or moved on, but the answer does not actually "install" SDL, but rather compiles and links it into a temporary location (/tmp/sdl-local) - you can then use the built files for further compilation/linking – jcdude Aug 25 '20 at 09:36