summaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorElliott Hird <penguinofthegods@gmail.com>2011-12-15 14:52:22 (GMT)
committerElliott Hird <penguinofthegods@gmail.com>2011-12-15 19:34:49 (GMT)
commit075847031b6cf7b9de3bb7c42648a74d168a752b (patch)
treea28a6887fc3b9942acc90e1368149fde51065c18 /bootstrap.sh
parent121f36d59f293263b9a27d01a8112de17978c5d1 (diff)
downloadNinja-075847031b6cf7b9de3bb7c42648a74d168a752b.zip
Ninja-075847031b6cf7b9de3bb7c42648a74d168a752b.tar.gz
Ninja-075847031b6cf7b9de3bb7c42648a74d168a752b.tar.bz2
Rewrite the bootstrap script in Python
This allows trouble-free builds on platforms with non-standard Python executable names. As a bonus, it passes the arguments received on to configure.py, so you don't have to reconfigure to build in a non-standard manner.
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh53
1 files changed, 0 insertions, 53 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index 35ffd9e..0000000
--- a/bootstrap.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# Copyright 2011 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-SYSTEMNAME=`uname -s`
-
-# Compute system-specific CFLAGS/LDFLAGS as used in both in the below
-# g++ call as well as in the later configure.py.
-if [ "${SYSTEMNAME}" = "Linux" ]; then
- export CFLAGS="${CFLAGS}"
- export LDFLAGS="${LDFLAGS}"
-elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
- export CFLAGS="${CFLAGS} -I/usr/local/include"
- export LDFLAGS="${LDFLAGS} -L/usr/local/lib"
-fi
-
-echo "Building ninja manually..."
-mkdir -p build
-./src/inline.sh kBrowsePy < src/browse.py > build/browse_py.h
-
-pattern='test\.cc$\|\.in\.cc$'
-case "$SYSTEMNAME" in
- MINGW32*)
- pattern="$pattern"'\|/browse\.cc$\|/subprocess\.cc$'
- ;;
- *)
- pattern="$pattern"'\|-win32\.cc$'
- ;;
-esac
-srcs=$(ls src/*.cc | grep -v "$pattern")
-
-${CXX:-g++} -Wno-deprecated ${CFLAGS} ${LDFLAGS} -o ninja.bootstrap $srcs
-
-echo "Building ninja using itself..."
-python ./configure.py
-./ninja.bootstrap
-rm ninja.bootstrap
-
-echo "Done!"