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

10 months ago
  1. # Pass PREFIX as argument. If not passed, "local/" is used as deafult.
  2. # Exit on errors
  3. set -e
  4. SCRIPT_DIR=$(dirname "$0")
  5. PREFIX=$1
  6. # Get Absolute Paths & Setup
  7. SCRIPT_DIR=$(dirname "$0")
  8. pushd "${SCRIPT_DIR}"
  9. SCRIPT_DIR=$(pwd)
  10. popd
  11. if [ "${PREFIX}" = "" ]; then
  12. PREFIX="${SCRIPT_DIR}/local"
  13. fi
  14. mkdir -p "${PREFIX}"
  15. pushd "${PREFIX}"
  16. PREFIX=$(pwd)
  17. popd
  18. TMP_DIR="${SCRIPT_DIR}/tmp"
  19. mkdir -p "${TMP_DIR}"
  20. if [ -f "${PREFIX}/bin/asn1c" ]; then
  21. echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
  22. exit 0
  23. fi
  24. # ASN1c executable
  25. ASN1_DIR="${TMP_DIR}/asn1c"
  26. if [ ! -d "${ASN1_DIR}" ]; then
  27. pushd "${TMP_DIR}"
  28. git clone -b "v0.9.28" git://github.com/vlm/asn1c.git
  29. popd
  30. fi
  31. pushd ${ASN1_DIR}
  32. autoreconf -iv
  33. ./configure --prefix=${PREFIX}
  34. make -j4 install
  35. popd