# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 102180 2013-01-29 10:20:41Z raimue@macports.org $

PortSystem          1.0

name                ccache
version             3.1.9
categories          devel
platforms           darwin freebsd
license             GPL-3+

maintainers         landonf openmaintainer

description         object-file caching compiler wrapper

long_description \
    ccache is a compiler cache.  It acts as a caching pre-processor to C/C++ \
    compilers, using the -E compiler switch and a hash to detect when a \
    compilation can be satisfied from cache.  This often results in a 5 to 10 \
    times speedup in common compilations.

homepage            http://ccache.samba.org/
master_sites        http://samba.org/ftp/ccache/
use_bzip2 yes

checksums           sha1    e80a5cb7301e72f675097246d722505ae56e3cd3 \
                    rmd160  9b6941d02b65396fe100668a7e79d78d04250cb0

configure.args      --mandir=${prefix}/share/man

set symlinks_dir    ${prefix}/libexec/ccache

depends_lib         port:zlib

post-destroot {
    file mkdir ${destroot}${symlinks_dir}

    foreach {bin} {
        cc
        gcc gcc2    gcc3    gcc-3.3 gcc-4.0 gcc-4.2
        c++ c++3    c++-3.3 c++-4.0 c++-4.2
        g++ g++2    g++3    g++-3.3 g++-4.0 g++-4.2
    } {
        ln -sf ${prefix}/bin/ccache ${destroot}${symlinks_dir}/${bin}
    }
}

notes "The ccache symlinks are installed in ${symlinks_dir}"
