Commit 325f848d authored by Mark Olesen's avatar Mark Olesen

CONFIG: makeGcc with -m32/-m64 option instead of old WM_ARCH_OPTION

parent 4c4a1175
......@@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# | Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -63,6 +63,7 @@ usage() {
usage: ${0##*/} [OPTION] [gcc-VERSION] [gmp-VERSION] [mpfr-VERSION] [mpc-VERSION]
options:
-clang Force clang/clang++ for building
-m32 | -m64 32-bit or 64-bit (default) ABI
-multilib for 64-bit systems with 32-bit support required
-no-multilib for 64-bit systems without 32-bit support (DEFAULT)
-no-threadsafe disable mpfr thread-safe (default is auto-detect)
......@@ -79,6 +80,8 @@ USAGE
exit 1
}
#------------------------------------------------------------------------------
optArch=64 # Use 64-bit ABI
# Build 32-bit libraries on 64-bit systems (normally not needed)
optMultilib=disable
unset optThreadSafe # unset=auto
......@@ -94,6 +97,9 @@ do
export CXX=clang++
;;
-m32 | -m64)
optArch="${1#*m}"
;;
-multi*)
optMultilib=enable
;;
......@@ -136,6 +142,7 @@ cat<<SUMMARY
GCC configuration
------------------
GCC = $gccPACKAGE
ABI = $optArch
GMP = $gmpPACKAGE
MPFR = $mpfrPACKAGE
MPC = $mpcPACKAGE
......@@ -144,17 +151,6 @@ Using CC = $CC $CFLAGS
Using CXX = $CXX $CXXFLAGS
SUMMARY
# Set 32 or 64 bit ABI
case "$WM_ARCH_OPTION" in
32 | 64)
ABI=$WM_ARCH_OPTION
;;
*)
die "The WM_ARCH_OPTION ($WM_ARCH_OPTION) must be 32 or 64"
;;
esac
#------------------------------------------------------------------------------
# Build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
......@@ -204,7 +200,7 @@ else
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$GMP_ARCH_PATH \
--libdir=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
--enable-cxx \
......@@ -234,7 +230,7 @@ fi
# Build MPFR
# ================
echo "---------------"
if [ -d $MPFR_ARCH_PATH ]
if [ -d "$MPFR_ARCH_PATH" ]
then
echo "Already built: $mpfrPACKAGE"
elif _foamIsSystem $MPFR_ARCH_PATH
......@@ -260,7 +256,7 @@ else
[ -n "$optThreadSafe" ] && configOpt="--${optThreadSafe}-thread-safe"
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$MPFR_ARCH_PATH \
--libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configOpt \
......@@ -290,7 +286,7 @@ fi
# Build MPC
# ================
echo "---------------"
if [ -d $MPC_ARCH_PATH ]
if [ -d "$MPC_ARCH_PATH" ]
then
echo "Already built: $mpcPACKAGE"
elif _foamIsSystem $MPC_ARCH_PATH
......@@ -312,7 +308,7 @@ else
cd $buildDIR
set -x
$sourceDIR/configure ABI=$ABI \
$sourceDIR/configure ABI=$optArch \
--prefix=$MPC_ARCH_PATH \
--libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
$configGMP $configMPFR \
......@@ -346,7 +342,7 @@ fi
# or specify -no-multilib on the command-line
#
echo "---------------"
if [ -d $GCC_ARCH_PATH ]
if [ -d "$GCC_ARCH_PATH" ]
then
echo "Already built: $gccPACKAGE"
elif _foamIsSystem $GCC_ARCH_PATH
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment