diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-19 17:24:43 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-04-19 17:24:43 (GMT) |
commit | 0e1e79f0e02606364018806d465d48eed8ffd153 (patch) | |
tree | c7bffe852a3f284a397638536558b2a198a8bfdb /config/apple | |
parent | 14d8e1c2b5ecaf2e298984f269094dd5f2bd735f (diff) | |
download | hdf5-0e1e79f0e02606364018806d465d48eed8ffd153.zip hdf5-0e1e79f0e02606364018806d465d48eed8ffd153.tar.gz hdf5-0e1e79f0e02606364018806d465d48eed8ffd153.tar.bz2 |
[svn-r23601] Bring revisions #23341 - 23597 from trunk to revise_chunks.
h5committtested.
Diffstat (limited to 'config/apple')
-rw-r--r-- | config/apple | 48 |
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/'` |