src_compile

Function src_compile
Purpose Configure and build the package.
Sandbox Enabled
Privilege user
Called for ebuild

Default src_compile

with EAPI=0,1

src_compile() {
    if [ -x ./configure ]; then
        econf
    fi
    if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
        emake || die "emake failed"
    fi
}

with EAPI=2

src_compile() {
    if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
        emake || die "emake failed"
    fi
}

Sample src_compile

with EAPI=0

src_compile() {
    use sparc && filter-flags -fomit-frame-pointer
    append-ldflags -Wl,-z,now

    econf \
        $(use_enable ssl ) \
        $(use_enable perl perlinterp )

    emake || die "Make failed!"
}

with EAPI=2

porting the above example to EAPI=2, you won't need to define an extra src_compile, as it only calls emake (which is the default src_compile function).

src_compile Processes

The following subsections cover different topics which often occur when writing src_compile functions.