diff --git a/client/Makefile.am b/client/Makefile.am index bb9a32036..c44046050 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -29,7 +29,7 @@ install-exec-local: $(LN_S) $(bindir)/icecc $(DESTDIR)$(bindir)/icerun $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir)/bin - for link in g++ gcc c++ cc clang++ clang; do \ + for link in g++ gcc c++ cc $(CLANG_SYMLINK_WRAPPERS); do \ rm -f $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\ $(LN_S) $(bindir)/icecc $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\ done @@ -37,6 +37,6 @@ install-exec-local: uninstall-local: rm $(DESTDIR)$(bindir)/icerun - for link in g++ gcc c++ cc clang++ clang; do \ + for link in g++ gcc c++ cc $(CLANG_SYMLINK_WRAPPERS); do \ rm $(DESTDIR)$(pkglibexecdir)/bin/$$link ;\ done diff --git a/configure.ac b/configure.ac index 23250c42e..191be09c9 100644 --- a/configure.ac +++ b/configure.ac @@ -304,6 +304,23 @@ else fi fi +AC_ARG_ENABLE(clang-wrappers, + AS_HELP_STRING([--enable-clang-wrappers], + [Use symlink wrappers for clang/clang++.])) + +CLANG_SYMLINK_WRAPPERS= +if test "$enable_clang_wrappers" = "yes"; then + CLANG_SYMLINK_WRAPPERS='clang clang++' +elif test "$enable_clang_wrappers" = "no"; then + true # do not enable +else + AC_CHECK_PROG(CLANG,clang,clang) + if test -n "$CLANG"; then + CLANG_SYMLINK_WRAPPERS='clang clang++' + fi +fi +AC_SUBST(CLANG_SYMLINK_WRAPPERS) + AC_CONFIG_FILES([ Makefile ]) AC_CONFIG_FILES([ client/Makefile ]) AC_CONFIG_FILES([ daemon/Makefile ]) diff --git a/suse/icecream.spec.in b/suse/icecream.spec.in index be1ec4c75..6bcff0f26 100644 --- a/suse/icecream.spec.in +++ b/suse/icecream.spec.in @@ -51,6 +51,16 @@ Requires: libstdc++-devel %description -n libicecream-devel icecream is the next generation distcc. +%package -n icecream-clang-wrappers +Summary: Distributed Compile Wrappers for Clang +Group: Development/Tools/Building +Requires: clang +Requires: icecream +Supplements: packageand(icecream:clang) + +%description -n icecream-clang-wrappers +Wrapper symlinks for clang/clang++ for icecream distributed building. + %prep %setup -q -n icecc-%{version} # DO NOT ADD PATCHES without github reference @@ -61,6 +71,7 @@ export CXXFLAGS="$RPM_OPT_FLAGS" %configure \ %if 0%{?suse_version} >= 1230 --enable-clang-rewrite-includes \ + --enable-clang-wrappers \ %endif --libexecdir %_libexecdir make %{?jobs:-j %jobs} @@ -105,11 +116,15 @@ rm -rf -- %_localstatedir/cache/icecream/* %_sbindir/rcicecream %_mandir/man*/* %_libexecdir/icecc +%exclude %_libexecdir/icecc/bin/clang +%exclude %_libexecdir/icecc/bin/clang++ %if 0%{?suse_version} %_sysconfdir/sysconfig/SuSEfirewall2.d/services/* %_localstatedir/adm/fillup-templates/sysconfig.icecream %if 0%{?suse_version} <= 1220 /opt/icecream +%exclude /opt/icecream/bin/clang +%exclude /opt/icecream/bin/clang++ %endif %endif %attr(-,icecream,icecream) %_localstatedir/cache/icecream @@ -121,4 +136,13 @@ rm -rf -- %_localstatedir/cache/icecream/* %_libdir/libicecc.* %_libdir/pkgconfig/icecc.pc +%files -n icecream-clang-wrappers +%defattr(-,root,root) +%_libexecdir/icecc/bin/clang +%_libexecdir/icecc/bin/clang++ +%if 0%{?suse_version} <= 1220 +/opt/icecream/bin/clang +/opt/icecream/bin/clang++ +%endif + %changelog