#!/bin/sh
# build-info -- Generate header file containing build details
# $Id: build-info,v 1.2 1999/08/03 14:42:00 john Exp $

sys_name="`hostname`.`domainname`"
user_name="$LOGNAME"
host_type="$1"
version="$2"
sawmilldir="$3"
lispdir="$4"
sawmillexecdir="$5"

build_date="`date +'%a %b %e %Y'`"
build_time="`date +'%T %Z'`"

cat >build.h <<EOF
/* build.h -- Definitions relating to the current build
   Automatically generated by build-info; DO NOT EDIT! */

#ifndef BUILD_H
#define BUILD_H

#define SAWMILL_VERSION "$version"
#define SAWMILL_DIR "$sawmilldir"
#define SAWMILL_LISPDIR "$lispdir"
#define SAWMILL_EXECDIR "$sawmillexecdir"

#define HOST_TYPE "$host_type"

#define BUILD_HOST "$sys_name"
#define BUILD_USER "$user_name"

#define BUILD_DATE "$build_date"
#define BUILD_TIME "$build_time"

#endif /* BUILD_H */
EOF
