Commits

Tuukka Norri committed 8d1d401

Build system, libpq headers
- Changed SCNetworkReachabilityFlags back to SCNetworkConnectionFlags, because the former isn't defined in Mac OS X 10.5 SDK.
- Rewrote the libpq build script as a makefile.
- libpq is now built in release configuration even when making a debug build of BaseTen.
- Architecture-independent PostgreSQL headers are now copied only once to BaseTen.framework.
- Added headers to include the corrent architecture-dependent PostgreSQL header.
- BXSocketDescriptor now compiles when Mac OS X 10.5 SDK is in use.
- Changed NSPointerArray and NSMapTable additions so that the new methods are defined in categories for these classes instead of NSObject. Adding the category to NSObject caused problems with NSFileWrapper deallocation.
- Changed BXDatabaseObjectModelXMLSerialization so that entities and attributes are sorted in the resulting document. This way the results can be compared more easily.
- Changed build configurations so that debug builds can be made for any supported architecture, not just the build machine's native architecture.
- Building for ppc64 works again.
- Made NSNetServiceDelegate conditional because the protocol isn't available in Mac OS X 10.5 SDK.

  • Participants
  • Parent commits d91ac98

Comments (0)

Files changed (74)

File BaseTen.xcodeproj/project.pbxproj

 		530A6A571199B9CA00ED63FD /* PGTSAsynchronousConnector.m in Sources */ = {isa = PBXBuildFile; fileRef = 530A6A531199B9CA00ED63FD /* PGTSAsynchronousConnector.m */; };
 		530A6A581199B9CA00ED63FD /* PGTSSynchronousConnector.h in Headers */ = {isa = PBXBuildFile; fileRef = 530A6A541199B9CA00ED63FD /* PGTSSynchronousConnector.h */; };
 		530A6A591199B9CA00ED63FD /* PGTSSynchronousConnector.m in Sources */ = {isa = PBXBuildFile; fileRef = 530A6A551199B9CA00ED63FD /* PGTSSynchronousConnector.m */; };
+		5314FA1F11CC3B0F000D213B /* libpq.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5314FA1E11CC3B0F000D213B /* libpq.a */; };
 		531A21500DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.h in Headers */ = {isa = PBXBuildFile; fileRef = 531A214E0DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.h */; };
 		531A21510DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.m in Sources */ = {isa = PBXBuildFile; fileRef = 531A214F0DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.m */; };
 		531A21560DE4324D006C757A /* BXPGAutocommitConnectionResetRecoveryAttempter.h in Headers */ = {isa = PBXBuildFile; fileRef = 531A21540DE4324D006C757A /* BXPGAutocommitConnectionResetRecoveryAttempter.h */; };
 		534BE4680F34F7130098951C /* BXForeignKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 5328FBD40C4580CD006DE171 /* BXForeignKey.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		534E3C7D11A77088002D49C8 /* BXSocketReachabilityObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 534E3C7B11A77088002D49C8 /* BXSocketReachabilityObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		534E3C7E11A77088002D49C8 /* BXSocketReachabilityObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E3C7C11A77088002D49C8 /* BXSocketReachabilityObserver.m */; };
+		534F122011CC302E00DC4F62 /* postgresql in Headers */ = {isa = PBXBuildFile; fileRef = 534F101911CC302E00DC4F62 /* postgresql */; settings = {ATTRIBUTES = (Private, ); }; };
 		53526E0A0E5D70EB00B67550 /* BXPredicateVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 53526E080E5D70EB00B67550 /* BXPredicateVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53526E0E0E5D909B00B67550 /* BXPGFromItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 539A84DA0E5B3AFF00A2625C /* BXPGFromItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53526E0F0E5D909B00B67550 /* BXPGFromItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 539A84DB0E5B3AFF00A2625C /* BXPGFromItem.m */; };
 		5354F87B0F004A6600422613 /* BXExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 5354F87A0F004A6600422613 /* BXExport.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5354F91E0F00511100422613 /* PGTSDeleteRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 5354F91C0F00511100422613 /* PGTSDeleteRule.h */; };
 		5354F91F0F00511100422613 /* PGTSDeleteRule.m in Sources */ = {isa = PBXBuildFile; fileRef = 5354F91D0F00511100422613 /* PGTSDeleteRule.m */; };
-		5355C08911A8725700C5DEAF /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5355C08811A8725700C5DEAF /* CoreServices.framework */; };
 		5356277D0E6E7D1F002EA3FD /* BXPGInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 530132E209D460230037C485 /* BXPGInterface.m */; };
 		535661D10F025DD800920008 /* NSURL+BaseTenAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 535661CB0F025DD800920008 /* NSURL+BaseTenAdditions.m */; };
 		535661D20F025DD800920008 /* NSURL+BaseTenAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 535661CC0F025DD800920008 /* NSURL+BaseTenAdditions.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		535F24C10E8AA62800311CB5 /* BXPGObjectExpressionValueType.m in Sources */ = {isa = PBXBuildFile; fileRef = 535F24BF0E8AA62800311CB5 /* BXPGObjectExpressionValueType.m */; };
 		535F24EE0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.h in Headers */ = {isa = PBXBuildFile; fileRef = 535F24EC0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.h */; };
 		535F24EF0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.m in Sources */ = {isa = PBXBuildFile; fileRef = 535F24ED0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.m */; };
-		53617F271035AF8A003CE4F5 /* libpq-fe.h in Headers */ = {isa = PBXBuildFile; fileRef = 53617F261035AF8A003CE4F5 /* libpq-fe.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53617F7F1035B89D003CE4F5 /* BXPGSQLScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 53617F681035B89D003CE4F5 /* BXPGSQLScanner.h */; };
 		53617F801035B89D003CE4F5 /* BXPGSQLScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 53617F691035B89D003CE4F5 /* BXPGSQLScanner.m */; };
 		53617F891035B89D003CE4F5 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 53617F731035B89D003CE4F5 /* common.c */; };
 		53857A8011921B0100426CEA /* libpq_additions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53915F9C0E3FD22D0098B419 /* libpq_additions.h */; };
 		53857A8111921B0200426CEA /* PGTSConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 53666CB40E1CD8D20028DBEA /* PGTSConstants.h */; };
 		53857A9D11921B5900426CEA /* PGTS.h in Headers */ = {isa = PBXBuildFile; fileRef = 53666C9B0E1CD8D20028DBEA /* PGTS.h */; };
-		53857A9E11921B5900426CEA /* libpq-fe.h in Headers */ = {isa = PBXBuildFile; fileRef = 53617F261035AF8A003CE4F5 /* libpq-fe.h */; };
 		53857AA711921B8100426CEA /* BXPredicateVisitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 53526E090E5D70EB00B67550 /* BXPredicateVisitor.m */; };
 		53857AAA11921B8500426CEA /* BXPredicateVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 53526E080E5D70EB00B67550 /* BXPredicateVisitor.h */; };
 		53857AAB11921B8600426CEA /* BXPGExpressionVisitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 53CE94040E64119500063193 /* BXPGExpressionVisitor.m */; };
 		53E3B1BE0E55BFC9001A99B5 /* PGTSAbstractObjectDescription.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53666CA10E1CD8D20028DBEA /* PGTSAbstractObjectDescription.mm */; };
 		53E3B1DA0E55C8B6001A99B5 /* PGTSNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 53666CC70E1CD8D20028DBEA /* PGTSNotification.m */; };
 		53E3B1EB0E55C8D8001A99B5 /* PGTSConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 53666CB50E1CD8D20028DBEA /* PGTSConstants.m */; };
