--- orig/debian/changelog
+++ mod/debian/changelog
@@ -1,3 +1,35 @@
+glibc (2.3.2.ds1-20multiarch5) multiarch; urgency=low
+
+  * Actually make the symlinks in the -dev package, not the normal one. 
+
+ -- Tollef Fog Heen <tfheen@idi.ntnu.no>  Wed, 23 Feb 2005 14:52:40 +0100
+
+glibc (2.3.2.ds1-20multiarch4) multiarch; urgency=low
+
+  * If DEB_BUILD_GNU_TYPE and $(GCC_ARCH) differ, make symlinks in
+    /usr/include as well.
+
+ -- Tollef Fog Heen <tfheen@idi.ntnu.no>  Thu, 10 Feb 2005 14:33:02 +0100
+
+glibc (2.3.2.ds1-20multiarch3) multiarch; urgency=low
+
+  * Make compat symlinks for crt1.o and friends.
+
+ -- Tollef Fog Heen <tfheen@idi.ntnu.no>  Wed,  9 Feb 2005 10:04:00 +0100
+
+glibc (2.3.2.ds1-20multiarch2) multiarch; urgency=low
+
+  * Bump version number and upload .orig.tar.gz
+  * Remove ccache from debian/rules to facilitate autobuilding.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Fri,  4 Feb 2005 16:03:05 +0100
+
+glibc (2.3.2.ds1-20multiarch0) multiarch; urgency=low
+
+  * Multiarch build
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Mon, 24 Jan 2005 12:47:49 +0100
+
 glibc (2.3.2.ds1-20) unstable; urgency=high
 
   * GOTO Masanori <gotom@debian.org>

--- orig/debian/control.in/libc
+++ mod/debian/control.in/libc
@@ -3,11 +3,12 @@
 Section: base
 Priority: required
 Provides: ${locale:Depends}
+Multi-Arch: yes
+Depends: @libc@-common (= ${Source-Version})
 Description: GNU C Library: Shared libraries and Timezone data
  Contains the standard libraries that are used by nearly all programs on
  the system. This package includes shared versions of the standard C library
  and the standard math library, as well as many others.
- Timezone data is also included.
 
 Package: @libc@-dev
 Architecture: @archs@
@@ -15,10 +16,21 @@
 Priority: standard
 Depends: @libc@ (= ${Source-Version})
 Recommends: gcc | c-compiler
+Multi-Arch: yes
 Description: GNU C Library: Development Libraries and Header Files
  Contains the symlinks, headers, and object files needed to compile
  and link programs which use the standard C library.
 
+Package: @libc@-dev-common
+Architecture: @archs@
+Section: libdevel
+Priority: standard
+Depends: @libc@ (= ${Source-Version})
+Recommends: c-compiler
+Description: GNU C Library: Development common files
+ Contains the support tools needed by the development package for the
+ GNU C Library.
+
 Package: @libc@-dbg
 Architecture: @archs@
 Section: libdevel
