#! /bin/sh
#
#   40install
#

set -u
progname=`basename $0`;
echo "### $progname ###"
buildenv=../buildenv
if [ ! -r $buildenv ]; then
    echo "$progname: $buildenv not found" >&2
    exit 1;
fi
. ../buildenv

for APPDIR in ${ENCODE_EUCJPMS} ${ENCODE_ISO2022JPMS}
do
    if [ ! -d ${APPDIR} ]; then
        echo "$progname: $buildenv not found" >&2
        exit 1;
    fi

    WORKDIR=`pwd`
    cd ${APPDIR}
    make install
    test $? -eq 0 || exit 1;
    cd ${WORKDIR}
done

enc2xs -C
test $? -eq 0 || exit 1;

exit 0;
