3 # Copyright 2011 Google Inc. All Rights Reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Compute system-specific CFLAGS/LDFLAGS as used in both in the below
22 # g++ call as well as in the later configure.py.
23 if [ "${SYSTEMNAME}" = "Linux" ]; then
24 export CFLAGS="${CFLAGS}"
25 export LDFLAGS="${LDFLAGS}"
26 elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
27 export CFLAGS="${CFLAGS} -I/usr/local/include"
28 export LDFLAGS="${LDFLAGS} -L/usr/local/lib"
31 echo "Building ninja manually..."
33 ./src/inline.sh kBrowsePy < src/browse.py > build/browse_py.h
35 pattern='test\.cc$\|\.in\.cc$'
38 pattern="$pattern"'\|/browse\.cc$\|/subprocess\.cc$'
41 pattern="$pattern"'\|-win32\.cc$'
44 srcs=$(ls src/*.cc | grep -v "$pattern")
46 ${CXX:-g++} -Wno-deprecated ${CFLAGS} ${LDFLAGS} -o ninja.bootstrap $srcs
48 echo "Building ninja using itself..."