
# we must be sure to build the binary package without using any flags
# that would make the binary require a specific cpu model.

export CFLAGS="-march=1.0 -mschedule=700 -O2 -pipe"
export MAKEOPTS="-j1"

# currently we must disable doc, X, opengl and openal support
export USE="-doc -opengl -tetex -java -X -openal"

#echo "you may also need to set PORTDIR_OVERLAY=\"\""
#echo "and also ACCEPT_KEYWORDS=\"~\${arch}\""
#echo "running:"
#echo "  USE=\"${USE}\" CFLAGS=\"${CFLAGS}\" emerge --buildpkgonly =dev-lang/ghc-$1"

emerge --ask --buildpkgonly =dev-lang/ghc-$1 || exit

#echo "created /usr/portage/packages/dev-lang/ghc-$1.tbz2"
#echo "to make the ghc-bin file just move it:"
#echo "mv /usr/portage/packages/All/ghc-$1.tbz2 /usr/portage/distfiles/ghc-bin-$1.tbz2"

