iphone compilation problems

Latest error. This time it is in the simulator environment.

env MACOSX_DEPLOYMENT_TARGET=10.6 PATH="/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++ -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -fpascal-strings -fasm-blocks -miphoneos-version-min=4.0 -o Opt3-OSX-iPhoneSimulator/interrogate Opt3-OSX-iPhoneSimulator/interrogate_interrogate_composite1.o Opt3-OSX-iPhoneSimulator/interrogate_interrogate_composite2.o -L…/cppparser/Opt3-OSX-iPhoneSimulator -L…/dconfig/Opt3-OSX-iPhoneSimulator -L…/dtoolbase/Opt3-OSX-iPhoneSimulator -L…/dtoolutil/Opt3-OSX-iPhoneSimulator -L…/interrogatedb/Opt3-OSX-iPhoneSimulator -L…/prc/Opt3-OSX-iPhoneSimulator -L…/pystub/Opt3-OSX-iPhoneSimulator -L/usr/local/panda/lib -lcppParser -linterrogatedb -ldconfig -ldtoolutil -ldtoolbase -lpystub -ldtoolutil -ldtoolbase -ldconfig -ldtoolutil -ldtoolbase -ldtoolutil -ldtoolbase -lprc -ldtoolbase -ldtoolbase -ldtoolutil -ldtoolbase -framework Foundation
Undefined symbols:
“.objc_class_name_NSAutoreleasePool”, referenced from:
literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libdtoolutil.a(dtoolutil_filename_assist.o)

ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [Opt3-OSX-iPhoneSimulator/interrogate] Error 1
make: *** [interrogate] Error 2

This is what my Config.pp looks like

//#define BUILD_IPHONE iPhoneOS
#define BUILD_IPHONE iPhoneSimulator
#define OSX_DEV_ROOT Developer
#define IOS_SDK_VERSION 4.2

#define HAVE_GLES2 1
#define GLES2_LIBS

#define HAVE_GLES 1
#define GLES_LIBS

#define LINK_ALL_STATIC 1

#define HAVE_FREETYPE
#define HAVE_GL
#define HAVE_OPENSSL
#define HAVE_PYTHON
#define HAVE_TINYDISPLAY
#define HAVE_WX

This is my modified PostConfig.pp

// This file is included after including all of $DTOOL/Config.pp and
// the user’s personal Config.pp file. It makes decisions necessary
// following the user’s Config settings.

#if [and [OSX_PLATFORM],[BUILD_IPHONE]] //#define IOS_PLATFORM iPhoneSimulator #define IOS_PLATFORM [BUILD_IPHONE]

#if $[eq $[IOS_PLATFORM], iPhoneOS] 
	#define ARCH_FLAGS -arch armv7 -arch armv6 -mno-thumb 
	#define osflags -fpascal-strings -miphoneos-version-min=4.0 
	#define DEBUGFLAGS -gdwarf-2 
#elif $[eq $[IOS_PLATFORM], iPhoneSimulator] 
	#define ARCH_FLAGS -arch i386 
	#define osflags -fpascal-strings -fasm-blocks -miphoneos-version-min=4.0 
	#define DEBUGFLAGS -gdwarf-2 -DDEBUG
#else 
	#error Inappropriate value for BUILD_IPHONE. 
#endif 

#define xcode $[OSX_DEV_ROOT] 
#define dev /$[xcode]/Platforms/$[IOS_PLATFORM].platform/Developer 
#define env env MACOSX_DEPLOYMENT_TARGET=10.6 PATH="$[dev]/usr/bin:/$[xcode]/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
#define CC $[env] $[dev]/usr/bin/gcc 
#define CXX $[env] $[dev]/usr/bin/g++ 
#define OSX_CDEFS __IPHONE_OS_VERSION_MIN_REQUIRED=40000 
#define OSX_CFLAGS -isysroot $[dev]/SDKs/$[IOS_PLATFORM]$[IOS_SDK_VERSION].sdk $[osflags] 

#defer ODIR_SUFFIX -$[IOS_PLATFORM]

#endif [/b]