I want to upgrade to 4.8 for our mac client. Since the prebuilt binaries only support 64 bit, I have to build the Qt frameworks myself which is fine. Many of our customers are still using OS X 10.5 so I configured the build against that SDK:

Qt Code:
  1. ./configure -platform macx-g++ -arch i386 -arch x86_64 -sdk /Developer/SDKs/MacOSX10.5.sdk -release
To copy to clipboard, switch view to plain text mode 
Everything seems to configure fine and makefiles are generated. However, as soon as I try to build any of the projects, I get a list of errors related to missing files:


Qt Code:
  1. gcc -c -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -arch i386 -arch i386 -Xarch_i386 -mmacosx-version-min=10.4 -isysroot /Developer-3.2.6/SDKs/MacOSX10.5.sdk -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG_PLUGIN_CHECK -DQT_NO_DEBUG -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/macx-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../../tools/shared -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared tools/qlocale_mac.mm -o .obj/release-shared/qlocale_mac.o
  2. In file included from /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/algorithm:65,
  3. from ../../include/QtCore/../../src/corelib/global/qglobal.h:68,
  4. from ../../include/QtCore/qglobal.h:1,
  5. from ../../include/QtCore/../../src/corelib/tools/qchar.h:45,
  6. from ../../include/QtCore/qchar.h:1,
  7. from ../../include/QtCore/../../src/corelib/tools/qstring.h:45,
  8. from ../../include/QtCore/qstring.h:1,
  9. from tools/qlocale_p.h:56,
  10. from tools/qlocale_mac.mm:42:
  11. /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:64:28: error: bits/c++config.h: No such file or directory
  12. ...
  13. /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
  14. ...
  15. /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/iosfwd:46:25: error: bits/c++io.h: No such file or directory
  16. ...
  17. /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/allocator.h:52:31: error: bits/c++allocator.h: No such file or directory
  18. ...
  19. /Developer-3.2.6/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/atomicity.h:38:30: error: bits/atomic_word.h: No such file or directory
  20. ...
To copy to clipboard, switch view to plain text mode 
It's true - these files definitely do not exist in the 10.5 SDK. They DO exist in the 10.7 SDK so I was able to build all the Qt frameworks for Lion but that doesn't help me out with my 10.5 and 10.6 users.

After sniffing around the internet, it seems that some/all of these files may be precompiled headers and others who got these errors found success by configuring their builds (for non Qt projects) not to use precompiled headers. As far as I can tell, however, there is no option with the Qt configure tool to avoid using precompiled headers.

Am I missing something obvious? Seems like it shouldn't be hard to build 4.8.0 for mac for the i386 and x86_64 architectures against 10.5 but I'm totally stumped.

Thanks.