There are standard development tools available for this.
You need the development sdl2 package installed though.
```
pkgman install libsdl2 libsdl2_devel
```
now, libsdl2 shows up in the standard pkg-config...
```
$ pkg-config sdl2 --libs
-L/packages/libsdl2-2.0.20-3/.self/develop/lib -lSDL2
```
And static...
```
$ pkg-config sdl2 --libs --static
-L/packages/libsdl2-2.0.20-3/.self/develop/lib -lSDL2 -ltextencoding -ldevice -lgame -lmedia -lbe -lroot -lGL -lm -Wl,--no-undefined -lSDL2
```
You can even make an operating system package with SDL2 dependencies:
```
cd ~
ls mcpixel3_haiku_x64 # bin gfx scr etc
cat .PackageInfo
name mcpixel3
version 1.7-1 (whatever)
architecture x86_64
summary "save the world"
description "saving the world, one McPixel at a time"
vendor "Devolver Digital"
packager "staff@devolverdigital.com"
copyrights {"(C) 2012-2023 Devolver Digital"}
licenses {"Closed"}
provides {
cmd:mcpixel
}
requires {
haiku >= r1beta4
lib:libSDL2
}
package create -b -I /boot/system/apps/McPixel McPixel.hpkg
package add -C mcpixel3_haiku_x64 McPixel.hpkg *
```