summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-07-01 18:21:28 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-07-01 18:21:28 +0000
commit6bd292cf80177873415e6cdde717f6ca6c1b140d (patch)
tree01191280069a08040be562a5b017fe80846ca61b
parent21ed4e17ca8430c643dd4596fb5ac939913be8e1 (diff)
downloaddh-illumos-6bd292cf80177873415e6cdde717f6ca6c1b140d.tar.gz
Set libdir and flags for 32-bit mode
-rwxr-xr-xdh_illumos_gate27
1 files changed, 27 insertions, 0 deletions
diff --git a/dh_illumos_gate b/dh_illumos_gate
index 765371c..babee1d 100755
--- a/dh_illumos_gate
+++ b/dh_illumos_gate
@@ -95,15 +95,42 @@ if (! -e $Makefile_master_orig) {
# Fix for GNU install:
# 1. do not strip directories, and do not strip at all
# 2. replace -f with -t
+# 3. Enable gcc4 mode and use compiler form /usr/bin
+# 4. Set -m32 to ensure 32-bit mode for host compiler (default is 64)
doit('sed', '-r', '-i', '
/INS\.(file|dir)/ s, -s,,;
/INS\.file/ s, -f, -t,;
/^__GNUC *=/ s,.*,__GNUC=,;
/^__GNUC4 *=/ s,.*,__GNUC4=,;
+ /^i386_XARCH *=/ s,.*,i386_XARCH = -m32,;
+ /^i386_AS_XARCH *=/ s,.*,i386_AS_XARCH = -xarch=i386,;
/.*__GNUC4.GCC_ROOT/ s,.*,$(__GNUC4)GCC_ROOT = /usr,;
', $Makefile_master
);
+# Fix usr/src/lib/Makefile.lib
+my $Makefile_lib = 'illumos-gate/usr/src/lib/Makefile.lib';
+my $Makefile_lib_orig = $Makefile_lib . '.orig';
+# Makefile.lib may not be unpacked, and it is ok
+if ( -e $Makefile_lib) {
+ if (! -e $Makefile_lib_orig) {
+ doit('cp', '-f', $Makefile_lib, $Makefile_lib_orig);
+ }
+ # XXX Currently only x86_64
+ # by default /usr/lib is for 32-bit libraries,
+ # and usr/lib/amd64 for 64-bit libraries.
+ my $multiarch64 = `dpkg-architecture -aillumos-amd64 -qDEB_HOST_MULTIARCH`;
+ my $multiarch32 = `dpkg-architecture -aillumos-i386 -qDEB_HOST_MULTIARCH`;
+ chomp $multiarch32;
+ chomp $multiarch64;
+ doit('sed', '-r', '-i', "
+ /ROOTFS_LIBDIR *=/ s,.*,ROOTLIBDIR = \$(ROOT)/lib/$multiarch32,;
+ /ROOTLIBDIR *=/ s,.*,ROOTLIBDIR = \$(ROOT)/usr/lib/$multiarch32,;
+ /ROOTLIBDIR64 *=/ s,.*,ROOTLIBDIR64 = \$(ROOT)/usr/lib/$multiarch64,;
+ /ROOTFS_LIBDIR64 *=/ s,.*,ROOTLIBDIR64 = \$(ROOT)/lib/$multiarch64,;
+ ", $Makefile_lib
+ );
+}
# Populate illumos-gate/illumos.sh with proper variables:
# 1. Set default build options and environment