source: tol/building/Linux/build.sh

devel
Last change on this file was 48833d3, checked in by Pedro Gea <pgea@…>, 11 years ago

Refs #1880, #1899
Se incorporan las opciones de compilación de las "ThirdParty" en build.sh.
Se corrige el mecanismo de inclusión de estos paquetes de tcl/Tk en la instalación. El mecanismo anterior basado en lib_children fallaba al no existir aún los directorios en tiempo de cmake.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7239 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100755
File size: 2.3 KB
Line 
1#!/bin/bash
2#************************************************************
3# La llamada al script recibe dos argumentos:
4#   ./build.sh [tol|toltcl|tolbase|rtol] [|Release|Debug]
5#************************************************************
6# Durante el proceso se pregunta por cada una de las etapas.
7#************************************************************
8
9BUILD_DIR=$PWD/$(dirname $0)
10source $BUILD_DIR/current_version.sh
11
12if [ "$1" = "" ]; then
13  echo -n "project? "
14  read project
15else
16  project=$1
17fi
18if !([ "$project" = "tol" ] || [ "$project" = "toltcl" ] || [ "$project" = "tolbase" ] || [ "$project" = "rtol" ]); then
19  echo "(!) First argument should be: tol, toltcl, tolbase or rtol."
20  exit
21fi
22
23PROJECT_DIR=$BUILD_DIR/../../$project
24if ! [ -d "$PROJECT_DIR" ]; then
25  echo "(!) Cannot find folder: $PROJECT_DIR"
26  exit
27fi
28
29if [ "$2" = "" ]; then
30  mode=Release
31else
32  mode=$2
33fi
34if !([ "$mode" = "Release" ] || [ "$mode" = "Debug" ]); then
35  echo "(!) Second argument should be: Release, Debug or should be avoided."
36  exit
37fi
38suffix=-$mode
39if [ "$mode" = "Release" ]; then
40  suffix=
41fi
42
43echo "----------------------------------------------------"
44echo " Building $project - $mode"
45echo "----------------------------------------------------"
46
47CMAKE_DIR=~/CMake_Build/$project/$mode
48if [ -d "$CMAKE_DIR" ]; then
49  echo "/!\ There is already a built folder of $project."
50  echo -n "mkdir? (y/n) "
51  read answer
52  if [ "$answer" = "y" ]; then
53    rm -r -f "$CMAKE_DIR"
54    mkdir -p "$CMAKE_DIR"
55  fi
56else
57  mkdir -p "$CMAKE_DIR"
58fi
59cd $CMAKE_DIR
60
61echo -n "cmake? (y/n) "
62read answer
63if [ "$answer" = "y" ]; then
64  if [ "$project" = "tol" ]; then
65    cmake $PROJECT_DIR -DCMAKE_BUILD_TYPE=$mode -DZIPARCHIVE_ROOT_DIR=/usr/local/ZipArchive$suffix -DZIPARCHIVE_AS_STATIC=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local/tol$version$suffix
66  else
67    if [ "$project" = "toltcl" ]; then
68      OPT_3PARTY="-DBUILD_TCLCURL=TRUE"
69    elif [ "$project" = "tolbase" ]; then
70      OPT_3PARTY="-DBUILD_TCLODBC=TRUE -DBUILD_TKTABLE=TRUE"
71    else
72      OPT_3PARTY=
73    fi
74    cmake $PROJECT_DIR $OPT_3PARTY -DCMAKE_BUILD_TYPE=$mode -DTOL_PREFIX_PATH=/usr/local/tol$version$suffix -DCMAKE_INSTALL_PREFIX=/usr/local/tol$version$suffix
75  fi 
76fi
77
78echo -n "make? (y/n) "
79read answer
80if [ "$answer" = "y" ]; then
81  make
82fi
83
84echo -n "install? (y/n) "
85read answer
86if [ "$answer" = "y" ]; then
87  sudo make install
88fi
Note: See TracBrowser for help on using the repository browser.