source: gs2-extensions/xpdf-tools/trunk/src/packages/CASCADE-MAKE/CMAKE.sh@ 32239

Last change on this file since 32239 was 32239, checked in by ak19, 6 years ago

Committing new helper script move-cmake.sh that will move cmake out of or back into the compilation area. These 2 functions of the script are called by XPDFTOOL.sh after compiling up xpdftools and by CMAKE.sh when searching for an existing CMake within the xpdftools extension to compile up xpdftools.

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2
3package=cmake
4version=-3.11.4
5
6progname=$0
7
8source ../cascade-make/lib/cascade-lib.bash GEXT_XPDFTOOLS ../.. $*
9
10prefix=$GEXTXPDFTOOLS_INSTALLED
11
12opt_run_untar $force_untar $auto_untar $package $version
13
14# For configuring cmake, run ./bootstrap <args> instead of ./configure <args>
15# See https://cmake.org/install/
16#opt_run_configure $force_config $auto_config $package $version $prefix
17if [ $force_config = "1" ] ; then
18 echo "[pushd $package$version]"
19 ( cd $package$version ; \
20 echo $CROSSCONFIGURE_VARS ./bootstrap --prefix="$prefix" $CROSSCONFIGURE_ARGS $@ ;
21 eval $CROSSCONFIGURE_VARS ./bootstrap --prefix="$prefix" $CROSSCONFIGURE_ARGS $@ )
22 if [ $? != 0 ] ; then
23 echo " Error encountered running *bootstrap* stage of $progname"
24 exit 1
25 fi
26 echo "[popd]"
27else
28 if [ $auto_config = "1" ] ; then
29 echo "Found top-level for ${progname%.*} => no need to run ./bootstrap"
30 fi
31fi
32
33# Check that CMake products weren't just moved out of the distribution area,
34# before recompiling all of CMake
35if [[ ! -e "$GEXTXPDFTOOLS_INSTALLED/bin/cmake" && -e "$GEXT_XPDFTOOLS/devel/$GSDLOS/bin/cmake" ]]; then
36 echo "**************************************"
37 echo "Moving intermediary CMake products back for development"
38 $GEXT_XPDFTOOLS/move-cmake.sh back
39 echo "**************************************"
40else
41 echo "@@@@ $GEXT_XPDFTOOLS/devel/$GSDLOS/bin/cmake does not exist"
42 echo "**************************************"
43fi
44
45# Only compile if necessary - we don't edit these source files:
46# Only compile up OUR cmake, and only if we haven't already got OUR cmake.
47# But don't use any system cmake: xpdf-tools is dependent on cmake version (>= 2.8.8)
48if [[ -x "$GEXTXPDFTOOLS_INSTALLED/bin/cmake" ]]; then
49 echo "found cmake in $GEXTXPDFTOOLS_INSTALLED/bin"
50 _CMAKE="$GEXTXPDFTOOLS_INSTALLED/bin/cmake"
51fi
52
53if [[ "$_CMAKE" ]]; then
54 _VERSION=$("$_CMAKE" --version 2>&1 | sed 's/.*cmake version \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/;1q')
55 echo "cmake version $_VERSION"
56fi
57
58if [[ ! "$_CMAKE" ]]; then
59 opt_run_make $compile $package $version
60 opt_run_make $install $package $version "install"
61else
62 echo "$package$version already available => no need to recompile"
63fi
64
65opt_run_make $clean $package $version "clean"
66opt_run_make $distclean $package $version "distclean"
67
68opt_run_tarclean $tarclean $package $version
Note: See TracBrowser for help on using the repository browser.