On 21.04.2010 18:27, Hector Oron wrote:
Hello Matthias,

I have started to do some work in this way, it is still WIP, but I
would like you to check if this way is OK with you then prepare
something more mergeable

There are two merge patches below:

From 024f597bbe0aa95fe967cc60abb0edec6f2694b3 Mon Sep 17 00:00:00 2001
From: Hector Oron<hector.o...@gmail.com>
Date: Wed, 21 Apr 2010 00:34:38 +0200
Subject: [PATCH 1/4] Merge rules.d/binary-cpp-cross.mk into binary-cpp.mk

Signed-off-by: Hector Oron<hector.o...@gmail.com>
---
  debian/rules.d/binary-cpp.mk |   22 ++++++++++++++++++++++
  1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/debian/rules.d/binary-cpp.mk b/debian/rules.d/binary-cpp.mk
index 6e1060f..efaad9e 100644
--- a/debian/rules.d/binary-cpp.mk
+++ b/debian/rules.d/binary-cpp.mk
@@ -8,9 +8,18 @@ dirs_cpp = \
        $(PF)/share/man/man1 \
        $(PF)/bin

+ifeq ($(DEB_CROSS),yes)
+dirs_cpp += \
+       $(gcc_lexec_dir)

not cross specific

+files_cpp = \
+       $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver) \
+       $(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1 \

that shouldn't be ifdef'd, but something like cmd_prefix set to $(DEB_TARGET_GNU_TYPE)- for the cross case.

+       $(gcc_lexec_dir)/cc1
+else
  files_cpp = \
        $(PF)/bin/cpp$(pkg_ver) \
        $(gcc_lexec_dir)/cc1
+endif

and then the whole ifdef is not necessary.

@@ -27,6 +36,14 @@ $(binary_stamp)-cpp: $(install_stamp)
        dh_installdirs -p$(p_cpp) $(dirs_cpp)
        DH_COMPAT=2 dh_movefiles -p$(p_cpp) $(files_cpp)

+ifeq ($(DEB_CROSS),yes)
+ifeq ($(with_unversioned),yes)
+       ln -sf $(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver) \
+         $(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp
+       ln -sf $(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1 \
+         $(d_cpp)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp.1
+endif

there is fixup code in debian/rules2 for the unversioned stuff, maybe better extend this, and elimintate the ifdef here.

+else
        ln -sf cpp$(pkg_ver) \
            $(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver)
        ln -sf cpp$(pkg_ver) \
@@ -47,6 +64,11 @@ endif
        dh_shlibdeps -p$(p_cpp)
        dh_gencontrol -p$(p_cpp) -- -v$(DEB_VERSION) $(common_substvars)
        dh_installdeb -p$(p_cpp)
+ifeq ($(DEB_CROSS),yes)
+       sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g'
<  debian/gcc-cross.postinst>  debian/$(p_cpp)/DEBIAN/postinst
+       sed 's/cross-/$(DEB_TARGET_GNU_TYPE)-/g;s/-ver/$(pkg_ver)/g;s/gcc/cpp/g'
<  debian/gcc-cross.prerm>  debian/$(p_cpp)/DEBIAN/prerm
+       chmod 755 debian/$(p_cpp)/DEBIAN/{postinst,prerm}
+endif

that should be a macro, which expands to nothing for the native build, and to the mangling for the cross build, called with no ifdef.

        $(call cross_mangle_scripts, $(p_gcc))

The macro should find out itself which scripts should be mangled.

I would place these macros in rules.defs for now.

The more interesting case is the merging of the library packaging. I would recommend starting with some lib which is not libgcc or libstdc++ for the easy cases.

  Matthias



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to