From 527747469eeb918f05a3ffac1de6b172dec2e72a Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 11 Sep 2012 01:05:31 +0000 Subject: Set LDLIBS{32,64} in env.sh; support 32-bit hosts --- debian/changelog | 4 +++- dh_illumos_gate | 42 ++++++++++++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 970829b..1b1be7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,10 @@ dh-illumos (8) UNRELEASED; urgency=low * Depends on make, not sunmake * Set i386_XARCH in Makefile to allow overriding * dh_illumos_make: option --native to use native compiler. + * Set LDLIBS32 and LDLIBS64 in env.sh + * Support 32-bit hosts ;-) - -- Igor Pashev Sat, 01 Sep 2012 20:28:55 +0000 + -- Igor Pashev Tue, 11 Sep 2012 01:03:33 +0000 dh-illumos (7) unstable; urgency=low diff --git a/dh_illumos_gate b/dh_illumos_gate index f4d76e1..b6fcbdb 100755 --- a/dh_illumos_gate +++ b/dh_illumos_gate @@ -69,16 +69,6 @@ Here are things which this helper does after unpacking illumos sources. init(options => { }); -# XXX Only illumos-amd64 is supported now XXX -my $multiarch64 = `dpkg-architecture -aillumos-amd64 -qDEB_HOST_MULTIARCH`; -chomp $multiarch64; -# These vars go into makefile: -my $rootfs_libdir = "\$(ROOT)/lib32"; -my $rootfs_libdir64 = "\$(ROOT)/lib/$multiarch64"; -my $rootlibdir = "\$(ROOT)/usr/lib32"; -my $rootlibdir64 = "\$(ROOT)/usr/lib/$multiarch64"; -my $Makefile_master = 'illumos-gate/usr/src/Makefile.master'; - my $tarball = '/usr/src/illumos-gate/illumos-gate.tar.xz'; my $changelogfile = 'debian/changelog'; @@ -112,6 +102,28 @@ code by default. =cut +my $multiarch = `dpkg-architecture -qDEB_HOST_MULTIARCH`; +chomp $multiarch; +my $bits = `dpkg-architecture -qDEB_HOST_ARCH_BITS`; +chomp $bits; + +# In illumos source 32-bit binaries are default +my ($libdir, $libdir64, $usrlibdir, $usrlibdir64); + +if ($bits == 64) { + $libdir = "lib32"; + $usrlibdir = "usr/$libdir"; + $libdir64 = "lib/$multiarch"; + $usrlibdir64 = "usr/$libdir64"; +} else { + $libdir = "lib/$multiarch"; + $usrlibdir = "usr/$libdir"; + $libdir64 = "lib64"; + $usrlibdir64 = "usr/$libdir64"; +} + +my $Makefile_master = 'illumos-gate/usr/src/Makefile.master'; + my $Makefile_master_orig = $Makefile_master . '.orig'; if (! -f $Makefile_master) { error("Could not find `$Makefile_master'. Is it accidently excluded via -X option?"); @@ -152,10 +164,10 @@ if (-f $Makefile_lib) { ', $Makefile_lib ); doit('sed', '-r', '-i', " - s,^(ROOTFS_LIBDIR)\\s*=.*,\\1=$rootfs_libdir,; - s,^(ROOTFS_LIBDIR64)\\s*=.*,\\1=$rootfs_libdir64,; - s,^(ROOTLIBDIR)\\s*=.*,\\1=$rootlibdir,; - s,^(ROOTLIBDIR64)\\s*=.*,\\1=$rootlibdir64,; + s,^(ROOTFS_LIBDIR)\\s*=.*,\\1=\$(ROOT)/$libdir,; + s,^(ROOTFS_LIBDIR64)\\s*=.*,\\1=\$(ROOT)/$libdir64,; + s,^(ROOTLIBDIR)\\s*=.*,\\1=\$(ROOT)/$usrlibdir,; + s,^(ROOTLIBDIR64)\\s*=.*,\\1=\$(ROOT)/$usrlibdir64,; ", $Makefile_lib ); } @@ -215,6 +227,8 @@ if (open (ENV, '>', $env)) { print ENV "export GCC_ROOT='/usr'\n"; print ENV "export LEX='/usr/bin/flex -l'\n"; print ENV "export STRIP=':'\n"; + print ENV "export LDLIBS32=\"-YP,\$ROOT/$libdir:\$ROOT/$usrlibdir\"\n"; + print ENV "export LDLIBS64=\"-YP,\$ROOT/$libdir64:\$ROOT/$usrlibdir64\"\n"; close(ENV); } else { -- cgit v1.2.3