Package: gcc-4.0
Version: 4.0.2-2
Severity: wishlist

Please provide a gcc-source-4.0 package which contains the current
sources to build for example cross compilers from them.

Bastian

-- 
Killing is stupid; useless!
                -- McCoy, "A Private Little War", stardate 4211.8
diff -urN gcc-4.0-4.0.2.orig/debian/control.m4 gcc-4.0-4.0.2/debian/control.m4
--- gcc-4.0-4.0.2.orig/debian/control.m4        2005-10-14 10:57:40.000000000 
+0000
+++ gcc-4.0-4.0.2/debian/control.m4     2005-10-14 10:54:11.000000000 +0000
@@ -901,6 +901,13 @@
  with the -msoft-float option, for CPUs without a floating-point unit.
 ')`'dnl libnof
 ')`'dnl
+
+Package: gcc-source`'PV
+Architecture: all
+Priority: PRI(optional)
+Description: Source of the GNU Compiler Collection
+ This package contains the sources and patches which are needed to
+ build the GNU Compiler Collection (GCC).
 dnl
 ')`'dnl gcc-X.Y
 dnl last line in file
diff -urN gcc-4.0-4.0.2.orig/debian/rules2 gcc-4.0-4.0.2/debian/rules2
--- gcc-4.0-4.0.2.orig/debian/rules2    2005-10-14 10:57:40.000000000 +0000
+++ gcc-4.0-4.0.2/debian/rules2 2005-10-14 10:54:11.000000000 +0000
@@ -944,6 +944,7 @@
   p_cxx  = g++$(pkg_ver)$(cross_bin_arch)
 endif
 p_hppa64 = gcc$(pkg_ver)-hppa64
+p_source = gcc-source$(pkg_ver)
 
 d      = debian/tmp
 d_base = debian/$(p_base)
@@ -953,6 +954,7 @@
 d_cxx  = debian/$(p_cxx)
 d_doc  = debian/$(p_doc)
 d_hppa64= debian/$(p_hppa64)
+d_source= debian/$(p_source)
 
 common_substvars = \
        $(shell awk "{printf \"'-V%s' \", \$$0}" debian/substvars.local)
@@ -968,6 +970,7 @@
 # native target
 
 include debian/rules.d/binary-base.mk
+include debian/rules.d/binary-source.mk
 ifeq ($(with_libgcc),yes)
   include debian/rules.d/binary-libgcc.mk
 endif
