chiark / gitweb /
autogen: add shortcut for building with clang
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 27 Dec 2013 20:54:48 +0000 (21:54 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 28 Dec 2013 20:24:25 +0000 (21:24 +0100)
For a while I have been cleaning up warnings when building with clang.
There are currently only two sources of warnings left: Wcast-align and Wgnu.
I am not convinced that fixing up those up is feasible so I run with them
disabled to spot regressions. E.g. clang is a bit more strict wrt to unused
variables with the cleanup attribute and I have fixed a number of those since.

Like the other options in autogen.sh I have a shortcut for clang as well. I use
'l' for llvm.

autogen.sh

index e6289b3bcbecad92b0dc2978e409d5e6f2d90be0..91df10a26be7c3536cbce4815ec6746b2e42e335 100755 (executable)
@@ -62,6 +62,9 @@ elif [ "x$1" = "xg" ]; then
 elif [ "x$1" = "xa" ]; then
         ./configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' --enable-kdbus $args
         make clean
+elif [ "x$1" = "xl" ]; then
+        ./configure CC=clang CFLAGS='-g -O0 -ftrapv -Wno-cast-align -Wno-gnu' --enable-kdbus $args
+        make clean
 else
         echo
         echo "----------------------------------------------------------------"