You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

43 lines
846 B

# Pass PREFIX as argument. If not passed, "local/" is used as deafult.
# Exit on errors
set -e
SCRIPT_DIR=$(dirname "$0")
PREFIX=$1
# Get Absolute Paths & Setup
SCRIPT_DIR=$(dirname "$0")
pushd "${SCRIPT_DIR}"
SCRIPT_DIR=$(pwd)
popd
if [ "${PREFIX}" = "" ]; then
PREFIX="${SCRIPT_DIR}/local"
fi
mkdir -p "${PREFIX}"
pushd "${PREFIX}"
PREFIX=$(pwd)
popd
TMP_DIR="${SCRIPT_DIR}/tmp"
mkdir -p "${TMP_DIR}"
if [ -f "${PREFIX}/bin/asn1c" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
# ASN1c executable
ASN1_DIR="${TMP_DIR}/asn1c"
if [ ! -d "${ASN1_DIR}" ]; then
pushd "${TMP_DIR}"
git clone -b "v0.9.28" git://github.com/vlm/asn1c.git
popd
fi
pushd ${ASN1_DIR}
autoreconf -iv
./configure --prefix=${PREFIX}
make -j4 install
popd