m4=`which m4`
+# Check if the given program is installed. Returns 0 if it exists, 1
+# otherwise; so it can be used in if.
+installed() {
+ which $1 | grep -E '^/' > /dev/null
+}
+
+# Prints the current OS. Supported are Debian (debian) and Mac OS X (darwin)
+# at the moment. If an unsupported OS is used an error is printed.
+os() {
+ if [ -f /etc/debian_version ]; then
+ echo debian
+ elif [ x`uname` = xDarwin ]; then
+ echo darwin
+ else
+ echo unsupported OS! >&2
+ return 1
+ fi
+}
+
# Creates a symbolic link for file $1 in dirname of $2 with name of basenmae
# $2.
#
# Process $1.m4 with m4 using the given options.
echo "m4(): generating '$file' from '$file.m4' with options '$*'"
$m4 $* $file.m4 >> $file
+
+ unset file
}