SUMMARY="An atomic memory update operations portable implementation"
DESCRIPTION="Semi-portable access to hardware-provided \
atomic memory update operations on a number architectures \
as said on the github project home."
HOMEPAGE="https://github.com/ivmai/libatomic_ops/"
COPYRIGHT="2003-2011 Hewlett-Packard Development Company, L.P."
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-$portVersion.tar.gz"
CHECKSUM_SHA256="bf210a600dd1becbf7936dd2914cf5f5d3356046904848dcfd27d0c8b12b6f8f"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libatomic_ops$secondaryArchSuffix = $portVersion
	lib:libatomic_ops$secondaryArchSuffix = 1.0.3 compat >= 1
	lib:libatomic_ops_gpl$secondaryArchSuffix = 1.0.3 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libatomic_ops$secondaryArchSuffix_devel = $portVersion
	devel:libatomic_ops$secondaryArchSuffix = 1.0.3 compat >= 1
	devel:libatomic_ops_gpl$secondaryArchSuffix = 1.0.3 compat >= 1
	"
REQUIRES_devel="
	libatomic_ops$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gawk
	cmd:gcc$secondaryArchSuffix
	cmd:grep
	cmd:ld$secondaryArchSuffix
	cmd:libtool$secondaryArchSuffix
	cmd:make
	cmd:sed
	"

BUILD()
{
	runConfigure ./configure --disable-dependency-tracking \
			--enable-shared \
			--with-gnu-ld

	make $jobArgs
}

INSTALL()
{
	make install

	fixPkgconfig

	prepareInstalledDevelLibs \
			libatomic_ops libatomic_ops_gpl

	# devel package
	packageEntries devel \
			$developDir $dataDir
}
