SHTOOL-ARX.TMP(1)
β¨ shtool-arx β¨
okay bestie, gather round, because this is the GNU shtool version of the ar(1) command β the extensional one, the glow-up edition π
πΈ NAME πΈ
shtool-arx β the GNU shtool ar(1) extensional command, no cap π«Ά
π¦ SYNOPSIS π¦
shtool arx [-t|--trace] [-C|--command cmd] op archive file [file ...]
π DESCRIPTION π
So shtool arx is literally just a wrapper around the archiving tool ar(1) β but she's got range. The way she ate is that she can build archives out of existing archives. Like, if one of the file arguments matches "*.a", then the archive member files inside that file get used instead of file itself. Iconic behavior, honestly. β¨
The whole trick of this command is the automatic handling of archive members, and it's highkey the moment if you wanna construct a (usually top-level) library archive out of pre-built sub-library archives (usually staying inside subdirs) in a large source tree. Very main character. π
And for GNU libtool based projects β surprise β a similar functionality is provided by GNU libtool internally too. So she's not the only one doing it, but she IS the one doing it right here. periodt. π
π OPTIONS π
The following command line options are available. Slay, there's two.
-t,--traceβ shows the actually involved shell commands. Basically she narrates her own drama so you can see exactly what she ran. π΅οΈββοΈ-C,--command cmdβ set the usedar(1)command tocmdinstead of just"ar"(which would be searched in$PATH). Pick your own fave ar, bestie. π«
π EXAMPLE π
Here's her in the wild, doing Makefile things:
# Makefile
AR=ar
RANLIB=ranlib
:
OBJS=foo.o bar.o
LIBS=baz/libbaz.a quux/libquux.a
:
libfoo.a: $(OBJS) $(LIBS)
shtool arx -C $(AR) rc libfoo.a $(OBJS) $(LIBS)
$(RANLIB) libfoo.a
See how LIBS is pointing at a bunch of sub-library archives? Yeah. She opens them up and folds their members right into libfoo.a. Chef's kiss. π€
π HISTORY π
The GNU shtool arx command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool. It was prompted by need to build libraries out of sub-libraries inside the OSSP project. A founding mother of build-system drama, we love her. πΈ
π SEE ALSO π
ngl if you're out here linking pre-built .a files by hand, you're doing it the hard way. let her cook. π
okay that's the whole page, mwah π this was brought to you by shtool 2.0.8, dated 18-Jul-2008 β yes she's vintage, yes she still slays, we stan a legacy queen πβ¨π«Ά
π¦ 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