--- boot0-9.0.ebuild.orig 2012-05-18 00:01:27.000000000 +0900 +++ boot0-9.0.ebuild.orig 2012-06-06 19:21:19.000000000 +0900 @@ -18,10 +18,13 @@ RDEPEND="" DEPEND="=sys-freebsd/freebsd-mk-defs-${RV}* - =sys-freebsd/freebsd-lib-${RV}*" + =sys-freebsd/freebsd-lib-${RV}* + || ( =sys-devel/gcc-4.5* >=sys-devel/clang-3.0 )" S="${WORKDIR}/sys/boot" +PATCHES=( "${FILESDIR}"/${P}-clang.patch ) + boot0_use_enable() { use ${1} && mymakeopts="${mymakeopts} LOADER_${2}_SUPPORT=\"yes\"" } @@ -34,7 +37,7 @@ } src_prepare() { - sed -e '/-fomit-frame-pointer/d' -e '/-mno-align-long-strings/d' \ + sed -e '/-mno-align-long-strings/d' \ -i "${S}"/i386/boot2/Makefile \ -i "${S}"/i386/gptboot/Makefile \ -i "${S}"/i386/gptzfsboot/Makefile \ @@ -44,6 +47,16 @@ src_compile() { strip-flags append-flags "-fno-strict-aliasing" + + if [ -e /usr/bin/clang ] ; then + export CC=clang + else + GCC=`ls -1 /usr/bin/gcc-4.5* | tail -n 1` + if [ -e ${GCC} ] ; then + export CC=${GCC} + fi + fi + NOFLAGSTRIP="yes" freebsd_src_compile }