summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-08-25 23:11:25 +0000
committerIgor Pashev <pashev.igor@gmail.com>2012-08-25 23:11:25 +0000
commitdeac07ef85b1b8a149840a35ec0689579efb5809 (patch)
treecc9face859a8323979e0a06b3fb35e7a99c2aab9
parent9e83eb0b7462828a50cc7157eb126c82ac726557 (diff)
downloaddh-illumos-deac07ef85b1b8a149840a35ec0689579efb5809.tar.gz
Adjust libdirs in makefile rather then in env.sh
-rw-r--r--debian/changelog4
-rwxr-xr-xdh_illumos_gate49
2 files changed, 34 insertions, 19 deletions
diff --git a/debian/changelog b/debian/changelog
index 060b3af..b40128b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,10 @@ dh-illumos (7) UNRELEASED; urgency=low
* Disable stripping. GNU strip can damage binaries, and we will carefully
strip when create package.
* Use ":" instead on "true"
+ * Adjust libdirs in makefile rather then in env.sh:
+ ROOTLIBDIR sometimes is overriden in makefiles with ROOTFS_LIBDIR.
- -- Igor Pashev <pashev.igor@gmail.com> Tue, 21 Aug 2012 12:37:00 +0000
+ -- Igor Pashev <pashev.igor@gmail.com> Sat, 25 Aug 2012 23:09:24 +0000
dh-illumos (6) unstable; urgency=low
diff --git a/dh_illumos_gate b/dh_illumos_gate
index 2b6ca36..37ee0e0 100755
--- a/dh_illumos_gate
+++ b/dh_illumos_gate
@@ -69,6 +69,16 @@ 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';
@@ -90,14 +100,6 @@ For example, you can use C<cd illumos-gate && diff -dub usr/src/Makefile.master.
to see all changes.
=cut
-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?");
-}
-if (! -e $Makefile_master_orig) {
- doit('cp', '-f', $Makefile_master, $Makefile_master_orig);
-}
=item Changes to F<illumos-gate/usr/src/Makefile.master>:
@@ -107,6 +109,14 @@ not tolerant here. Also replace option C<-f> with C<-t>.
=cut
+my $Makefile_master_orig = $Makefile_master . '.orig';
+if (! -f $Makefile_master) {
+ error("Could not find `$Makefile_master'. Is it accidently excluded via -X option?");
+}
+if (! -e $Makefile_master_orig) {
+ doit('cp', '-f', $Makefile_master, $Makefile_master_orig);
+}
+
doit('sed', '-r', '-i', '
/^INS\.(file|dir)/ s, -s,,;
/^INS\.file/ s, -f, -t,;
@@ -119,6 +129,12 @@ doit('sed', '-r', '-i', '
Append C<CFLAGS> to C<BUILD.SO> command, because C<BUILD.SO>
by default uses C compiler to create shared library.
+Set C<ROOTLIBDIR>, C<ROOTLIBDIR64>, C<ROOTFS_LIBDIR> and C<ROOTLIBDIR64>
+to match Debian multiarch layout. For example C<ROOTLIBDIR64> =
+F</usr/lib/x86_64-illumos> and C<ROOTFS_LIBDIR> = F</lib32> on I<illumos-amd64>.
+It cannot be done in environment file F<env.sh> (see below), because
+in some cases C<ROOTLIBDIR> will be overriden by C<ROOTFS_LIBDIR> within makefiles.
+
=cut
my $Makefile_lib = 'illumos-gate/usr/src/lib/Makefile.lib';
@@ -131,6 +147,13 @@ if (-f $Makefile_lib) {
/^BUILD.SO/ s,\$\(CC\),$(CC) $(CFLAGS),;
', $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,;
+ ", $Makefile_lib
+ );
}
=item Create F<illumos-gate/env.sh>
@@ -174,10 +197,6 @@ my $version = $changelog->{'Source'} . '_' . $changelog->{'Version'};
my $cwd = getcwd();
my $env = 'illumos-gate/env.sh';
my $mach = `uname -p`; chomp $mach;
-# XXX Only illumos-amd64 is supported now XXX
-my $multiarch64 = `dpkg-architecture -aillumos-amd64 -qDEB_HOST_MULTIARCH`;
-#my $multiarch32 = `dpkg-architecture -aillumos-i386 -qDEB_HOST_MULTIARCH`;
-chomp $multiarch64;
if (open (ENV, '>', $env)) {
print ENV "# This file was generated by dh_illumos_gate(1)\n";
print ENV "export VERSION='$version'\n";
@@ -195,13 +214,7 @@ if (open (ENV, '>', $env)) {
print ENV "export __GNUC4=''\n";
print ENV "export GCC_ROOT='/usr'\n";
print ENV "export i386_XARCH='-m32'\n";
- print ENV "export ROOTFS_LIBDIR=\"\$ROOT/lib32\"\n";
- print ENV "export ROOTFS_LIBDIR64=\"\$ROOT/lib/$multiarch64\"\n";
- print ENV "export ROOTLIBDIR=\"\$ROOT/usr/lib32\"\n";
- print ENV "export ROOTLIBDIR64=\"\$ROOT/usr/lib/$multiarch64\"\n";
print ENV "export LEX='/usr/bin/flex -l'\n";
- print ENV "export LDLIBS32=\"-L\$ROOTFS_LIBDIR -L\$ROOTLIBDIR\"\n";
- print ENV "export LDLIBS64=\"-L\$ROOTFS_LIBDIR64 -L\$ROOTLIBDIR64\"\n";
print ENV "export STRIP=':'\n";
close(ENV);