2011-11-13 00:38:55 +01:00
|
|
|
#!/bin/sh
|
2011-11-13 00:38:58 +01:00
|
|
|
# mk.li 10-Jul-97
|
2011-11-13 00:38:56 +01:00
|
|
|
# please edit this file !
|
2011-11-13 00:38:55 +01:00
|
|
|
|
|
|
|
mk()
|
|
|
|
{
|
|
|
|
MYBASE=`pwd`;
|
|
|
|
ERRFILE=$TMP/`basename $MYBASE`.err;
|
|
|
|
rm -f $ERRFILE;
|
2011-11-13 00:38:56 +01:00
|
|
|
if [ $V_VPATH = '..' ] ; then
|
|
|
|
if [ ! -d $OBJDIR ] ; then mkdir $OBJDIR; fi
|
|
|
|
cd $OBJDIR;
|
|
|
|
fi
|
2011-11-13 00:38:56 +01:00
|
|
|
if $MAKE -f $V_VPATH/makefile.unx $@ 2>&1;then true;else kill -HUP $MK_PPID;fi | tee $ERRFILE
|
2011-11-13 00:38:56 +01:00
|
|
|
if [ $V_VPATH = '..' ] ; then
|
|
|
|
cd ..;
|
|
|
|
fi
|
2011-11-13 00:38:57 +01:00
|
|
|
if [ -f $ERRFILE ] ; then
|
|
|
|
chmod 666 $ERRFILE
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
print_error()
|
|
|
|
{
|
|
|
|
echo ""
|
|
|
|
echo "The errors are also reported in '$ERRFILE'"
|
|
|
|
echo "============================================================="
|
2011-11-13 00:38:55 +01:00
|
|
|
}
|
|
|
|
|
2011-11-13 00:38:56 +01:00
|
|
|
TOLOWER='tr "[A-Z]" "[a-z]"'
|
|
|
|
UNX=`uname -s | $TOLOWER`
|
2011-11-13 00:38:57 +01:00
|
|
|
MASCHINE=`uname -m`
|
2011-11-13 00:38:56 +01:00
|
|
|
MK_PPID=$$
|
|
|
|
export MK_PPID
|
2011-11-13 00:38:57 +01:00
|
|
|
|
|
|
|
trap 'print_error; exit 1' 1
|
2011-11-13 00:38:56 +01:00
|
|
|
|
|
|
|
case $UNX in
|
|
|
|
linux)
|
2011-11-13 00:38:56 +01:00
|
|
|
V_VPATH=".."
|
|
|
|
OBJDIR="obj"
|
|
|
|
CC=cc
|
|
|
|
CPP="cc -E"
|
2011-11-13 00:38:56 +01:00
|
|
|
# CFLAGS="-pipe -O2 -fomit-frame-pointer"
|
|
|
|
# problems gcc2.5.8 ^^^^^^^^^^^^^^^^^^^^^
|
2011-11-13 00:38:56 +01:00
|
|
|
CFLAGS="-pipe -Wall"
|
2011-11-13 00:38:57 +01:00
|
|
|
|
|
|
|
case $MASCHINE in
|
|
|
|
sparc)
|
|
|
|
HOSTCFLAGS="-DLINUX -DSPARC"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
HOSTCFLAGS="-DLINUX"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -f /usr/lib/libgdbm.a ] || [ -f /usr/lib/libgdbm.so ] ; then
|
|
|
|
NDBMLIB="-lgdbm"
|
|
|
|
else
|
2011-11-13 00:38:56 +01:00
|
|
|
NDBMLIB="-ldbm"
|
2011-11-13 00:38:57 +01:00
|
|
|
fi
|
2011-11-13 00:38:56 +01:00
|
|
|
CRYPTLIB=""
|
2011-11-13 00:38:56 +01:00
|
|
|
NSLLIB=""
|
|
|
|
MAKE=make
|
|
|
|
TMP=/tmp
|
|
|
|
INSTALL=install
|
|
|
|
;;
|
2011-11-13 00:38:57 +01:00
|
|
|
########### SYSV (UnixWare) ##############
|
2011-11-13 00:38:56 +01:00
|
|
|
unix_sv)
|
2011-11-13 00:38:56 +01:00
|
|
|
V_VPATH="."
|
|
|
|
OBJDIR="."
|
2011-11-13 00:38:56 +01:00
|
|
|
CC=cc
|
2011-11-13 00:38:56 +01:00
|
|
|
CPP="cc -E"
|
|
|
|
CFLAGS=
|
2011-11-13 00:38:56 +01:00
|
|
|
HOSTCFLAGS=""
|
|
|
|
NDBMLIB="/usr/ucblib/libucb.a"
|
2011-11-13 00:38:56 +01:00
|
|
|
CRYPTLIB="-lgen"
|
2011-11-13 00:38:56 +01:00
|
|
|
NSLLIB="-lnsl"
|
2011-11-13 00:38:56 +01:00
|
|
|
MAKE=make
|
2011-11-13 00:38:56 +01:00
|
|
|
TMP=/tmp
|
|
|
|
INSTALL=/usr/ucb/install
|
|
|
|
;;
|
|
|
|
*) echo "mk.li: Unknown or not supported OS, probably you must set \$UNX"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2011-11-13 00:38:58 +01:00
|
|
|
## BEGIN try to pass around what the dbm is to the compiler (acli 19970709)
|
|
|
|
case "$NDBMLIB" in
|
|
|
|
*gdbm*)
|
|
|
|
HOSTCFLAGS="$HOSTCFLAGS -DUSE_GDBM"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
## END
|
|
|
|
|
|
|
|
|
2011-11-13 00:38:56 +01:00
|
|
|
export CC
|
2011-11-13 00:38:56 +01:00
|
|
|
export CPP
|
2011-11-13 00:38:56 +01:00
|
|
|
export CFLAGS
|
|
|
|
export HOSTCFLAGS
|
|
|
|
export NDBMLIB
|
2011-11-13 00:38:56 +01:00
|
|
|
export CRYPTLIB
|
2011-11-13 00:38:56 +01:00
|
|
|
export NSLLIB
|
|
|
|
export TMP
|
|
|
|
export INSTALL
|
2011-11-13 00:38:56 +01:00
|
|
|
export V_VPATH
|
|
|
|
export OBJDIR
|
2011-11-13 00:38:56 +01:00
|
|
|
|
2011-11-13 00:38:55 +01:00
|
|
|
mk $@
|