I've created fink packaging for a building the llvm
and llvm-gcc-4.2 svn pulls under fink on Mac OS X. Hopefully
the fink info script and patch should be clear enough for
some comments on my build approach. The llvm-gcc and llvm-g++
compilers seem okay so far. The llvm-gfortran compiler seems to
always spew a warning..
WARNING: 128-bit integers not supported!
...even when just compiling a simple helloworld program
with a single print statement. I haven't done a complete
make check-gfortran yet but a partial run looked to be
failing about half of the testsuite. Here is the info
and patch file I am using in fink.
Jack
ps I assume I am supposed to also install the llvm that I
build for the llvm-gcc-4.2 front end as well as the
llvm-gcc-4.2 front end itself.
Info2: <<
Package: llvm-gcc42
Version: 2.1.999
Revision: r45367
Source: llvm-2.2-%r.tar.bz2
Source-MD5: b2489582afc41f1d7d04c7a03e76d96f
Source2: llvm-gcc-4.2-%r.tar.bz2
Source2-MD5: a3bd327510a2af4dbec8044d88deec9b
Type: -64bit
Depends: gmp-shlibs (>= 4.2.1-1), libmpfr1-shlibs (>=
2.2.0-2),libgettext3-shlibs, %N-shlibs (>= %v-%r)
BuildDepends: gmp (>= 4.2.1-1), libmpfr1 (>= 2.2.0-2), gettext-tools,
libgettext3-dev, automake1.9
BuildConflicts: libiconv-dev
ConfigureParams: <<
--prefix=%p/lib/llvm-gcc-4.2 --mandir=%p/share/man --infodir=%p/share/info
--with-gmp=%p --with-libiconv-prefix=/usr --with-system-zlib
<<
PatchScript: <<
#!/bin/sh -ev
cd ../llvm-gcc-4.2-%r
patch -p1 < %a/%n.patch
<<
CompileScript: <<
#!/bin/bash -ev
ulimit -s `ulimit -s`
darwinvers=`uname -r|cut -f1 -d.`
mkdir ../llvm_objdir
cd ../llvm_objdir
if [ `uname -p` = "powerpc" ]; then
TRIPLE=powerpc-apple-darwin$darwinvers
else
TRIPLE=i686-apple-darwin$darwinvers
fi
../llvm-2.2-%r/configure %c --build=$TRIPLE --target=$TRIPLE --host=$TRIPLE
--enable-optimized --enable-assertions
make tools-only
mkdir ../llvm_gcc42_objdir
rm -fr ../llvm-gcc-4.2-%r/libstdc++-v3
cd ../llvm_gcc42_objdir
LLVMOBJDIR="%b/../llvm_objdir"
if [ `uname -p` = "powerpc" ]; then
TRIPLE=powerpc-apple-darwin$darwinvers
TARGETOPTIONS=""
else
TRIPLE=i686-apple-darwin$darwinvers
TARGETOPTIONS="--with-arch=nocona --with-tune=generic"
fi
../llvm-gcc-4.2-%r/configure %c --build=$TRIPLE --target=$TRIPLE --host=$TRIPLE
$TARGETOPTIONS --with-gxx-include-dir=/usr/include/c++/4.0.0
--enable-llvm=$LLVMOB
JDIR --enable-languages=c,c++,fortran
make
<<
InstallScript: <<
#!/bin/sh -ev
cd ../llvm_objdir
make install DESTDIR=%d
cd ../llvm_gcc42_objdir
make install DESTDIR=%d
mkdir -p %i/bin
ln -s %p/lib/llvm-gcc-4.2/bin/gcc %i/bin/llvm-gcc
ln -s %p/lib/llvm-gcc-4.2/bin/g++ %i/bin/llvm-g++
ln -s %p/lib/llvm-gcc-4.2/bin/gfortran %i/bin/llvm-gfortran
ln -s /usr/lib/libstdc++.6.dylib %i/lib/llvm-gcc-4.2/lib/libstdc++.6.dylib
mv %i/share/info/cpp.info %i/share/info/llvm-cpp.info
mv %i/share/info/gcc.info %i/share/info/llvm-gcc.info
mv %i/share/info/cppinternals.info %i/share/info/llvm-cppinternals.info
mv %i/share/info/gccinstall.info %i/share/info/llvm-gccinstall.info
mv %i/share/info/gccint.info %i/share/info/llvm-gccint.info
mv %i/share/info/libgomp.info %i/share/info/llvm-libgomp.info
mv %i/share/info/gfortran.info %i/share/info/llvm-gfortran.info
# remove build path from .la files
perl -pi -e "s, \-L[^ ']*/%n-%v-%r/llvm_objdir/Release/lib[^
']*,,g" `find %i/lib/llvm-gcc-4.2/lib -name '*.la'`
<<
SplitOff: <<
Package: %N-shlibs
Description: Shared libraries for llvm-gcc42
Files: <<
lib/llvm-gcc-4.2/lib/libgfortran.2*.dylib
lib/llvm-gcc-4.2/lib/libgomp.1*.dylib
lib/llvm-gcc-4.2/lib/libgcc_s.1*.dylib
lib/llvm-gcc-4.2/%lib/libgfortran.2*.dylib
lib/llvm-gcc-4.2/%lib/libgomp.1*.dylib
<<
Shlibs: <<
%p/lib/llvm-gcc-4.2/lib/libgfortran.2.dylib 3.0.0 %n (>= 2.1.999-r45361)
32
%p/lib/llvm-gcc-4.2/lib/libgomp.1.dylib 2.0.0 %n (>= 2.1.999-r45361) 32
%p/lib/llvm-gcc-4.2/lib/libgcc_s.1.dylib 1.0.0 %n (>= 2.1.999-r45361)
32-64
%p/lib/llvm-gcc-4.2/%lib/libgfortran.2.dylib 3.0.0 %n (>= 2.1.999-r45361)
64
%p/lib/llvm-gcc-4.2/%lib/libgomp.1.dylib 2.0.0 %n (>= 2.1.999-r45361) 64
<<
<<
License: GPL
Description: Low Level Virtual Machine Compiler
InfoDocs: llvm-cpp.info llvm-gcc.info llvm-cppinternals.info
llvm-gccinstall.info llvm-gccint.info llvm-libgomp.info llvm-gfortran.info
DescDetail: <<
A compilation strategy designed to enable effective program optimization across
the entire lifetime of a program. LLVM supports effective optimization at
compile time, link-time (particularly interprocedural), run-time and offline
(i.e., after software is installed), while remaining transparent to developers
and maintaining compatibility with existing build scripts.
<<
DescPackaging: <<
The tarballs used for this version were created with the commands...
svn co --revision 45367 http://llvm.org/svn/llvm-project/llvm/trunk
llvm-2.2-r45367
tar --exclude=.svn -jcvf llvm-2.2-r45367.tar.bz2 llvm-2.2-r45367
svn co --revision 45367 http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk
llvm-gcc-4.2-r45367
tar --exclude=.svn -jcvf llvm-gcc-4.2-r45367.tar.bz2 llvm-gcc-4.2-r45367
<<
Homepage: http://llvm.org/
Maintainer: Jack Howarth <howarth at bromo.med.uc.edu>
<<
--- llvm-gcc-4.2-r45367.org/configure 2007-12-27 14:08:30.000000000 -0500
+++ llvm-gcc-4.2-r45367/configure 2007-12-27 14:09:33.000000000 -0500
@@ -1224,7 +1224,7 @@
noconfigdirs="$noconfigdirs sim target-rda"
# LLVM LOCAL begin
noconfigdirs="$noconfigdirs target-boehm-gc target-libffi"
- noconfigdirs="$noconfigdirs target-libgfortran target-libjava"
+ noconfigdirs="$noconfigdirs target-libjava"
noconfigdirs="$noconfigdirs target-libmudflap target-libobjc"
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3
target-zlib"
# LLVM LOCAL end
@@ -1235,7 +1235,7 @@
noconfigdirs="$noconfigdirs ${libgcj}"
# LLVM LOCAL begin
noconfigdirs="$noconfigdirs target-boehm-gc target-libffi"
- noconfigdirs="$noconfigdirs target-libgfortran target-libjava"
+ noconfigdirs="$noconfigdirs target-libjava"
noconfigdirs="$noconfigdirs target-libmudflap target-libobjc"
noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3
target-zlib"
# LLVM LOCAL end