The Motif package contains a user interface component toolkit and multiple accompanying tools.
byacc-20260126, libjpeg-turbo, libpng, libXp-1.0.4, xbitmaps, and Xorg Libraries
Apply a patch to fix various runtime and buildtime issues:
patch -Np1 -i ../motif-2.3.8-third_party_fixes-1.patch
Remove stray autogenerated files to ensure a successful build:
rm -rvf tools/wml/{wmllex,wmluiltok}.cRegenerate the configure scripts:
touch AUTHORS NEWS && autoreconf -fiv -I.
Set multiple environment variables to ensure a working build:
export OLDLANG=$LANG && export LANG=C && export LEX=flex && export YACC=byacc
Install Motif by running the following commands:
sed -i '1 i\%option main' tools/wml/wmluiltok.l &&
CFLAGS+=" -std=gnu17" \
CXXFLAGS+=" -std=gnu17" \
./configure --prefix=/usr \
--with-x \
--disable-static \
--enable-utf8 \
--enable-xft \
--enable-jpeg \
--enable-png \
--enable-motif22-compatibility &&
make
Now, as the root user:
make install && make -C demos install-data
Still as the root user, move the demos into the correct location:
rm -rvf /usr/share/doc/motif-2.3.8/demos && install -vdm755 /usr/share/doc/motif-2.3.8/demos && mv -v /usr/share/Xm/* /usr/share/doc/motif-2.3.8/demos && rmdir -v /usr/share/Xm
Still as the root user, install some auxiliary files:
install -vDm644 /dev/stdin /usr/share/X11/app-defaults/Mwm << "EOF"Mwm*fontList: variable Mwm*iconClick: False Mwm*iconPlacement: top left Mwm*moveOpaque: True Mwm*rootButtonClick: True Mwm*foreground: #000000 Mwm*background: #B8B8C0 Mwm*enableThinThickness: True Mwm*enableEtchedInMenu: True Mwm*menu*fontList: -adobe-helvetica-medium-r-*--*-120-*-*-*-*-*-* Mwm*client*title*fontList: -adobe-helvetica-bold-r-*--*-100-*-*-*-*-*-* Mwm*icon*fontList: -adobe-helvetica-bold-r-*--*-80-*-*-*-*-*-* Mwm*feedback*fontList: -adobe-helvetica-bold-r-*--*-100-*-*-*-*-*-* Mwm*multiClickTime: 300 Mwm*useIconBox: TrueEOF install -vDm644 /dev/stdin /usr/share/xsessions/mwm.desktop << "EOF"[Desktop Entry] Name=MWM Comment=The Motif Window Manager Exec=/usr/bin/mwm TryExec=/usr/bin/mwm Type=ApplicationEOF
The above install command(s) need some
explanation. Typically in the books when configuration files get created,
cat is used. It uses a Bash feature called
“heredoc” which takes optionally multiple lines of input
until a given term, and forwards it to something. In the
cat command, heredoc is used to feed into
/dev/stdin, and cat writes from
/dev/stdin to the specified file.
As for install, its use is more in-depth and has a
lot more going on. In premise, it is doing the same thing as the
cat commands. It heredocs to
/dev/stdin and is forwarded to a file;
install does the writing. In a more straightforward way,
it copies /dev/stdin to the specified file, which was
filled by the heredoc. It has been used over cat so that
the permissions can be set and the directory the file needs to be in will be
created in the process.
Finally, unset the environment variables previously set:
export LANG=$OLDLANG && unset OLDLANG && unset LEX && unset YACC
C{,XX}FLAGS='std=gnu17': These variables ensure this
package properly builds as C23 is now the default in GCC-15.x.x.