FIX-LA-RELINK-COMMAND(1)

NAME
fix-la-relink-command - fixes relink_command field of .la files in a build tree

SYNOPSIS
fix-la-relink-command [OPTIONS] [LAFILES or DIRECTORIES]

DESCRIPTION
fix-la-relink-command modifies the relink_command field of libtool .la files to ensure that during the relinking stage of make install, the corresponding library is linked to libraries in the local build tree and not to the versions of the same libraries that are installed systemwide.

Specifically, for every .la file in a relative directory $dir that is specified in relink_command, fix-la-relink-command adds an extra -L$dir/.libs argument, and puts these arguments before the first relative .la file or -L argument with an absolute path.

For example,

    relink_command="(cd /tmp/foo/libfoo; /bin/sh /tmp/foo/libtool --silent --tag CC --mode=relink gcc -O2 foo.lo bar/libbar.la ../baz/libbaz.la /usr/lib/libfrob.la -lm)"

will become

    relink_command="(cd /tmp/foo/libfoo; /bin/sh /tmp/foo/libtool --silent --tag CC --mode=relink gcc -O2 foo.lo -Lbar/.libs -L../baz/.libs bar/libbar.la ../baz/libbaz.la /usr/lib/libfrob.la -lm)"

  Options

-h, --help
    Show usage information and exit.

-m, --manual
    Show manual page and exit.

-q, --quiet
    Do not print messages.

-v, --version
    Show version information and exit.

  Arguments
If names of .la files are given, they are processed. If names of directories are given, .la files in them are processed recursively, but hidden or symlinked subdirectories will not be recursed into.

RESTRICTIONS
It is assumed that relink_command is one line. It is assumed that any spaces in paths are escaped using '\'.

COPYRIGHT AND LICENSE
Copyright 2011, 2012 Alexandre Rostovtsev <tetromino@gentoo.org>

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO
The GNU libtool manual, <http://www.gnu.org/software/libtool/manual/libtool.html>