summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-09-11 01:05:31 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-09-11 01:05:31 +0000
commit527747469eeb918f05a3ffac1de6b172dec2e72a (patch)
treee592812b2bf48d339613a75d14d10c57e1ecb9d1
parentd442f6460c590da92f5c216b2e060b8ba6adbd98 (diff)
downloaddh-illumos-527747469eeb918f05a3ffac1de6b172dec2e72a.tar.gz
Set LDLIBS{32,64} in env.sh; support 32-bit hosts
-rw-r--r--debian/changelog4
-rwxr-xr-xdh_illumos_gate42
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 <pashev.igor@gmail.com> Sat, 01 Sep 2012 20:28:55 +0000
+ -- Igor Pashev <pashev.igor@gmail.com> 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 {