summaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorasmodai <asmodai@in-nomine.org>2011-02-28 19:44:33 (GMT)
committerEvan Martin <martine@danga.com>2011-02-28 19:44:33 (GMT)
commita5a707d19e8f6c97724eaa0b8f755cca3b25d6fa (patch)
treeb1ee9a88104ce419800eb6695bad5663bc0a8789 /bootstrap.sh
parent613af34675303acbe6b282ad46dde73a04eb9105 (diff)
downloadNinja-a5a707d19e8f6c97724eaa0b8f755cca3b25d6fa.zip
Ninja-a5a707d19e8f6c97724eaa0b8f755cca3b25d6fa.tar.gz
Ninja-a5a707d19e8f6c97724eaa0b8f755cca3b25d6fa.tar.bz2
bootstrap.sh: FreeBSD support
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 5ac9141..571c98c 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Copyright 2011 Google Inc. All Rights Reserved.
#
@@ -16,18 +16,32 @@
set -e
+SYSTEMNAME=`uname -s`
+
+if [ "${SYSTEMNAME}" = "Linux" ]; then
+ EXTRA_CFLAGS=
+ EXTRA_LDFLAGS=
+elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
+ EXTRA_CFLAGS="-I/usr/local/include"
+ EXTRA_LDFLAGS="-L/usr/local/lib -lexecinfo"
+fi
+
cat >config.ninja <<EOT
# This file is generated by bootstrap.sh.
-conf_cflags = -O2
-conf_ldflags = -s
+conf_cflags = -O2 ${EXTRA_CFLAGS}
+conf_ldflags = -s ${EXTRA_LDFLAGS}
# When developing:
-# conf_cflags = -g -Wall
-# conf_ldlags =
+# conf_cflags = -g -Wall ${EXTRA_CFLAGS}
+# conf_ldlags = ${EXTRA_LDFLAGS}
EOT
echo "Building ninja manually..."
srcs=$(ls src/*.cc | grep -v test)
-g++ -Wno-deprecated -o ninja.bootstrap $srcs
+if [ "${SYSTEMNAME}" = "Linux" ]; then
+ g++ -Wno-deprecated -o ninja.bootstrap $srcs
+elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
+ g++ -Wno-deprecated ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o ninja.bootstrap $srcs
+fi
echo "Building ninja using itself..."
./ninja.bootstrap ninja