Current File : /home/inlingua/public_html/decay_sym/root/var/softaculous/apps/libargon2/build/make.sh
#!/bin/bash
source /var/softaculous/apps/build/common.sh

#https://github.com/P-H-C/phc-winner-argon2

is_file $AMPPS_PATH"/libargon2/bin/argon2"
if [ $? == 0 ]
	then
	
		banner "Installing argon2"
		cd $SRC_PATH
		remove_dir phc-winner-argon2
	
		git clone --recursive --depth=1 https://github.com/P-H-C/phc-winner-argon2.git
		
		cd phc-winner-argon2
		sed -i 's/PREFIX ?= \/usr/PREFIX ?= \/usr\/local\/apps\/libargon2/g' /setups/phc-winner-argon2/Makefile
		sed -i 's/LIBRARY_REL ?= lib\/x86_64-linux-gnu/LIBRARY_REL ?= lib/g' /setups/phc-winner-argon2/Makefile
		sed -i 's/-march=$(OPTTARGET)//' /setups/phc-winner-argon2/Makefile
		sed -i sed -i '/CFLAGS += -std=c89 -O3 -Wall -g -Iinclude -Isrc/a CFLAGS += -mno-avx -mno-avx2 -march=x86-64' /setups/phc-winner-argon2/Makefile
		
		make clean
		
		make PREFIX=/usr/local/apps/libargon2 LIBRARY_REL=lib
		make install
		
fi	
	
is_file $AMPPS_PATH"/libargon2/bin/argon2"
if [ $? == 0 ]
	then
		banner 'argon2 could not compile due to some reason'
		exit 1
fi