kind: autotools

sources:
- kind: git
  url: upstream:make-tarball
  track: baserock/make-4.1-ttyname-segfault-fix
  ref: 4978d7129e42340ab9efeb0cb9cae4ad0fa052d4

depends:
- filename: build-essential/stage1.bst
  type: build
- build-essential/stage2-linux-api-headers.bst
- build-essential/stage2-glibc.bst

variables:
  prefix: /tools

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

config:
  configure-commands:
  - STAGE2_SYSROOT="$(dirname $(dirname $(pwd)))" CPPFLAGS="--sysroot=$STAGE2_SYSROOT" CXX=false
    LDFLAGS="--sysroot=$STAGE2_SYSROOT" ./configure --prefix="%{prefix}" --disable-nls --without-guile
    --build=$(sh config/config.guess) --host=%{target-stage1}
  build-commands:
  - STAGE2_SYSROOT="$(dirname $(dirname $(pwd)))" make
