|
From: <ai...@us...> - 2013-10-25 06:36:38
|
Revision: 12628
http://sourceforge.net/p/plplot/code/12628
Author: airwin
Date: 2013-10-25 06:36:35 +0000 (Fri, 25 Oct 2013)
Log Message:
-----------
Initial commit of build configuration for Tcl.
Tested by Alan W. Irwin <ai...@us...> on Linux using
a build_projects build with -DBUILD_THE_BUILDTOOLS=ON and the
build_tcl target. Tcl-8.61 (and itcl-4.0.0 and several other
components) built and installed without issues. Afterward, an
ordinary build_projects build with the build_plplot_lite target found
that installation of Tcl-8.6.1 and iTcl-4.0.0 and used it to determine
Tcl-8.6 results for all our standard examples which agreed with the
corresponding C results.
Modified Paths:
--------------
trunk/cmake/build_projects/CMakeLists.txt
Added Paths:
-----------
trunk/cmake/build_projects/tcl/
trunk/cmake/build_projects/tcl/bp.cmake
Modified: trunk/cmake/build_projects/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/CMakeLists.txt 2013-10-25 06:22:19 UTC (rev 12627)
+++ trunk/cmake/build_projects/CMakeLists.txt 2013-10-25 06:36:35 UTC (rev 12628)
@@ -83,6 +83,10 @@
bash
make
python
+ uname
+ sed
+ ln
+ chmod
)
foreach(executable ${executables_LIST})
@@ -105,6 +109,31 @@
)
message(STATUS "PYTHON_VERSION = ${PYTHON_VERSION}")
+# Determine whether OS is 64-bits from uname -m "machine name" field.
+
+execute_process(
+ COMMAND
+ ${UNAME_EXECUTABLE} -m
+ OUTPUT_VARIABLE UNAME_MACHINE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+# Determine desired install permissions on shared objects.
+if(CMAKE_INSTALL_SO_NO_EXE)
+ set(SO_NUMERICAL_PERMISSIONS 644)
+else(CMAKE_INSTALL_SO_NO_EXE)
+ set(SO_NUMERICAL_PERMISSIONS 755)
+endif(CMAKE_INSTALL_SO_NO_EXE)
+
+# This will need refinement as more platforms tested, but it works on
+# Intel/AMD Linux hardware and also MinGW/MSYS on 32-bit Windows for
+# now.
+if(UNAME_MACHINE STREQUAL x86_64)
+ set(BP_HAVE_64_BIT_OS ON)
+else(UNAME_MACHINE STREQUAL x86_64)
+ set(BP_HAVE_64_BIT_OS OFF)
+endif(UNAME_MACHINE STREQUAL x86_64)
+
# Use modified version of the CMake 2.8.12 ExternalProject module
# where the tar.xz processing has been fixed.
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
@@ -258,6 +287,7 @@
pkg-config
#subversion
swig
+ tcl
)
else(BUILD_THE_BUILDTOOLS)
# List of all configurations. Order doesn't matter because multiple
Added: trunk/cmake/build_projects/tcl/bp.cmake
===================================================================
--- trunk/cmake/build_projects/tcl/bp.cmake (rev 0)
+++ trunk/cmake/build_projects/tcl/bp.cmake 2013-10-25 06:36:35 UTC (rev 12628)
@@ -0,0 +1,121 @@
+# tcl/bp.cmake
+# CMakeLists.txt file to configure the build of tcl.
+
+# 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.
+
+# These build configuration details for Tcl adapted from information in
+# <http://www.linuxfromscratch.org/blfs/view/svn/general/tcl.html>.
+
+# Protect against configuring a build twice in one CMake call
+if(tcl_configured)
+ return()
+endif(tcl_configured)
+set(tcl_configured ON)
+
+# List of dependencies (most of which are build tools) which should be
+# ignored.
+set(BP_ignored_dependencies_LIST ${extra_ignored_dependencies_list})
+
+set(tcl_dependencies_LIST)
+# Remove dependencies that should be ignored.
+if(tcl_dependencies_LIST)
+ list(REMOVE_ITEM tcl_dependencies_LIST ${BP_ignored_dependencies_LIST})
+endif(tcl_dependencies_LIST)
+
+set(tcl_dependencies_targets)
+foreach(build_configuration ${tcl_dependencies_LIST})
+ if(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ include(${build_configuration}/bp.cmake)
+ list(APPEND tcl_dependencies_targets build_${build_configuration})
+ else(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ message(STATUS "Warning: A build_configuration for ${build_configuration} does not exist so it is assumed this dependency of tcl has been installed another way.")
+ endif(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+endforeach(build_configuration ${tcl_dependences_LIST})
+
+# This can be safely done only after above includes.
+set(BP_PACKAGE tcl)
+
+# Data that is related to downloads.
+set(${BP_PACKAGE}_URL http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz)
+set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5)
+set(${BP_PACKAGE}_DOWNLOAD_HASH aae4b701ee527c6e4e1a6f9c7399882e)
+
+# Data that is related to the PATH that must be used.
+# N.B. note below that we always use the unix subdirectory of the
+# source tree to find the configure script. Note, there is a macosx
+# and win subdirectory there as well that contain configure scripts
+# with additional options for those platforms, but for now the unix
+# version of configure may be good enough for our needs for all
+# platforms.
+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}/unix")
+ set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
+else(MSYS_PLATFORM)
+ set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}/unix")
+ set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
+endif(MSYS_PLATFORM)
+#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")
+
+if(BP_HAVE_64_BIT_OS)
+ set(TCL_ENABLE_64_BIT --enable-64bit)
+endif(BP_HAVE_64_BIT_OS)
+
+ExternalProject_Add(
+ build_${BP_PACKAGE}
+ DEPENDS ${${BP_PACKAGE}_dependencies_targets}
+ URL ${${BP_PACKAGE}_URL}
+ URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH}
+ CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} ${source_PATH}/${BP_CONFIGURE_COMMAND} --mandir=${BP_CMAKE_INSTALL_PREFIX}/share/man ${TCL_ENABLE_64_BIT}
+ BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND}
+ INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install
+ )
+
+add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-build
+ COMMAND echo "Replace build-tree locations by install-tree locations"
+ COMMAND ${SED_EXECUTABLE}
+ -e "s@^\\(TCL_SRC_DIR='\\).*@\\1${BP_CMAKE_INSTALL_PREFIX}/include'@"
+ -e "/TCL_B/s@='\\(-L\\)\\?.*build_tcl@='\\1${BP_CMAKE_INSTALL_PREFIX}/lib@"
+ -i tclConfig.sh
+ APPEND
+ )
+
+add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-install
+ COMMAND echo "Install-tree fixups"
+ COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install-private-headers
+ COMMAND ${LN_EXECUTABLE} -v -sf tclsh8.6 ${BP_CMAKE_INSTALL_PREFIX}/bin/tclsh
+ COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/libtcl8.6.so
+ APPEND
+ )
+
+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.
|