From 8dfb4e1330e797cc158fad831d80f73dfd820d47 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 3 Jun 2013 19:55:39 +0000 Subject: [PATCH] take the modif from snapshot to 3.3 --- debian/rules | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/debian/rules b/debian/rules index 8700245e..0706eed4 100755 --- a/debian/rules +++ b/debian/rules @@ -69,6 +69,11 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) LDFLAGS_EXTRA=-coverage -lgcov endif +ifneq (,$(filter scan-build,$(DEB_BUILD_OPTIONS))) +# enable the build using scan-build + PRE_CONFIGURE=scan-build +endif + %: dh $@ # --buildsystem=cmake --builddirectory=$(TARGET_BUILD) @@ -117,7 +122,7 @@ override_dh_auto_configure: debian/lldb-$(LLVM_VERSION).install debian/lldb-$(LL readlink compiler-rt # Start the actual configure - cd $(TARGET_BUILD) && \ + cd $(TARGET_BUILD) && $(PRE_CONFIGURE) \ ../configure $(confargs) \ --prefix=/usr/lib/llvm-$(LLVM_VERSION) \ --bindir=\$${prefix}/bin/ \ @@ -146,10 +151,10 @@ override_dh_auto_build: cd $(CURDIR)/tools/clang/docs && make -f Makefile.sphinx override_dh_auto_install: - chrpath -d `find $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable` - chrpath -d $(TARGET_BUILD)/Release/bin/clang $(MAKE) -C $(TARGET_BUILD) VERBOSE=1 install DESTDIR=$(CURDIR)/debian/tmp/ + chrpath -d $(TARGET_BUILD)/Release/bin/clang chrpath -d `find $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable` + mv $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/libLLVM-$(LLVM_VERSION)*.so $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/libLLVM-$(LLVM_VERSION).so.$(SONAME_EXT) mv $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/liblldb.so $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/liblldb.so.$(SONAME_EXT) @@ -178,13 +183,13 @@ override_dh_auto_install: echo "$$f"|grep "3\.2" || mv $$f `echo $$f|sed "s|\.1|-$(LLVM_VERSION).1|"`; \ done - mv $(CURDIR)/build-llvm/tools/clang/docs/tools/clang.1 $(CURDIR)/build-llvm/tools/clang/docs/tools/clang-$(LLVM_VERSION).1 + mv $(CURDIR)/$(TARGET_BUILD)/tools/clang/docs/tools/clang.1 $(CURDIR)/$(TARGET_BUILD)/tools/clang/docs/tools/clang-$(LLVM_VERSION).1 # Remove some license files rm $(CURDIR)/debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/llvm/Support/LICENSE.TXT # Managed in lldb-X.Y.links.in - rm -f $(CURDIR)/build-llvm/Release/lib/python*/site-packages/lldb/_lldb.so + rm -f $(CURDIR)/$(TARGET_BUILD)/Release/lib/python*/site-packages/lldb/_lldb.so # Remove the copy of jquery. See bug #701087 cd $(CURDIR)/docs/_build/html/_static/ && rm -f jquery.js && ln -s /usr/share/javascript/jquery/jquery.js @@ -198,7 +203,7 @@ override_dh_installman: .PHONY: override_dh_strip override_dh_strip: - dh_strip -p libclang$(SONAME_EXT) --dbg-package=libclang$(SONAME_EXT)-dbg + dh_strip -p libclang$(SONAME_EXT)-$(LLVM_VERSION) --dbg-package=libclang$(SONAME_EXT)-$(LLVM_VERSION)-dbg dh_strip -p libllvm$(LLVM_VERSION) --dbg-package=libllvm$(LLVM_VERSION)-dbg dh_strip -a @@ -216,19 +221,23 @@ override_dh_auto_test: # LLVM tests $(MAKE) -C $(TARGET_BUILD) check || true # clang tests - cd build-llvm/ && $(MAKE) -C tools/clang/ test || true + cd $(TARGET_BUILD)/ && $(MAKE) -C tools/clang/ test || true # lldb tests - cd build-llvm/Release/lib/python2.7/site-packages/lldb && if test ! -h _lldb.so -o ! -f _lldb.so; then ln -s ../../../liblldb.so _lldb.so; fi - cd build-llvm/ && $(MAKE) -C tools/lldb/test || true + cd $(TARGET_BUILD)/Release/lib/python2.7/site-packages/lldb && if test ! -h _lldb.so -o ! -f _lldb.so; then ln -s ../../../liblldb.so _lldb.so; fi + cd $(TARGET_BUILD)/Release/lib/python2.7/site-packages/lldb && if test ! -h libLLVM-$(LLVM_VERSION).so.$(SONAME_EXT) -o ! -f _lldb.so; then ln -s ../../../libLLVM-$(LLVM_VERSION).so libLLVM-$(LLVM_VERSION).so.$(SONAME_EXT); fi + cd $(TARGET_BUILD)/ && $(MAKE) -C tools/lldb/test || true # Managed by debian build system - rm -f $(CURDIR)/build-llvm/Release/lib/python*/site-packages/lldb/_lldb.so + rm -f $(CURDIR)/$(TARGET_BUILD)/Release/lib/python*/site-packages/lldb/_lldb.so # polly tests - cd build-llvm/ && $(MAKE) check-polly -C tools/polly/test/ || true + cd $(TARGET_BUILD)/ && $(MAKE) -C tools/polly/test/ check-polly || true if test "$(CODECOVERAGE)" = "yes"; then \ + REPORT=reports/llvm-toolchain.info; \ mkdir -p reports/; \ - lcov --directory build-llvm/ --capture --ignore-errors source --output-file reports/scilab-code-coverage.info; \ - genhtml -o reports/coverage --show-details --highlight --legend reports/scilab-code-coverage.info; \ + lcov --directory $(TARGET_BUILD)/ --capture --ignore-errors source --output-file $$REPORT; \ + lcov --remove $$REPORT "/usr*" -o $$REPORT; \ + lcov --remove $$REPORT "$(TARGET_BUILD)/*" -o $$REPORT; \ + genhtml -o reports/coverage --show-details --highlight --legend $$REPORT; \ fi override_dh_gencontrol: