diff --git a/configure b/configure index c2cc8f617..3ffce7a94 100755 --- a/configure +++ b/configure @@ -338,7 +338,22 @@ than or equal to 4.14 will see significantly reduced performance. fi fi - +if [[ "$CONFIG_CRYPTO" = "y" ]]; then + set +e + nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}') + ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)" + set -e + if [[ $nasm_ver -lt "21202" ]]; then + echo Crypto requires NASM version 2.12.02 or newer. Please install + echo or upgrade then re-run this scrip. + else + if [[ "$ipsec" == "" ]]; then + echo "To enable crypto you must first go to the intel-ipsec-mb directory and " + echo "run 'make' then 'sudo make install' then re-run this script." + exit 1 + fi + fi +fi echo -n "Creating CONFIG.local..." diff --git a/scripts/pkgdep.sh b/scripts/pkgdep.sh index 5700335f5..956e0db23 100755 --- a/scripts/pkgdep.sh +++ b/scripts/pkgdep.sh @@ -3,6 +3,9 @@ SYSTEM=`uname -s` +scriptsdir=$(readlink -f $(dirname $0)) +rootdir=$(readlink -f $scriptsdir/..) + if [ -s /etc/redhat-release ]; then # Includes Fedora, CentOS if [ -f /etc/centos-release ]; then @@ -62,3 +65,24 @@ else echo "pkgdep: unknown system type." exit 1 fi + +# Only crypto needs nasm and this lib but because the lib requires root to +# install we do it here. +nasm_ver=$(nasm -v | sed 's/[^0-9]*//g' | awk '{print substr ($0, 0, 5)}') +if [[ $nasm_ver -lt "21202" ]]; then + echo Crypto requires NASM version 2.12.02 or newer. Please install + echo or upgrade and re-run this script if you are going to use Crypto. +else + ipsec="$(find /usr -name intel-ipsec-mb.h 2>/dev/null)" + if [[ "$ipsec" == "" ]]; then + if [[ -d "$rootdir/intel-ipsec-mb" ]]; then + cd $rootdir/intel-ipsec-mb + make + make install + cd - + else + echo "The intel-ipsec-mb submodule has not been cloned and will not be installed." + echo "To enable crypto, run 'git submodule update --init' and then run this script again." + fi + fi +fi