sed -i '/"lib64"/s/64//' Modules/GNUInstallDirs.cmake

_parallel_opt() {
	local i n
	for i in $MAKEOPTS; do
		case "$i" in
			-j*) n=${i#-j};;
		esac;
	done
	[ -n "$n" ] && echo "--parallel $n"
}


# jsoncpp needs cmake to build so to avoid recursive build
# dependency, we use the bundled version of jsoncpp.
# Do NOT remove --no-system-jsoncpp unless you consulted
# from alpine/apkbuild
./bootstrap \
--prefix=/usr \
--mandir=/share/man \
--datadir=/share/$isim \
--docdir=/share/doc/$isim \
--system-libs \
--no-system-jsoncpp \
$(_parallel_opt)

make
