# Template file for 'tcc'
pkgname=tcc
version=0.9.27
revision=3
_gitrev=85483f321d8df6cce08ef88d86f50c9a60b307ef
wrksrc=tinycc-${_gitrev:0:7}
build_style=gnu-configure
make_check_target="test"
hostmakedepends="perl"
short_desc="Tiny C Compiler"
maintainer="Juan RP <xtraeme@voidlinux.org>"
license="LGPL-2.1"
homepage="http://bellard.org/tcc/"
distfiles="http://repo.or.cz/tinycc.git/snapshot/${_gitrev}.tar.gz>${pkgname}-${version}.tar.gz"
checksum=6fd34260bd8df776f3710252aa9c2385d390729d20bff85de652610160fc8e35
nopie=yes
nocross=yes

case "$XBPS_TARGET_MACHINE" in
	*-musl) configure_args="--config-musl";;
esac

pre_configure() {
	# Replace lib64 with lib
	sed -i configure -e "s;lib64;lib;g"
}

do_build() {
	# Can't use (many of) our CFLAGS or LDFLAGS
	# because TCC is bootstrapped with the same flags
	make CFLAGS= LDFLAGS= ${makejobs}
}
