llvm 2.2 build problems

I'm getting an error when trying to build llvm 2.2's tblgen:

llvm[2]: Linking Release executable tblgen (without symbols)
/usr/bin/ld: Undefined symbols:
llvm::MemoryBuffer::getFileOrSTDIN(char const*, unsigned int,
std::basic_string<char, std::char_traits<char>, std::allocator<char>

*, long long)

llvm::cl::ParseCommandLineOptions(int, char**, char const*)

It's being run with this to configure: "./configure
--prefix=/opt/local --enable-optimized --enable-jit"

and this to build: "make tools-only"

What am I doing wrong? I'm on an intel macbook pro running 10.4.11.

Finally, here's the full build log:

llvm[1]: Compiling Alarm.cpp for Release build
llvm[1]: Compiling Disassembler.cpp for Release build
llvm[1]: Compiling DynamicLibrary.cpp for Release build
llvm[1]: Compiling IncludeFile.cpp for Release build
llvm[1]: Compiling MappedFile.cpp for Release build
llvm[1]: Compiling Memory.cpp for Release build
llvm[1]: Compiling Mutex.cpp for Release build
llvm[1]: Compiling Path.cpp for Release build
llvm[1]: Compiling Process.cpp for Release build
llvm[1]: Compiling Program.cpp for Release build
llvm[1]: Compiling Signals.cpp for Release build
llvm[1]: Compiling TimeValue.cpp for Release build
llvm[1]: Compiling ltdl.c for Release build
llvm[1]: Building Release Archive Library libLLVMSystem.a
llvm[1]: Compiling APFloat.cpp for Release build
APFloat.cpp: In constructor 'llvm::APFloat::APFloat(const
llvm::fltSemantics&, const char*)':
APFloat.cpp:680: warning: control may reach end of non-void function
'llvm::APFloat::opStatus llvm::APFloat::convertFromString(const char*,
llvm::APFloat::roundingMode)' being inlined
llvm[1]: Compiling APInt.cpp for Release build
llvm[1]: Compiling Allocator.cpp for Release build
llvm[1]: Compiling Annotation.cpp for Release build
llvm[1]: Compiling CommandLine.cpp for Release build
llvm[1]: Compiling ConstantRange.cpp for Release build
llvm[1]: Compiling Debug.cpp for Release build
llvm[1]: Compiling Dwarf.cpp for Release build
llvm[1]: Compiling FileUtilities.cpp for Release build
llvm[1]: Compiling FoldingSet.cpp for Release build
llvm[1]: Compiling GraphWriter.cpp for Release build
llvm[1]: Compiling IsInf.cpp for Release build
llvm[1]: Compiling IsNAN.cpp for Release build
llvm[1]: Compiling ManagedStatic.cpp for Release build
llvm[1]: Compiling MemoryBuffer.cpp for Release build
llvm[1]: Compiling PluginLoader.cpp for Release build
llvm[1]: Compiling SlowOperationInformer.cpp for Release build
llvm[1]: Compiling SmallPtrSet.cpp for Release build
llvm[1]: Compiling Statistic.cpp for Release build
llvm[1]: Compiling Streams.cpp for Release build
llvm[1]: Compiling StringExtras.cpp for Release build
llvm[1]: Compiling StringMap.cpp for Release build
llvm[1]: Compiling StringPool.cpp for Release build
llvm[1]: Compiling SystemUtils.cpp for Release build
llvm[1]: Compiling Timer.cpp for Release build
llvm[1]: Building Release Archive Library libLLVMSupport.a
llvm[2]: Compiling AsmWriterEmitter.cpp for Release build
llvm[2]: Compiling CallingConvEmitter.cpp for Release build
llvm[2]: Compiling CodeEmitterGen.cpp for Release build
llvm[2]: Compiling CodeGenDAGPatterns.cpp for Release build
llvm[2]: Compiling CodeGenInstruction.cpp for Release build
llvm[2]: Compiling CodeGenTarget.cpp for Release build
llvm[2]: Compiling DAGISelEmitter.cpp for Release build
llvm[2]: Compiling InstrEnumEmitter.cpp for Release build
llvm[2]: Compiling InstrInfoEmitter.cpp for Release build
llvm[2]: Compiling IntrinsicEmitter.cpp for Release build
llvm[2]: Compiling Record.cpp for Release build
llvm[2]: Compiling RegisterInfoEmitter.cpp for Release build
llvm[2]: Compiling SubtargetEmitter.cpp for Release build
llvm[2]: Compiling TGLexer.cpp for Release build
llvm[2]: Compiling TGParser.cpp for Release build
llvm[2]: Compiling TableGen.cpp for Release build
llvm[2]: Compiling TableGenBackend.cpp for Release build
llvm[2]: Linking Release executable tblgen (without symbols)
/usr/bin/ld: Undefined symbols:
llvm::MemoryBuffer::getFileOrSTDIN(char const*, unsigned int,
std::basic_string<char, std::char_traits<char>, std::allocator<char>

*, long long)

llvm::cl::ParseCommandLineOptions(int, char**, char const*)
collect2: ld returned 1 exit status

Thanks!

It turns out my problem was that I still had llvm-2.0 installed, and
I'm guessing the build script was finding 2.0's libLLVMSupport.a
instead of the one that was just built. I think this happened because
macports (which I'm making the llvm build script for) specifies these
environment variables:

CFLAGS='-O2' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2'
CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2'
LDFLAGS='-L/opt/local/lib' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0'
INSTALL='/usr/bin/install' OBJCFLAGS='-O2' FFLAGS='-O2'
CC='/usr/bin/gcc-4.0'

If I run the build without CPPFLAGS='-I/opt/local/include' and
LDFLAGS='-L/opt/local/lib' specified it builds fine. Is there anything
that could be changed so that this conflict doesn't happen again?