summaryrefslogtreecommitdiff
path: root/devel/mkcmd/files
diff options
context:
space:
mode:
authorepg <epg>2004-11-10 00:46:04 +0000
committerepg <epg>2004-11-10 00:46:04 +0000
commita7348dc0787e757bbe18e5c018418c59fa1b77a5 (patch)
tree134792100ffa27490ed3569ab9a2d38a8a26d727 /devel/mkcmd/files
parent7abb0d83956561c45136cba9855f7ac82affad9a (diff)
downloadpkgsrc-a7348dc0787e757bbe18e5c018418c59fa1b77a5.tar.gz
Import mkcmd-8.14.
mkcmd lets us build a nifty command line option parser and some on-line documentation in a snap. It is a prerequisite for many of Kevin Braunsdorf's tools.
Diffstat (limited to 'devel/mkcmd/files')
-rw-r--r--devel/mkcmd/files/makeme69
1 files changed, 69 insertions, 0 deletions
diff --git a/devel/mkcmd/files/makeme b/devel/mkcmd/files/makeme
new file mode 100644
index 00000000000..12b290a13b8
--- /dev/null
+++ b/devel/mkcmd/files/makeme
@@ -0,0 +1,69 @@
+#!/bin/sh
+# $Id: makeme,v 1.1.1.1 2004/11/10 00:46:04 epg Exp $
+# This hack won't work for every trick you can play with /usr/msrc.
+# If the Distfile sends different files to the various platforms, or
+# builds a file on the meta source machine with a special tool or
+# database you are toast. {N.B. mk's lib, rdist, mkcmd have issues.}
+
+# if we have a local.defs read it for umask, PATH, and such.
+[ -f /usr/local/lib/distrib/local.defs ] && . /usr/local/lib/distrib/local.defs
+
+# It does work for the tools that build the meta source system itself,
+# of course (mkcmd, distrib, rcsvg, and the like). You can use it to
+# process the Make.host file through m4 for localhost.
+#
+# Check for the mandatory Make.host file...
+if [ ! -f Make.host ] ; then
+ echo 1>&2 "$0: not in a meta source directory, no Make.host"
+ exit 126
+fi
+
+# distrib: default column headers: %HOST SHORTHOST HOSTTYPE HOSTOS HASSRC
+if [ -z "$HOST" ] ; then
+ HOST=`uname -n || hostname`
+fi
+if [ -z "$SHORTHOST" ] ; then
+ SHORTHOST=`expr $HOST : '\([^.]*\)\..*' \| $HOST`
+fi
+if [ -z "$HOSTTYPE" ] ; then
+ case `uname -sr || uname -a` in
+ HP-UX*7.*)
+ HOSTTYPE="HPUX9" ;;
+ HP-UX*8.*)
+ HOSTTYPE="HPUX9" ;;
+ HP-UX*9.*)
+ HOSTTYPE="HPUX9" ;;
+ HP-UX*10.*)
+ HOSTTYPE="HPUX10" ;;
+ *NEXT*)
+ HOSTTYPE="NEXT2" ;;
+ *Solaris*|*[Ss]un[Oo][Ss]*)
+ HOSTTYPE="SUN5" ;;
+ *BSD*)
+ HOSTTYPE="FREEBSD" ;;
+ BSDI*)
+ HOSTTYPE="BSDI" ;;
+ Linux*|LINUX*)
+ HOSTTYPE="LINUX" ;;
+ *)
+ echo 1>&2 "$0: set HOSTTYPE and export it by hand."
+ exit 2 ;;
+ esac
+fi
+if [ -z "$HOSTOS" ] ; then
+ HOSTOS=`uname -r | sed -e 's/^[A-Za-z .]*//' -e 's/-[A-Za-z]*//' -e 's/\.\([0-9][0-9]\)/\1/g' -e 'y/./0/' -e 's/^0*//'`
+fi
+
+# Now fake the Distrib @file@ expansion and hope the rest works out.
+# Some make's mistakenly think you must call fork() to get a SIG-child...
+# so they barf out errors for this -- they should learn UNIX.
+m4 - Make.host <<! |make -f - ${1:+"$@"}
+define(\`HOST',\`$HOST')dnl
+define(\`SHORTHOST',\`$SHORTHOST')dnl
+define(\`HOSTTYPE',\`$HOSTTYPE')dnl
+define(\`MYTYPE',\`$HOSTTYPE')dnl
+define(\`HOSTOS',\`$HOSTOS')dnl
+define(\`MYOS',\`$HOSTOS')dnl
+define(\`HASSRC',\`yes')dnl
+define(\`MSRC_BOOT',\`${MSRC_BOOT-yes}')dnl
+!