sdl-config(1)

πŸ“¦ version 1.2.15, in debian bookworm, ubuntu jammy

✨ sdl-config β€” bestie edition ✨

okay so you know that one little script that tells you literally everything about your installed SDL? yeah. that's this. it's a General Commands Manual page, and it lives at sdl-config(1), so you can pull it up whenever with man 1 sdl-config. 🫢


🌸 NAME 🌸

sdl-config β€” it's a script, and its whole job is handing you the tea about the installed version of SDL πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

sdl-config [--prefix=[DIR]] [--exec-prefix=[DIR]] [--version] [--cflags]
[--libs] [--static-libs]

that's the whole vibe check right there ✨


πŸŽ€ DESCRIPTION πŸŽ€

so sdl-config is the tool you use to configure stuff and figure out the compiler and linker flags you should be using to compile and link programs, libraries, and plugins that use SDL. no cap.

it's also used internally by the m4 macros that ship with SDL, so it's lowkey the backbone of the whole operation. iconic behavior honestly πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • --cflags β€” prints the compiler flags you need to compile a program or library that uses SDL. your gcc's new best friend fr fr.
  • --exec-prefix[=DIR] β€” okay so, if DIR is not specified, it prints the exec prefix of the current SDL installation.

if DIR is specified, it uses that instead of the installation exec prefix that SDL was built with when it computes the output for the --cflags, --libs and --static-libs options.

⚠️ bestie listen β€” this option MUST be specified before any of --cflags, --libs and --static-libs. order matters, okay? 😭
  • --libs β€” prints the linker flags you need to link a program that uses SDL. chef's kiss πŸ“
  • --static-libs β€” prints the linker flags you need to statically link a program that uses SDL. different energy, same icon status.
  • --prefix[=DIR] β€” if DIR is not specified, it prints the prefix of the current SDL installation.

if DIR is specified, it uses that instead of the installation prefix that SDL was built with when computing the output for the --cflags, --libs and --static-libs options. it's also used for the exec prefix if --exec-prefix was not specified.

⚠️ again, and I cannot stress this enough β€” this option MUST come before any of --cflags, --libs and --static-libs. periodt. πŸ’…
  • --version β€” prints the currently installed version of SDL on standard output. short, sweet, slay.

🌈 EXAMPLES 🌈

  • compile a C source file into an executable program, like so:
gcc -o main.o $(sdl-config --cflags) main.c
  • link compiled objects into an executable program, like so:
gcc -o my_app $(sdl-config --libs) main.o util.o

see? the command substitution is doing the heavy lifting and we are just vibing 🧚


πŸ‘‘ AUTHOR πŸ‘‘

the Simple DirectMedia Layer (SDL) library was written by Sam Lantinga. 🫢

this manual page was written by Branden Robinson, originally for Progeny Linux Systems, Inc., and the Debian Project. Updated in 2013 by Manuel A. Fernandez Montecelo <mafm@debian.org>.


and that's the whole page bestie πŸ’œ this was SDL 1.2, dated 2013-07-27 β€” go forth and link things, you're gonna eat πŸ”₯πŸ‘‘

πŸ“¦ where this page comes from