diff options
author | Eric Hameleers <alien@slackware.com> | 2014-08-25 13:57:08 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2014-08-25 13:57:08 +0000 |
commit | 73ea9104c8b71f87ddfe42fb4032b2696a81b9b4 (patch) | |
tree | a037ba63c3019e0d98ca44f82ea3d4aaa79e627d /chromium-dev | |
parent | 6ee25050d6fb07216dde53502663b86f4bb73a97 (diff) | |
download | asb-73ea9104c8b71f87ddfe42fb4032b2696a81b9b4.tar.gz asb-73ea9104c8b71f87ddfe42fb4032b2696a81b9b4.tar.xz |
Add support (untested yet) for compiling with clang instead of gcc
Diffstat (limited to 'chromium-dev')
-rwxr-xr-x | chromium-dev/build/chromium-dev.SlackBuild | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chromium-dev/build/chromium-dev.SlackBuild b/chromium-dev/build/chromium-dev.SlackBuild index bfb57227..f9b27ab0 100755 --- a/chromium-dev/build/chromium-dev.SlackBuild +++ b/chromium-dev/build/chromium-dev.SlackBuild @@ -56,6 +56,10 @@ TAG=${TAG:-alien} # but you'll lose some Chrome functionality like using in-browser applications: USE_NACL=${USE_NACL:-1} +# Use the clang compiler. Results in faster build and smaller binaries. +# I default this to "off" because it is untested: +USE_CLANG=${USE_CLANG:-0} + DOCS="AUTHORS LICENSE README*" # Where do we look for sources? @@ -231,6 +235,19 @@ sed -e 's|config_dir.Append("chromium")|config_dir.Append("${PRGNAM}")|' \ -e 's|config_dir.Append("chrome-frame")|config_dir.Append("chrome-frame-dev")|' \ -i chrome/common/chrome_paths_linux.cc +if [ "$USE_CLANG" = "1" ]; then + # clang doesn't support this option yet: + sed -e '/-Wno-absolute-value/d' -i build/common.gypi + + # -Dclang=1 uses clang instead of gcc. + # -Dclang_use_chrome_plugins=1 fails with clang 3.5 - disable for now. + CLANG_OPTS=" -Dclang=1 -Dclang_use_chrome_plugins=0" + export CC="clang" + export CXX="clang++" +else + CLANG_OPTS=" -Dclang=0" +fi + chown -R root:root . chmod -R u+w,go+r-w,a+X-s . @@ -247,6 +264,7 @@ export -n CXXFLAGS="$SLKCFLAGS" export -n CFLAGS="$SLKCFLAGS -Wno-unused-local-typedefs" _chromium_conf=( + ${CLANG_OPTS} -Ddisable_glibc=1 -Dffmpeg_branding=Chrome -Dgoogle_api_key=$_google_api_key |