# 1998 09 03 Mouse # Make sure $LOCALROOT is set - for simplicity below, to avoid constantly # writing ${LOCALROOT:-/local}. : ${LOCALROOT:=/local} # Unpack the .gz files into X11-R6.4p3 mkdir X11-R6.4p3 cd X11-R6.4p3 gunzip < ../DIST/tog-1.tar.gz | mtar xvfpS - gunzip < ../DIST/tog-2.tar.gz | mtar xvfpS - gunzip < ../DIST/tog-3.tar.gz | mtar xvfpS - # Apply fixes patch -p0 < ../DIST/fix-01 patch -p0 < ../DIST/fix-02 patch -p0 < ../DIST/fix-03 # Apply various other patches. ( cd ../patches/xc ; find . -type f -print ) | sed -e 's;^./;;' | while read fn do < ../patches/xc/$fn patch xc/$fn rm -f xc/$fn.orig done ( cd ../patches.localized/xc ; find . -type f -print ) | sed -e 's;^./;;' | while read fn do cat ../patches.localized/xc/$fn | sed -e "s;@@LOCALROOT@@;$LOCALROOT;g" | patch xc/$fn rm -f xc/$fn.orig done v=`uname -m`-`uname -r` if [ -d ../patches.vers/$v ]; then ( cd ../patches.vers/$v ; find . -type f -print ) | sed -e 's;^./;;' | while read fn do cat ../patches.vers/$v/$fn | sed -e "s;@@LOCALROOT@@;$LOCALROOT;g" | patch $fn rm -f $fn.orig done fi # 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. chmod 644 xc/config/cf/NetBSD.cf chmod 644 xc/config/imake/imakemdep.h 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 (echo /.usr.libexec.cpp/s@@$cpp\@; echo w; echo q) | ed - xc/config/cf/NetBSD.cf (echo /.usr.libexec.cpp/s@@$cpp\@; echo w; echo q) | ed - xc/config/imake/imakemdep.h # Normalize permissions. mfind . -type d ! -perm 0755 -print | xargs chmod 755 mfind . -type f -perm 0111/0 ! -perm 0644 -print | xargs chmod 644 mfind . -type f ! -perm 0111/0 ! -perm 0755 -print | xargs chmod 755 # 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 cd ../.. exit 0 # 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 .. # rm -rf X11-R6.4p3