summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-24 15:29:27 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-24 15:29:27 -0800
commit1810885d58ee9a72b7c52092741b4cf2b91dc833 (patch)
treeccb6bcb792e9ea013d23f5ac30efabec296f51ae
parent53921862b61b4c33f29c8810898deb354d02fb28 (diff)
downloadmcbind-1810885d58ee9a72b7c52092741b4cf2b91dc833.tar.gz
Update configure to work on FreeBSD.
-rwxr-xr-xconfigure89
1 files changed, 48 insertions, 41 deletions
diff --git a/configure b/configure
index 03d334b..c075a65 100755
--- a/configure
+++ b/configure
@@ -1,60 +1,67 @@
-#!/bin/bash
+#!/usr/bin/env bash
prefix="/usr/local"
for i in `seq 300`; do
- echo "Lots of output to emulate automake... ok"
- echo "Testing for things you'll never use... fail"
- echo "Satisfying the fortran77 lobby... ok"
- echo "Burning CPU time checking for the bloody obvious... ok"
+ echo "Lots of output to emulate automake... ok"
+ echo "Testing for things you'll never use... fail"
+ echo "Satisfying the fortran77 lobby... ok"
+ echo "Burning CPU time checking for the bloody obvious... ok"
done
echo "Automake emulated successfully"
INST_ROOT='/usr/local'
for arg in $*; do
- shift 1
- echo $*
- case $arg in
- "--redo" | "-r")
- if [ -f ./configvar_cache ]; then
- . ./configvar_cache
- fi
- ;;
- --prefix=*)
- prefix=`echo $arg | sed 's/^--prefix=//g'`
- ;;
- --clanglib=*)
- clanglib=`echo $arg | sed 's/^--clanglib=//g'`
- ;;
- --clanginc=*)
- clanginc=`echo $arg | sed 's/^--clanginc=//g'`
- ;;
- "--prefix" | "--clangpath"| "--help" | "-h")
- echo "Usage:"
- echo " --prefix=pfx : The prefix to install to"
- echo " --clangdir=dir : The path to find clang in"
- break;
- ;;
- *) echo "Unrecognized argument $arg";;
- esac
+ shift 1
+ echo $*
+ case $arg in
+ "--redo" | "-r")
+ if [ -f ./configvar_cache ]; then
+ . ./configvar_cache
+ fi
+ ;;
+ --prefix=*)
+ prefix=`echo $arg | sed 's/^--prefix=//g'`
+ ;;
+ --clanglib=*)
+ clanglib=`echo $arg | sed 's/^--clanglib=//g'`
+ ;;
+ --clanginc=*)
+ clanginc=`echo $arg | sed 's/^--clanginc=//g'`
+ ;;
+ "--prefix" | "--clangpath"| "--help" | "-h")
+ echo "Usage:"
+ echo " --prefix=pfx : The prefix to install to"
+ echo " --clangdir=dir : The path to find clang in"
+ break;
+ ;;
+ *) echo "Unrecognized argument $arg";;
+ esac
done
OS=`uname`
-for version in "" -3.7 -3.6 -3.5 3.4; do
- if [ ! -z "`which llvm-config$version`" ]; then
- llc=llvm-config$version
- break
- fi
+# god damn it, llvm...
+for version in "" `seq 10 -1 1`; do
+ if [ ! -z "`which llvm-config3$version`" ]; then
+ llc=llvm-config3$version
+ break
+ elif [ ! -z "`which llvm-config3.$version`" ]; then
+ llc=llvm-config3.$version
+ break
+ elif [ ! -z "`which llvm-config-3.$version`" ]; then
+ llc=llvm-config-3.$version
+ break
+ fi
done
if [ -z "$clanglib" ]; then
- clanglib=`$llc --libdir`
+ clanglib=`$llc --libdir`
fi
if [ -z "$clanginc" ]; then
- clanginc=`$llc --includedir`
+ clanginc=`$llc --includedir`
fi
echo "export INST_ROOT=$prefix" > config.mk
@@ -64,9 +71,9 @@ echo "export LDFLAGS+=-L$clanglib -lclang" >> config.mk
echo "prefix=$prefix" > configvar_cache
echo "clangdir=$clangdir" > configvar_cache
cat << EOF
- Building with:
- prefix=$prefix
- clanglib=$clanglib
- clanglib=$clanginc
+Building with:
+prefix=$prefix
+clanglib=$clanglib
+clanglib=$clanginc
EOF