Find nacl-gcc via PATH rather than hard-coding a relative pathname
[glibc/nacl-glibc.git] / myconfig.sh
blob5188b624c02d74d2b56620bd63b4dd52e603929a
1 #!/bin/bash
3 set -e
5 # Since we are taking Linux glibc as a starting point we need the
6 # Linux kernel headers. In the long term we will need Linux's errno
7 # numbers, but probably nothing more.
8 rm -rf kernel-headers
9 mkdir kernel-headers
10 cp -a /usr/include/asm /usr/include/asm-generic /usr/include/linux \
11 kernel-headers/
13 if ! which nacl-gcc >/dev/null; then
14 echo Error: nacl-gcc not found on PATH
15 exit 1
18 BUILDDIR=build
19 mkdir -p $BUILDDIR
20 PREFIX=$(cd .. && pwd)/install
21 cd $BUILDDIR
22 ../configure --prefix=$PREFIX --host=i486-linux-gnu \
23 CC="`which nacl-gcc` -L`pwd`/../ld" \
24 CFLAGS="-march=i486 -pipe -fstrict-aliasing -O2 -g -mno-tls-direct-seg-refs" \
25 --with-headers=`pwd`/../kernel-headers --enable-kernel=2.2.0
26 # --disable-shared