# 2022 12 07 Mouse # Make sure $LOCALROOT is set - for simplicity below, to avoid constantly # writing ${LOCALROOT:-/local}. : ${LOCALROOT:=/local} # Work in X11-R6.4p3. cd X11-R6.4p3 # Localize site.def. sed -e "s@@LOCALROOT@@$LOCALROOTg" < xc/config/cf/site.def.base > xc/config/cf/site.def # Uncomment this line to build with debugging on. #DBG#patch -p1 < ../build-with-debug.patch # Some NetBSD versions keep cpp in other than /usr/libexec/cpp, that being # where NetBSD.cf expects to find it. So coax cc into telling us where # it is. But some versions don't use cpp when doing compiles, instead # integrating it into cc1, which makes this test show cc1 instead of cpp. # So if we get cc1, bash it to cpp instead. Fortunately, all such cases # I've run into keep cpp in the same place. cpp=`(cc --verbose -E -x c /dev/null 2>&1 > /dev/null) | sed -e 's@^[^/]*/@/@' -e 's/ .*//'` case "$cpp" in */cc1) cpp=/usr/bin/cpp;; esac for f in xc/config/cf/NetBSD.cf xc/config/imake/imakemdep.h do sed -e "s/usr/libexec/cpp$cpp" < $f.base > $f done # Libraries need to be visible here during the build before the install, # or things like xkbcomp don't work. (Ignore errors from these commands; # the commands are carefully chosen to either error out or DTRT.) rm $LOCALROOT/.lib/X11-R6.4p3 2>/dev/null [ -d $LOCALROOT/.lib/X11-R6.4p3 ] || ln -s $LOCALROOT/src/X11/X11-R6.4p3/xc/exports/lib $LOCALROOT/.lib/X11-R6.4p3 2>/dev/null # Do the build! cd xc ( case "$LD_LIBRARY_PATH" in "") LD_LIBRARY_PATH=$LOCALROOT/src/X11/X11-R6.4p3/xc/exports/lib:$LOCALROOT/lib:/usr/lib ;; *) LD_LIBRARY_PATH=$LOCALROOT/src/X11/X11-R6.4p3/xc/exports/lib:"$LD_LIBRARY_PATH" ;; esac export LD_LIBRARY_PATH # On at least one architecture (next68k), it is very hard to get # BOOTSTRAPCFLAGS set everywhere it needs to be with less than this. BOOTSTRAPCFLAGS=-D`uname -m` export BOOTSTRAPCFLAGS make World ) # Remove the symlink we may have made above rm $LOCALROOT/.lib/X11-R6.4p3 2>/dev/null # Install it make install make install.man # Fix up installation bug that installs xterm setuid even if not root chmod 711 $LOCALROOT/.bin/X11-R6.4p3/xterm exit 0 cd ../.. # Fix up the font server config file: cat final-patch-fs-config | sed -e "s;@@LOCALROOT@@;$LOCALROOT;g" | patch $LOCALROOT/.lib/X11-R6.4p3/X11/fs/config rm -f $LOCALROOT/.lib/X11-R6.4p3/X11/fs/config.orig # If utmp entries are desired for xterm, then, as root, # chown root $LOCALROOT/.bin/X11-R6.4p3/xterm # chmod 4711 $LOCALROOT/.bin/X11-R6.4p3/xterm # Clean up # cd .. # git clean -d -x -f -q