dungeon_crawler

view prototype/configure @ 70:f55ddab0f3a4

"fixed" the disappearing lights issue
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 09 Oct 2012 02:54:01 +0300
parents 938a6a155c94
children
line source
1 #!/bin/sh
3 opt=false
4 dbg=true
5 profiling=false
7 while [ $# -gt 0 ]; do
8 case $1 in
9 --prefix=*)
10 PREFIX=`echo $1 | sed 's/--prefix=//'`
11 ;;
12 --enable-*)
13 export `echo $1 | sed 's/--enable-//'`=true
14 ;;
15 --disable-*)
16 export `echo $1 | sed 's/--disable-//'`=false
17 ;;
18 esac
19 shift
20 done
22 echo '# Generated makefile, do not edit' >Makefile
23 echo "PREFIX = $PREFIX" >>Makefile
24 if $opt; then
25 echo 'opt = -O3 -ffast-math' >>Makefile
26 fi
27 if $dbg; then
28 echo 'dbg = -g' >>Makefile
29 fi
30 if $profiling; then
31 echo 'prof = -pg' >>Makefile
32 fi
34 # determine the C++11 flags we need to pass to the C++ compiler
35 if [ -z "$CXX" ]; then
36 CXX=c++
37 fi
39 verstr=`$CXX --version`
40 if echo "$verstr" | grep LLVM; then
41 if echo | $CXX -c -x c++ -o /dev/null -std=c++11 - >/dev/null 2>&1; then
42 cxxflags11='-std=c++11 -stdlib=libc++'
43 ldflags11='-stdlib=libc++'
44 fi
45 else
46 if echo | $CXX -c -x c++ -o /dev/null -std=c++11 - >/dev/null 2>&1; then
47 cxxflags11='-std=c++11'
48 elif echo | $CXX -c -x c++ -o /dev/null -std=c++0x - >/dev/null 2>&1; then
49 cxxflags11='-std=c++0x'
50 fi
51 fi
52 if [ -z "$cxxflags11" ]; then
53 echo 'Failed to find C++11 capable compiler.'
54 fi
56 echo "cxx11_cflags = $cxxflags11" >>Makefile
57 if [ -n "$ldflags11" ]; then
58 echo "cxx11_ldflags = $ldflags11" >>Makefile
59 fi
61 cat Makefile.in >>Makefile