From: <ai...@us...> - 2013-07-20 19:08:30
|
Revision: 12433 http://sourceforge.net/p/plplot/code/12433 Author: airwin Date: 2013-07-20 19:08:25 +0000 (Sat, 20 Jul 2013) Log Message: ----------- Initial commit of the ffi build configuration. libffi is a hard dependency of modern glib which is not mentioned in the jhbuild configuration of glib. So adding this build configuration for libffi is a workaround for that jhbuild configuration bug for glib. Tested by Alan W. Irwin <ai...@us...> using the build_ffi target for both the "Unix Makefiles" generator on Linux and the "MSYS Makefiles" generator on Wine. Note the latter was a factor of 35 (!) slower than the former. (5 minutes versus 9 seconds.) My guess is most of this extra time is taken up running the configure script. That is, that part of the build is strongly subject to startup latency costs for Wine so that for builds of much larger autotooled packages, the Wine slowdown factor will generally be substantially smaller than 35. Modified Paths: -------------- trunk/cmake/build_projects/CMakeLists.txt Added Paths: ----------- trunk/cmake/build_projects/ffi/ trunk/cmake/build_projects/ffi/bp.cmake Modified: trunk/cmake/build_projects/CMakeLists.txt =================================================================== --- trunk/cmake/build_projects/CMakeLists.txt 2013-07-19 12:41:03 UTC (rev 12432) +++ trunk/cmake/build_projects/CMakeLists.txt 2013-07-20 19:08:25 UTC (rev 12433) @@ -246,6 +246,7 @@ shapelib wxwidgets #glib + ffi ) endif(BUILD_THE_BUILDTOOLS) Added: trunk/cmake/build_projects/ffi/bp.cmake =================================================================== --- trunk/cmake/build_projects/ffi/bp.cmake (rev 0) +++ trunk/cmake/build_projects/ffi/bp.cmake 2013-07-20 19:08:25 UTC (rev 12433) @@ -0,0 +1,64 @@ +# ffi/bp.cmake +# This file should be included directly or indirectly from a top-level +# CMakeLists.txt file to configure the build of ffi. + +# Copyright (C) 2013 Alan W. Irwin + +# This file is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this file; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# The top-level CMakeLists.txt file that includes this file should +# have run "include(ExternalProject)" and set EP_BASE variable (and +# corresponding directory property) as well as various BP variables +# used below that configure how the External_Project functions +# operate. + +set(BP_PACKAGE ffi) + +# Protect against configuring a build twice in one CMake call +if(${BP_PACKAGE}_configured) + return() +endif(${BP_PACKAGE}_configured) +set(${BP_PACKAGE}_configured ON) + +# Data that is related to downloads. +set(${BP_PACKAGE}_URL ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz) +set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE SHA256) +set(${BP_PACKAGE}_DOWNLOAD_HASH 1dddde1400c3bcb7749d398071af88c3e4754058d2d4c0b3696c2f82dc5cf11c) + +# Data that is related to the PATH that must be used. +if(MSYS_PLATFORM) + #set(BP_PATH_NODLL "${BP_PATH}") + #set(BP_PATH "${EP_BASE}/Build/build_${BP_PACKAGE}/dll;${BP_PATH_NODLL}") + determine_msys_path(BP_PATH "${BP_PATH}") + # Must have all elements of env command in MSYS platform form + determine_msys_path(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}") +else(MSYS_PLATFORM) + set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}") +endif(MSYS_PLATFORM) +#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}") + +ExternalProject_Add( + build_${BP_PACKAGE} + URL ${${BP_PACKAGE}_URL} + URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH} + CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${source_PATH}/${BP_CONFIGURE_COMMAND} + BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} + INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install + ) + +list(APPEND build_target_LIST build_${BP_PACKAGE}) +# Restore BP_PATH to original state. +set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}") +#message(STATUS "${BP_PACKAGE} restored original BP_PATH = ${BP_PATH}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |