script to build gdc trunk against apple gcc-5465 on leopard

Dave Cheney dave at cheney.net
Tue Dec 18 08:11:06 PST 2007


Hi

I've been working on a script that produces a working build of gdc 
against apples gcc-5465. The script will download all the necessary 
depenancies and produce a destroot/ containing a working gdc  complier. 
I have used this to build an app .pkg file containing an installable 
version of gdc for leopard which is >>> this <<< close to working. For 
reasons that I don't understand it doesn't pick up the system include 
path, /usr/include/d/4.0.1 so you have to include it manually

[dave at crimson oakland]$ gdc -v
Using built-in specs.
Target: i686-apple-darwin9.1.0
Configured with: /Users/dave/devel/gdc-apple/work/gcc-5465/configure 
--prefix=/Users/dave/devel/gdc-apple/destroot --enable-languages=c,d 
--with-system-zlib --disable-nls --disable-multilib
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465) (gdc 0.24, using dmd 1.022)
[dave at crimson oakland]$ gdmd -v helloworld.d -I/usr/include/d/4.0.1
parse     helloworld
semantic  helloworld
import    object	(/usr/include/d/4.0.1/object.d)
semantic2 helloworld
semantic3 helloworld
code      helloworld

If anyone can offer any advice on the proper build switches to remove 
the requirement to have to include /usr/include/d/4.0.1 that would be 
greatly appreciated.

Feedback and comments are most welcome

Kind Regards

Dave Cheney

ps. you can also download the script here, 
http://dave.cheney.net/paste/build-gdc.sh
pps. for the extra adventous you can download the package maker file 
and build your own gdc, 
http://dave.cheney.net/paste/gdc-5465.pmdoc.tar.gz

--- cut here ---

#!/bin/bash

WORKDIR=`pwd`/work
SRCDIR=`pwd`/src
DESTROOT=`pwd`/destroot
SETUP_GCC_ARGS="--d-language-version=1"

if [ ! -d $SRCDIR ]; then
	mkdir $SRCDIR
fi

if [ ! -d $SRCDIR/dgcc ]; then
	svn co https://dgcc.svn.sourceforge.net/svnroot/dgcc/trunk $SRCDIR/dgcc
else
	svn up $SRCDIR/dgcc
fi

if [ ! -f $SRCDIR/gcc-5465.tar.gz ]; then
 	curl 
http://www.opensource.apple.com/darwinsource/tarballs/other/gcc-5465.tar.gz 
> $SRCDIR/gcc-5465.tar.gz
fi

rm -rf $WORKDIR
rm -rf $DESTROOT
mkdir -p $WORKDIR
mkdir -p $DESTROOT
pushd $WORKDIR

tar xfz $SRCDIR/gcc-5465.tar.gz
cp -r $SRCDIR/dgcc/d $WORKDIR/gcc-5465/gcc

pushd $WORKDIR/gcc-5465
./gcc/d/setup-gcc.sh
popd

$WORKDIR/gcc-5465/configure \
	--prefix=$DESTROOT \
	--enable-languages=c,d \
	--with-system-zlib \
	--disable-nls \
	--disable-multilib
	# --disable-checking \
	# -enable-werror \
	# --prefix=/usr --mandir=/share/man
	# --enable-languages=c,c++,d \
	# --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ \
	# --with-gxx-include-dir=/include/c++/4.0.0 \
	# --with-slibdir=/usr/lib
	# --build=i686-apple-darwin9 \
	# --with-arch=nocona \
	# --with-tune=generic \
	# --host=i686-apple-darwin9 \
	# --target=i686-apple-darwin9 \

	
make && make install

popd

--- cut here ---



More information about the D.gnu mailing list