Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Last active July 16, 2023 00:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/c140314d7ea07b32865df354a67ef188 to your computer and use it in GitHub Desktop.
Save stuaxo/c140314d7ea07b32865df354a67ef188 to your computer and use it in GitHub Desktop.
Install openwatcom-1.9 on Linux
#!/bin/bash
#
# Download open watcom 1.9 from sourceforge.
#
# Requires curl or wget
FILENAME="open-watcom-c-linux-1.9"
URL="https://master.dl.sourceforge.net/project/openwatcom/open-watcom-1.9/$FILENAME"
# Check if curl is available
if command -v curl >/dev/null 2>&1; then
echo "Downloading $FILENAME"
curl -s -OL "$URL"
elif command -v wget >/dev/null 2>&1; then
echo "Downloading $FILENAME"
wget -q "$URL"
else
echo "Install curl or wget and re-run or manually download the file $FILENAME, from"
echo $URL
echo 1
fi
chmod +x $FILENAME
#!/bin/bash
#
# Unattended install of openwatcom 1.9
#
# ./install-ow1.9.sh
#
# Ensure open-watcom-c-linux-1.9 is in current directory before running.
#
#
# TERM=vt100 is set to avoid a floating point error in the installer, that
# makes it harder to use in modern terminal emulators - but that doesn't
# matter here as we do an unattended install.
#
OWINST_FILENAME="open-watcom-c-linux-1.9"
OWINST_URL="https://master.dl.sourceforge.net/project/openwatcom/open-watcom-1.9/open-watcom-c-linux-1.9"
OWINST_DEST="/opt/openwatcom-1.9"
OWINST_OVERRIDE_FILE="override.inf"
# User may pass an installer file, e.g. ./install-ow1 ~/Downloads/open-watcom-c-linux-1.9
if [ $# -eq 1 ]; then
OWINST_FILENAME=$1
fi
if [ ! -f "$OWINST_FILENAME" ]; then
echo "No installer found at $OWINST_FILENAME"
echo "Either pass the filename on the commandline"
echo "The installer can be downloaded from:"
echo "$OWINST_URL"
exit 1
fi
if [ ! -x "$OWINST_FILENAME" ]; then
echo "The installer $OWINST_FILENAME is not executable."
echo "Please make it executable using the command: chmod +x $OWINST_FILENAME"
exit 1
fi
PARENT_DIR=$(dirname "$OWINST_DEST")
if [ ! -d "$PARENT_DIR" ]; then
echo "The parent directory $PARENT_DIR of the destination does not exist."
exit 1
fi
if [ ! -w "$PARENT_DIR" ]; then
SUDO=sudo
else
SUDO=""
fi
# Perform tilde expansion because openwatcom-1.9 installer support tilde expansion in DstDir:
eval OWINST_DEST=$OWINST_DEST
TERM=vt100 $SUDO ./"$OWINST_FILENAME" -f="$OWINST_OVERRIDE_FILE" -dDstDir="$OWINST_DEST" -s
# Install all models of libs
ms=true
mm=true
mc=true
ml=true
mh=true
# Install C++ development support
cplusplus=true
# Install only Linux host and target
lnxhost=true
lnxtarg=true
# Install PDF documentation
pdf_helpfiles=true
# Install sample source code
samples=true
# Install Novell NLM target files
nlmtarg=true
# Install RDOS host tools
rdoshost=true
# Install RDOS target files
rdostarg=true
# Install run-time library startup source
rtsource=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment