|
From: <ai...@us...> - 2013-07-02 00:04:58
|
Revision: 12403
http://sourceforge.net/p/plplot/code/12403
Author: airwin
Date: 2013-07-02 00:04:52 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
Implement a BUILD_THE_BUILDTOOLS option.
When this variable is set to ON with -DBUILD_THE_BUILDTOOLS=ON, this
puts build_projects in a special mode to build and install only a
small list of buildtools. Only cmake is on that list of buildtools
for now that are built with this option. cmake is built with the
bootstrap method to cut the dependence on the binary version of cmake
that is used to configure build_projects in the
-DBUILD_THE_BUILDTOOLS=ON case.
The idea is once the buildtools list of packages is built with this
special option, then you can put those buildtools on the PATH and use
them from then on in normal builds of build_packages to reduce the
reliance on downloaded binaries for all results.
Tested by: Alan W. Irwin <ai...@us...> using the
build_all target for the "Unix Makefiles" generator on Linux and the
"MSYS Makefiles" generator on (the Wine version of) Windows. Note
these were just successful build tests, and the resulting
cmake-2.8.11.1 binary in each case has not been tested (yet) by using
it for builds of other software. But all subsequent tests will be
using these bootstrapped versions.
Modified Paths:
--------------
trunk/cmake/build_projects/CMakeLists.txt
trunk/cmake/build_projects/README
Added Paths:
-----------
trunk/cmake/build_projects/cmake/
trunk/cmake/build_projects/cmake/bp.cmake
Modified: trunk/cmake/build_projects/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/CMakeLists.txt 2013-07-01 20:14:47 UTC (rev 12402)
+++ trunk/cmake/build_projects/CMakeLists.txt 2013-07-02 00:04:52 UTC (rev 12403)
@@ -201,18 +201,40 @@
# on those individual build targets
set(build_target_LIST)
-# List of all configurations. Order doesn't matter because multiple
-# attempts to include the same configuration (via dependencies) are ignored.
-set(build_configuration_LIST
- libagg
- libharu
- libqhull
- ndiff
- plplot
- shapelib
- wxwidgets
-)
+option(BUILD_THE_BUILDTOOLS "Build the buildtools (such as cmake) used for the rest of the builds" OFF)
+if(BUILD_THE_BUILDTOOLS)
+ set(executables_LIST
+ sh
+ )
+ foreach(executable ${executables_LIST})
+ string(TOUPPER ${executable} EXECUTABLE)
+ find_program(${EXECUTABLE}_EXECUTABLE ${executable})
+ if(NOT ${EXECUTABLE}_EXECUTABLE)
+ if(MSYS_PLATFORM)
+ message(STATUS "${executable} missing from your MSYS platform. If sh is missing, use a generator other than 'MinGW Makefiles'. If something else is missing use mingw-get to install it.")
+ endif(MSYS_PLATFORM)
+ message(FATAL_ERROR "${executable} must be on your PATH in order for build_projects to work correctly")
+ endif(NOT ${EXECUTABLE}_EXECUTABLE)
+ endforeach(executable ${executables_LIST})
+
+ set(build_configuration_LIST
+ cmake
+ )
+else(BUILD_THE_BUILDTOOLS)
+ # List of all configurations. Order doesn't matter because multiple
+ # attempts to include the same configuration (via dependencies) are ignored.
+ set(build_configuration_LIST
+ libagg
+ libharu
+ libqhull
+ ndiff
+ plplot
+ shapelib
+ wxwidgets
+ )
+endif(BUILD_THE_BUILDTOOLS)
+
foreach(build_configuration ${build_configuration_LIST})
include(${build_configuration}/bp.cmake)
endforeach(build_configuration ${build_configuration_LIST})
Modified: trunk/cmake/build_projects/README
===================================================================
--- trunk/cmake/build_projects/README 2013-07-01 20:14:47 UTC (rev 12402)
+++ trunk/cmake/build_projects/README 2013-07-02 00:04:52 UTC (rev 12403)
@@ -54,7 +54,9 @@
http://www.cmake.org/files. I am currently using
v2.8/cmake-2.8.10.2-win32-x86.zip. Unpack this using the unzip
command you just installed. Put the resulting
-cmake-2.8.10.2-win32-x86/bin on your PATH.
+cmake-2.8.10.2-win32-x86/bin on your PATH. This downloadable binary
+(which poses a security concern like all downloadable binaries)
+is only used once.
7. If you are going to try the "NMake Makefiles JOM" generator, download
the latest jom_VERSION.zip from http://releases.qt-project.org/jom, unpack
@@ -66,15 +68,57 @@
correction in a following post in that thread.
===============================================================================
-Build instructions:
+Build instructions for the buildtools (such as cmake):
-1. Adjust the local path to the PLplot source tree in plplot/bp.cmake
-(this will only necessary until build_projects is updated to configure
+Note that when cmake is built this way it is configured by the
+bootstrap script (which demands sh is on the PATH) rather than cmake
+itself so the downloaded binary version of cmake used to configure the
+build_tools build is not actually used to build cmake which provides a
+slight increase in security for the paranoid. And you should be
+paranoid about security (i.e., you should build your own
+version of CMake from source, in my opinion rather than relying
+on a downloaded binary) since crackers are always
+trying it on.
+
+Note the special paths below which have a _buildtools suffix, and also
+note the special option -DBUILD_THE_BUILDTOOLS=ON which configures
+builds of _only_ the build tools such as cmake that are used for the
+other software projects.
+
+Linux "Unix Makefiles"
+
+wine@raven> mkdir -p /home/wine/newstart/build_script/build_dir-linux_buildtools
+wine@raven> cd /home/wine/newstart/build_script/build_dir-linux_buildtools
+wine@raven> rm -rf /home/wine/newstart/build_script/build_dir-linux_buildtools/*
+wine@raven> cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/home/wine/newstart/build_script/install-linux_buildtools -DBUILD_THE_BUILDTOOLS=ON ~software/plplot_svn/HEAD/plplot_allura/cmake/build_projects >& cmake.out
+wine@raven> make VERBOSE=1 build_all >& build_all.out
+
+Windows "MSYS Makefiles" (This is a special case that requires sh.exe to
+be on the PATH so the "MinGW Makefiles" generator cannot be used.
+
+bash.exe-3.1$ mkdir -p /z/home/wine/newstart/build_script/build_dir-git_buildtools
+bash.exe-3.1$ cd /z/home/wine/newstart/build_script/build_dir-git_buildtools
+bash.exe-3.1$ rm -rf /z/home/wine/newstart/build_script/build_dir-git_buildtools/*
+bash.exe-3.1$ cmake -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/z/home/wine/newstart/build_script/install-git_buildtools -DBUILD_THE_BUILDTOOLS=ON /z/home/software/plplot_svn/HEAD/plplot_allura/cmake/build_projects >& cmake.out
+bash.exe-3.1$ mingw32-make.exe VERBOSE=1 build_all >& build_all.out
+
+Build instructions for everything else which is not a build tool but
+which uses those (such as cmake) which have been built above:
+
+1. Put the bin directory contained in the install tree created above
+at the top of the PATH. In my case this directory is either
+/home/wine/newstart/build_script/install-linux_buildtools/bin (Linux)
+or /z/home/wine/newstart/build_script/install-git_buildtool/bin
+(Windows). This step insures you will be using the buildtools you
+built yourself from source from now on rather than some downloaded binary.
+
+2. Adjust the local path to the PLplot source tree in plplot/bp.cmake
+(this will only be necessary until build_projects is updated to configure
a build of an svn client that works on Windows). The alternative is
to download and test a released version of PLplot, but I prefer the
-trunk version.
+svn trunk version because that is much more up to date.
-2. Examples of configuring a build and test of PLplot and some of its
+3. Examples of configuring a build and test of PLplot and some of its
soft dependencies on several different systems with various generators
and build tools. Adjust these for your own paths, and note the first
three commands in each group are to insure you start with a clean
Added: trunk/cmake/build_projects/cmake/bp.cmake
===================================================================
--- trunk/cmake/build_projects/cmake/bp.cmake (rev 0)
+++ trunk/cmake/build_projects/cmake/bp.cmake 2013-07-02 00:04:52 UTC (rev 12403)
@@ -0,0 +1,64 @@
+# cmake/bp.cmake
+# This file should be included directly or indirectly from a top-level
+# CMakeLists.txt file to configure the build of cmake.
+
+# 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 cmake)
+
+# 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_CMAKE_DIR v2.8)
+set(BP_CMAKE_VERSION 2.8.11.1)
+set(${BP_PACKAGE}_URL http://www.cmake.org/files/${BP_CMAKE_DIR}/cmake-${BP_CMAKE_VERSION}.tar.gz)
+set(${BP_PACKAGE}_URL_MD5 df5324a3b203373a9e0a04b924281a43)
+
+# 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}")
+ determine_msys_path(${BP_PACKAGE}_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+else(MSYS_PLATFORM)
+ set(${BP_PACKAGE}_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+endif(MSYS_PLATFORM)
+#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")
+
+ExternalProject_Add(
+ build_${BP_PACKAGE}
+ URL ${${BP_PACKAGE}_URL}
+ URL_MD5 ${${BP_PACKAGE}_URL_MD5}
+ CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} CFLAGS=-O3 CXXFLAGS=-O3 ${SH_EXECUTABLE} ${EP_BASE}/Source/build_${BP_PACKAGE}/bootstrap --prefix=${${BP_PACKAGE}_INSTALL_PREFIX} --parallel=8
+ BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_BUILD_COMMAND}
+ INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_BUILD_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.
|