libtool and all-static

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

libtool and all-static

Stuart Henderson
As reported by a user, the cgi scripts from sysutils/nut should
be statically linked, but since the switch to ports libtool this
no longer happens. NUT uses -all-static to build these files which
libtool accepts but ignores.

The diff below treats -all-static like -static and seems to fix
things for NUT without fallout. See below for results with everything
that uses it. From what I see with necpp (and list posts relating to
necpp compilation in Fink with Apple's libtool) it suggests the
diff isn't 100% correct, but it does fix a problem and doesn't
seem to make anything else worse.

Does it make sense to commit this, or does it make more sense
to just switch sysutils/nut back to GNU libtool for now?

- devel/popt
- misc/rpm
linking test programs (doesn't affect the package)

- sysutils/nut
linking cgi scripts (diff fixes these to be statically linked)

- textproc/libical
linking libical-static.la - doesn't seem to affect the package
(only change between packages with/without this diff are file dates
in ar(1) archive headers)

- cad/necpp
all-static is used when linking the main executable - diff doesn't
seem to affect this, it's linked dynamically either way...

Index: libtool
===================================================================
RCS file: /cvs/ports/infrastructure/bin/libtool,v
retrieving revision 1.31
diff -u -p -r1.31 libtool
--- libtool 2 Mar 2011 08:06:33 -0000 1.31
+++ libtool 16 May 2011 07:49:46 -0000
@@ -403,7 +403,7 @@ if ($mode eq 'compile') {
  my $sharedlib = $libname.'.so';
  my $sharedlib_symlink;
 
- if ($opts{'static'}) {
+ if ($opts{'static'} || $opts{'all-static'}) {
  $shared = 0;
  $static = 1;
  }