diff -urN gcc-4.0-4.0.2.orig/debian/rules.d/binary-source.mk 
gcc-4.0-4.0.2/debian/rules.d/binary-source.mk
--- gcc-4.0-4.0.2.orig/debian/rules.d/binary-source.mk  1970-01-01 
00:00:00.000000000 +0000
+++ gcc-4.0-4.0.2/debian/rules.d/binary-source.mk       2005-10-14 
10:54:11.000000000 +0000
@@ -0,0 +1,18 @@
+indep_binaries := $(indep_binaries) gcc-source
+
+$(binary_stamp)-gcc-source:
+       dh_testdir
+       dh_testroot
+
+       dh_install -p$(p_source) $(gcc_tarball) usr/src/gcc$(pkg_ver)
+       dh_install -p$(p_source) debian/patches usr/src/gcc$(pkg_ver)
+       chmod 755 debian/$(p_source)/usr/src/gcc$(pkg_ver)/patches/*
+       dh_install -p$(p_source) debian/rules.defs debian/rules.patch 
debian/rules.source debian/rules.unpack usr/src/gcc$(pkg_ver)
+       dh_fixperms -p$(p_source)
+       dh_gencontrol -p$(p_source) -- -v$(DEB_VERSION) $(common_substvars)
+       dh_installdeb -p$(p_source)
+       dh_md5sums -p$(p_source)
+       dh_builddeb -p$(p_source)
+
+       touch $@
+
diff -urN gcc-4.0-4.0.2.orig/debian/rules.defs gcc-4.0-4.0.2/debian/rules.defs
--- gcc-4.0-4.0.2.orig/debian/rules.defs        2005-10-14 10:57:40.000000000 
+0000
+++ gcc-4.0-4.0.2/debian/rules.defs     2005-10-14 10:54:57.000000000 +0000
@@ -12,36 +12,34 @@
 
 lib64          = lib64
 
-# architecture dependent variables
-DEB_BUILD_GNU_TYPE     := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-DEB_HOST_ARCH          := $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_CPU       := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
-DEB_HOST_GNU_SYSTEM    := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
-DEB_HOST_GNU_TYPE      := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-
-# allow debian/target to be used instead of GCC_TARGET - this was requested
-# by toolchain-source maintainer
-ifndef GCC_TARGET
-DEBIAN_TARGET_FILE := $(strip $(shell cat debian/target 2>/dev/null))
-ifneq ($(DEBIAN_TARGET_FILE),)
-GCC_TARGET := $(DEBIAN_TARGET_FILE)
+define dpkg_architecture
+ DEB_$(2)_$(1) := $$(shell dpkg-architecture -f $(4) -qDEB_$(if 
$(3),$(3),$(2))_$(1) 2>/dev/null)
+endef
+
+$(eval $(call dpkg_architecture,GNU_TYPE,BUILD))
+
+$(eval $(call dpkg_architecture,ARCH,HOST))
+$(eval $(call dpkg_architecture,GNU_CPU,HOST))
+$(eval $(call dpkg_architecture,GNU_SYSTEM,HOST))
+$(eval $(call dpkg_architecture,GNU_TYPE,HOST))
+
+ifeq (,$(findstring -,$(GCC_TARGET)))
+$(eval $(call dpkg_architecture,ARCH,TARGET,HOST,-a$(GCC_TARGET)))
+$(eval $(call dpkg_architecture,GNU_CPU,TARGET,HOST,-a$(DEB_TARGET_ARCH)))
+$(eval $(call dpkg_architecture,GNU_SYSTEM,TARGET,HOST,-a$(DEB_TARGET_ARCH)))
+$(eval $(call dpkg_architecture,GNU_TYPE,TARGET,HOST,-a$(DEB_TARGET_ARCH)))
+ifeq ($(DEB_TARGET_ARCH),)
+$(error GCC_TARGET value "$(GCC_TARGET)" is not a valid Debian architecture)
+endif
+else
+$(eval $(call dpkg_architecture,GNU_TYPE,TARGET,HOST,-t$(GCC_TARGET)))
+$(eval $(call dpkg_architecture,GNU_CPU,TARGET,HOST,-t$(DEB_TARGET_GNU_TYPE)))
+$(eval $(call 
dpkg_architecture,GNU_SYSTEM,TARGET,HOST,-t$(DEB_TARGET_GNU_TYPE)))
+$(eval $(call dpkg_architecture,ARCH,TARGET,HOST,-t$(DEB_TARGET_GNU_TYPE)))
+ifeq ($(DEB_TARGET_GNU_TYPE),)
+$(error GCC_TARGET value "$(GCC_TARGET)" is not a valid GNU target)
 endif
 endif
-
-DEB_TARGET_ARCH                := $(shell dpkg-architecture -f \
-                       -a$(GCC_TARGET) -qDEB_HOST_ARCH 2>/dev/null)
-DEB_TARGET_ARCH_OS     := $(shell dpkg-architecture -f \
-                       -a$(GCC_TARGET) -qDEB_HOST_ARCH_OS 2>/dev/null)
-DEB_TARGET_ARCH_CPU    := $(shell dpkg-architecture -f \
-                       -a$(GCC_TARGET) -qDEB_HOST_ARCH_CPU 2>/dev/null)
-
-DEB_TARGET_GNU_CPU     := $(shell dpkg-architecture -f \
-                       -a$(DEB_TARGET_ARCH) -qDEB_HOST_GNU_CPU 2>/dev/null)
-DEB_TARGET_GNU_SYSTEM  := $(shell dpkg-architecture -f \
-                       -a$(DEB_TARGET_ARCH) -qDEB_HOST_GNU_SYSTEM 2>/dev/null)
-DEB_TARGET_GNU_TYPE    := $(shell dpkg-architecture -f \
-                       -a$(DEB_TARGET_ARCH) -qDEB_HOST_GNU_TYPE 2>/dev/null)
 
 # ---------------------------------------------------------------------------
 # which binary packages are built?
@@ -49,10 +47,6 @@
 # cross compiler support. If GCC_TARGET is set, then it's the architecture
 # we build for.
 
-ifeq ($(DEB_TARGET_ARCH),)
-$(error GCC_TARGET value "$(GCC_TARGET)" is not a valid Debian architecture)
-endif
-
 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
   DEB_CROSS = yes
   # TP: Target Prefix. Used primarily as a prefix for cross tool
@@ -670,14 +664,6 @@
   endif
 endif
 
-ifeq ($(biarch32),yes)
-  with_32bit_check := $(shell CC="gcc -m32" sh debian/runcheck.sh)
-endif
-
-ifeq ($(biarch),yes)
-  with_64bit_check := $(shell CC="gcc -m64" sh debian/runcheck.sh)
-endif
-
 ifeq ($(with_java),yes)
   ifeq ($(biarch32),yes)
     with_java_biarch_awt := yes
@@ -696,6 +682,15 @@
   force_gnu_locales := disabled for $(DEB_TARGET_GNU_SYSTEM)
 endif
 
+gcc_srcdir             := gcc-4.0.2
+gcc_tarball            := $(gcc_srcdir).tar.bz2
+
+gpc_srcdir             := gpc-20030830
+gpc_tarball            := gpc-20030830.tar.gz
+
+#testsuite_srcdir      := testsuite-3.3-20030118
+#testsuite_tarball     := $(testsuite_srcdir).tar.bz2
+
 unpack_stamp           := $(stampdir)/01-unpack-stamp
 patch_stamp            := $(stampdir)/02-patch-stamp
 control_stamp          := $(stampdir)/03-control-stamp
diff -urN gcc-4.0-4.0.2.orig/debian/rules.patch gcc-4.0-4.0.2/debian/rules.patch
--- gcc-4.0-4.0.2.orig/debian/rules.patch       2005-10-14 10:57:40.000000000 
+0000
+++ gcc-4.0-4.0.2/debian/rules.patch    2005-10-14 10:54:11.000000000 +0000
@@ -7,7 +7,7 @@
 
 .NOTPARALLEL:
 
-patchdir       = debian/patches
+patchdir       ?= debian/patches
 
 # which patches should be applied?
 debian_patches = \
diff -urN gcc-4.0-4.0.2.orig/debian/rules.source 
gcc-4.0-4.0.2/debian/rules.source
--- gcc-4.0-4.0.2.orig/debian/rules.source      1970-01-01 00:00:00.000000000 
+0000
+++ gcc-4.0-4.0.2/debian/rules.source   2005-10-14 10:54:11.000000000 +0000
@@ -0,0 +1,15 @@
+GCC_TARGET = $(DEB_TARGET_GNU_TYPE)
+
+source_dir = /usr/src/gcc-4.0/
+patchdir = $(source_dir)/patches
+
+include $(source_dir)/rules.defs
+include $(source_dir)/rules.patch
+include $(source_dir)/rules.unpack
+
+clean-source:
+       rm -rf $(stampdir)
+       rm -rf $(gcc_srcdir) $(gpc_srcdir) p
+       rm -rf bin
+       rm -rf $(srcdir)
+
diff -urN gcc-4.0-4.0.2.orig/debian/rules.unpack 
gcc-4.0-4.0.2/debian/rules.unpack
--- gcc-4.0-4.0.2.orig/debian/rules.unpack      2005-10-14 10:57:40.000000000 
+0000
+++ gcc-4.0-4.0.2/debian/rules.unpack   2005-10-14 10:56:03.000000000 +0000
@@ -3,17 +3,6 @@
 # exists, the rule exits with an error to prevent deletion of modified
 # source files. It has to be deleted manually.
 
-gcc_srcdir             := gcc-4.0.2
-#gcc_srcdir            := gcc-20050701
-gcc_tarball            := $(gcc_srcdir).tar.bz2
-
-gpc_srcdir             := gpc-20030830
-gpc_tarball            := gpc-20030830-minimal.tar.bz2
-gpc_tarball            := gpc-20030830.tar.gz
-
-#testsuite_srcdir      := testsuite-3.3-20030118
-#testsuite_tarball     := $(testsuite_srcdir).tar.bz2
-
 tarballs = $(gcc_tarball)
 ifeq ($(with_check),yes)
   tarballs += $(testsuite_tarball)
@@ -37,7 +26,7 @@
        @chmod 755 debian/dh_*
 
 # ---------------------------------------------------------------------------
-$(unpack_stamp)-$(gcc_tarball): $(gcc_tarball)
+$(unpack_stamp)-$(gcc_tarball): $(source_dir)$(gcc_tarball)
        : # unpack gcc tarball
        -mkdir $(stampdir)
        if [ -d $(srcdir) ]; then \
@@ -46,15 +35,15 @@
        fi
        rm -rf $(gcc_srcdir)
        case $(gcc_tarball) in \
-         *.bz2) tar -x --bzip2 -f $(gcc_tarball);; \
-         *.gz)  tar -x --gzip  -f $(gcc_tarball);; \
+         *.bz2) tar -x --bzip2 -f $(source_dir)$(gcc_tarball);; \
+         *.gz)  tar -x --gzip  -f $(source_dir)$(gcc_tarball);; \
          *)     false; \
        esac
        mv $(gcc_srcdir) $(srcdir)
        echo "$(gcc_tarball) unpacked." > $@
 
 # ---------------------------------------------------------------------------
-$(unpack_stamp)-$(gpc_tarball): $(gpc_tarball)
+$(unpack_stamp)-$(gpc_tarball): $(source_dir)$(gpc_tarball)
        : # unpack gpc tarball
        -mkdir $(stampdir)
        if [ -d $(srcdir)/gcc/p ]; then \
@@ -64,8 +53,8 @@
        #rm -rf $(gpc_srcdir)
        rm -rf p
        case $(gpc_tarball) in \
-         *.bz2) tar -x --bzip2 -f $(gpc_tarball);; \
-         *.gz)  tar -x --gzip  -f $(gpc_tarball);; \
+         *.bz2) tar -x --bzip2 -f $(source_dir)$(gpc_tarball);; \
+         *.gz)  tar -x --gzip  -f $(source_dir)$(gpc_tarball);; \
          *)     false; \
        esac
        if [ -d p ]; then \
@@ -77,13 +66,13 @@
        echo "$(gpc_tarball) unpacked." > $@
 
 # ---------------------------------------------------------------------------
-$(unpack_stamp)-$(testsuite_tarball): $(testsuite_tarball)
+$(unpack_stamp)-$(testsuite_tarball): $(source_dir)$(testsuite_tarball)
        : # unpack testsuite tarball
        -mkdir $(stampdir)
        rm -rf $(testsuite_srcdir)
        case $(testsuite_tarball) in \
-         *.bz2) tar -x -p --bzip2 -f $(testsuite_tarball);; \
-         *.gz)  tar -x -p --gzip  -f $(testsuite_tarball);; \
+         *.bz2) tar -x -p --bzip2 -f $(source_dir)$(testsuite_tarball);; \
+         *.gz)  tar -x -p --gzip  -f $(source_dir)$(testsuite_tarball);; \
          *)     false; \
        esac
        for t in gcc libjava libstdc++-v3; do \

Attachment: signature.asc
Description: Digital signature

Reply via email to