xgettext(1) on Solnix vs Linux and the BSDs

On a default Solnix system, /usr/bin/xgettext is the small illumos xgettext, which takes only -n -s -a -x -c -d -j -m -M -p -h. The published Solnix page (pkgs.solnix.gettext) describes GNU gettext xgettext 0.22.5, the same program family as on Linux and NetBSD. A script that uses GNU long options such as -o or -L fails on the default binary.

What Solnix runs

The published page comes from pkgs.solnix.gettext (GNU gettext-tools 0.22.5), but the xgettext on PATH is the illumos one at /usr/bin/xgettext. No other illumos variants are shipped. To get the GNU options, install pkgs.solnix.gettext. The bundle does not say where that package installs its binary or whether it comes earlier on PATH. The illumos page covers C source only and documents no long options.

Differences

Compared withTopicWhat differs
Linux, NetBSDdefault binary is not GNUThe Solnix default xgettext is the illumos tool, with a synopsis of -ns, -a, -x, -c, -d, -j, -m, -M, -p and -h. Linux and NetBSD ship the GNU tool, whose synopsis is `xgettext [OPTION] [INPUTFILE]...` with many long options.
Source: Solnix default illumos xgettext(1) SYNOPSIS; Linux xgettext(1) SYNOPSIS; NetBSD xgettext(1) SYNOPSIS
Linux, NetBSD-o and --output missingThe illumos xgettext has no -o. Output goes to messages.po, or to the name chosen with -d, in the current directory or in the -p directory. GNU xgettext on Linux and NetBSD has -o FILE, and `-o -` writes to standard output.
Source: Solnix default illumos xgettext(1) OPTIONS -d, -p; Linux xgettext(1) -o; NetBSD xgettext(1) -o
Linux, NetBSD-p meaning and existing .po fileillumos -p pathname names the output directory, and GNU -p DIR does the same. The illumos page says an existing .po file is overwritten unless -j is given. The GNU pages say nothing about this.
Source: Solnix default illumos xgettext(1) DESCRIPTION, -p, -j; Linux xgettext(1) -p; NetBSD xgettext(1) -p
Linux, NetBSD-s sort behaviourOn illumos, -s sorts by msgid and removes all duplicate msgids. On GNU, -s (--sort-output) only sorts, and Linux marks it deprecated. The illumos page writes duplicate msgids as comment lines when -s is not used. The GNU pages do not describe this.
Source: Solnix default illumos xgettext(1) DESCRIPTION, -s; Linux xgettext(1) -s; NetBSD xgettext(1) -s
Linux, NetBSD-n is the opposite of the GNU defaultillumos -n adds file and line comments in the form `# # File: filename, line: line-number`. In GNU xgettext, -n (--add-location) is already the default and produces `#: filename:line` lines. A GNU script that expects `#:` references gets a different format from the illumos tool.
Source: Solnix default illumos xgettext(1) -n; Linux xgettext(1) -n, --no-location; NetBSD xgettext(1) -n
Linux, NetBSD-x requires -aOn illumos, -x exclude-file can only be used together with -a. The GNU pages place no such condition on -x.
Source: Solnix default illumos xgettext(1) -x; Linux xgettext(1) -x; NetBSD xgettext(1) -x
Linux, NetBSD-m and -M argument syntaxillumos -m prefix and -M suffix take a separate argument, and the page says to give an empty string to make msgstr equal msgid. GNU -m[STRING] and -M[STRING] have an optional argument that is attached to the option, and Linux also has --msgstr-prefix and --msgstr-suffix.
Source: Solnix default illumos xgettext(1) -m, -M; Linux xgettext(1) -m, -M; NetBSD xgettext(1) -m, -M
Linux, NetBSD-c without a tagillumos -c requires a comment-tag argument. GNU xgettext accepts -c with no tag, which places all comment blocks that precede keyword lines in the output. NetBSD writes this as -c[=TAG].
Source: Solnix default illumos xgettext(1) -c; Linux xgettext(1) -c; NetBSD xgettext(1) -c
Linux, NetBSDlanguage and input handlingillumos xgettext handles ANSI C source and takes filenames or `-` for standard input. It has no -L, -f, -D or --from-code. GNU xgettext guesses the language from the file extension and can be told with -L. Default input encoding is ASCII, changed with --from-code.
Source: Solnix default illumos xgettext(1) NAME, DESCRIPTION; Linux xgettext(1) -L, -f, -D, --from-code; NetBSD xgettext(1) -L, --from-code
NetBSDpublished GNU page has more options than NetBSDThe published Solnix GNU page (0.22.5) lists options that the NetBSD page (GNU 0.16.1) does not: --check, --sentence-end, --its, --kde, --itstool, --color, --style, --package-name and --package-version. It also lists JavaScript, Vala, Lua, RSJ and Desktop as -L languages.
Source: Solnix xgettext(1) Operation mode, Output details, -L; NetBSD xgettext(1) same sections
LinuxGNU page versus Linux pageThe published GNU page (0.22.5) and the Linux page (gettext-1.0) are the same program family. The Linux page adds --no-check, --no-git, --generated, --reference and --tag, and its -L list includes TypeScript, TSX, Rust, Go, Modula-2, D, OCaml, Guile and GSettings.
Source: Linux xgettext(1) --no-check, --no-git, --generated, --reference, --tag, -L; Solnix xgettext(1) Operation mode, Output details
Linux, NetBSD-T and -s statusThe Linux page marks -T (trigraphs) and -s (sort-output) as deprecated. The published Solnix GNU page marks -s as deprecated but not -T. The NetBSD page marks neither. The illumos page documents neither -T nor any deprecation.
Source: Linux xgettext(1) -T, -s; Solnix xgettext(1) -T, -s; NetBSD xgettext(1) -T, -s

Standards

  • POSIX: xgettext is a POSIX.1-2024 utility according to the bundle header. None of the xgettext pages in the bundle states a standard.
  • Solnix: The illumos xgettext(1) SEE ALSO points to attributes(7), but the bundle text shows no interface stability entry.

Writing portable scripts

  • Use only -n, -s, -a, -x, -c, -d, -j, -m, -M and -p if the script must also run on the default illumos xgettext, and pass C source files only. Do not rely on -o, -L, -f or any long option.
  • Do not parse the location comments. The illumos -n form `# # File: filename, line: line-number` differs from the GNU `#: filename:line` form. To get the GNU form on Solnix, install pkgs.solnix.gettext.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.