From 87e378c14dc8253faad414e7ce48a92e07b36f90 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Sat, 21 Sep 2013 14:20:31 -0500 Subject: [PATCH] BUILD_GITHUB_PLUGIN will build GITHUB_PLUGIN on Linux now. Don't know if the parser works yet, but the FootprintEnumerate() function worked in testing. --- CMakeLists.txt | 10 +++++++--- CMakeModules/download_boost.cmake | 26 ++++++++++---------------- patches/openssl-1.0.1e.patch | 26 ++++++++++++++++++++++++++ pcbnew/github/CMakeLists.txt | 6 +++--- 4 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 patches/openssl-1.0.1e.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index e33bac5abc..e2a4f46af7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,13 @@ option( KICAD_SCRIPTING_WXPYTHON option( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default OFF)" ) -if( NOT MINGW ) # BUILD_GITHUB_PLUGIN is not MINGW ready yet. - # still have some build problems, even on linux - #option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF ) +# BUILD_GITHUB_PLUGIN for MINGW is pretty demanding due to download_openssl.cmake and openssl's +# use of perl to drive its configure step. You might find it works in a cross builder say on linux. +# Dick is not personally supporting Windows any more with this exotic stuff. Some other windows +# developer will have to smooth out the build issues. So enable this for MINGW without my help but +# with my best wishes. +if( NOT MINGW ) + option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF ) endif() diff --git a/CMakeModules/download_boost.cmake b/CMakeModules/download_boost.cmake index 059e017925..f670687339 100644 --- a/CMakeModules/download_boost.cmake +++ b/CMakeModules/download_boost.cmake @@ -39,8 +39,8 @@ set( BOOST_ROOT "${PROJECT_SOURCE_DIR}/boost_root" ) if( BUILD_GITHUB_PLUGIN ) # Space separated list which indicates the subset of boost libraries to compile. - # Chosen libraries are based on pion-net _client_ (not server) requirements. Client - # requirements are less demanding. + # Chosen libraries are based on AVHTTP requirements, and possibly + # unit_test_framework for its own worth. set( BOOST_LIBS_BUILT date_time #exception @@ -52,7 +52,7 @@ if( BUILD_GITHUB_PLUGIN ) #signals system thread - unit_test_framework + #unit_test_framework ) endif() @@ -75,16 +75,11 @@ set( headers_src "${PREFIX}/src/boost/boost" ) function( set_boost_lib_names libs output ) foreach( lib ${libs} ) - - if( false ) - set( fullpath_lib, "${BOOST_ROOT}/lib/libboost_${lib}.${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - message( STATUS "fullpath_lib:${fullpath_lib}" ) - list( APPEND output ${fullpath_lib} ) - endif() - - message( STATUS "lib:${lib}" ) - + set( fullpath_lib "${BOOST_ROOT}/lib/libboost_${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}" ) + list( APPEND results ${fullpath_lib} ) endforeach() + # set the results into variable represented by output into caller's scope + set( ${output} ${results} PARENT_SCOPE ) endfunction() @@ -135,10 +130,9 @@ if( BUILD_GITHUB_PLUGIN ) INSTALL_COMMAND "" ) - #file( GLOB boost_libs "${BOOST_ROOT}/lib/*${CMAKE_STATIC_LIBRARY_SUFFIX}" ) - set_boost_lib_names( ${BOOST_LIBS_BUILT} boost_libs ) - - message( STATUS "BOOST_ROOT:${BOOST_ROOT} boost_libs:${boost_libs}" ) + set( boost_libs "" ) + set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs ) + #message( STATUS "BOOST_ROOT:${BOOST_ROOT} boost_libs:${boost_libs}" ) set( Boost_LIBRARIES ${boost_libs} CACHE FILEPATH "Boost libraries directory" ) set( Boost_INCLUDE_DIR "${BOOST_ROOT}/include" CACHE FILEPATH "Boost include directory" ) diff --git a/patches/openssl-1.0.1e.patch b/patches/openssl-1.0.1e.patch new file mode 100644 index 0000000000..11cb624721 --- /dev/null +++ b/patches/openssl-1.0.1e.patch @@ -0,0 +1,26 @@ +=== modified file 'crypto/bio/bio.h' +--- crypto/bio/bio.h 2013-02-08 14:43:05 +0000 ++++ crypto/bio/bio.h 2013-02-08 14:43:26 +0000 +@@ -752,7 +752,7 @@ + + /*long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);*/ + +-#ifdef __GNUC__ ++#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__MINGW64__) + # define __bio_h__attr__ __attribute__ + #else + # define __bio_h__attr__(x) + +=== modified file 'e_os.h' +--- e_os.h 2013-02-08 14:43:05 +0000 ++++ e_os.h 2013-02-08 14:43:20 +0000 +@@ -290,7 +290,7 @@ + # ifdef _WIN64 + # define strlen(s) _strlen31(s) + /* cut strings to 2GB */ +-static unsigned int _strlen31(const char *str) ++static inline unsigned int _strlen31(const char *str) + { + unsigned int len=0; + while (*str && len<0x80000000U) str++, len++; + diff --git a/pcbnew/github/CMakeLists.txt b/pcbnew/github/CMakeLists.txt index cb4538ac8f..c46f09b752 100644 --- a/pcbnew/github/CMakeLists.txt +++ b/pcbnew/github/CMakeLists.txt @@ -27,8 +27,7 @@ include( download_avhttp ) if( MINGW ) - # @todo: take this from python-a-mingw-us' PythonExternalPackages.cmake which does - # openssl compilation on MINGW. About 20 minutes work. + # download, compile and install to scratch dir a recent OPENSSL library and headers include( download_openssl ) else() find_package( OpenSSL REQUIRED ) @@ -36,7 +35,8 @@ else() # FindOpenSSL.cmake does not set this var into cache, so is not globally visible, # do it here incase some other link image needs these libraries - set( OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}" CACHE FILEPATH "OpenSSL link libraries" ) + set( OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}" CACHE FILEPATH "OpenSSL link libraries" ) + set( OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_DIR}" CACHE FILEPATH "OpenSSL include dir" ) endif()