#! /usr/bin/perl
# 
# $Id$
# Main page of 'My::Project::libtool'
# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; exactly version 2 of June 1991 is required
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


package project::libtool::Index;
require 5.6.0;	# at least 'use warnings;' but we need some 5.6.0+ modules anyway
our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
our $CVS_ID=q$Id$;
use strict;
use warnings;

BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
use My::Web;
Wuse 'My::Project';
Wuse 'project::libtool::ListItem';


My::Project->init_project(
		"__PACKAGE__"=>__PACKAGE__,
		"ListItem"=>\@project::libtool::ListItem::ListItem,
		);


print <<"HERE";
<p>When you include convenience library (<i>.a</i>) containing two conflicting name
objects (same basename from two different directories) only one of those two
object files will survive in &quot;<i>.libs/libA.lax/</i>&quot; arena:</p>
<pre>
	rm -fr .libs/libA.lax/libB.a
	mkdir .libs/libA.lax/libB.a
	(cd .libs/libA.lax/libB.a &amp;&amp; ar x /abs/path/to/A/B/.libs/libB.a)
</pre>

<p>The patch implements automatic renaming of &quot;<i>*.*</i>&quot; to &quot;<i>*-@{[ '$' ]}seqnum.*</i>&quot;
in such case:</p>
<pre>
	libtool: link: warning: object name conflicts; renaming object files
	libtool: link: warning: to ensure that they will not overwrite
	(cd .libs/libA.lax/libB.a &amp;&amp; ar xN 1 /abs/path/to/A/B/.libs/libB.a 'XconflictX.o' &amp;&amp; mv -f 'XconflictX.o' 'XconflictX-1.o')
	(cd .libs/libA.lax/libB.a &amp;&amp; ar xN 2 /abs/path/to/A/B/.libs/libB.a 'XconflictX.o' &amp;&amp; mv -f 'XconflictX.o' 'XconflictX-2.o')
</pre>

<p>Although renaming to a new name may be confusing IMO there is no better option.
The original (conflicting) name is not left there in any instance to prevent
misleading confusion of different object file found than expected.</p>
HERE


My::Web->footer();
