1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit bsdmk freebsd flag-o-matic
9 DESCRIPTION="FreeBSD's bootloader"
11 KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
13 IUSE="bzip2 ieee1394 tftp zfs"
15 SRC_URI="mirror://gentoo/${SYS}.tar.bz2
16 mirror://gentoo/${LIB}.tar.bz2
17 mirror://gentoo/${CONTRIB}.tar.bz2"
20 DEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*
21 =sys-freebsd/freebsd-lib-${RV}*"
23 S="${WORKDIR}/sys/boot"
25 PATCHES=( "${FILESDIR}/${PN}-9.2-gcc46.patch"
26 "${FILESDIR}/${PN}-add-nossp-cflags.patch" )
29 use ${1} && mymakeopts="${mymakeopts} LOADER_${2}_SUPPORT=\"yes\""
33 boot0_use_enable ieee1394 FIREWIRE
34 boot0_use_enable zfs ZFS
35 boot0_use_enable tftp TFTP
36 boot0_use_enable bzip2 BZIP2
40 sed -e '/-fomit-frame-pointer/d' -e '/-mno-align-long-strings/d' \
41 -i "${S}"/i386/boot2/Makefile \
42 -i "${S}"/i386/gptboot/Makefile \
43 -i "${S}"/i386/gptzfsboot/Makefile \
44 -i "${S}"/i386/zfsboot/Makefile || die
49 append-flags "-fno-strict-aliasing"
51 cd "${WORKDIR}/lib/libstand" || die
55 CFLAGS="${CFLAGS} -I${WORKDIR}/lib/libstand"
56 LDFLAGS="${LDFLAGS} -L${WORKDIR}/lib/libstand"
57 export LIBSTAND="${WORKDIR}/lib/libstand/libstand.a"
58 NOFLAGSTRIP="yes" freebsd_src_compile
63 mkinstall FILESDIR=/boot || die "mkinstall failed"