I just recently discovered tests for watcom in the Build.sh script

Naturally curious as I am, I started to play with trying to compile mksh with openwatcom on Linux (Arch x86_64) - mostly due to nostalgia with all the Dos4GW games etc... curious to see how small/performant openwatcom can make a real modern program compared to GCC.

It seems like the tests choke on a number of places (preprocessor does not successfully identify watcom etc...). and the libc bundled with openwatcom does not contain some headers that seems to be needed.

Are there any tricks to get through the Build.sh? Or is the watcom support abandoned? There seems to be a lot of warnings during the tests...

For reference, I attach my modified PKGBUILD (modified from the officially distributed variant of mksh in Arch linux) that I use for my compilation tests.
# $Id$
# Mantainer: Jens Staal <[email protected]>
# adopted from the community build:
## Maintainer: Thorsten TC6pper <[email protected]>
## Contributor: Daniel Hommel <[email protected]>

pkgname=mksh-ow
pkgver=R46
pkgrel=3
pkgdesc='The MirBSD Korn Shell - built with OpenWatcom'
url='https://www.mirbsd.org/mksh.htm'
license=('custom')
arch=('i686' 'x86_64')
makedepends=('open_watcom')
install=mksh.install

provides=("mksh")
conflicts=("mksh")
replaces=("mksh")

source=("https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-$pkgver.tgz";
        'https://www.mirbsd.org/TaC-mksh.txt')
md5sums=('77c108d8143a6e7670954d77517d216d'
         'a231b325d5f2155a6c667a9323986718')

build() {
  rm -rf $srcdir/build # start fresh
  cp -ar "$srcdir/mksh" $srcdir/build
  cd $srcdir/build

  msg "setting up watcom environment variables"
  source /opt/watcom/owsetenv.sh
  export TERMINFO="/usr/lib/terminfo"
  export CC="wcc386"
  export CPP="wpp386"
  export LINKER="wlink"
  export WCL386="-zq"
  export WCC386="-zq -w4 -zp4 -5 -fp5"
  export WPP386="-I/opt/watcom/h -I/opt/watcom/lh"
  #some stuff not properly defined in the watcom c-library
  export CFLAGS="$WCC386"
  export CPPFLAGS="$WPP386"
  export LDFLAGS=$WCL386
  export LD=$LINKER

  
  msg "fixing some stuff in Build.sh"
  msg2 "some compiler identification issues"
  export HAVE_CAN_COMPILER_WORKS=1
  
  sed -i 's/ct=untested/ct=watcom/g' Build.sh
  sed -i 's/-c conftest.c/conftest.c/g' Build.sh
  sed -i 's/-o -//g' Build.sh
  sed -i 's/-o //g' Build.sh
  
  msg2 "some missing headers"
  touch $srcdir/build/pwd.h
  touch $srcdir/build/termio.h
  touch $srcdir/build/features.h
  
  
  sh Build.sh -r
  ./test.sh
}

package() {
  cd "$srcdir/build"
  install -D -m 755 mksh "$pkgdir/usr/bin/mksh"
  install -D -m 644 mksh.1 "$pkgdir/usr/share/man/man1/mksh.1"
  install -D -m 644 dot.mkshrc "$pkgdir/etc/skel/.mkshrc"
  install -D -m 644 "$srcdir/TaC-mksh.txt" 
"$pkgdir/usr/share/licenses/mksh/TaC-mksh.txt"
}

# vim:set ts=2 sw=2 et:


Reply via email to