# About CXXFLAGS:
# https://github.com/weidai11/cryptopp/blob/60f81a77e0c9a0e7ffc1ca1bc438ddfa2e43b78e/GNUmakefile#L1278-L1281
# 
# When using our default flags, build error:
# /usr/bin/ld: /tmp/ccbsywCD.ltrans4.ltrans.o: warning: relocation against `_ZN8CryptoPP7BLAKE2s7RestartEv' in read-only section `.text'
# /usr/bin/ld: /tmp/ccbsywCD.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `_ZN8CryptoPP6Filter6DetachEPNS_22BufferedTransformationE' can not be used when making a shared object; recompile with -fPIC
# /usr/bin/ld: final link failed: bad value
# collect2: error: ld returned 1 exit status
abinfo "Building ..."
make dynamic cryptest.exe libcryptopp.pc \
    CXXFLAGS="${CXXFLAGS} -fPIC"

abinfo "Installing ..."
make install \
    DESTDIR="$PKGDIR" \
    PREFIX="/usr"