@@ -56,6 +68,16 @@
  boot floppies. If you are not making your own set of Debian boot floppies
  using the `boot-floppies' package, you probably don't need this package.
 
+Package: @libc@-common
+Architecture: @archs@
+Section: base
+Priority: required
+Replaces: @libc@ (<< 2.3.2.ds1-20multiarch0)
+Conflicts: @libc@ (<< 2.3.2.ds1-20multiarch0)
+Description: GNU C Library: Common files
+ Contains common files for the standard libraries that are used by
+ nearly all programs on the system.  Timezone data is also included.
+
 Package: @libc@-udeb
 XC-Package-Type: udeb
 Architecture: @archs@


--- orig/debian/debhelper.in/libc-dbg.install
+++ mod/debian/debhelper.in/libc-dbg.install
@@ -1 +1 @@
-TMPDIR/lib/*.so* usr/lib/debug
+TMPDIR/lib/*.so* usr/lib/DEB_BUILD_GNU_TYPE/debug


--- orig/debian/debhelper.in/libc-dev.install
+++ mod/debian/debhelper.in/libc-dev.install
@@ -1,26 +1,24 @@
-debian/tmp-libc/usr/bin/gencat usr/bin
-debian/tmp-libc/usr/bin/mtrace usr/bin
-debian/tmp-libc/usr/bin/rpcgen usr/bin
 
-debian/tmp-libc/usr/lib/libanl.a usr/lib
-debian/tmp-libc/usr/lib/libBrokenLocale.a usr/lib
-debian/tmp-libc/usr/lib/libbsd-compat.a usr/lib
-debian/tmp-libc/usr/lib/libc.a usr/lib
-debian/tmp-libc/usr/lib/libc_nonshared.a usr/lib
-debian/tmp-libc/usr/lib/libcrypt.a usr/lib
-debian/tmp-libc/usr/lib/libdl.a usr/lib
-debian/tmp-libc/usr/lib/libg.a usr/lib
-debian/tmp-libc/usr/lib/libieee.a usr/lib
-debian/tmp-libc/usr/lib/libm.a usr/lib
-debian/tmp-libc/usr/lib/libmcheck.a usr/lib
-debian/tmp-libc/usr/lib/libnsl.a usr/lib
-debian/tmp-libc/usr/lib/libpthread.a usr/lib
-debian/tmp-libc/usr/lib/libpthread_nonshared.a usr/lib
-debian/tmp-libc/usr/lib/libresolv.a usr/lib
-debian/tmp-libc/usr/lib/librpcsvc.a usr/lib
-debian/tmp-libc/usr/lib/librt.a usr/lib
-debian/tmp-libc/usr/lib/libutil.a usr/lib
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libanl.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libBrokenLocale.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libbsd-compat.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libc.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libc_nonshared.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libcrypt.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libdl.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libg.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libieee.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libm.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libmcheck.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libnsl.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libpthread.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libpthread_nonshared.a /usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libresolv.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/librpcsvc.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/librt.a usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/libutil.a usr/lib/DEB_BUILD_GNU_TYPE
 
-debian/tmp-libc/usr/lib/*.o usr/lib
-debian/tmp-libc/usr/lib/*.so usr/lib
-debian/tmp-libc/usr/include/* usr/include
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/*.o usr/lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/*.so usr/lib/DEB_BUILD_GNU_TYPE
+
+debian/tmp-libc/usr/include/DEB_BUILD_GNU_TYPE/* usr/include/DEB_BUILD_GNU_TYPE


--- orig/debian/debhelper.in/libc.docs
+++ mod/debian/debhelper.in/libc.docs
@@ -1,10 +0,0 @@
-log-test-*
-DEB_SRCDIR/BUGS
-DEB_SRCDIR/FAQ
-DEB_SRCDIR/INTERFACE
-DEB_SRCDIR/NEWS
-DEB_SRCDIR/NOTES
-DEB_SRCDIR/PROJECTS
-DEB_SRCDIR/README 
-DEB_SRCDIR/hesiod/README.hesiod
-debian/TODO


--- orig/debian/debhelper.in/libc.install
+++ mod/debian/debhelper.in/libc.install
@@ -1,23 +1,3 @@
-debian/tmp-libc/lib/*.so* lib
-debian/tmp-libc/usr/lib/gconv/*.so usr/lib/gconv
-debian/tmp-libc/usr/lib/gconv/gconv-modules usr/lib/gconv
-debian/tmp-libc/usr/share/zoneinfo/* usr/share/zoneinfo
-debian/tmp-libc/usr/bin/iconv usr/bin
-debian/tmp-libc/usr/bin/locale usr/bin
-debian/tmp-libc/usr/bin/localedef usr/bin
-debian/tmp-libc/usr/bin/getent usr/bin
-debian/tmp-libc/usr/bin/getconf usr/bin
-debian/tmp-libc/usr/bin/catchsegv usr/bin
-debian/tmp-libc/usr/bin/tzselect usr/bin
-debian/tmp-libc/usr/bin/ldd* usr/bin
-debian/tmp-libc/usr/sbin/zdump usr/bin
-debian/tmp-libc/usr/sbin/rpcinfo usr/bin
-
-debian/tmp-libc/usr/sbin/zic usr/sbin
-debian/tmp-libc/usr/sbin/iconvconfig usr/sbin
-
-debian/tmp-libc/sbin/ldconfig sbin
-
-debian/tmp-libc/usr/lib/pt_chown usr/lib
-
-debian/local/usr_sbin/tzconfig usr/sbin
+debian/tmp-libc/lib/DEB_BUILD_GNU_TYPE/*.so* lib/DEB_BUILD_GNU_TYPE
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/gconv/*.so usr/lib/DEB_BUILD_GNU_TYPE/gconv
+debian/tmp-libc/usr/lib/DEB_BUILD_GNU_TYPE/gconv/gconv-modules usr/lib/DEB_BUILD_GNU_TYPE/gconv


--- orig/debian/debhelper.in/libc.links
+++ mod/debian/debhelper.in/libc.links
@@ -1 +0,0 @@
-etc/localtime usr/share/zoneinfo/localtime 

--- orig/debian/rules
+++ mod/debian/rules
@@ -35,6 +35,7 @@
 # The minimum package version with which these packages are compatible.
 shlib_dep_ver = 2.3.2.ds1-4
 shlib_dep = $(libc) (>= $(shlib_dep_ver))
+export DH_VERBOSE=1
 
 # Beyond here you shouldn't need to customise anything:
 
@@ -47,6 +48,7 @@
 DEB_BUILD_GNU_CPU     ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
 DEB_BUILD_GNU_TYPE    ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_BUILD_GNU_SYSTEM  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
+GCC_ARCH              ?= $(shell gcc -dumpmachine)
 
 DEB_HOST_GNU_CPU_ALT  ?=
 DEB_HOST_GNU_TYPE_ALT ?=
@@ -65,7 +67,7 @@
 KERNEL_HOST_CPU := $(subst powerpc,ppc,$(DEB_HOST_GNU_CPU))
 
 # How many makes to run at once?
-NJOBS = 1
+NJOBS = 2
 
 # Default setup
 GLIBC_PASSES ?= libc
@@ -73,15 +75,17 @@
 prefix=/usr
 bindir=$(prefix)/bin
 datadir=$(prefix)/share
-includedir=$(prefix)/include
+includedir=$(prefix)/include/$(DEB_BUILD_GNU_TYPE)
 infodir=$(prefix)/share/info
-libdir=$(prefix)/lib
+libdir=$(prefix)/lib/$(DEB_BUILD_GNU_TYPE)
 docdir=$(prefix)/share/doc
 mandir=$(prefix)/share/man
 sbindir=$(prefix)/sbin
+slibdir=/lib/$(DEB_BUILD_GNU_TYPE)
 libexecdir=$(prefix)/lib
+extra_libdir=/lib:$(prefix)/lib
 
-BUILD_CC = gcc-3.3
+BUILD_CC = gcc
 
 # Set CC for cross-compiling
 ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
@@ -112,7 +116,7 @@
 # Which build pass are we on?
 curpass = $(filter-out %_,$(subst _,_ ,$@))
 
-DEB_ARCH_REGULAR_PACKAGES = $(libc) $(libc)-dev $(libc)-dbg $(libc)-prof $(libc)-pic
+DEB_ARCH_REGULAR_PACKAGES = $(libc) $(libc)-dev $(libc)-dbg $(libc)-prof $(libc)-pic $(libc)-common $(libc)-dev-common
 DEB_INDEP_REGULAR_PACKAGES = glibc-doc locales
 DEB_UDEB_PACKAGES = $(libc)-udeb libnss-dns-udeb libnss-files-udeb
 


--- orig/debian/rules.d/build.mk
+++ mod/debian/rules.d/build.mk
@@ -23,12 +23,18 @@
 	echo "mandir = $(mandir)"	>> $(DEB_BUILDDIR)/configparms
 	echo "infodir = $(infodir)"	>> $(DEB_BUILDDIR)/configparms
 	echo "libexecdir = $(libexecdir)" >> $(DEB_BUILDDIR)/configparms
+	echo "libdir = $(libdir)"      >> $(DEB_BUILDDIR)/configparms
+	echo "includedir = $(includedir)" >> $(DEB_BUILDDIR)/configparms
 	echo "LIBGD = no"		>> $(DEB_BUILDDIR)/configparms
 	echo "sysconfdir = /etc"	>> $(DEB_BUILDDIR)/configparms
 	echo "rootsbindir = /sbin"	>> $(DEB_BUILDDIR)/configparms
 ifneq ($(call xx,slibdir),)
 	echo "slibdir = $(call xx,slibdir)" >> $(DEB_BUILDDIR)/configparms
 endif
+ifneq ($(call xx,extra_libdir),)
+	echo "extra_libdir = $(call xx,extra_libdir)" >> $(DEB_BUILDDIR)/configparms
+
+endif
 
 	# Prevent autoconf from running unexpectedly by setting it to false.
 	# Also explicitly pass CC down - this is needed to get -m64 on


--- orig/debian/rules.d/debhelper.mk
+++ mod/debian/rules.d/debhelper.mk
@@ -17,7 +17,7 @@
 	install --mode=0644 build-tree/$(DEB_HOST_ARCH)-libc/libresolv.map debian/$(libc)-pic/usr/lib/libresolv_pic.map
 
 # Some per-package extra files to install.
-define $(libc)_extra_debhelper_pkg_install
+define $(libc)-common_extra_debhelper_pkg_install
 	install --mode=0644 $(DEB_SRCDIR)/ChangeLog debian/$(curpass)/usr/share/doc/$(curpass)/changelog
 	install --mode=0644 $(DEB_SRCDIR)/linuxthreads/README debian/$(curpass)/usr/share/doc/$(curpass)/README.linuxthreads
 	install --mode=0644 $(DEB_SRCDIR)/linuxthreads/ChangeLog debian/$(curpass)/usr/share/doc/$(curpass)/ChangeLog.linuxthreads
@@ -32,6 +32,31 @@
 	install --mode=0644 debian/FAQ debian/$(curpass)/usr/share/doc/$(curpass)/README.Debian
 endef
 
+$(patsubst %,$(stamp)binaryinst_%,$(libc)):: $(stamp)debhelper
+	mkdir -p debian/$(curpass)/usr/share/doc
+	mkdir -p debian/$(curpass)/lib/$(DEB_BUILD_GNU_TYPE)
+	mkdir -p debian/$(curpass)/usr/lib/$(DEB_BUILD_GNU_TYPE)
+	ln -sf $(libc)-common debian/$(curpass)/usr/share/doc/$(curpass)
+	if [ "$(DEB_BUILD_GNU_TYPE)" != "$(GCC_ARCH)" ]; then \
+		ln -sf $(DEB_BUILD_GNU_TYPE) debian/$(curpass)/lib/$(GCC_ARCH) ;\
+		ln -sf $(DEB_BUILD_GNU_TYPE) debian/$(curpass)/usr/lib/$(GCC_ARCH) ;\
+	fi
+
+$(patsubst %,$(stamp)binaryinst_%,$(libc)-dev):: $(stamp)debhelper
+	dh_installdirs -p$(curpass)
+	dh_install -p$(curpass)
+	mkdir -p debian/$(curpass)/usr/share/doc
+	ln -sf $(libc)-dev-common debian/$(curpass)/usr/share/doc/$(curpass)
+
+	if [ "$(DEB_BUILD_GNU_TYPE)" != "$(GCC_ARCH)" ]; then \
+		ln -sf $(DEB_BUILD_GNU_TYPE) debian/$(curpass)/usr/include/$(GCC_ARCH) ;\
+	fi
+
+	for file in debian/$(curpass)/usr/lib/$(DEB_BUILD_GNU_TYPE)/*.o; do \
+		dh_link -p$(curpass)  $${file##debian/$(curpass)/} \
+		/usr/lib/$${file##*/} ; \
+	done
+
 define locales_extra_debhelper_pkg_install
 	install --mode=0644 $(DEB_SRCDIR)/localedata/ChangeLog debian/$(curpass)/usr/share/doc/$(curpass)/changelog
 endef
@@ -115,6 +140,14 @@
 
 	dh_installdeb -p$(curpass)
 	# dh_shlibdeps -p$(curpass)
+	#dh_installlib -p$(curpass)
+	# Hack
+	if [ "$(curpass)" = "$(libc)" ]; then \
+		ln -sf $(DEB_BUILD_GNU_TYPE)/$$(basename $$(find debian/$(curpass)/lib -type f -name ld-\*)) \
+		debian/$(curpass)/lib/$$(basename $$(find debian/$(curpass)/lib -type l -name ld-\*)) ;\
+	fi
+	#dh_installinclude -p$(curpass)
+
 	dh_gencontrol -p$(curpass) -- $($(curpass)_control_flags)
 	dh_md5sums -p$(curpass)
 	dh_builddeb -p$(curpass)
@@ -163,6 +196,7 @@
 	  sed -e "s#TMPDIR#debian/tmp-libc#" -i $$z; \
 	  sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \
 	  sed -e "s#LIBC#$(libc)#" -i $$z; \
+	  sed -e "s#DEB_BUILD_GNU_TYPE#$(DEB_BUILD_GNU_TYPE)#g" -i $$z; \
 	  case $$z in \
 	    *.install) sed -e "s/^#.*//" -i $$z ;; \
 	  esac; \
@@ -209,7 +243,7 @@
 	  cat debian/debhelper.in/libc-otherbuild.install >>$$z; \
 	  sed -e "s#TMPDIR#debian/tmp-$$x#" -i $$z; \
 	  sed -e "s#DEB_SRCDIR#$(DEB_SRCDIR)#" -i $$z; \
-	  sed -e "s#DESTLIBDIR#/tls#" -i $$z; \
+	  sed -e "s#DESTLIBDIR#/$(DEB_BUILD_GNU_TYPE)/tls#g" -i $$z; \
 	  case $$z in \
 	    *.install) sed -e "s/^#.*//" -i $$z ;; \
 	  esac; \


--- orig/debian/sysdeps/depflags.mk
+++ mod/debian/sysdeps/depflags.mk
@@ -4,7 +4,9 @@
 	  perl debian/sysdeps/depflags.pl
 
 libc_control_flags = $(shell $(depflags) libc)
+libc_common_control_flags = $(shell $(depflags) libc_common)
 libc_dev_control_flags = $(shell $(depflags) libc_dev)
+libc_dev_common_control_flags = $(shell $(depflags) libc_dev_common)
 
 # If there's a -DDepends for libc-dev, add this to it.  If there isn't
 # then the control file's depends line (which contains this) will be used.


--- orig/debian/sysdeps/depflags.pl
+++ mod/debian/sysdeps/depflags.pl
@@ -148,10 +148,29 @@
 if ($libc ne "libc6") {
     push @{$libc_dev_c{'Provides'}}, 'libc6-dev';
 }
+
+# Multiarch
+if ($libc eq "libc6") {
+    push @{$libc_c{'Depends'}}, "libc6-common";
+    push @{$libc_common_c{'Replaces'}}, 'libc6 (<< 2.3.2.ds1-20multiarch0)';
+    push @{$libc_common_c{'Conflicts'}}, 'libc6 (<< 2.3.2.ds1-20multiarch0)';
+    push @{$libc_common_c{'Depends'}}, 'libc6 (>= 2.3.2.ds1-20multiarch0)';
+    push @{$libc_dev_c{'Depends'}}, "libc6-dev-common";
+    push @{$libc_dev_common_c{'Replaces'}}, 'libc6-dev (<< 2.3.2.ds1-20multiarch0)';
+    push @{$libc_dev_common_c{'Conflicts'}}, 'libc6-dev (<< 2.3.2.ds1-20multiarch0)';
+    push @{$libc_dev_common_c{'Depends'}}, 'libc6-dev (>= 2.3.2.ds1-20multiarch0)';
+} else {
+     die "Multiarch for $libc not implemented";
+}
+
 if ($type eq "libc") {
     %pkg = %libc_c;
+} elsif ($type eq "libc_common") {
+    %pkg = %libc_common_c;
 } elsif ($type eq "libc_dev") {
     %pkg = %libc_dev_c;
+} elsif ($type eq "libc_dev_common") {
+    %pkg = %libc_dev_common_c;
 } else {
     die "Unknown package $type";
 }


--- /dev/null
+++ mod/debian/debhelper.in/libc-common.docs
@@ -0,0 +1,10 @@
+log-test-*
+DEB_SRCDIR/BUGS
+DEB_SRCDIR/FAQ
+DEB_SRCDIR/INTERFACE
+DEB_SRCDIR/NEWS
+DEB_SRCDIR/NOTES
+DEB_SRCDIR/PROJECTS
+DEB_SRCDIR/README 
+DEB_SRCDIR/hesiod/README.hesiod
+debian/TODO
--- /dev/null
+++ mod/debian/debhelper.in/libc-common.install
@@ -0,0 +1,21 @@
+debian/tmp-libc/usr/share/zoneinfo/* usr/share/zoneinfo
+debian/tmp-libc/usr/bin/iconv usr/bin
+debian/tmp-libc/usr/bin/locale usr/bin
+debian/tmp-libc/usr/bin/localedef usr/bin
+debian/tmp-libc/usr/bin/getent usr/bin
+debian/tmp-libc/usr/bin/getconf usr/bin
+debian/tmp-libc/usr/bin/catchsegv usr/bin
+debian/tmp-libc/usr/bin/glibcbug usr/bin
+debian/tmp-libc/usr/bin/tzselect usr/bin
+debian/tmp-libc/usr/bin/ldd* usr/bin
+debian/tmp-libc/usr/sbin/zdump usr/bin
+debian/tmp-libc/usr/sbin/rpcinfo usr/bin
+
+debian/tmp-libc/usr/sbin/zic usr/sbin
+debian/tmp-libc/usr/sbin/iconvconfig usr/sbin
+
+debian/tmp-libc/sbin/ldconfig sbin
+
+debian/tmp-libc/usr/lib/pt_chown usr/lib
+
+debian/local/usr_sbin/tzconfig usr/sbin
--- /dev/null
+++ mod/debian/debhelper.in/libc-common.links
@@ -0,0 +1 @@
+etc/localtime usr/share/zoneinfo/localtime 
--- /dev/null
+++ mod/debian/debhelper.in/libc-common.manpages
@@ -0,0 +1,13 @@
+debian/local/manpages/catchsegv.1
+debian/local/manpages/getent.1
+debian/local/manpages/getconf.1
+debian/local/manpages/iconv.1
+debian/local/manpages/iconvconfig.8
+debian/local/manpages/ldconfig.8
+debian/local/manpages/ldd.1 
+debian/local/manpages/locale.1
+debian/local/manpages/localedef.1
+debian/local/manpages/rpcinfo.8
+debian/local/manpages/tzselect.1
+debian/local/manpages/zdump.1
+debian/local/manpages/zic.8
--- /dev/null
+++ mod/debian/debhelper.in/libc-dev-common.install
@@ -0,0 +1,4 @@
+
+debian/tmp-libc/usr/bin/gencat usr/bin
+debian/tmp-libc/usr/bin/mtrace usr/bin
+debian/tmp-libc/usr/bin/rpcgen usr/bin
--- /dev/null
+++ mod/debian/debhelper.in/libc-dev-common.manpages
@@ -0,0 +1,3 @@
+debian/local/manpages/gencat.1
+debian/local/manpages/mtrace.1
+debian/local/manpages/rpcgen.1 
--- /dev/null
+++ mod/debian/patches/.arch-ids/99_multiarch-ld.dpatch.id
@@ -0,0 +1 @@
+Tollef Fog Heen <tfheen@idi.ntnu.no> Wed Jan 26 13:44:04 2005 8998.0
--- /dev/null
+++ mod/debian/patches/99_multiarch-ld.dpatch
@@ -0,1 +1,49 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: Multiarch support
+# DP: Author: Tollef Fog Heen <tfheen@debian.org>
+# DP: Upstream status: Not submitted
+# DP: Date: 2005-01-20
+
+if [ $# -ne 2 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
+    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
+    *)
+	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+	exit 1
+esac
+exit 0
+
+# append the patch here and adjust the -p? flag in the patch calls.
+--- glibc-2.3.2/Makeconfig	2004-05-10 19:32:23.000000000 +0200
++++ glibc-2.3.2/Makeconfig	2004-05-10 19:30:33.000000000 +0200
+@@ -178,6 +178,12 @@
+ endif
+ inst_slibdir = $(install_root)$(slibdir)
+ 
++# Extra places to look for libraries
++ifndef extra_libdir
++extra_libdir := $(exec_prefix)/lib/$(shell gcc -dumpmachine):/lib/$(shell gcc -dumpmachine)
++endif
++
++
+ # Prefix to put on files installed in $(libdir).  For libraries `libNAME.a',
+ # the prefix is spliced between `lib' and the name, so the linker switch
+ # `-l$(libprefix)NAME' finds the library; for other files the prefix is
+@@ -482,6 +488,10 @@
+ default-rpath = $(libdir)
+ endif
+ 
++ifdef extra_libdir
++default-rpath += :$(extra_libdir)
++endif
++
+ ifndef link-extra-libs
+ ifeq (yes,$(build-shared))
+ ifneq ($(common-objpfx),$(objpfx))
--- orig/debian/debhelper.in/libc-dev.manpages
+++ /dev/null
@@ -1,3 +0,0 @@
-debian/local/manpages/gencat.1
-debian/local/manpages/mtrace.1
-debian/local/manpages/rpcgen.1 
--- orig/debian/debhelper.in/libc.manpages
+++ /dev/null
@@ -1,13 +0,0 @@
-debian/local/manpages/catchsegv.1
-debian/local/manpages/getent.1
-debian/local/manpages/getconf.1
-debian/local/manpages/iconv.1
-debian/local/manpages/iconvconfig.8
-debian/local/manpages/ldconfig.8
-debian/local/manpages/ldd.1 
-debian/local/manpages/locale.1
-debian/local/manpages/localedef.1
-debian/local/manpages/rpcinfo.8
-debian/local/manpages/tzselect.1
-debian/local/manpages/zdump.1
-debian/local/manpages/zic.8

