#!/bin/bash

lazdir=/usr/src/lazarus/
funits=`readlink -n -f -s ./units/`
exeout=`readlink -n -f -s ./`

gcmpcroot=$exeout/gcmpcl
     pushd $gcmpcroot
lazbuild --lazarusdir=$lazdir --opt="-Cg -k-pie -k-znow" gcmp.lpi
fpc -B -k-pie -k-znow -CfSSE64 -CX -XX -O3 -Mobjfpc -Cg acmp.pas
mv acmp gcmp ../
make clean
     popd

mv ./acmp ./gcmp ./usr/bin/

echo 'All OK :)'