summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2013-03-29 23:13:05 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2013-03-29 23:13:05 (GMT)
commit6c974c824db0c4b97a5ec5e03726ebe4a2198ad9 (patch)
treea89f756228cc72486ff1e71fbc68fd29baa01ba3 /config
parented621aae38837e90c7273087de22f1752eee7cc7 (diff)
downloadhdf5-6c974c824db0c4b97a5ec5e03726ebe4a2198ad9.zip
hdf5-6c974c824db0c4b97a5ec5e03726ebe4a2198ad9.tar.gz
hdf5-6c974c824db0c4b97a5ec5e03726ebe4a2198ad9.tar.bz2
[svn-r23495] ported revisions 23433:23494 from the trunk
Diffstat (limited to 'config')
-rw-r--r--config/apple48
1 files changed, 44 insertions, 4 deletions
diff --git a/config/apple b/config/apple
index c5c0a19..ac93ea5 100644
--- a/config/apple
+++ b/config/apple
@@ -20,17 +20,25 @@
#
# See BlankForm in this directory for details.
-# The default compiler is `gcc'
+# The default compiler is `clang'.
+# No support for OS older than darwin 10.X.
if test "X-" = "X-$CC"; then
- CC=gcc
- CC_BASENAME=gcc
+ case "$host_os" in
+ darwin10.*) # Snow Leopard. Use gcc/g++ because clang++ is not available.
+ CC=gcc
+ CC_BASENAME=gcc
+ ;;
+ *)
+ CC=clang
+ CC_BASENAME=clang
+ ;;
+ esac
fi
# Figure out compiler flags
. $srcdir/config/gnu-flags
# temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not
# use -O option as it causes failures in test/dt_arith.
-#echo host_os=$host_os
case "$host_os" in
darwin1[12].*) # lion & mountain lion
#echo cc_vendor=$cc_vendor'-'cc_version=$cc_version
@@ -48,6 +56,11 @@ esac
. $srcdir/config/intel-flags
if test "X-" = "X-$FC"; then
case $CC_BASENAME in
+ clang)
+ # clang has no fortran compiler. Use gfortran.
+ FC=gfortran
+ FC_BASENAME=gfortran
+ ;;
gcc*)
FC=gfortran
FC_BASENAME=gfortran
@@ -59,8 +72,30 @@ if test "X-" = "X-$FC"; then
esac
fi
+if test "X-" = "X-$CXX"; then
+ case $CC_BASENAME in
+ clang)
+ CXX=clang++
+ CXX_BASENAME=clang++
+ ;;
+ gcc)
+ CXX=g++
+ CXX_BASENAME=g++
+ ;;
+ icc)
+ CXX=icpc
+ CXX_BASENAME=icpc
+ ;;
+ esac
+fi
+
# compiler version strings
case $CC in
+ clang)
+ cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\
+ grep 'Apple' | sed 's/(.*//'`
+ ;;
+
*gcc*)
cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 | grep -v 'PathScale' |\
grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'`
@@ -97,6 +132,11 @@ esac
# get c++ version info
case $CXX in
+ clang++)
+ cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
+ grep 'Apple' | sed 's/(.*//'`
+ ;;
+
*g++*)
cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\
grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'`