Skip to content

Instantly share code, notes, and snippets.

@metacollin
Last active August 29, 2015 14:14
Show Gist options
  • Save metacollin/97b547034d144f483c0f to your computer and use it in GitHub Desktop.
Save metacollin/97b547034d144f483c0f to your computer and use it in GitHub Desktop.
boost patch for kicad
=== modified file 'CMakeModules/download_boost.cmake'
--- CMakeModules/download_boost.cmake 2015-02-18 02:19:26.000000000 -0700
+++ CMakeModules/download_boost.cmake 2015-02-18 02:07:00.000000000 -0700
@@ -32,6 +32,11 @@
set( BOOST_RELEASE 1.54.0 )
set( BOOST_MD5 15cb8c0803064faef0c4ddf5bc5ca279 ) # re-calc this on every RELEASE change
+if( APPLE )
+ set( BOOST_RELEASE 1.57.0 )
+ set( BOOST_MD5 1be49befbdd9a5ce9def2983ba3e7b76 )
+endif()
+
# The boost headers [and static libs if built] go here, at the top of KiCad
# source tree in boost_root.
set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" )
@@ -144,33 +149,19 @@
set( BOOST_LINKFLAGS "linkflags=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -fno-common" )
set( BOOST_TOOLSET "toolset=darwin" )
- if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
- set(BOOST_CXXFLAGS "${BOOST_CXXFLAGS} -fno-lto" )
- set(BOOST_LINKFLAGS "${BOOST_LINKFLAGS} -fno-lto" )
- endif()
-
if( CMAKE_OSX_ARCHITECTURES )
- if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc ") AND
- (CMAKE_OSX_ARCHITECTURES MATCHES "64"))
+ if( (CMAKE_OSX_ARCHITECTURES MATCHES "386" AND CMAKE_OSX_ARCHITECTURES MATCHES "64") )
message( "-- BOOST found 32/64 Address Model" )
set( BOOST_ADDRESSMODEL "address-model=32_64" )
- endif()
-
- if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") AND
- (CMAKE_OSX_ARCHITECTURES MATCHES "ppc"))
- message("-- BOOST found ppc/x86 Architecture")
+ set( BOOST_PCH "pch=off" )
+ endif()
- set(BOOST_ARCHITECTURE "architecture=combined")
- elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
+ if( (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES "386") )
message("-- BOOST found x86 Architecture")
set(BOOST_ARCHITECTURE "architecture=x86")
- elseif( (CMAKE_OSX_ARCHITECTURES MATCHES "ppc64" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc") )
- message("-- BOOST found ppc Architecture")
-
- set(BOOST_ARCHITECTURE "architecture=ppc")
endif()
set( BOOST_CFLAGS "${BOOST_CFLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}" )
@@ -192,70 +183,39 @@
# <src>/.downloads-by-cmake$ less /tmp/product/.downloads-by-cmake/boost_1_54_0/src/boost-stamp/boost-download-err.log
# If out.log does not show 100%, then try increasing TIMEOUT even more, or download the URL manually and put it
# into <src>/.downloads-by-cmake/ dir.
- # LOG_DOWNLOAD ON
+ # LOG_DOWNLOAD ON
- INSTALL_DIR "${BOOST_ROOT}"
+ INSTALL_DIR "${BOOST_ROOT}"
# The patch command executes with the working directory set to <SOURCE_DIR>
# Revert the branch to pristine before applying patch sets as bzr patch
# fails when applying a patch to the branch twice and doesn't have a switch
# to ignore previously applied patches
- PATCH_COMMAND bzr revert
- # bzr revert is insufficient to remove "added" files:
+ PATCH_COMMAND bzr revert
COMMAND bzr clean-tree -q --force
COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch"
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch"
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266
- # tell bzr about "added" files by last patch:
- COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S
-
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273
-
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw64_interlocked.patch"
-
- # tell bzr about "added" files by last patch:
- COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S
- COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S
- COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S
- COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S
-
- COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266
- COMMAND bzr add libs/context/build/Jamfile.v2
- COMMAND bzr add libs/context/build/architecture.jam
- COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/jump_ppc32_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/jump_ppc64_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/make_combined_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/make_ppc32_sysv_macho_gas.S
- COMMAND bzr add libs/context/src/asm/make_ppc64_sysv_macho_gas.S
-
- # [Mis-]use this step to erase all the boost headers and libraries before
- # replacing them below.
- UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
-
- BINARY_DIR "${PREFIX}/src/boost/"
- CONFIGURE_COMMAND ${bootstrap}
-
- BUILD_COMMAND ./b2
- variant=release
- threading=multi
- ${BOOST_CFLAGS}
- ${BOOST_TOOLSET}
- ${BOOST_CXXFLAGS}
- ${BOOST_LINKFLAGS}
- ${BOOST_ADDRESSMODEL}
- ${BOOST_ARCHITECTURE}
- ${b2_libs}
- ${BOOST_LINKTYPE}
- --prefix=<INSTALL_DIR>
- install
+ UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${BOOST_ROOT}"
+
+ BINARY_DIR "${PREFIX}/src/boost/"
+ CONFIGURE_COMMAND ${bootstrap} ${b2_libs}
+
+ BUILD_COMMAND ./b2
+ variant=release
+ ${BOOST_CFLAGS}
+ ${BOOST_TOOLSET}
+ ${BOOST_CXXFLAGS}
+ ${BOOST_LINKFLAGS}
+ ${BOOST_ADDRESSMODEL}
+ ${BOOST_ARCHITECTURE}
+ ${BOOST_PCH}
+ ${b2_libs}
+ ${BOOST_LINKTYPE}
+ --prefix=<INSTALL_DIR>
+ install
- INSTALL_COMMAND ""
+ INSTALL_COMMAND ""
)
if( MINGW )
@@ -295,6 +255,7 @@
ExternalProject_Add_Step( boost bzr_commit_boost
+ COMMAND bzr whoami --branch --directory <SOURCE_DIR> "Kicad Build <[email protected]>"
COMMAND bzr ci -q -m pristine <SOURCE_DIR>
COMMENT "committing pristine boost files to 'boost scratch repo'"
DEPENDERS patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment