PORT: Mac port headers update for Time.H
[foam-extend-3.0.git] / ThirdParty / AllMake.stage5
blob5447e3aa71a4d4ba8bf62b492508a8258f803f4a
1 #!/bin/bash
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | foam-extend: Open Source CFD
5 # \\ / O peration |
6 # \\ / A nd | For copyright notice see file Copyright
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
10 # This file is part of foam-extend.
12 # foam-extend is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation, either version 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # AllMake.stage5
28 # Description
29 # Build script for ThirdParty packages not requiring rpm packaging
32 # Requirements:
33 # 1: Your OpenFOAM environment must be properly initialized
34 # 2: OpenFOAM must already been compiled because swak4Foam depends on
35 # OpenFOAM include files and libraries
37 # Author:
38 # Martin Beaudoin, Hydro-Quebec, (2012)
40 #------------------------------------------------------------------------------
41 # run from Third-party directory only
42 cd ${0%/*} || exit 1
44 wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
45 echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
46 echo " The environment variables are inconsistent with the installation."
47 echo " Check the OpenFOAM entries in your dot-files and source them."
48 exit 1
51 #------------------------------------------------------------------------------
53 echo "========================================"
54 echo "Starting ThirdParty AllMake: Stage5 "
55 echo "========================================"
56 echo
58 # swak4Foam - Version 0.2.4
59 # In fact, we are basically tracking the head branch from the Mercurial repository
60 # which is also replicated under the Breeder_1.7 section of the Subversion repository
63 SWAK_RELEASE_VERSION=0.2.4
65 if [ -z "$SWAK4FOAM_SYSTEM" ]
66 then
67 # Do we need to download the source code?
68 # We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
69 # We will not generate a rpm package, but all ThirdParty source code will be
70 # centralized under the same scratch area
71 if [ ! -e ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION ];
72 then
73 echo "Checking for a Mercurial client: hg"
74 command -v hg >/dev/null
75 if [ $? -eq 0 ];
76 then
77 echo "Using Mercurial/hg to download the source code for swak4Foam"
79 cd ./rpmBuild/BUILD;
80 hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION;
81 cd swak4Foam-$SWAK_RELEASE_VERSION;
82 hg checkout version_$SWAK_RELEASE_VERSION
84 else
85 echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
86 command -v svn >/dev/null
87 if [ $? -eq 0 ];
88 then
89 echo "Using Subversion/svn to download the source code for swak4Foam"
90 (cd ./rpmBuild/BUILD; svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.7/libraries/swak4Foam swak4Foam-$SWAK_RELEASE_VERSION)
91 else
92 echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
93 exit -1
96 # We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
97 # If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
98 # comment out the next two lines
99 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
100 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
101 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; sed -i.old "s|// #define FOAM_SYMMTENSOR_WORKAROUND|#define FOAM_SYMMTENSOR_WORKAROUND|g" Libraries/swak4FoamParsers/include/swak.H )
103 # We recompile everything
104 (cd ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION; ./Allwclean; ./Allwmake)
105 else
106 echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-$SWAK_RELEASE_VERSION"
107 echo "Please remove this directory if you want to refresh your installation of swak4Foam"
109 echo ""
110 else
111 echo "Using system installed swak4Foam"
112 echo ""
115 echo "========================================"
116 echo "Done ThirdParty AllMake: Stage5 "
117 echo "========================================"
118 echo
120 # ----------------------------------------------------------------- end-of-file