You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.7 KiB

16 years ago
  1. Compiling KiCad on Apple Mac OS X
  2. =================================
  3. First written: 2010-01-31
  4. Last edited by: Jerry Jacobs <xor.gate.engineering[at]gmail[dot]com>
  5. Snow Leopard
  6. ------------
  7. Requirements
  8. * XCode Tools (http://developer.apple.com/tools/xcode)
  9. * CMake (http://www.cmake.org)
  10. * wxWidgets 2.9 (http://www.wxwidgets.org/downloads)
  11. * Doxygen (http://www.doxygen.nl)
  12. Building wxWidgets 2.9 Universal
  13. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. To check if your tools and libraries are installed check with file for architectures.
  15. user@macosx$ file /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib
  16. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib: Mach-O universal binary with 4 architectures
  17. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib (for architecture ppc7400): Mach-O dynamically linked shared library stub ppc
  18. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib (for architecture ppc64)Mach-O 64-bit dynamically linked shared library stub ppc64
  19. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib (for architecture i386):Mach-O dynamically linked shared library stub i386
  20. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libSystem.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library stub x86_64
  21. You need the architectures what you are compiling for !
  22. If you have problems that the 64bits library is not build you should add in
  23. the configure file:
  24. At time of writing (2009-01-16) this is on line 18381
  25. changing this: OSX_UNIV_OPTS="-arch ppc -arch i386"
  26. into this: OSX_UNIV_OPTS="-arch ppc -arch i386 -arch x86_64"
  27. Building a universal monolib wxWidgets 2.9 with the following parameters:
  28. ./configure --enable-unicode=yes --enable-shared=no --enable-monolithic --with-opengl \
  29. --enable-universal_binary --enable-aui --enable-debug --with-osx_cocoa \
  30. --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk/ --prefix=/opt/wxwidgets-svn
  31. If you dont need the debugging symbols then you can remove the --enable-debug parameter.
  32. Compiling and installing:
  33. make
  34. sudo make install
  35. Building KiCad
  36. ~~~~~~~~~~~~~~
  37. Extract the sources or get them from subversion.
  38. user@mac-osx$ cmake .
  39. Regarding Kicad the only things i've changed are the Variables
  40. in the generated CMakeCache.txt
  41. It depends on which CMake version you use:
  42. //Flags used by the compiler during all build types.
  43. //This fixes also BOOST macro errors
  44. CMAKE_CXX_FLAGS:STRING=-D__ASSERTMACROS__
  45. //Build architectures for OSX
  46. CMAKE_OSX_ARCHITECTURES:STRING=x86_64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5
  47. //The product will be built against the headers and libraries located
  48. // inside the indicated SDK.
  49. CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.5.sdk
  50. //Minimum OS X version to target for deployment (at runtime); newer
  51. // APIs weak linked. Set to empty string for default value.
  52. CMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.5
  53. Or:
  54. CMAKE_OSX_ARCHITECTURE = x86_64 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5
  55. CMAKE_OSX_SYSROOT = /Developer/SDKs/MacOSX10.5.sdk
  56. CMAKE_CXX_FLAGS = -D__ASSERTMACROS__
  57. Then we invoke make:
  58. user@mac-osx$ make
  59. Known Problems
  60. ~~~~~~~~~~~~~~
  61. In file included from
  62. /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22In
  63. file included from
  64. /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/reversible_ptr_container.hpp:22,
  65. from
  66. /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_sequence_adapter.hpp:20,
  67. from
  68. /temp/kicad-sources/boost_1_38_0/boost/ptr_container/ptr_vector.hpp:20,
  69. from
  70. /temp/kicad-sources/kicad/include/board_item_struct.h:9,
  71. from /temp/kicad-sources/kicad/include/pcbstruct.h:10,
  72. from /temp/kicad-sources/kicad/3d-viewer/3d_viewer.h:29,
  73. from /temp/kicad-sources/kicad/3d-viewer/3d_aux.cpp:23:
  74. /temp/kicad-sources/boost_1_38_0/boost/ptr_container/detail/static_move_ptr.hpp:154:50:
  75. error: macro "check" passed 2 arguments, but takes just 1
  76. CMAKE_CXX_FLAGS = -D__ASSERTMACROS__ fixes this :-)
  77. configure:18585: gcc -isysroot /Developer/SDKs/MacOSX10.5.sdk/ -mmacosx-version-min=10.5 -o conftest -arch i386 -arch x86_64 -arch ppc -arch i386 -arch x86_64 -arch ppc conftest.c >&5
  78. ld: warning: in /Developer/SDKs/MacOSX10.5.sdk//usr/lib/libSystem.dylib, missing required architecture ppc in file
  79. Installing rosetta and xcode with all architectures fixes this "problem"
  80. ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
  81. You get this error because the QuickTime 10.6 framework is not build with 64bit support. This not a real issue for KiCad because we don't use it anyway.