On Mac use different compilers with the same settings if no separate configuration directory is set
--HG-- branch : bgschaid/minorAdditionsBranch
This commit is contained in:
parent
bb0d8e90a6
commit
1713e3dcf9
4 changed files with 76 additions and 32 deletions
80
etc/bashrc
80
etc/bashrc
|
@ -268,26 +268,68 @@ Darwin)
|
||||||
|
|
||||||
export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"`
|
export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"`
|
||||||
|
|
||||||
if [ "$compilerInstall" == "System" ]
|
which -s port >/dev/null
|
||||||
|
if [ $? -eq "0" -a -d '/opt/local/etc/macports' ]
|
||||||
then
|
then
|
||||||
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
case $WM_COMPILER in
|
then
|
||||||
Gcc43)
|
echo "Using Macports binaries"
|
||||||
export WM_CC='gcc-mp-4.3'
|
fi
|
||||||
export WM_CXX='g++-mp-4.3'
|
|
||||||
;;
|
export WM_USE_MACPORT=1
|
||||||
Gcc44)
|
|
||||||
export WM_CC='gcc-mp-4.4'
|
if [ "$compilerInstall" == "System" ]
|
||||||
export WM_CXX='g++-mp-4.4'
|
then
|
||||||
;;
|
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
|
||||||
Gcc45)
|
case $WM_COMPILER in
|
||||||
export WM_CC='gcc-mp-4.5'
|
Gcc42)
|
||||||
export WM_CXX='g++-mp-4.5'
|
export WM_MACPORT_VERSION=4.2
|
||||||
;;
|
;;
|
||||||
*)
|
Gcc43)
|
||||||
export WM_COMPILER=
|
export WM_MACPORT_VERSION=4.3
|
||||||
;;
|
;;
|
||||||
esac
|
Gcc44)
|
||||||
|
export WM_MACPORT_VERSION=4.4
|
||||||
|
;;
|
||||||
|
Gcc45)
|
||||||
|
export WM_MACPORT_VERSION=4.5
|
||||||
|
;;
|
||||||
|
Gcc46)
|
||||||
|
export WM_MACPORT_VERSION=4.6
|
||||||
|
;;
|
||||||
|
Gcc47)
|
||||||
|
export WM_MACPORT_VERSION=4.7
|
||||||
|
;;
|
||||||
|
Gcc48)
|
||||||
|
export WM_MACPORT_VERSION=4.8
|
||||||
|
;;
|
||||||
|
Gcc)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported MacPorts-Compiler $WM_COMPILER"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$WM_COMPILER" != "Gcc" ]
|
||||||
|
then
|
||||||
|
export WM_CC="gcc-mp-$WM_MACPORT_VERSION"
|
||||||
|
export WM_CXX="g++-mp-$WM_MACPORT_VERSION"
|
||||||
|
|
||||||
|
ruleDirBase=$WM_DIR/rules/$WM_ARCH
|
||||||
|
ruleDir=$ruleDirBase$WM_COMPILER
|
||||||
|
if [ ! -e $ruleDir ]
|
||||||
|
then
|
||||||
|
echo "Rule directory $ruleDir not existing. Linking to $ruleDirBase"
|
||||||
|
ln -s $ruleDirBase $ruleDir
|
||||||
|
fi
|
||||||
|
unset ruleDir ruleDirBase
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -z "$WM_CC" ]
|
||||||
|
then
|
||||||
|
# nobody set the compiler
|
||||||
|
export WM_CC="gcc"
|
||||||
|
export WM_CXX="g++"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
@ -187,17 +187,19 @@ fi
|
||||||
unset compilerBin compilerLib compilerInstall
|
unset compilerBin compilerLib compilerInstall
|
||||||
|
|
||||||
|
|
||||||
case "$WM_COMPILER" in
|
if [ -z "$WM_CC" ]
|
||||||
Gcc*)
|
then
|
||||||
export WM_CC='gcc'
|
case "$WM_COMPILER" in
|
||||||
export WM_CXX='g++'
|
Gcc*)
|
||||||
;;
|
export WM_CC='gcc'
|
||||||
Icc)
|
export WM_CXX='g++'
|
||||||
export WM_CC='icc'
|
;;
|
||||||
export WM_CXX='icpc'
|
Icc)
|
||||||
;;
|
export WM_CC='icc'
|
||||||
esac
|
export WM_CXX='icpc'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# Communications library
|
# Communications library
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
cWARN = -Wall
|
cWARN = -Wall
|
||||||
|
|
||||||
cc = gcc $(WM_CXXFLAGS)
|
cc = $(WM_CC) $(WM_CXXFLAGS)
|
||||||
|
|
||||||
include $(RULES)/c$(WM_COMPILE_OPTION)
|
include $(RULES)/c$(WM_COMPILE_OPTION)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
|
c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
|
||||||
|
|
||||||
CC = g++ $(WM_CXXFLAGS)
|
CC = $(WM_CXX) $(WM_CXXFLAGS)
|
||||||
|
|
||||||
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
include $(RULES)/c++$(WM_COMPILE_OPTION)
|
||||||
|
|
||||||
|
|
Reference in a new issue