SHTOOL-SLO.TMP(1)
π
SHTOOL-SLO.TMP(1) β no wait, bestie, that's just the manual page name, the actual star of the show is shtool-slo
okay so. you opened the manual for shtool-slo and the header is yelling SHTOOL-SLO.TMP(1) at you and the vibe is GNU Portable Shell Tool. ignore the shouty caps, that's just how man pages dress for the group chat. here's the tea π
β¨ NAME β¨
shtool-slo β GNU shtool separate linker options by library class π¦
like. it literally just sorts your linker flags by what kind of library they belong to. that's the whole job. and it EATS.
πΈ SYNOPSIS πΈ
shtool slo [-p|--prefix str] -- -Ldir -llib [-Ldir -llib ...]
yes bestie, that's the whole shape of it. -p or --prefix if you want a custom prefix, then a -- because arguments are messy, then as many -Ldir / -llib pairs as your little heart desires. π«Ά
π DESCRIPTION π
so what this command actually does: it separates the linker options -L and -l by library class. π«
and here's the iconic part β the argument line it's looking at can be an arbitrary command line, any command line at all, as long as those options are hiding somewhere inside it. slo parses only these two options and ignores literally everything else in there. it's giving selective attention, and honestly? valid.
the result is a trivial shell script printed on "stdout" which defines six variables containing the -L and -l options sorted by class:
"SLO_DIRS_OBJ"and"SLO_LIBS_OBJ"β these contain the-Land-loptions of static libraries"SLO_DIRS_PIC"and"SLO_LIBS_PIC"β these contain the-Land-loptions of static libraries containing PIC ("Position Independent Code")"SLO_DIRS_DSO"and"SLO_LIBS_DSO"β these contain the-Land-loptions of shared libraries
and the -p option? it lets you change the default variable prefix from ""SLO_"" to str. customise your slay. π
now, why would anyone want this separation, i hear you asking. the intent is to provide a way between static and shared libraries, which is important if one wants to link custom DSOs against libraries β because not all platforms allow one to link these DSOs against shared libraries. π so the move is: first separate out the shared libraries, then link the DSO only against the static libraries. and honestly you can also just use this command to plain sort the options, no big deal, it doesn't mind. π§
π OPTIONS π
the following command line options are available, bestie. here's the rundown:
-p,--prefixstr β FIXME
not me telling you the original manual literally just says FIXME here π that's it. that's the whole description. the docs said "figure it out" and dipped. i'm not gonna invent behaviour that isn't written down, so: FIXME it is. we respect the mystery. π
-Ldirβ Directory where libraries are searched in. π-llibβ Library to search for. π
π EXAMPLE π
here's the whole vibe in action, copy it exactly, don't freestyle:
# configure.in
LINK_STD="$LDFLAGS $LIBS"
eval `shtool slo $LINK_STD`
LINK_DSO="$SLO_DIRS_OBJ $SLO_LIBS_OBJ $SLO_DIRS_PIC $SLO_LIBS_PIC"
:
see how it evals the output and suddenly all six variables just exist? main character energy fr fr. β¨
π¦ HISTORY π¦
the GNU shtool slo command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for Apache. it was later taken over into GNU shtool. a glow-up arc, honestly. π
π SEE ALSO π
iykyk. go read those next, bestie. π«Ά
okay that's the whole page, you're welcome. and before you close the tab β this manual page is from shtool 2.0.8, dated 18-Jul-2008. yes she's a little vintage but she still serves. π periodt.
π¦ where this page comes from
- debian bookworm: shtool 2.0.8-10 Β· GPL-2.0-or-later
- debian trixie: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu jammy: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu noble: shtool 2.0.8-10 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms