Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd party software build should not use llvm-gcc anymore #92

Closed
herzbube opened this issue Feb 8, 2013 · 3 comments
Closed

3rd party software build should not use llvm-gcc anymore #92

herzbube opened this issue Feb 8, 2013 · 3 comments
Assignees
Milestone

Comments

@herzbube
Copy link
Owner

herzbube commented Feb 8, 2013

Xcode 4.6 deprecates llvm-gcc. The release notes say this: "Xcode 4.6 is the last major Xcode release that will include the llvm-gcc compiler and the GDB debugger. Please move to use the Apple LLVM compiler and LLDB debugger [...]"

@ghost ghost assigned herzbube Feb 8, 2013
@herzbube
Copy link
Owner Author

This can be fixed by moving the entire build process to use the Xcode build system. CocoaLumberjack, QuincyKit and ZipKit are already there, now Boost and Fuego also need to be streamlined.

The latest version of Boost can be built as a framework with this: https://gitorious.org/~galbraithjoseph/boostoniphone/galbraithjosephs-boostoniphone

Experimentation has shown that Fuego trunk can also be built with Xcode (no attempt was made to actually execute the result). A few compilation errors need to be fixed, especially due to ambiguous names (e.g. "mutex" is both in the boost and the std namespace), but none of the changes are too wild.

For the moment, the project is put on hold until Fuego 2.0 has been released.

@herzbube
Copy link
Owner Author

How to build Boost as framework:

  • Read comments to this article to see whether new issues have cropped up: http://www.danielsefton.com/2012/03/building-boost-1-49-with-clang-ios-5-1-and-xcode-4-3/
  • The build script that builds the latest version of Boost can be fetched like this: git clone git://gitorious.org/~galbraithjoseph/boostoniphone/galbraithjosephs-boostoniphone.git
  • Run the build script: ./boost.sh
  • This fetches the Boost sources from SVN (pre-requisite: svn command line client). Fetches the sources of the most recent release (i.e. not trunk or anything).
  • Afterwards runs the build with the Xcode toolchain (pre-requisite: Xcode installed and xcode-select must have been run)
  • It is unclear whether the command line dev tools are still needed - one commenter on the website says that he had an error due to a missing "cc", but on the other hand the build output clearly shows that the Xcode toolchain is used
  • There are a few compiler warnings which need to be investigated (first impression: nothing serious)

The results are dropped here:

ios/framework/boost.framework
osx/framework/boost.framework

Tweaks to the build process:

The build uses the following BJam snippet (copy&pasted verbatim from boost.sh):

using darwin : ${IPHONE_SDKVERSION}~iphone
: $XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/$COMPILER -arch armv6 -arch armv7 -arch armv7s -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS
: $XCODE_ROOT/Platforms/iPhoneOS.platform/Developer
: arm iphone
;
using darwin : ${IPHONE_SDKVERSION}~iphonesim
: $XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin/$COMPILER -arch i386 -fvisibility=hidden -fvisibility-inlines-hidden $EXTRA_CPPFLAGS
: $XCODE_ROOT/Platforms/iPhoneSimulator.platform/Developer
: x86 iphone
;

@herzbube
Copy link
Owner Author

How to build Fuego as static library:

  • Checkout fuego-trunk: svn co https://fuego.svn.sourceforge.net/svnroot/fuego/trunk fuego-trunk
  • Create new Xcode project
    • Template = Cocoa Touch Static Library
    • Name = fuego-on-ios
  • Make the following project modifications
    • Target "fuego-on-ios" > Build Phases > Link Binary With Libraries > Select the Boost framework previously built (ios/framework/boost.framework)
    • Add the following subfolders with their content to the project: fuegomain, go, gouct, gtpengine, simpleplayers, smartgame
      • Xcode displays a dialog "Choose options for adding these files" where it offers to "create external build system project", using the build tool /usr/bin/make. Disable the checkbox so that the files are added to the Xcode build system.
      • Add the files to the target "fuego-on-ios"
  • Build
  • When errors occur, fix them and restart the build. Below is a detailed list of changes I had to make at the time of writing this.
  • There are a few compiler warnings which need to be investigated (first impression: nothing serious)

Tweaks to the build process:

  • Build using deployment target iOS 5.0
  • Add simulator build of the Boost framework

For fuego-trunk the following errors had to be fixed at the time of writing this:

  • SgHash.h: The operator>> mistakenly uses the std::ostream return type. Instead use std::istream
  • GtpEngine.cpp: Several errors due to ambiguity of "mutex". There is a statement "using boost::mutex" at the top of the file, but "mutex" is also known in the std namespace. Fix this by prefixing all occurrences of "mutex" with "boost::mutex". Also remove the "using" statement to be on the safe side.
  • SgUctTree.cpp: Same problem, this time it's not only "mutex" but also "shared_ptr". Fix by removing the "using" statements and writing "boost::mutex" and "boost::shared_ptr"
  • SgProcess.h: Includes a GCC specific header file (ext/stdio_filebuf.h). Fix by excluding SgProcess.cpp from the build process. This is possible because no other place in Fuego references SgProcess, and the class is not used by Little Go.

herzbube added a commit that referenced this issue Oct 12, 2013
…neral build improvements

general changes to the build
- the 3rdparty build now uses clang instead of llvm-gcc
- the clang binary used is the one reported by "xcrun"
  (instead of manually generating a deep link into the Xcode.app
  folder)
- instead of environment variables the build now uses compiler/linker
  options to specify the deployment target (e.g. -miphoneos-version-min
  instead of IPHONEOS_DEPLOYMENT_TARGET)
- the simulator build now has its own deployment target (previously
  it used the iPhone deployment target)
- remove the compiler option "-thumb-interwork" from the iPhone build
- an attempt to use the libc++ implementation of the C++ standard library
  (compiler/linker option "-stdlib=libc++") was abandoned because Fuego
  hung up on thread initialization during application startup

changes to the Boost build
- new Boost version 1.54.0 (previously 1.45.0)
- improve boost build by using the <root> option in the bjam user config
  (source for this is the Boost build script in the Gitorious project
  galbraithjosephs-boostoniphone)

changes to the Fuego build
- new Fuego version uec-cup-2013 (previously 1.1)
- fuego patch changes
  - patches 2, 3 and 4 are now consolidated in 02-fuego-mainfunction.patch
  - patch 6 that fixes a configure script problem is no longer necessary since
    the new Fuego version already contains a fixed configure script
  - new patches to fix general clang compiler errors, and C++11 compiler
    errors

doc changes
- clearly state in the quick-start guide that the build is geared to a specific
  combination of Xcode/iOS SDK
- add information about build configurations used in old version
- add detailed instructions on how a patched version of Fuego can be built
  and tested on the Mac OS X command line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant