]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
support clang as CC compiler
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Oct 2011 21:11:11 +0000 (21:11 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Oct 2011 21:11:11 +0000 (21:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@24558 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure

index 7fd9c6d0c1e5ca28af4a7f265e0ae5d7cf62b4dd..998e7466643e6d01a864236f95b06d9c84a5057d 100644 (file)
@@ -1382,26 +1382,33 @@ AC_DEFUN(DEAL_II_DETERMINE_CC_BRAND, dnl
                      CC_VERSION=borland_bcc
                    else
 
-                     dnl KAI C? It seems as if the documented options
-                     dnl -V and --version are not always supported, so give
-                     dnl the whole thing a second try by looking for /KCC/
-                     dnl somewhere in the paths that are output by -v. This
-                     dnl is risky business, since this combination of
-                     dnl characters might appear on other installations
-                      dnl of other compilers as well, so put this test to
-                      dnl the very end of the detection chain for the
-                      dnl various compilers
-                     is_kai_cc="`($CC --version 2>&1) | grep 'KAI C'`"
-                     is_kai_cc="$is_kai_cc`($CC -v 2>&1) | grep /KCC/`"
-                     if test "x$is_kai_cc" != "x" ; then
-                       AC_MSG_RESULT(C compiler is KAI C)
-                       CC_VERSION=kai_cc
-                     else
-
-                        dnl  Aw, nothing suitable found...
-                        AC_MSG_RESULT([Unrecognized compiler -- still trying])
-                       CC_VERSION=unknown_cc
-                      fi
+                     is_clang="`($CC --version 2>&1) | grep clang`"
+                     if test "x$is_clang" != x ; then
+                        AC_MSG_RESULT(C compiler is clang)
+                       CC_VERSION=clang
+                     else
+
+                       dnl KAI C? It seems as if the documented options
+                       dnl -V and --version are not always supported, so give
+                       dnl the whole thing a second try by looking for /KCC/
+                       dnl somewhere in the paths that are output by -v. This
+                       dnl is risky business, since this combination of
+                       dnl characters might appear on other installations
+                        dnl of other compilers as well, so put this test to
+                        dnl the very end of the detection chain for the
+                        dnl various compilers
+                       is_kai_cc="`($CC --version 2>&1) | grep 'KAI C'`"
+                       is_kai_cc="$is_kai_cc`($CC -v 2>&1) | grep /KCC/`"
+                       if test "x$is_kai_cc" != "x" ; then
+                         AC_MSG_RESULT(C compiler is KAI C)
+                         CC_VERSION=kai_cc
+                       else
+
+                          dnl  Aw, nothing suitable found...
+                          AC_MSG_RESULT([Unrecognized compiler -- still trying])
+                         CC_VERSION=unknown_cc
+                        fi
+                     fi
                     fi
                   fi
                 fi
@@ -1540,6 +1547,12 @@ AC_DEFUN(DEAL_II_SET_CC_FLAGS, dnl
 
           ;;
 
+      clang)
+         CFLAGS="$CFLAGS -g"
+         CFLAGSO="$CFLAGS -fast -O2"
+         CFLAGSPIC="-fPIC"
+         ;;
+
       sun_cc*)
           CFLAGS="$CFLAGS -g"
           CFLAGSO="$CFLAGS -fast -O2"
index 8c792b8ebac650556191c88f0feb958efc022406..9b603ebcdd774ffac03c5b30513bb142c2b9d409 100755 (executable)
@@ -5175,18 +5175,26 @@ $as_echo "C compiler is Borland C" >&6; }
                      CC_VERSION=borland_bcc
                    else
 
-                                                                                                                                                                                             is_kai_cc="`($CC --version 2>&1) | grep 'KAI C'`"
-                     is_kai_cc="$is_kai_cc`($CC -v 2>&1) | grep /KCC/`"
-                     if test "x$is_kai_cc" != "x" ; then
-                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: C compiler is KAI C" >&5
+                     is_clang="`($CC --version 2>&1) | grep clang`"
+                     if test "x$is_clang" != x ; then
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: C compiler is clang" >&5
+$as_echo "C compiler is clang" >&6; }
+                       CC_VERSION=clang
+                     else
+
+                                                                                                                                                                                                                                               is_kai_cc="`($CC --version 2>&1) | grep 'KAI C'`"
+                       is_kai_cc="$is_kai_cc`($CC -v 2>&1) | grep /KCC/`"
+                       if test "x$is_kai_cc" != "x" ; then
+                         { $as_echo "$as_me:${as_lineno-$LINENO}: result: C compiler is KAI C" >&5
 $as_echo "C compiler is KAI C" >&6; }
-                       CC_VERSION=kai_cc
-                     else
+                         CC_VERSION=kai_cc
+                       else
 
-                                                { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unrecognized compiler -- still trying" >&5
+                                                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unrecognized compiler -- still trying" >&5
 $as_echo "Unrecognized compiler -- still trying" >&6; }
-                       CC_VERSION=unknown_cc
-                      fi
+                         CC_VERSION=unknown_cc
+                        fi
+                     fi
                     fi
                   fi
                 fi
@@ -5322,6 +5330,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
           ;;
 
+      clang)
+         CFLAGS="$CFLAGS -g"
+         CFLAGSO="$CFLAGS -fast -O2"
+         CFLAGSPIC="-fPIC"
+         ;;
+
       sun_cc*)
           CFLAGS="$CFLAGS -g"
           CFLAGSO="$CFLAGS -fast -O2"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.