+		53E8522611CE2D7700588B12 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53E8522511CE2D7700588B12 /* CoreServices.framework */; };
 		53E8985E1035B97D0062AA4D /* psqlscan.l in Sources */ = {isa = PBXBuildFile; fileRef = 53617F6B1035B89D003CE4F5 /* psqlscan.l */; };
 		53ED2E8E0E1AB7CB0095BE8B /* BXLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 53ED2E8C0E1AB7CB0095BE8B /* BXLogger.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		53F9D04C11B0828900600413 /* PGTSOids.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F9D04A11B0828900600413 /* PGTSOids.h */; };
 		530A6A551199B9CA00ED63FD /* PGTSSynchronousConnector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSSynchronousConnector.m; path = Sources/PGTSSynchronousConnector.m; sourceTree = "<group>"; };
 		530ADD8309ED21EF004A13C3 /* BaseTen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = BaseTen.h; path = Sources/BaseTen.h; sourceTree = "<group>"; };
 		531266E40B68F9CA00637EDA /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
+		5314FA1E11CC3B0F000D213B /* libpq.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpq.a; path = "../Release/BaseTen-PostgreSQL/universal/lib/libpq.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		531A214E0DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGConnectionResetRecoveryAttempter.h; path = Sources/BXPGConnectionResetRecoveryAttempter.h; sourceTree = "<group>"; };
 		531A214F0DE431D1006C757A /* BXPGConnectionResetRecoveryAttempter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXPGConnectionResetRecoveryAttempter.m; path = Sources/BXPGConnectionResetRecoveryAttempter.m; sourceTree = "<group>"; };
 		531A21540DE4324D006C757A /* BXPGAutocommitConnectionResetRecoveryAttempter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGAutocommitConnectionResetRecoveryAttempter.h; path = Sources/BXPGAutocommitConnectionResetRecoveryAttempter.h; sourceTree = "<group>"; };
 		534E3C7B11A77088002D49C8 /* BXSocketReachabilityObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXSocketReachabilityObserver.h; path = Sources/BXSocketReachabilityObserver.h; sourceTree = "<group>"; };
 		534E3C7C11A77088002D49C8 /* BXSocketReachabilityObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXSocketReachabilityObserver.m; path = Sources/BXSocketReachabilityObserver.m; sourceTree = "<group>"; };
 		534EE22F0E53213300B079B0 /* libBaseTen.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBaseTen.a; sourceTree = BUILT_PRODUCTS_DIR; };
+		534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "external-release.xcconfig"; sourceTree = "<group>"; };
+		534F100D11CC2E2700DC4F62 /* ecpg_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ecpg_config.h; path = Sources/ecpg_config.h; sourceTree = "<group>"; };
+		534F100E11CC2E2700DC4F62 /* pg_config_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pg_config_os.h; path = Sources/pg_config_os.h; sourceTree = "<group>"; };
+		534F100F11CC2E2700DC4F62 /* pg_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pg_config.h; path = Sources/pg_config.h; sourceTree = "<group>"; };
+		534F101911CC302E00DC4F62 /* postgresql */ = {isa = PBXFileReference; lastKnownFileType = folder; name = postgresql; path = "../Release/BaseTen-PostgreSQL/universal/postgresql"; sourceTree = BUILT_PRODUCTS_DIR; };
 		53526E080E5D70EB00B67550 /* BXPredicateVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPredicateVisitor.h; path = Sources/BXPredicateVisitor.h; sourceTree = "<group>"; };
 		53526E090E5D70EB00B67550 /* BXPredicateVisitor.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.objc; fileEncoding = 4; name = BXPredicateVisitor.m; path = Sources/BXPredicateVisitor.m; sourceTree = "<group>"; };
 		535444130D634A47002A6C47 /* BaseTen.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BaseTen.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		5354F87A0F004A6600422613 /* BXExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXExport.h; path = Sources/BXExport.h; sourceTree = "<group>"; };
 		5354F91C0F00511100422613 /* PGTSDeleteRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSDeleteRule.h; path = Sources/PGTSDeleteRule.h; sourceTree = "<group>"; };
 		5354F91D0F00511100422613 /* PGTSDeleteRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSDeleteRule.m; path = Sources/PGTSDeleteRule.m; sourceTree = "<group>"; };
-		5355C08811A8725700C5DEAF /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
 		535661CB0F025DD800920008 /* NSURL+BaseTenAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSURL+BaseTenAdditions.m"; path = "Sources/NSURL+BaseTenAdditions.m"; sourceTree = "<group>"; };
 		535661CC0F025DD800920008 /* NSURL+BaseTenAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSURL+BaseTenAdditions.h"; path = "Sources/NSURL+BaseTenAdditions.h"; sourceTree = "<group>"; };
 		535661CD0F025DD800920008 /* NSArray+BaseTenAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSArray+BaseTenAdditions.h"; path = "Sources/NSArray+BaseTenAdditions.h"; sourceTree = "<group>"; };
 		535F24BF0E8AA62800311CB5 /* BXPGObjectExpressionValueType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXPGObjectExpressionValueType.m; path = Sources/BXPGObjectExpressionValueType.m; sourceTree = "<group>"; };
 		535F24EC0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGIdentityExpressionValueType.h; path = Sources/BXPGIdentityExpressionValueType.h; sourceTree = "<group>"; };
 		535F24ED0E8AA96B00311CB5 /* BXPGIdentityExpressionValueType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXPGIdentityExpressionValueType.m; path = Sources/BXPGIdentityExpressionValueType.m; sourceTree = "<group>"; };
-		53617F261035AF8A003CE4F5 /* libpq-fe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "libpq-fe.h"; path = "Sources/libpq-fe.h"; sourceTree = "<group>"; };
 		53617F681035B89D003CE4F5 /* BXPGSQLScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXPGSQLScanner.h; path = Sources/BXPGSQLScanner.h; sourceTree = "<group>"; };
 		53617F691035B89D003CE4F5 /* BXPGSQLScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BXPGSQLScanner.m; path = Sources/BXPGSQLScanner.m; sourceTree = "<group>"; };
-		53617F6B1035B89D003CE4F5 /* psqlscan.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = psqlscan.l; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/psqlscan.l"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F6C1035B89D003CE4F5 /* psqlscan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = psqlscan.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/psqlscan.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F6D1035B89D003CE4F5 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/common.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F6E1035B89D003CE4F5 /* print.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = print.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/print.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F6F1035B89D003CE4F5 /* settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = settings.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/settings.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F701035B89D003CE4F5 /* variables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = variables.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/variables.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F711035B89D003CE4F5 /* dumputils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dumputils.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/pg_dump/dumputils.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F721035B89D003CE4F5 /* stringutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stringutils.h; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/stringutils.h"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F731035B89D003CE4F5 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = common.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/common.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F741035B89D003CE4F5 /* copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = copy.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/copy.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F751035B89D003CE4F5 /* dumputils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dumputils.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/pg_dump/dumputils.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F761035B89D003CE4F5 /* keywords.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = keywords.c; path = "BaseTen-PostgreSQL/postgresql-src/src/backend/parser/keywords.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F771035B89D003CE4F5 /* mbprint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mbprint.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/mbprint.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F781035B89D003CE4F5 /* path.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = path.c; path = "BaseTen-PostgreSQL/postgresql-src/src/port/path.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F791035B89D003CE4F5 /* print.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = print.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/print.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F7A1035B89D003CE4F5 /* prompt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prompt.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/prompt.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F7B1035B89D003CE4F5 /* snprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snprintf.c; path = "BaseTen-PostgreSQL/postgresql-src/src/port/snprintf.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F7C1035B89D003CE4F5 /* stringutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stringutils.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/stringutils.c"; sourceTree = BUILT_PRODUCTS_DIR; };
-		53617F7D1035B89D003CE4F5 /* variables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = variables.c; path = "BaseTen-PostgreSQL/postgresql-src/src/bin/psql/variables.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F6B1035B89D003CE4F5 /* psqlscan.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = psqlscan.l; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/psqlscan.l"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F6C1035B89D003CE4F5 /* psqlscan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = psqlscan.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/psqlscan.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F6D1035B89D003CE4F5 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = common.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/common.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F6E1035B89D003CE4F5 /* print.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = print.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/print.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F6F1035B89D003CE4F5 /* settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = settings.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/settings.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F701035B89D003CE4F5 /* variables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = variables.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/variables.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F711035B89D003CE4F5 /* dumputils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dumputils.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/pg_dump/dumputils.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F721035B89D003CE4F5 /* stringutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stringutils.h; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/stringutils.h"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F731035B89D003CE4F5 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = common.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/common.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F741035B89D003CE4F5 /* copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = copy.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/copy.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F751035B89D003CE4F5 /* dumputils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dumputils.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/pg_dump/dumputils.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F761035B89D003CE4F5 /* keywords.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = keywords.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/backend/parser/keywords.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F771035B89D003CE4F5 /* mbprint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mbprint.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/mbprint.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F781035B89D003CE4F5 /* path.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = path.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/port/path.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F791035B89D003CE4F5 /* print.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = print.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/print.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F7A1035B89D003CE4F5 /* prompt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prompt.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/prompt.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F7B1035B89D003CE4F5 /* snprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snprintf.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/port/snprintf.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F7C1035B89D003CE4F5 /* stringutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stringutils.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/stringutils.c"; sourceTree = BUILT_PRODUCTS_DIR; };
+		53617F7D1035B89D003CE4F5 /* variables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = variables.c; path = "../Release/BaseTen-PostgreSQL/postgresql-8.3.11/src/bin/psql/variables.c"; sourceTree = BUILT_PRODUCTS_DIR; };
 		536206280FB87A0300ACAE57 /* PGTSDates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSDates.m; path = Sources/PGTSDates.m; sourceTree = "<group>"; };
 		536206290FB87A0300ACAE57 /* PGTSValueTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGTSValueTypes.m; path = Sources/PGTSValueTypes.m; sourceTree = "<group>"; };
 		536206350FB87AB700ACAE57 /* PGTSValueTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGTSValueTypes.h; path = Sources/PGTSValueTypes.h; sourceTree = "<group>"; };
 		53DBE8120B666C7900C3D20A /* libssl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libssl.dylib; path = usr/lib/libssl.dylib; sourceTree = SDKROOT; };
 		53E068240DEAE02A0004363D /* BXProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; name = BXProbes.d; path = Sources/BXProbes.d; sourceTree = "<group>"; };
 		53E11A250A791A8D00D0107C /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = System/Library/Frameworks/ExceptionHandling.framework; sourceTree = SDKROOT; };
+		53E8522511CE2D7700588B12 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
 		53ED2E8C0E1AB7CB0095BE8B /* BXLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BXLogger.h; path = Sources/BXLogger.h; sourceTree = "<group>"; };
 		53EFE9E00BA96444008666B7 /* BaseTenAppKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = BaseTenAppKit.xcodeproj; path = BaseTenAppKit/BaseTenAppKit.xcodeproj; sourceTree = "<group>"; };
 		53EFEA950BA98028008666B7 /* BXDatabaseObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = BXDatabaseObjectPrivate.h; path = Sources/BXDatabaseObjectPrivate.h; sourceTree = "<group>"; };
 				537920580E3F519000423965 /* CoreData.framework in Frameworks */,
 				53D69A880EAE072A00C4C22D /* SystemConfiguration.framework in Frameworks */,
 				535B3E1E1038146500A5FB7E /* libpcre.a in Frameworks */,
-				5355C08911A8725700C5DEAF /* CoreServices.framework in Frameworks */,
+				5314FA1F11CC3B0F000D213B /* libpq.a in Frameworks */,
+				53E8522611CE2D7700588B12 /* CoreServices.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			children = (
 				53C4E26B1194C757003FB842 /* pcre.h */,
 				535B3E1D1038146500A5FB7E /* libpcre.a */,
+				5314FA1E11CC3B0F000D213B /* libpq.a */,
 				53DBE8010B666C3B00C3D20A /* libcrypto.dylib */,
 				53DBE8120B666C7900C3D20A /* libssl.dylib */,
 				538679870DE31C1D000C9A78 /* libstdc++.6.dylib */,
 				D2F7E79907B2D74100F64583 /* CoreData.framework */,
-				5355C08811A8725700C5DEAF /* CoreServices.framework */,
+				53E8522511CE2D7700588B12 /* CoreServices.framework */,
 				0867D69BFE84028FC02AAC07 /* Foundation.framework */,
 				538678D30DE31BA0000C9A78 /* IOKit.framework */,
 				531266E40B68F9CA00637EDA /* Security.framework */,
 			name = Unneeded;
 			sourceTree = "<group>";
 		};
+		534F101011CC2E7400DC4F62 /* LibPQ Headers */ = {
+			isa = PBXGroup;
+			children = (
+				534F100D11CC2E2700DC4F62 /* ecpg_config.h */,
+				534F100E11CC2E2700DC4F62 /* pg_config_os.h */,
+				534F100F11CC2E2700DC4F62 /* pg_config.h */,
+				534F101911CC302E00DC4F62 /* postgresql */,
+			);
+			name = "LibPQ Headers";
+			sourceTree = "<group>";
+		};
 		535738400F33695000DB3D0B /* Object model */ = {
 			isa = PBXGroup;
 			children = (
 			isa = PBXGroup;
 			children = (
 				53666C9B0E1CD8D20028DBEA /* PGTS.h */,
-				53617F261035AF8A003CE4F5 /* libpq-fe.h */,
 				53666D850E1CDFF80028DBEA /* Connection */,
 				53666D2E0E1CDDA70028DBEA /* Metadata */,
 				53666D820E1CDF100028DBEA /* Queries */,
 				5362062C0FB87A8F00ACAE57 /* Type conversion */,
+				534F101011CC2E7400DC4F62 /* LibPQ Headers */,
 				53666D890E1CE05C0028DBEA /* Other */,
 			);
 			name = PGTS;
 				98A6CD660F45C8420029B2C4 /* coverage-non-gc.xcconfig */,
 				535444230D634A98002A6C47 /* release-gc.xcconfig */,
 				535444240D634A98002A6C47 /* release-non-gc.xcconfig */,
+				534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */,
 			);
 			path = xcconfig;
 			sourceTree = SOURCE_ROOT;
 				536206550FB87E8C00ACAE57 /* PGTSDates.h in Headers */,
 				53015A850FBEF22400E52C1E /* BXArraySize.h in Headers */,
 				53D0482110021E07001A92FB /* BXDatabaseObjectModelMOMSerialization.h in Headers */,
-				53617F271035AF8A003CE4F5 /* libpq-fe.h in Headers */,
 				53617F7F1035B89D003CE4F5 /* BXPGSQLScanner.h in Headers */,
 				53C8CC65118F1B8800E7AF88 /* BXDatabaseObjectModelStoragePrivate.h in Headers */,
 				53C8CC66118F1B8800E7AF88 /* BXDatabaseObjectModelPrivate.h in Headers */,
 				539204DE11AECEAF000E2BEC /* BXDictionaryFunctions.h in Headers */,
 				5392053D11AEDB4F000E2BEC /* BXCollectionFunctions.h in Headers */,
 				53F9D04C11B0828900600413 /* PGTSOids.h in Headers */,
+				534F122011CC302E00DC4F62 /* postgresql in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				53857A8011921B0100426CEA /* libpq_additions.h in Headers */,
 				53857A8111921B0200426CEA /* PGTSConstants.h in Headers */,
 				53857A9D11921B5900426CEA /* PGTS.h in Headers */,
-				53857A9E11921B5900426CEA /* libpq-fe.h in Headers */,
 				53857AAA11921B8500426CEA /* BXPredicateVisitor.h in Headers */,
 				53857AAE11921B8900426CEA /* BXPGExpressionVisitor.h in Headers */,
 				53857AB211921B9700426CEA /* BXPGConstantParameterMapper.h in Headers */,
 			buildConfigurationList = 535444100D634A47002A6C47 /* Build configuration list for PBXNativeTarget "BaseTen Framework + GC" */;
 			buildPhases = (
 				535443C40D634A47002A6C47 /* Headers */,
-				53ED0E6310355F94000CFECF /* Copy PostgreSQL Headers */,
+				53ED0E6310355F94000CFECF /* Copy Architecture-Specific PostgreSQL Headers */,
 				535443EB0D634A47002A6C47 /* Resources */,
 				535443EE0D634A47002A6C47 /* Sources */,
 				535444080D634A47002A6C47 /* Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "for x in $ARCHS\ndo\n\tsource \"$PROJECT_DIR\"/Tools/PostgreSQL/build-postgresql.sh \"$x\"\ndone\nsource \"$PROJECT_DIR\"/Tools/PostgreSQL/create-universal-binaries.sh";
+			shellScript = "# make gets re-run with the appropriate number of concurrent tasks.\n/usr/bin/make -f Tools/PostgreSQL/PostgreSQL.mk \"$ACTION\"\n";
 			showEnvVarsInLog = 0;
 		};
 		537934A40E54B71B0006EC54 /* ShellScript */ = {
 			shellScript = "source Tools/set-version-numbers.sh";
 			showEnvVarsInLog = 0;
 		};
-		53ED0E6310355F94000CFECF /* Copy PostgreSQL Headers */ = {
+		53ED0E6310355F94000CFECF /* Copy Architecture-Specific PostgreSQL Headers */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 			);
 			inputPaths = (
 			);
-			name = "Copy PostgreSQL Headers";
+			name = "Copy Architecture-Specific PostgreSQL Headers";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		5362E86D0E1CE46D005C7654 /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 535444220D634A98002A6C47 /* debug-non-gc.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
 				PRODUCT_NAME = PostgreSQL;
 			};
 		};
 		5362E86E0E1CE46D005C7654 /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 535444240D634A98002A6C47 /* release-non-gc.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
 				PRODUCT_NAME = PostgreSQL;
 			};
 		};
 		537EB5F911AD8449008FA78E /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 535444200D634A98002A6C47 /* common.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = PCRE;
 			};
 			name = Debug;
 		};
 		537EB5FA11AD8449008FA78E /* Coverage */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 535444200D634A98002A6C47 /* common.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = PCRE;
 			};
 			name = Coverage;
 		};
 		537EB5FB11AD8449008FA78E /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 535444200D634A98002A6C47 /* common.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
+				PRODUCT_NAME = PCRE;
 			};
 			name = Release;
 		};
 		};
 		98A6CD6C0F45C8600029B2C4 /* Coverage */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 98A6CD660F45C8420029B2C4 /* coverage-non-gc.xcconfig */;
+			baseConfigurationReference = 534F0FB511CBD7E800DC4F62 /* external-release.xcconfig */;
 			buildSettings = {
 				PRODUCT_NAME = PostgreSQL;
 			};

File BaseTenAppKit/Sources/BXConnectUsingBonjourViewController.h

 #import <BaseTenAppKit/BXConnectionViewController.h>
 
 
-@interface BXConnectUsingBonjourViewController : BXConnectionViewController <NSNetServiceBrowserDelegate, NSNetServiceDelegate>
+@interface BXConnectUsingBonjourViewController : BXConnectionViewController
 {
 	IBOutlet NSTableView* mAddressTable;
 	IBOutlet NSArrayController* mBonjourArrayController;
 - (void) startDiscovery;
 - (void) stopDiscovery;
 @end
+
+
+@interface BXConnectUsingBonjourViewController (NSNetServiceDelegate)
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
+<NSNetServiceDelegate>
+#endif
+@end
+
+
+
+@interface BXConnectUsingBonjourViewController (NSNetServiceBrowserDelegate)
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
+<NSNetServiceBrowserDelegate>
+#endif
+@end

File BaseTenAppKit/Sources/BXConnectUsingBonjourViewController.m

 @end
 
 
-@implementation BXConnectUsingBonjourViewController (NetServiceBrowserDelegate)
+
+@implementation BXConnectUsingBonjourViewController (NSNetServiceBrowserDelegate)
 - (void) netServiceBrowser: (NSNetServiceBrowser *) netServiceBrowser 
 			didFindService: (NSNetService *) netService moreComing: (BOOL) moreServicesComing
 {
 		[netService setDelegate: self];
 	}
 }
+@end
 
+
+
+@implementation BXConnectUsingBonjourViewController (NSNetServiceDelegate)
 - (void) netServiceDidResolveAddress: (NSNetService *) netService
 {
 	[mBonjourArrayController addObject: netService];
 }
 
+
 - (void) netService: (NSNetService *) netService didNotResolve: (NSDictionary *) errorDict
 {
 }

File BaseTenAppKit/xcconfig/common.xcconfig

-#include "../../common-xcconfig/10.5.xcconfig"
+#include "../../common-xcconfig/MacOSX10.5-6.xcconfig"
 #include "../../common-xcconfig/common.xcconfig"
 #include "../../common-xcconfig/framework.xcconfig"
 
 LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)
 USER_HEADER_SEARCH_PATHS = $(PROJECT_DIR)
 GCC_PREFIX_HEADER = Sources/BaseTenAppKit_Prefix.pch
+ARCHS = ppc ppc64 i386 x86_64

File BaseTenAppKit/xcconfig/release-gc.xcconfig

 #include "../../common-xcconfig/gc.xcconfig"
 #include "../../common-xcconfig/release.xcconfig"
 #include "common.xcconfig"
+
 INSTALL_PATH = @executable_path/../Frameworks

File BaseTenAppKit/xcconfig/release-non-gc.xcconfig

 #include "../../common-xcconfig/non-gc.xcconfig"
 #include "../../common-xcconfig/release.xcconfig"
 #include "common.xcconfig"
+
 INSTALL_PATH = @executable_path/../Frameworks

File BaseTenAssistant/Sources/BXAController.h

 @class MKCStackView;
 
 
-@interface BXAController : NSObject <NSNetServiceBrowserDelegate, NSNetServiceDelegate>
+@interface BXAController : NSObject
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
+<NSNetServiceBrowserDelegate, NSNetServiceDelegate>
+#endif
 {
 	struct bx_regular_expression_st mCompilationErrorRegex;
 	struct bx_regular_expression_st mCompilationFailedRegex;

File BaseTenAssistant/xcconfig/common.xcconfig

-#include "../../common-xcconfig/10.5.xcconfig"
+#include "../../common-xcconfig/MacOSX10.5.xcconfig"
 #include "../../common-xcconfig/common.xcconfig"
 #include "../../common-xcconfig/application.xcconfig"
 #include "../../common-xcconfig/gc.xcconfig"
 USER_HEADER_SEARCH_PATHS = $(PROJECT_DIR)
 GCC_PREFIX_HEADER = Sources/BaseTenAssistant_Prefix.pch
 IBC_PLUGIN_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)
+ARCHS = ppc ppc64 i386 x86_64

File InterfaceBuilderPlugin/InterfaceBuilderPlugin.xcodeproj/project.pbxproj

 	objects = {
 
 /* Begin PBXBuildFile section */
-		5373A1580CEC8F5C006B581B /* ExceptionHandling.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5373A1570CEC8F5C006B581B /* ExceptionHandling.framework */; };
 		5373A2180CEC9894006B581B /* BXDatabaseContext.classdescription in Resources */ = {isa = PBXBuildFile; fileRef = 53978F5D0CEC640200B93B3C /* BXDatabaseContext.classdescription */; };
 		5373A2190CEC9895006B581B /* BXSynchronizedArrayController.classdescription in Resources */ = {isa = PBXBuildFile; fileRef = 53978F5C0CEC640200B93B3C /* BXSynchronizedArrayController.classdescription */; };
 		5373A24D0CECA493006B581B /* BXDatabaseContextInspector.m in Sources */ = {isa = PBXBuildFile; fileRef = 5373A24C0CECA493006B581B /* BXDatabaseContextInspector.m */; };
 		53978F8D0CEC709200B93B3C /* BXArrayController.png in Resources */ = {isa = PBXBuildFile; fileRef = 53978F8A0CEC709200B93B3C /* BXArrayController.png */; };
 		53978F8E0CEC709200B93B3C /* BXDatabaseObject.png in Resources */ = {isa = PBXBuildFile; fileRef = 53978F8B0CEC709200B93B3C /* BXDatabaseObject.png */; };
 		53978F8F0CEC709200B93B3C /* Palette5.icns in Resources */ = {isa = PBXBuildFile; fileRef = 53978F8C0CEC709200B93B3C /* Palette5.icns */; };
+		53F5573A11CD6BE900E52F6E /* InterfaceBuilderKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D069550A49DF9100C95564 /* InterfaceBuilderKit.framework */; };
 		53F749640E362DFA003C2E55 /* BaseTen.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 5373CC8D0D65B9710084BD9D /* BaseTen.framework */; };
 		53F749680E362DFD003C2E55 /* BaseTenAppKit.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 5373CC900D65B9710084BD9D /* BaseTenAppKit.framework */; };
 		8D1AC9700486D14A00FE50C9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD92D38A0106425D02CA0E72 /* Cocoa.framework */; };
 		8D1AC9800486D23B00FE50C9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */; };
-		C0D069560A49DF9100C95564 /* InterfaceBuilderKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D069550A49DF9100C95564 /* InterfaceBuilderKit.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
 			buildActionMask = 2147483647;
 			files = (
 				8D1AC9700486D14A00FE50C9 /* Cocoa.framework in Frameworks */,
-				C0D069560A49DF9100C95564 /* InterfaceBuilderKit.framework in Frameworks */,
-				5373A1580CEC8F5C006B581B /* ExceptionHandling.framework in Frameworks */,
 				5373CD8D0D65C31D0084BD9D /* BaseTen.framework in Frameworks */,
 				5373CD8E0D65C31E0084BD9D /* BaseTenAppKit.framework in Frameworks */,
+				53F5573A11CD6BE900E52F6E /* InterfaceBuilderKit.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			children = (
 				53978FCC0CEC764300B93B3C /* BaseTen.xcodeproj */,
 				53978FA50CEC763800B93B3C /* BaseTenAppKit.xcodeproj */,
-				5373A1570CEC8F5C006B581B /* ExceptionHandling.framework */,
 				DD92D38A0106425D02CA0E72 /* Cocoa.framework */,
 				C0D069550A49DF9100C95564 /* InterfaceBuilderKit.framework */,
+				5373A1570CEC8F5C006B581B /* ExceptionHandling.framework */,
 			);
 			name = Frameworks;
 			sourceTree = "<group>";

File InterfaceBuilderPlugin/Sources/BXIBPlugin.m

 
 #import "BXIBPlugin.h"
 
-//#define BXIB_USE_EXCEPTION_HANDLER
+//#define BXIB_USE_EXCEPTION_HANDLER 1
 
-#ifdef BXIB_USE_EXCEPTION_HANDLER
+#if defined(BXIB_USE_EXCEPTION_HANDLER) && BXIB_USE_EXCEPTION_HANDLER
 #import <ExceptionHandling/ExceptionHandling.h>
 #endif
 
     return [NSArray arrayWithObjects: baseTenBundle, baseTenAppKitBundle, nil];
 }
 
-#ifdef BXIB_USE_EXCEPTION_HANDLER
+#if defined(BXIB_USE_EXCEPTION_HANDLER) && BXIB_USE_EXCEPTION_HANDLER
 - (void) didLoad
 {
 	[super didLoad];

File InterfaceBuilderPlugin/xcconfig/common.xcconfig

 #include "../../common-xcconfig/common.xcconfig"
-#include "../../common-xcconfig/10.5.xcconfig"
+#include "../../common-xcconfig/MacOSX10.5.xcconfig"
 #include "../../common-xcconfig/gc.xcconfig"
 
 INFOPLIST_FILE = Info.plist
 LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)
 USER_HEADER_SEARCH_PATHS = $(PROJECT_DIR)
 GCC_PREFIX_HEADER = Sources/InterfaceBuilderPlugin_Prefix.pch
+ARCHS = ppc i386 x86_64

File InterfaceBuilderPlugin/xcconfig/release.xcconfig

 #include "../../common-xcconfig/release.xcconfig"
 #include "common.xcconfig"
-ARCHS = ppc i386 x86_64

File Resources/BaseTenModifications.sql.m4

 	rel := "baseten".reltype (relid);
 	-- Trigger functions cannot be written in SQL
 	fdecl :=
-		'CREATE OR REPLACE FUNCTION "baseten".' || quote_ident (fname) || ' () RETURNS TRIGGER AS $$ ' ||
+		'CREATE OR REPLACE FUNCTION ' || "baseten".quote_ident_bx (fname) || ' () RETURNS TRIGGER AS $$ ' ||
 		'BEGIN ' ||
 			'INSERT INTO ' || "baseten".quote_ident_bx (mtable) || ' (' ||
 				'"baseten_modification_type", "baseten_modification_cols", ' || array_to_string (pkey, ', ') ||

File Sources/BXConnectionMonitor.h

 - (void) connectionMonitorSystemWillSleep: (BXConnectionMonitor *) monitor;
 - (void) connectionMonitorSystemDidWake: (BXConnectionMonitor *) monitor;
 - (void) connectionMonitor: (BXConnectionMonitor *) monitor
-	  networkStatusChanged: (SCNetworkReachabilityFlags) flags;
+	  networkStatusChanged: (SCNetworkConnectionFlags) flags;
 @end
 
 

File Sources/BXConnectionMonitor.m

 		}
 		else
 		{
-			SCNetworkReachabilityFlags flags = 0;
+			SCNetworkConnectionFlags flags = 0;
 			if ([observer getReachabilityFlags: &flags])
 			{
-				if (kSCNetworkReachabilityFlagsReachable & flags ||
-					kSCNetworkReachabilityFlagsConnectionAutomatic & flags)
+				if (kSCNetworkFlagsReachable & flags ||
+					kSCNetworkFlagsConnectionAutomatic & flags)
 				{
 					retval = YES;
 				}				
 
 @implementation BXConnectionMonitor (BXSocketReachabilityObserverDelegate)
 - (void) socketReachabilityObserver: (BXSocketReachabilityObserver *) observer 
-			   networkStatusChanged: (SCNetworkReachabilityFlags) flags
+			   networkStatusChanged: (SCNetworkConnectionFlags) flags
 {
 	[(id <BXConnectionMonitorClient>) [observer userInfo] connectionMonitor: self networkStatusChanged: flags];
 }

File Sources/BXDatabaseContext.m

 	return mode;
 }
 
-- (void) networkStatusChanged: (SCNetworkReachabilityFlags) newFlags
+- (void) networkStatusChanged: (SCNetworkConnectionFlags) newFlags
 {
 	[mDelegateProxy databaseContext: self networkStatusChanged: newFlags];
 }

File Sources/BXDatabaseContextDelegateProtocol.h

  * \note The default implementation does nothing but this might change in the future.
  */
 - (void) databaseContext: (BXDatabaseContext *) context
-	networkStatusChanged: (SCNetworkReachabilityFlags) newFlags;
+	networkStatusChanged: (SCNetworkConnectionFlags) newFlags;
 @end

File Sources/BXDatabaseObjectModelXMLSerialization.m

 	NSXMLElement* root = [NSXMLElement elementWithName: @"objectModel"];
 	NSXMLDocument* retval = [NSXMLDocument documentWithRootElement: root];
 	
-	NSArray* entities = [objectModel entities];
+	NSArray* entities = [[objectModel entities] sortedArrayUsingSelector: @selector (compare:)];
 	BXEnumerate (currentEntity, e, [entities objectEnumerator])
 	{
 		NSXMLElement* entity = [NSXMLElement elementWithName: @"entity"];
 		[entity addChild: name];
 		
 		NSXMLElement* attrs = [NSXMLElement elementWithName: @"attributes"];
-		BXEnumerate (currentAttr, e, [[currentEntity attributesByName] objectEnumerator])
+		NSArray *attrDescs = [[[currentEntity attributesByName] allValues] sortedArrayUsingSelector: @selector (compare:)];
+		BXEnumerate (currentAttr, e, [attrDescs objectEnumerator])
 		{
 			if (! [currentAttr isExcluded])
 			{
 		if ((exportFkeyRelationships || exportRelNameRelationships) && [currentEntity hasCapability: kBXEntityCapabilityRelationships])
 		{
 			NSXMLElement* rels = [NSXMLElement elementWithName: @"relationships"];
-			BXEnumerate (currentRel, e, [[currentEntity relationshipsByName] objectEnumerator])
+			NSArray *relDescs = [[[currentEntity relationshipsByName] allValues] sortedArrayUsingSelector: @selector (compare:)];
+			BXEnumerate (currentRel, e, [relDescs objectEnumerator])
 			{
 				BOOL usesRelNames = [currentRel usesRelationNames];
 				if (((usesRelNames && exportRelNameRelationships) ||

File Sources/BXDispatchSocketDescriptor.h

 #import <BaseTen/BXSocketDescriptor.h>
 
 
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
+
 @interface BXDispatchSocketDescriptor : BXSocketDescriptor
 {
 	dispatch_queue_t mQueue;
 	int mSocket;
 }
 @end
+
+#endif

File Sources/BXDispatchSocketDescriptor.m

 // $Id$
 //
 
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
+
 #import "BXDispatchSocketDescriptor.h"
 #import "BXSocketDescriptorPrivate.h"
 #import <libkern/OSAtomic.h>
 	}
 }
 @end
+
+#endif

File Sources/BXEntityDescription.h

 - (NSArray *) fields;
 - (BOOL) isView;
 - (NSArray *) objectIDs;
+- (NSComparisonResult) compare: (BXEntityDescription *) anotherEntity;
 - (NSComparisonResult) caseInsensitiveCompare: (BXEntityDescription *) anotherEntity;
 - (BOOL) isValidated;
 - (NSDictionary *) relationshipsByName;

File Sources/BXEntityDescription.m

     return (mFlags & kBXEntityIsView) ? YES : NO;
 }
 
+
+- (NSComparisonResult) compare: (BXEntityDescription *) anotherEntity
+{
+    NSComparisonResult retval = NSOrderedSame;
+    if (self != anotherEntity)
+    {
+        retval = [[self schemaName] compare: [anotherEntity schemaName]];
+        if (NSOrderedSame == retval)
+        {
+            retval = [[self name] compare: [anotherEntity name]];
+        }
+    }
+    return retval;
+}
+
+
 - (NSComparisonResult) caseInsensitiveCompare: (BXEntityDescription *) anotherEntity
 {
     NSComparisonResult retval = NSOrderedSame;

File Sources/BXHostResolver.m

 
 - (NSError *) _errorForStreamError: (const CFStreamError *) streamError;
 
-- (void) _reachabilityCheckDidComplete: (SCNetworkReachabilityFlags) flags;
+- (void) _reachabilityCheckDidComplete: (SCNetworkConnectionFlags) flags;
 - (void) _hostCheckDidComplete: (const CFStreamError *) streamError;
 
 - (void) _removeReachability;
 
 
 static void
-ReachabilityCallback (SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info)
+ReachabilityCallback (SCNetworkReachabilityRef target, SCNetworkConnectionFlags flags, void *info)
 {
 	[(id) info _reachabilityCheckDidComplete: flags];
 }
 		mReachability = SCNetworkReachabilityCreateWithAddress (kCFAllocatorDefault, addrinfo->ai_addr);
 		
 		// For some reason the reachability check doesn't work with numeric addresses when using the run loop.
-		SCNetworkReachabilityFlags flags = 0;
+		SCNetworkConnectionFlags flags = 0;
 		status = SCNetworkReachabilityGetFlags (mReachability, &flags);
 		ExpectL (status)
 		
 }
 
 
-- (void) _reachabilityCheckDidComplete: (SCNetworkReachabilityFlags) actual
+- (void) _reachabilityCheckDidComplete: (SCNetworkConnectionFlags) actual
 {
 	// We use the old type name, since the new one only appeared in 10.6.
 	
 	if (mAddresses)
 	{
 		//Any flag in "required" will suffice. (Hence not 'required == (required & actual)'.)
-		SCNetworkReachabilityFlags required = kSCNetworkReachabilityFlagsReachable | kSCNetworkReachabilityFlagsConnectionAutomatic;	
+		SCNetworkConnectionFlags required = kSCNetworkFlagsReachable | kSCNetworkFlagsConnectionAutomatic;	
 		if ((required & actual) && [mAddresses count])
 			[mDelegate hostResolverDidSucceed: self addresses: mAddresses];
 		else

File Sources/BXInterface.h

 - (BOOL) handleInvalidTrust: (SecTrustRef) trust result: (SecTrustResultType) result;
 - (NSError *) packQueryError: (NSError *) error;
 - (enum BXSSLMode) sslMode;
-- (void) networkStatusChanged: (SCNetworkReachabilityFlags) newFlags;
+- (void) networkStatusChanged: (SCNetworkConnectionFlags) newFlags;
 @end
 
 

File Sources/BXPGConnectionResetRecoveryAttempter.m

 {
 }
 
-- (void) PGTSConnection: (PGTSConnection *) connection networkStatusChanged: (SCNetworkReachabilityFlags) newFlags
+- (void) PGTSConnection: (PGTSConnection *) connection networkStatusChanged: (SCNetworkConnectionFlags) newFlags
 {
 }
 @end

File Sources/BXPGTransactionHandler.m

 	[mInterface connection: connection receivedResultSet: res];
 }
 
-- (void) PGTSConnection: (PGTSConnection *) connection networkStatusChanged: (SCNetworkReachabilityFlags) newFlags
+- (void) PGTSConnection: (PGTSConnection *) connection networkStatusChanged: (SCNetworkConnectionFlags) newFlags
 {
 	BXDatabaseContext* context = [mInterface databaseContext];
 	[context networkStatusChanged: newFlags];

File Sources/BXSocketDescriptor.m

 #import "BXDispatchSocketDescriptor.h"
 #import "BXRunLoopSocketDesciptor.h"
 #import "BXValidationLock.h"
+
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
 #import <dispatch/dispatch.h>
+#endif
 
 
 static volatile BOOL stUsesGCD = NO;
 	id retval = nil;
 	@synchronized (self)
 	{
+#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED
 		if (NULL != dispatch_get_current_queue && stUsesGCD)
 			retval = [[BXDispatchSocketDescriptor alloc] initWithSocket: socket];
 		else
 			retval = [[BXRunLoopSocketDesciptor alloc] initWithSocket: socket];
+#else
+		retval = [[BXRunLoopSocketDesciptor alloc] initWithSocket: socket];
+#endif
 	}
 	
 	return retval;

File Sources/BXSocketReachabilityObserver.h

 
 @protocol BXSocketReachabilityObserverDelegate <NSObject>
 - (void) socketReachabilityObserver: (BXSocketReachabilityObserver *) observer 
-			   networkStatusChanged: (SCNetworkReachabilityFlags) flags;
+			   networkStatusChanged: (SCNetworkConnectionFlags) flags;
 @end
 
 
 - (BOOL) install;
 - (void) invalidate;
 
-- (BOOL) getReachabilityFlags: (SCNetworkReachabilityFlags *) flags;
+- (BOOL) getReachabilityFlags: (SCNetworkConnectionFlags *) flags;
 - (void) setRunLoop: (CFRunLoopRef) runLoop;
 - (CFRunLoopRef) runLoop;
 - (void) setDelegate: (id <BXSocketReachabilityObserverDelegate>) delegate;

File Sources/BXSocketReachabilityObserver.m

 
 
 @interface BXSocketReachabilityObserver ()
-- (void) _networkStatusChanged: (SCNetworkReachabilityFlags) flags;
+- (void) _networkStatusChanged: (SCNetworkConnectionFlags) flags;
 @end
 
 
 
 static void
-NetworkStatusChanged (SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *observerPtr)
+NetworkStatusChanged (SCNetworkReachabilityRef target, SCNetworkConnectionFlags flags, void *observerPtr)
 {
 	BXSocketReachabilityObserver* observer = (BXSocketReachabilityObserver *) observerPtr;
 	[observer _networkStatusChanged: flags];
 }
 
 
-- (void) _networkStatusChanged: (SCNetworkReachabilityFlags) flags
+- (void) _networkStatusChanged: (SCNetworkConnectionFlags) flags
 {
 	if ([mValidationLock lockIfValid])
 	{
 }
 
 
-- (BOOL) getReachabilityFlags: (SCNetworkReachabilityFlags *) flags
+- (BOOL) getReachabilityFlags: (SCNetworkConnectionFlags *) flags
 {
 	ExpectR (flags, NO);
 	BOOL retval = NO;

File Sources/NSObject+BaseTenAdditions.m

 //
 
 
-//By adding the methods to NSObject we don't override NSMapTable's and NSPointerArray's implementation if one gets made.
-@implementation NSObject (BaseTenAdditions)
-#pragma mark NSPointerArray additions
+@implementation NSPointerArray (BaseTenAdditions)
 - (void) addObject: (id) anObject
 {
-	if ([self respondsToSelector: @selector (addPointer:)])
-		[(id) self addPointer: anObject];
-	else
-		[self doesNotRecognizeSelector: _cmd];
+	[self addPointer: anObject];
 }
 
 
 - (NSEnumerator *) objectEnumerator
 {
-	id retval = nil;
-	if ([self respondsToSelector: @selector (allObjects)])
-		retval = [[(id) self allObjects] objectEnumerator];
-	else
-		[self doesNotRecognizeSelector: _cmd];
-	return retval;
+	return [[self allObjects] objectEnumerator];
 }
+@end
 
 
-#pragma mark NSMapTable additions
 
+@implementation NSMapTable (BaseTenAdditions)
 - (void) makeObjectsPerformSelector: (SEL) selector withObject: (id) object
 {
-	NSEnumerator* e = [(id) self objectEnumerator];
+	NSEnumerator *e = [self objectEnumerator];
 	id currentObject = nil;
 	while ((currentObject = [e nextObject]))
 		[currentObject performSelector: selector withObject: object];
 
 - (NSArray *) objectsForKeys: (NSArray *) keys notFoundMarker: (id) marker
 {
-	NSMutableArray* retval = [NSMutableArray arrayWithCapacity: [keys count]];
-	NSEnumerator* e = [keys objectEnumerator];
+	NSMutableArray *retval = [NSMutableArray arrayWithCapacity: [keys count]];
+	NSEnumerator *e = [keys objectEnumerator];
 	id currentKey = nil;
 	while ((currentKey = [e nextObject]))
 	{
-		id object = [(id) self objectForKey: currentKey];
+		id object = [self objectForKey: currentKey];
 		if (! object)
 			object = marker;
 		[retval addObject: object];

File Sources/NSString+PGTSAdditions.m

 
 #import <stdlib.h>
 #import <limits.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "NSString+PGTSAdditions.h"
 #import "PGTSConnection.h"
 

File Sources/PGTS.h

 // $Id$
 //
 
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 #import "PGTSConnection.h"
 #import "PGTSNotification.h"

File Sources/PGTSAbstractClassDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/PGTSSchemaObjectDescription.h>
 #import <BaseTen/PGTSConstants.h>
 

File Sources/PGTSAbstractObjectDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/PGTSAbstractDescription.h>
 
 

File Sources/PGTSAdditions.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 @class PGTSConnection;
 

File Sources/PGTSAdditions.m

 
 #import <stdlib.h>
 #import <limits.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "PGTSAdditions.h"
 #import "PGTSConnection.h"
 #import "PGTSConstants.h"

File Sources/PGTSColumnDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "PGTSAbstractDescription.h"
 
 

File Sources/PGTSConnection.h

 #import <Foundation/Foundation.h>
 #import <SystemConfiguration/SystemConfiguration.h>
 #import <BaseTen/BXOpenSSLCompatibility.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/PGTSCertificateVerificationDelegate.h>
 #import <BaseTen/BXConnectionMonitor.h>
 @class PGTSConnection;

File Sources/PGTSConnection.mm

 //
 
 #import <CoreFoundation/CoreFoundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 #import "PGTSConnection.h"
 #import "PGTSConnectionPrivate.h"

File Sources/PGTSConnector.h

 
 #import <Foundation/Foundation.h>
 #import <BaseTen/BXExport.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 @class PGTSConnector;
 

File Sources/PGTSDatabaseDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/PGTSAbstractDescription.h>
 
 @class PGTSSchemaDescription;

File Sources/PGTSFoundationObjects.m

 //
 
 
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "PGTSFoundationObjects.h"
 #import "PGTSConnection.h"
 #import "PGTSConnectionPrivate.h"

File Sources/PGTSOids.h

 
 #import <Foundation/Foundation.h>
 #import <BaseTen/BXExport.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 
 BX_INTERNAL id PGTSOidAsObject (Oid o);

File Sources/PGTSQuery.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 
 @class PGTSConnection;

File Sources/PGTSQueryDescription.m

 #import "PGTSProbes.h"
 #import "BXLogger.h"
 #import "BXSocketDescriptor.h"
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <libkern/OSAtomic.h>
 
 

File Sources/PGTSResultSet.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 
 
 @class PGTSConnection;

File Sources/PGTSResultSet.mm

 
 #import <stdlib.h>
 #import <limits.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "PGTSConnection.h"
 #import "PGTSResultSet.h"
 #import "PGTSConstants.h"

File Sources/PGTSSchemaDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/PGTSAbstractObjectDescription.h>
 
 

File Sources/PGTSSchemaObjectDescription.h

 //
 
 #import <Foundation/Foundation.h>
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import "PGTSAbstractObjectDescription.h"
 #import "PGTSConstants.h"
 

File Sources/ecpg_config.h

+//
+// ecpg_config.h
+// BaseTen
+//
+// Copyright (C) 2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#if defined (__ppc__) && __ppc__
+#include <BaseTen/postgresql/ppc/ecpg_config.h>
+#elif defined (__ppc64__) && __ppc64__
+#include <BaseTen/postgresql/ppc64/ecpg_config.h>
+#elif defined (__i386__) && __i386__
+#include <BaseTen/postgresql/i386/ecpg_config.h>
+#elif defined (__x86_64__) && __x86_64__
+#include <BaseTen/postgresql/x86_64/ecpg_config.h>
+#elif defined (__arm__) && __arm__
+#include <BaseTen/postgresql/armv6/ecpg_config.h>
+#else
+#error "Unsupported architecture."
+#endif

File Sources/libpq-fe.h

-//
-// libpq-fe.h
-// BaseTen
-//
-// Copyright (C) 2009 Marko Karppinen & Co. LLC.
-//
-// Before using this software, please review the available licensing options
-// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
-// us at sales@karppinen.fi. Without an additional license, this software
-// may be distributed only in compliance with the GNU General Public License.
-//
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2.0,
-// as published by the Free Software Foundation.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-//
-// $Id$
-//
-
-#if defined (__ppc__) && __ppc__
-#include <BaseTen/postgresql/ppc/libpq-fe.h>
-#elif defined (__ppc64__) && __ppc64__
-#include <BaseTen/postgresql/ppc64/libpq-fe.h>
-#elif defined (__i386__) && __i386__
-#include <BaseTen/postgresql/i386/libpq-fe.h>
-#elif defined (__x86_64__) && __x86_64__
-#include <BaseTen/postgresql/x86_64/libpq-fe.h>
-#elif defined (__arm__) && __arm__
-#include <BaseTen/postgresql/armv6/libpq-fe.h>
-#else
-#error "Unsupported architecture."
-#endif

File Sources/libpq_additions.h

 // $Id$
 //
 
-#import <BaseTen/libpq-fe.h>
+#import <BaseTen/postgresql/libpq-fe.h>
 #import <BaseTen/BXExport.h>
 
 

File Sources/pg_config.h

+//
+// pg_config.h
+// BaseTen
+//
+// Copyright (C) 2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#if defined (__ppc__) && __ppc__
+#include <BaseTen/postgresql/ppc/pg_config.h>
+#elif defined (__ppc64__) && __ppc64__
+#include <BaseTen/postgresql/ppc64/pg_config.h>
+#elif defined (__i386__) && __i386__
+#include <BaseTen/postgresql/i386/pg_config.h>
+#elif defined (__x86_64__) && __x86_64__
+#include <BaseTen/postgresql/x86_64/pg_config.h>
+#elif defined (__arm__) && __arm__
+#include <BaseTen/postgresql/armv6/pg_config.h>
+#else
+#error "Unsupported architecture."
+#endif

File Sources/pg_config_os.h

+//
+// pg_config_os.h
+// BaseTen
+//
+// Copyright (C) 2010 Marko Karppinen & Co. LLC.
+//
+// Before using this software, please review the available licensing options
+// by visiting http://www.karppinen.fi/baseten/licensing/ or by contacting
+// us at sales@karppinen.fi. Without an additional license, this software
+// may be distributed only in compliance with the GNU General Public License.
+//
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License, version 2.0,
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+// $Id$
+//
+
+#if defined (__ppc__) && __ppc__
+#include <BaseTen/postgresql/ppc/pg_config_os.h>
+#elif defined (__ppc64__) && __ppc64__
+#include <BaseTen/postgresql/ppc64/pg_config_os.h>
+#elif defined (__i386__) && __i386__
+#include <BaseTen/postgresql/i386/pg_config_os.h>
+#elif defined (__x86_64__) && __x86_64__
+#include <BaseTen/postgresql/x86_64/pg_config_os.h>
+#elif defined (__arm__) && __arm__
+#include <BaseTen/postgresql/armv6/pg_config_os.h>
+#else
+#error "Unsupported architecture."
+#endif

File Tools/PostgreSQL/PostgreSQL.mk

+include Tools/common.mk
+
+
+PG_BUILD_DIR   = $(BUILD_DIR)/Release/BaseTen-PostgreSQL
+PG_VERSION     = 8.3.11
+PG_SOURCE_FILE = Contrib/PostgreSQL/postgresql-$(PG_VERSION).tar.bz2
+PG_DIR         = postgresql-$(PG_VERSION)
+PG_ROOT        = $(PG_BUILD_DIR)/$(PG_DIR)
+
+UNIVERSAL_LIBS = $(foreach my_arch,$(ARCHS),$(PG_BUILD_DIR)/$(my_arch)/lib/libpq.a)
+UNIVERSAL_BINS = $(foreach my_arch,$(ARCHS),$(PG_BUILD_DIR)/$(my_arch)/bin/psql)
+
+
+.PHONY: all clean build build-specifics build-arch
+
+
+all: build
+
+
+clean:
+	$(RM) -rf $(PG_BUILD_DIR)
+
+
+build: $(PG_BUILD_DIR)/universal/postgresql $(PG_BUILD_DIR)/universal/lib/libpq.a $(PG_BUILD_DIR)/universal/bin/psql
+
+
+build-arch: $(PG_ROOT)
+	-$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT) distclean
+
+	cd "$(PG_ROOT)" && \
+	CC="$(CC_$(ARCH))" \
+	CFLAGS="$(CFLAGS_$(ARCH))" \
+	CPPFLAGS="$(CPPFLAGS_$(ARCH))" \
+	LDFLAGS="$(LDFLAGS_$(ARCH))" \
+	./configure --build=$(shell $(PG_ROOT)/config.guess) --host=$(TARGET_$(ARCH)) --target=$(TARGET_$(ARCH)) \
+		--prefix="$(PG_BUILD_DIR)/$(ARCH)" \
+		--disable-shared \
+		--without-zlib \
+		--without-readline \
+		--with-openssl
+
+	## Required targets, see src/backend/Makefile: Make symlinks...
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/backend ../../src/include/parser/parse.h
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/backend ../../src/include/utils/fmgroids.h
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/port
+
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/include install
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/interfaces install
+	$(MAKE) -j $(AVAILCPU) -C $(PG_ROOT)/src/bin/psql install
+
+
+$(PG_BUILD_DIR)/universal/lib/libpq.a: $(UNIVERSAL_LIBS)
+	$(MKDIR) -p $(PG_BUILD_DIR)/universal/lib
+	$(LIPO) $(UNIVERSAL_LIBS) -create -output $(PG_BUILD_DIR)/universal/lib/libpq.a
+
+
+$(PG_BUILD_DIR)/universal/bin/psql: $(UNIVERSAL_BINS)
+	$(MKDIR) -p $(PG_BUILD_DIR)/universal/bin
+	$(LIPO) $(UNIVERSAL_BINS) -create -output $(PG_BUILD_DIR)/universal/bin/psql
+
+
+$(PG_BUILD_DIR)/universal/postgresql: $(PG_BUILD_DIR)/ppc/include
+	$(MKDIR) -p $(PG_BUILD_DIR)/universal/postgresql
+	$(CP) -a $(PG_BUILD_DIR)/ppc/include/* $(PG_BUILD_DIR)/universal/postgresql
+
+	$(CP) -a $(SRCROOT)/Sources/pg_config.h $(PG_BUILD_DIR)/universal/postgresql/pg_config.h
+	$(CP) -a $(SRCROOT)/Sources/pg_config.h $(PG_BUILD_DIR)/universal/postgresql/postgresql/server/pg_config.h
+
+	$(CP) -a $(SRCROOT)/Sources/pg_config_os.h $(PG_BUILD_DIR)/universal/postgresql/pg_config_os.h
+	$(CP) -a $(SRCROOT)/Sources/pg_config_os.h $(PG_BUILD_DIR)/universal/postgresql/postgresql/server/pg_config_os.h
+
+	$(CP) -a $(SRCROOT)/Sources/ecpg_config.h $(PG_BUILD_DIR)/universal/postgresql/ecpg_config.h
+
+
+$(PG_BUILD_DIR)/%/include $(PG_BUILD_DIR)/%/lib/libpq.a $(PG_BUILD_DIR)/%/bin/psql: $(PG_SOURCE_FILE)
+	ARCH=$* $(MAKE) -f Tools/PostgreSQL/PostgreSQL.mk build-arch
+
+
+$(PG_ROOT): $(PG_SOURCE_FILE)
+	$(MKDIR) -p $(PG_BUILD_DIR)
+	$(TAR) -jxf $(PG_SOURCE_FILE) -C $(PG_BUILD_DIR)
+	$(LN) -s $(PG_DIR) $(PG_BUILD_DIR)/postgresql-src
+	$(PATCH) -p0 -d $(PG_ROOT) < $(SRCROOT)/Patches/libpq.patch
+	$(PATCH) -p0 -d $(PG_ROOT) < $(SRCROOT)/Patches/pg-makefile.patch

File Tools/PostgreSQL/copy-postgresql-headers.sh

 CP=/bin/cp
 MKDIR=/bin/mkdir
-PRIVATE_HEADERS="$BUILT_PRODUCTS_DIR"/"$PRIVATE_HEADERS_FOLDER_PATH"
+PRIVATE_HEADERS="$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH"
 
 for x in $ARCHS
 do
-    if [ ! -e "$PRIVATE_HEADERS"/postgresql/"$x" ]
+    if [ ! -e "$PRIVATE_HEADERS/postgresql/$x" ]
     then
-        "$MKDIR" -p "$PRIVATE_HEADERS"/postgresql/
-        "$CP" -R "$BUILT_PRODUCTS_DIR"/BaseTen-PostgreSQL/"$x"/include "$PRIVATE_HEADERS"/postgresql/"$x"
+        "$MKDIR" -p "$PRIVATE_HEADERS/postgresql/$x"
+
+        for y in pg_config.h pg_config_os.h ecpg_config.h
+        do
+            "$CP" -R "$BUILD_DIR/Release/BaseTen-PostgreSQL/$x/include/$y" "$PRIVATE_HEADERS/postgresql/$x/$y"
+        done
     fi
 done

File Tools/RegexKit-common.mk

-CP = /bin/cp
-RM = /bin/rm
-MV = /bin/mv
-ENV = /usr/bin/env
-PATCH = /usr/bin/patch
-XCODEBUILD = xcodebuild
-
-BUILD_SETTINGS_DIR = RegexKit-patched-source/Source/Build/Xcode
-
-
-.PHONY: all build clean RegexKit-xc
-
-
-build: $(BUILD_DIR)/Release/$(RESULT)
-
-
-clean: RegexKit-xc
-	$(RM) -rf RegexKit-patched-source
-
-
-$(BUILD_DIR)/Release/$(RESULT): RegexKit-patched-source RegexKit-xc
-
-
-RegexKit-xc: RegexKit-patched-source
-	@if [ -n "$(BUILD_DIR)" ] && [ -n "$(OBJROOT)" ]; then \
-		cd RegexKit-patched-source; \
-		$(ENV) -i PATH="$(PATH)" \
-			$(XCODEBUILD) -configuration Release -target $(TARGET) \
-				$(MAKECMDGOALS) \
-				SYMROOT="$(BUILD_DIR)" \
-				OBJROOT="$(OBJROOT)" \
-				GCC_VERSION=4.0; \
-	fi
-
-
-RegexKit-patched-source:
-	@if [ -z "$(BUILD_DIR)" ]; then \
-		echo "BUILD_DIR wasn't set."; \
-		exit 1; \
-	fi
-
-	@if [ -z "$(OBJROOT)" ]; then \
-		echo "OBJROOT wasn't set."; \
-		exit 1; \
-	fi
-
-	$(CP) -pLR RegexKit-current-source RegexKit-patched-source
-	$(PATCH) -d RegexKit-patched-source -p0 < ../../Patches/pcre-makefile.patch
-
-	$(MV) -i $(BUILD_SETTINGS_DIR)/"RegexKit Build Settings.xcconfig" $(BUILD_SETTINGS_DIR)/RegexKit_Build_Settings.xcconfig
-	$(PATCH) -d RegexKit-patched-source -p0 < ../../Patches/pcre-build.patch
-	$(MV) -i $(BUILD_SETTINGS_DIR)/RegexKit_Build_Settings.xcconfig $(BUILD_SETTINGS_DIR)/"RegexKit Build Settings.xcconfig"

File Tools/common.mk

+TAR              = /usr/bin/gnutar
+LIPO             = /usr/bin/lipo
+TOUCH            = /usr/bin/touch
+SLEEP            = /bin/sleep
+MKDIR            = /bin/mkdir
+LN               = /bin/ln
+PATCH            = /usr/bin/patch
+
+AVAILCPU         = $(shell /usr/sbin/sysctl -n hw.availcpu)
+
+TARGET_ppc       = powerpc-apple-darwin
+TARGET_i386      = i386-apple-darwin
+TARGET_ppc64     = powerpc64-apple-darwin
+TARGET_x86_64    = x86_64-apple-darwin
+TARGET_armv6     = armv6-apple-darwin
+
+CC_ppc           = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_ppc)
+CC_i386          = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_i386)
+CC_ppc64         = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_ppc64)
+CC_x86_64        = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_x86_64)
+CC_armv6         = $(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2
+
+CFLAGS_ppc       = -arch $(ARCH)
+CFLAGS_i386      = -arch $(ARCH)
+CFLAGS_ppc64     = -arch $(ARCH)
+CFLAGS_x86_64    = -arch $(ARCH)
+CFLAGS_armv6     = -arch $(ARCH)
+
+CPPFLAGS_ppc     = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -isysroot $(SDKROOT)
+CPPFLAGS_ppc64   = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -isysroot $(SDKROOT)
+CPPFLAGS_i386    = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -isysroot $(SDKROOT)
+CPPFLAGS_x86_64  = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -isysroot $(SDKROOT)
+CPPFLAGS_armv6   = -arch $(ARCH) -miphoneos-version-min=3.0 -isysroot $(SDKROOT)
+
+LDFLAGS_ppc      = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -Wl,-syslibroot,$(SDKROOT)
+LDFLAGS_i386     = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -Wl,-syslibroot,$(SDKROOT)
+LDFLAGS_ppc64    = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -Wl,-syslibroot,$(SDKROOT)
+LDFLAGS_x86_64   = -arch $(ARCH) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET) -Wl,-syslibroot,$(SDKROOT)
+LDFLAGS_armv6    = -arch $(ARCH) -miphoneos-version-min=3.0 -Wl,-syslibroot,$(SDKROOT)

File Tools/copy-items-for-assistant.sh

     fi
 fi
 
-if [ ! -d "$FRAMEWORKS_DIR/RegexKit.framework" ]
-then
-    global_bd_rk="$BUILD_DIR/Release/RegexKit.framework"
-    baseten_bd_rk="$SRCROOT/../build/Release/RegexKit.framework"
-
-    if [ -d "$global_bd_rk" ]
-    then
-        "$CP" -a -f -v "$global_bd_rk" "$FRAMEWORKS_DIR"
-    elif [ -d "$baseten_bd_rk" ]
-    then
-        "$CP" -a -f -v "$baseten_bd_rk" "$FRAMEWORKS_DIR"
-    else
-        echo "Didn't find RegexKit.framework!"
-        exit 1
-    fi
-fi
-
 exit 0

File Tools/defines.sh

 baseten_version="1.8"
-my_build_dir="${BUILT_PRODUCTS_DIR}/BaseTen-PostgreSQL"
-my_additions_dir="${BUILT_PRODUCTS_DIR}/BaseTen-PG-Additions"
-postgresql_version="8.3.11"
-postgresql_source_file="postgresql-${postgresql_version}.tar.bz2"
-postgresql_root="${my_build_dir}/postgresql-${postgresql_version}"
-my_availcpu=`/usr/sbin/sysctl -n hw.availcpu`
 
 function exit_on_error
 {

File Tools/pcre.mk

-TAR              = /usr/bin/gnutar
-LIPO             = /usr/bin/lipo
-TOUCH            = /usr/bin/touch
-SLEEP            = /bin/sleep
-MKDIR            = /bin/mkdir
+include Tools/common.mk
+
 
 PCRE_BUILD_DIR   = $(BUILD_DIR)/Release/BaseTen-pcre
 PCRE_VERSION     = 8.02
 PCRE_SOURCE_FILE = Contrib/pcre/pcre-$(PCRE_VERSION).tar.bz2
 PCRE_ROOT        = $(PCRE_BUILD_DIR)/pcre-$(PCRE_VERSION)
-AVAILCPU         = $(shell /usr/sbin/sysctl -n hw.availcpu)
-UNIVERSAL_LIBS   = $(foreach my_arch,ppc ppc64 i386 x86_64,$(PCRE_BUILD_DIR)/$(my_arch)/lib/libpcre.a)
-
-TARGET_ppc       = powerpc-apple-darwin
-TARGET_i386      = i386-apple-darwin
-TARGET_ppc64     = powerpc64-apple-darwin
-TARGET_x86_64    = x86_64-apple-darwin
-TARGET_armv6     = armv6-apple-darwin
-
-CC_ppc           = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_ppc)
-CC_i386          = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_i386)
-CC_ppc64         = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_ppc64)
-CC_x86_64        = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc-$(GCC_VERSION_x86_64)
-CC_armv6         = $(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2
-
-CFLAGS_ppc       = -arch ppc
-CFLAGS_i386      = -arch i386
-CFLAGS_ppc64     = -arch ppc64
-CFLAGS_x86_64    = -arch x86_64
-CFLAGS_armv6     = -arch armv6
-
-CPPFLAGS_ppc     = -arch ppc    -mmacosx-version-min=10.5  -isysroot $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-CPPFLAGS_i386    = -arch i386   -mmacosx-version-min=10.5  -isysroot $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-CPPFLAGS_ppc64   = -arch ppc64  -mmacosx-version-min=10.5  -isysroot $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-CPPFLAGS_x86_64  = -arch x86_64 -mmacosx-version-min=10.5  -isysroot $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-CPPFLAGS_armv6   = -arch armv6  -miphoneos-version-min=3.0 -isysroot $(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
-
-LDFLAGS_ppc      = -arch ppc    -mmacosx-version-min=10.5  -Wl,-syslibroot,$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-LDFLAGS_i386     = -arch i386   -mmacosx-version-min=10.5  -Wl,-syslibroot,$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-LDFLAGS_ppc64    = -arch ppc64  -mmacosx-version-min=10.5  -Wl,-syslibroot,$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-LDFLAGS_x86_64   = -arch x86_64 -mmacosx-version-min=10.5  -Wl,-syslibroot,$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
-LDFLAGS_armv6    = -arch armv6  -miphoneos-version-min=3.0 -Wl,-syslibroot,$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+UNIVERSAL_LIBS   = $(foreach my_arch,$(ARCHS),$(PCRE_BUILD_DIR)/$(my_arch)/lib/libpcre.a)
 
 
 .PHONY: all clean build build-specifics build-arch

File common-xcconfig/10.4.xcconfig

-GCC_VERSION_ppc = 4.0
-GCC_VERSION_i386 = 4.0
-GCC_VERSION_ppc64 = 4.2
-GCC_VERSION_x86_64 = 4.2
-MACOSX_DEPLOYMENT_TARGET_ppc = 10.4
-MACOSX_DEPLOYMENT_TARGET_i386 = 10.4
-MACOSX_DEPLOYMENT_TARGET_ppc64 = 10.5
-MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.5
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(CURRENT_ARCH))
-
-// This doesn't work in Xcode 3.1.
-// GCC_VERSION = $(GCC_VERSION_$(CURRENT_ARCH))
-GCC_VERSION  = 4.0

File common-xcconfig/10.5.xcconfig

-GCC_VERSION = 4.2
-
-// For the PostgreSQL build script.
-GCC_VERSION_ppc = 4.2
-GCC_VERSION_i386 = 4.2
-GCC_VERSION_ppc64 = 4.2
-GCC_VERSION_x86_64 = 4.2
-
-MACOSX_DEPLOYMENT_TARGET = 10.5

File common-xcconfig/MacOSX10.4.xcconfig

+GCC_VERSION_ppc = 4.0
+GCC_VERSION_i386 = 4.0
+GCC_VERSION_ppc64 = 4.2
+GCC_VERSION_x86_64 = 4.2
+
+// This doesn't work in Xcode 3.1.
+// GCC_VERSION = $(GCC_VERSION_$(CURRENT_ARCH))
+GCC_VERSION  = 4.0
+
+MACOSX_DEPLOYMENT_TARGET_ppc = 10.4
+MACOSX_DEPLOYMENT_TARGET_i386 = 10.4
+MACOSX_DEPLOYMENT_TARGET_ppc64 = 10.5
+MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.5
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(CURRENT_ARCH))
+
+SDKROOT_ppc = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
+SDKROOT_i386 = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
+SDKROOT_ppc64 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT_x86_64 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT = $(SDKROOT_$(CURRENT_ARCH))

File common-xcconfig/MacOSX10.5-6.xcconfig

+// Architecture specifics are required by the PostgreSQL build script.
+GCC_VERSION_ppc = 4.2
+GCC_VERSION_i386 = 4.2
+GCC_VERSION_ppc64 = 4.2
+GCC_VERSION_x86_64 = 4.2
+GCC_VERSION = 4.2
+
+MACOSX_DEPLOYMENT_TARGET_ppc = 10.5
+MACOSX_DEPLOYMENT_TARGET_i386 = 10.5
+MACOSX_DEPLOYMENT_TARGET_ppc64 = 10.5
+MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.5
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(CURRENT_ARCH))
+
+SDKROOT_ppc = $(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk
+SDKROOT_i386 = $(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk
+SDKROOT_ppc64 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT_x86_64 = $(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk
+SDKROOT = $(SDKROOT_$(CURRENT_ARCH))

File common-xcconfig/MacOSX10.5.xcconfig

+// Architecture specifics are required by the PostgreSQL build script.
+GCC_VERSION_ppc = 4.2
+GCC_VERSION_i386 = 4.2
+GCC_VERSION_ppc64 = 4.2
+GCC_VERSION_x86_64 = 4.2
+GCC_VERSION = 4.2
+
+MACOSX_DEPLOYMENT_TARGET_ppc = 10.5
+MACOSX_DEPLOYMENT_TARGET_i386 = 10.5
+MACOSX_DEPLOYMENT_TARGET_ppc64 = 10.5
+MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.5
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(CURRENT_ARCH))
+
+SDKROOT_ppc = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT_i386 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT_ppc64 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT_x86_64 = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
+SDKROOT = $(SDKROOT_$(CURRENT_ARCH))

File common-xcconfig/common.xcconfig

 PREBINDING = NO
 SKIP_INSTALL = YES
 ZERO_LINK = NO
-SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk
 WARNING_CFLAGS = -Wall
 OTHER_CFLAGS = -DUSE_SSL -DXCODEBUILD_TARGET_NAME="$(TARGET_NAME)" -DXCODEBUILD_PROJECT_NAME="$(PROJECT_NAME)" -DXCODEBUILD_PROJECT_FILE_PATH="$(PROJECT_FILE_PATH)"
 OTHER_LDFLAGS = $(COVERAGE_LDFLAGS)

File common-xcconfig/debug.xcconfig

-ARCHS = $(NATIVE_ARCH_ACTUAL)
 COPY_PHASE_STRIP = NO
 DEBUG_BUILD = YES
 DEPLOYMENT_POSTPROCESSING = NO
 SKIP_INSTALL = YES
 STRIP_INSTALLED_PRODUCT = NO
 DEBUG_BUILD = 1
+ONLY_ACTIVE_ARCH = YES

File common-xcconfig/iPhoneOS3.0.xcconfig

+SDKROOT = $(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+IPHONEOS_DEPLOYMENT_TARGET = 3.0

File common-xcconfig/release.xcconfig

-ARCHS = ppc i386 ppc64 x86_64
 DEPLOYMENT_POSTPROCESSING = YES
 GCC_DEBUGGING_SYMBOLS =
 GCC_ENABLE_FIX_AND_CONTINUE = NO

File xcconfig/common.xcconfig

-#include "../common-xcconfig/10.5.xcconfig"
+#include "../common-xcconfig/MacOSX10.5-6.xcconfig"
 #include "../common-xcconfig/common.xcconfig"
 #include "../common-xcconfig/framework.xcconfig"
 
+ARCHS = ppc ppc64 i386 x86_64
 DYLIB_COMPATIBILITY_VERSION = 1
 DYLIB_CURRENT_VERSION = 1
 FRAMEWORK_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILD_DIR)/Release
 FRAMEWORK_VERSION = A
 GCC_PREFIX_HEADER = Sources/BaseTen_Prefix.pch
-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/internal $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/server $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/server/libpq $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/postgresql $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/postgresql/internal $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/postgresql/server $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/include/postgresql/server/libpq .
 INFOPLIST_FILE = Resources/Info.plist
-LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILT_PRODUCTS_DIR)/BaseTen-PostgreSQL/$(CURRENT_ARCH)/lib $(BUILD_DIR)/Release/pcre-7.6/lib .
-OTHER_LDFLAGS = $(COVERAGE_LDFLAGS) -ObjC -headerpad_max_install_names -lpq
+HEADER_SEARCH_PATHS  = $(BUILT_PRODUCTS_DIR) $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universql/postgresql/internal $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/server $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/server/libpq $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/postgresql $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/postgresql/internal $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/postgresql/server $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/postgresql/postgresql/server/libpq .
+LIBRARY_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR) $(BUILD_DIR)/Release/BaseTen-pcre/universal/lib $(BUILD_DIR)/Release/BaseTen-PostgreSQL/universal/lib .
+OTHER_LDFLAGS = $(COVERAGE_LDFLAGS) -ObjC -headerpad_max_install_names
 PRODUCT_NAME = BaseTen
 WRAPPER_EXTENSION = framework

File xcconfig/external-release.xcconfig

+#include "../common-xcconfig/non-gc.xcconfig"
+#include "../common-xcconfig/release.xcconfig"
+#include "../common-xcconfig/MacOSX10.5.xcconfig"
+
+ARCHS = ppc ppc64 i386 x86_64

File xcconfig/release-gc.xcconfig

 #include "../common-xcconfig/gc.xcconfig"
 #include "../common-xcconfig/release.xcconfig"
 #include "common.xcconfig"
+
 INSTALL_PATH = @executable_path/../Frameworks

File xcconfig/release-non-gc.xcconfig

 #include "../common-xcconfig/non-gc.xcconfig"