=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2013-09-23 15:19:39 +0000
+++ CMakeLists.txt	2013-10-05 14:01:22 +0000
@@ -53,14 +53,7 @@
 
 option( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default 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()
+option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
 
 
 #Set version option (stable or testing)

=== modified file 'CMakeModules/download_boost.cmake'
--- CMakeModules/download_boost.cmake	2013-09-23 15:19:39 +0000
+++ CMakeModules/download_boost.cmake	2013-10-05 14:00:23 +0000
@@ -87,21 +87,27 @@
 
     # It will probably be simpler to make this the only path in the future.
 
-    # (BTW "test" yields "unit_test_framework" when passed to bootstrap.{sh,bat} ).
+    # (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
     #message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
-    string( REPLACE "unit_test_framework" "test" libs_csv "${BOOST_LIBS_BUILT}" )
-    #message( STATUS "REPLACE libs_csv:${libs_csv}" )
-
-    string( REGEX REPLACE "\\;" "," libs_csv "${libs_csv}" )
-    #message( STATUS "libs_csv:${libs_csv}" )
+    string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
+    #message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
 
     if( MINGW )
-        set( bootstrap "bootstart.bat mingw" )
+        set( bootstrap bootstrap.bat mingw )
+
+        foreach( lib ${boost_libs_list} )
+            set( b2_libs ${b2_libs} --with-${lib} )
+        endforeach()
         unset( PIC_STUFF )
     else()
-        set( bootstrap bootstrap.sh )
+        string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
+        #message( STATUS "libs_csv:${libs_csv}" )
+
+        set( bootstrap bootstrap.sh --with-libraries=${libs_csv} )
         # pass to *both* C and C++ compilers
         set( PIC_STUFF "cflags=${PIC_FLAG}" )
+        set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
+        unset( b2_libs )
     endif()
 
     ExternalProject_Add( boost
@@ -120,13 +126,13 @@
 
         BINARY_DIR      "${PREFIX}/src/boost/"
         CONFIGURE_COMMAND ./${bootstrap}
-                        --with-libraries=${libs_csv}
 
         BUILD_COMMAND   ./b2
                         variant=release
                         threading=multi
                         toolset=gcc
                         ${PIC_STUFF}
+                        ${b2_libs}
                         #link=static
                         --prefix=<INSTALL_DIR>
                         install
@@ -134,12 +140,35 @@
         INSTALL_COMMAND ""
         )
 
+    if( MINGW )
+        execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
+            OUTPUT_VARIABLE GCC_VERSION
+            OUTPUT_STRIP_TRAILING_WHITESPACE )
+
+        string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
+        #message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
+
+        string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
+        #message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
+
+        # adjust the names of the libraries to suit the build. There's no
+        # symbolic links provided on the MinGW build to allow us to use
+        # generic names for the libs
+        foreach( lib ${BOOST_LIBS_BUILT} )
+            set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
+        endforeach()
+
+        set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
+        set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
+        unset( mingw_boost_libs )
+    endif()
+
     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" )
-
+    set( Boost_LIBRARIES    ${boost_libs}      CACHE FILEPATH "Boost libraries directory" )
+    set( Boost_INCLUDE_DIR  "${BOOST_INCLUDE}" CACHE FILEPATH "Boost include directory" )
+    #message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
 
 else( BUILD_GITHUB_PLUGIN )
 

=== modified file 'pcbnew/github/CMakeLists.txt'
--- pcbnew/github/CMakeLists.txt	2013-09-21 19:20:31 +0000
+++ pcbnew/github/CMakeLists.txt	2013-10-04 23:04:56 +0000
@@ -26,7 +26,7 @@
 #################################################
 include( download_avhttp )
 
-if( MINGW )
+if( MINGW AND NOT OPENSSL_ROOT_DIR )
     # download, compile and install to scratch dir a recent OPENSSL library and headers
     include( download_openssl )
 else()
@@ -58,10 +58,16 @@
     github_plugin.cpp
     )
 
+if( MINGW )
+    set( GITHUB_ADDITIONAL_LIBS ws2_32 )
+endif()
+
 # No, you don't get github without boost and openssl
 target_link_libraries( github_plugin
     ${Boost_LIBRARIES}
     ${OPENSSL_LIBRARIES}
+    ${wxWidgets_LIBRARIES}
+    ${GITHUB_ADDITIONAL_LIBS}
     )
 
 add_dependencies( github_plugin boost )

