Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

root/tags/releases/0.99.8/lib/build-gdc.sh

Revision 4431, 1.8 kB (checked in by larsivi, 3 years ago)

Fixed some bashisms

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1 #!/bin/sh -v
2 cd "`dirname $0`"
3
4 while [ "$#" != "0" ]
5 do
6     case "$1" in
7         --debug)
8             DEBUG=1
9             ;;
10     esac
11     shift
12 done
13  
14 # Allow gdc and gdmd to be overriden
15 if [ "$GDC" = "" ]
16 then
17     export GDC=${GDC_PREFIX}gdc${GDC_POSTFIX}
18 fi
19 if [ "$GDMD" = "" ]
20 then
21     export GDMD=${GDC_PREFIX}gdmd${GDC_POSTFIX}
22 fi
23
24 # Make sure scripts are installable (typically zip doesn't preserve x bit)
25 chmod a+x compiler/gdc/configure
26 chmod a+x compiler/gdc/config.guess
27
28 GDC_VER="`$GDC --version | grep 'gdc' | sed 's/^.*gdc \(pre\-\{0,1\}release \)*\([0-9]*\.[0-9]*\).*$/\2/'`"
29 GDC_MAJOR="`echo $GDC_VER | sed 's/\..*//'`"
30 GDC_MINOR="`echo $GDC_VER | sed 's/.*\.//'`"
31 HOST_ARCH="`./compiler/gdc/config.guess | sed 's/-.*//'`"
32 ADD_CFLAGS=
33 if [ "$HOST_ARCH" = "powerpc" -a ! "`./compiler/gdc/config.guess | grep darwin`" ]
34 then
35     ADD_CFLAGS="-mregnames"
36 fi
37
38 if [ "$DEBUG" = "1" ]
39 then
40     ADD_CFLAGS="$ADD_CFLAGS -g"
41 fi
42
43 if [ "$GDC_MAJOR" = "0" -a \
44      "$GDC_MINOR" -lt "23" ]
45 then
46     echo 'This version of Tango requires GDC 0.23 or newer.'
47     exit 1
48 fi
49
50 # Make sure object.di is present for clean GDC installs
51 cp ../object.di compiler/gdc/object.di
52
53 cd ./compiler/gdc
54 ./configure || exit 1
55 cd ../..
56
57 # Remove object.di again
58 rm compiler/gdc/object.di
59
60 # Check make we have
61 MAKE=`which gmake`
62 if [ ! -e "$MAKE" ]
63 then
64     MAKE=`which make`
65     if [ ! "`$MAKE --version | grep 'GNU Make'`" ]
66     then
67         echo 'No supported build tool found.'
68         exit 1
69     fi
70 fi
71
72 export MAKETOOL=$MAKE
73
74 OLDHOME=$HOME
75 export HOME=`pwd`
76 $MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1
77 $MAKE lib doc install -fgdc-posix.mak DC="$GDMD" ADD_CFLAGS="$ADD_CFLAGS" \
78     SYSTEM_VERSION="-version=Posix" || exit 1
79 $MAKE clean -fgdc-posix.mak DC="$GDMD" || exit 1
80 chmod 644 ../tango/core/*.di || exit 1
81
82 export HOME=$OLDHOME
Note: See TracBrowser for help on using the browser.