diff --git a/debian/control b/debian/control index 2a1a03cf..7b72b9eb 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 9.0), flex, bison, dejagnu, tcl8.5, expect, sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9), lsb-release, patchutils, diffstat, xz-utils, chrpath, python-dev, libedit-dev, swig, python-sphinx, ocaml-nox, binutils-dev, libcloog-isl-dev, - libisl-dev (>= 0.11.1) + libisl-dev Build-Conflicts: oprofile, ocaml Standards-Version: 3.9.3 Homepage: http://www.llvm.org/ @@ -45,8 +45,8 @@ Description: C, C++ and Objective-C compiler (LLVM based) Package: clang-3.3 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libstdc++6-4.7-dev, libgcc-4.7-dev, - libobjc-4.7-dev, libclang-common-dev (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, + libclang-common-dev (= ${binary:Version}) Provides: c-compiler, objc-compiler, c++-compiler Recommends: llvm-3.3-dev, python Replaces: clang (<< 1:3.1), clang-3.1, compiler-rt diff --git a/debian/rules b/debian/rules index 618e39ea..53b3ef15 100755 --- a/debian/rules +++ b/debian/rules @@ -16,6 +16,12 @@ DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH) OCAML_STDLIB_DIR ?= $(shell ocamlc -where) +distribution := $(shell lsb_release --id --short) +distrel := $(shell lsb_release --codename --short) +ifeq ($(distrel),n/a) + distrel := sid +endif + confargs := \ --with-c-include-dirs=/usr/include/$(DEB_HOST_MULTIARCH):/usr/include/$(DEB_HOST_GNU_TYPE):/usr/include \ --with-cxx-include-root=/usr/include/c++/$(GCC_VERSION) \ @@ -33,10 +39,27 @@ ifneq (,$(findstring $(DEB_HOST_ARCH),armel)) opt_flags += -marm endif +ifeq ($(distribution),Ubuntu) + ifeq ($(distrel),precise) + control_vars = '-Vdep:devlibs=libstdc++6-4.6-dev' + endif + ifeq ($(distrel),quantal) + control_vars = '-Vdep:devlibs=libstdc++6-4.7-dev' + endif + ifeq ($(distrel),raring) + control_vars = '-Vdep:devlibs=libstdc++6-4.7-dev, libgcc-4.7-dev, libobjc-4.7-dev' + endif + +else + # Debian experimental + control_vars = '-Vdep:devlibs=libstdc++6-4.7-dev, libgcc-4.7-dev, libobjc-4.7-dev' +endif + %: dh $@ # --buildsystem=cmake --builddirectory=$(TARGET_BUILD) + debian/%: debian/%.in sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' -e "s|@OCAML_STDLIB_DIR@|$(OCAML_STDLIB_DIR)|g" -e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $< > $@ @@ -147,6 +170,9 @@ override_dh_shlibdeps: override_dh_auto_test: $(MAKE) -C $(TARGET_BUILD) check || true +override_dh_gencontrol: + dh_gencontrol -- $(control_vars) + override_dh_auto_clean: dh_auto_clean rm -rf $(TARGET_BUILD) tools/clang/include/clang/Debian/debian_path.h docs/_build/ tools/clang/docs/_html/