kind: autotools

sources:
- kind: git
  url: upstream:ccache
  track: baserock/build-essential
  ref: 567631456f0899cdf0c382f898d38aadc8901d32

depends:
- filename: build-essential/stage2.bst
  type: build
- build-essential/glibc.bst
- build-essential/zlib.bst

environment:
  PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin

config:
  configure-commands:
  - ./configure --prefix="%{prefix}"
  install-commands:
  - make DESTDIR="%{install-root}" install
  - mkdir -p "%{install-root}%{prefix}/lib/ccache"
  - for cc in gcc cc g++ c++; do ln -sf "%{prefix}/bin/ccache" "%{install-root}%{prefix}/lib/ccache/$cc";
    done
  - for cc in gcc cc g++ c++; do ln -sf "%{prefix}/bin/ccache" "%{install-root}%{prefix}/lib/ccache/%{target}-$cc";
    done
