Re: Favoring static linking at configure time

2007-12-19 Thread Benoit Sigoure

On Dec 16, 2007, at 4:23 PM, Benoit Sigoure wrote:

OK So finally I solved the whole thing by adding /abs/path/to/ 
libfoo.$libext (instead of -lfoo) in $LIBS ($libext is computed by  
libtool, most of the time it's .a but it happens to be .lib at  
least for MSVC).  This is probably fragile but at least it works on  
GNU/Linux (GCC, ICC), OSX (Apple GCC) and Windows (Cygwin, MinGW,  
MSVC).



I stumbled on the following problem (on Linux and MacOSX, at least):

/bin/sh ../libtool --tag=CXX   --mode=link g++ [-Warning-flags] - 
D_THREAD_SAFE  -g -O2 -static -L/opt/local/lib -R/opt/local/lib  -o  
libkernel.la -rpath /usr/local/gostai/kernel/powerpc-apple- 
darwin8.8.0/engine [all-my.lo]  /opt/local/lib/libboost_thread-mt-1_34.a

mkdir .libs
*** Warning: Linking the shared library libkernel.la against the
*** static library /opt/local/lib/libboost_thread-mt-1_34.a is not  
portable!
ar cru .libs/libkernel.a /opt/local/lib/libboost_thread-mt-1_34.a   
[all-my.o]

ranlib .libs/libkernel.a

Isn't it weird that Libtool puts an installed static archive in the  
static archive I'm building?


(I used both Apple's Libtool which comes with DevTools 2.4 and hasn't  
got a --version and Debian's ltmain.sh (GNU libtool) 1.5.22 Debian  
1.5.22-4 (1.1220.2.365 2005/12/18 22:14:06))


--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory




___
http://lists.gnu.org/mailman/listinfo/libtool


Re: SWIG + Libtool

2007-12-19 Thread Olly Betts
On 2007-12-19, Dustin J. Mitchell <[EMAIL PROTECTED]> wrote:
> I'm trying to build Perl modules, constructed via SWIG, within an
> application that is otherwise built with autoconf/automake/libtool.
> Has anyone found/created a natural way to do this?

I do it like so (the XS is hand-crafted rather than SWIG-generated
but I doubt that makes much difference):

http://svn.xapian.org/Makefile.PL?root=Search-Xapian&view=markup

This Makefile.PL can either build against an installed version of
Xapian (not using libtool), or against an uninstalled tree (using
libtool) - you should be able to adapt the machinery from the
latter I think.

The fairly obvious part is to set 'LD' and 'CC' to use libtool.  The
main trick is to pass .la files in LDLOADLIBS which is set using "macro"
which avoids warnings from MakeMaker.

Cheers,
Olly



___
http://lists.gnu.org/mailman/listinfo/libtool


Re: rm -f

2007-12-19 Thread Patrick Welche
On Sun, Dec 16, 2007 at 10:04:59AM +0100, Ralf Wildenhues wrote:
> Only if you have a dummy file to remove.  In libtool it's easier to just
> add
>   test -z "$files" || $RM $files
> 
> as appropriate.  Which tests are failing for you, Patrick?  I assume
> this is NetBSD?

First good news: it is test singular - I think I got confused
reading testsuite.log, and yes it is NetBSD-current, autotools HEAD
from 12 December.  I tried the following patch to help track it
down, but didn't get anywhere - shouldn't I hope echo output to at
least end up in stdout? I thought that the other instances of RM
would at least have a character printed even if all variables were
empty.

This is a highlight of testsuite.log:

> libtool: link: rm -f "/usr/src/local/libtool/tests/testsuite.dir/56/tests/test
suite.dir/55/sub3/.libs/dlselfS.o"
> /stresstest.at:267: ./sub3/dlself; lt_status=$?; if test $lt_status -eq 0; the
n :;
>  elif test "X$host" != "X$build" && \
>   { test -x "./sub3/dlself" || test -x "./sub3/dlself"$EXEEXT; }
>  then (exit 77); else (exit $lt_status); fi
> Not enabling shell tracing (command contains an embedded newline)
> eval '/usr/src/local/libtool/tests/testsuite.dir/56/libtool --mode=link gcc -g
 -O2  -o ""sub2/liba.la ""sub/a.lo' "" -export-symbols-regex "v.*" -rpath /nonex
istent
> /stresstest.at:251: eval '$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o "$rel"s
ub2/liba.la "$rel"sub/a.lo' $linkargs
> stderr:
> usage: rm [-f|-i] [-dPRrvW] file ...
> stdout:
> libtool: link: rm -fr  sub2/.libs/liba.a sub2/.libs/liba.la
> libtool: link: generating symbol list for `liba.la'
> libtool: link: using reloadable object file for export list...
> libtool: link: creating reloadable object files...
> libtool: link: generating symbol list for `liba.la'
> libtool: link: creating a temporary reloadable object file: sub2/.libs/liba.la
-1.o
> libtool: link: /usr/bin/ld -r -o sub2/.libs/liba.la-1.o sub/.libs/a.o 
> libtool: link: rm -f 
> /stresstest.at:251: exit code was 1, expected 0
> 55. stresstest.at:31: 55. Link option thorough search test (stresstest.at:31):
 FAILED (stresstest.at:251)
> 
> 
56. cmdline_wrap.at:28: 56. Run tests with low max_cmd_len (cmdline_wrap.at:28):
 FAILED (cmdline_wrap.at:43)


Cheers,

Patrick
Index: libltdl/config/ltmain.m4sh
===
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.92
diff -u -r1.92 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  24 Nov 2007 08:00:21 -  1.92
+++ libltdl/config/ltmain.m4sh  19 Dec 2007 15:32:42 -
@@ -1513,6 +1513,11 @@
command="$command -o $lobj"
   fi
 
+# XXXPW
+echo after Place PIC objects
+echo lobj: $lobj
+echo output_obj: $output_obj
+echo removelist: $removelist
   $opt_dry_run || $RM "$lobj" "$output_obj"
 
   func_show_eval "$command"\
@@ -6387,6 +6392,10 @@
   esac
 
   # Delete the old objects.
+# XXXPW
+echo delete the old objects
+echo obj: $obj
+echo libobj: $libobj
   $opt_dry_run || $RM $obj $libobj
 
   # Objects from convenience libraries.  This assumes
@@ -6703,6 +6712,9 @@
# Replace the output file specification.
link_command=`$ECHO "X$link_command" | $Xsed -e '[EMAIL 
PROTECTED]@%'"$output"'%g'`
# Delete the old output file.
+# XXXPW
+echo Delete the old output file
+echo output: $output
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
@@ -6817,6 +6829,9 @@
}
  ;;
  * )
+# XXXPW
+echo before trap
+echo output: $output
$RM $output
trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
 
___
http://lists.gnu.org/mailman/listinfo/libtool