libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cxx archiver II


From: Patrick Guio
Subject: cxx archiver II
Date: Fri, 27 Oct 2000 16:24:50 +0200 (CEST)

Small correction!
The archive command is
ar -rv 
*not*
ar -ts

Otherwise I think that the problem is comin from the fact that there are
no .lo corresponding to the .o in the templates directory
maybe something like 
foreach obj (repository/*.o
  ln -fs $obj $obj:r.lo
end
before running bin/ksh ../libtool --mode=link 
should be run?
Sincerely
Patrick

---------- Forwarded message ----------
Date: Fri, 27 Oct 2000 15:51:40 +0200 (CEST)
From: Patrick Guio <address@hidden>
To: address@hidden
Subject: cxx archiver


Dear all
As you know I am trying to use libtool :-) Now on a DEC machine when I am
trying to create a library, here what is happening:
The sources are well compiled, for example:

% source='argparsing.cpp'
object='libutilities_la-argparsing.lo' libtool=yes \
depfile='.deps/libutilities_la-argparsing.Plo'
tmpdepfile='.deps/libutilities_la-argparsing.TPlo' \
depmode=dashmstdout /bin/ksh ../depcomp \
/bin/ksh ../libtool --mode=compile cxx
-DPACKAGE=\"mudfas\" -DVERSION=\"0.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1
-I. -I. -I.  -DHDF -I/astro/local/opt/HDF_4.1r3/4.1r3_digunix/include
-I/mn/sothi/u1/patrickg/src/blitz -DFLOAT_FIELD -ptr util -nocompress -std
strict_ansi -DBZ_DISABLE_XOPEN_SOURCE -ieee -c -o
libutilities_la-argparsing.lo `test -f argparsing.cpp || echo
'./'`argparsing.cpp
cxx -DPACKAGE=\"mudfas\" -DVERSION=\"0.9\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1
-I. -I. -I. -DHDF -I/astro/local/opt/HDF_4.1r3/4.1r3_digunix/include
-I/mn/sothi/u1/patrickg/src/blitz -DFLOAT_FIELD -ptr util -nocompress -std
strict_ansi -DBZ_DISABLE_XOPEN_SOURCE -ieee -c argparsing.cpp -o
libutilities_la-argparsing.o
echo timestamp > libutilities_la-argparsing.lo

*Note* that I had to specify in libutilities_la_CXXFLAGS the option
-ptr util 
This is just to indicate that the templates for this library should go
there. Actually it should be better to have -ptr libutilities_la for
consistency....

Then it does

/bin/ksh ../libtool --mode=link cxx  -nocompress -std strict_ansi
-DBZ_DISABLE_XOPEN_SOURCE -ieee  -L/mn/sothi/u1/patrickg/src/blitz/lib
-lblitz -L/astro/local/opt/HDF_4.1r3/4.1r3_digunix/lib -lmfhdf -ldf -ljpeg
-lz -o libutilities.la -rpath /usr/local/lib util/*.o -version-info 0:0:0
libutilities_la-argparsing.lo libutilities_la-integrate.lo  -lm 
mkdir .libs

*** Warning: Linking the shared library libutilities.la against the
non-libtool
*** objects 
util/_RWdeallocate_buffers__Q13std33list__TPCcQ13std15allocator__TPCcXv.o 
....
and so on many templates!!!!!
....
util/upper_bound__CQ18_RWrwstd138_RWrb_tree__TiQ13std12pair__TCiPCcQ18_RWrwstd36_RWsel3ujvku3.o
is not portable!
rm -fr .libs/libutilities.la .libs/libutilities.* .libs/libutilities.*
(cd . && ln -s libutilities_la-argparsing.lo libutilities_la-argparsing.o)
(cd . && ln -s libutilities_la-integrate.lo libutilities_la-integrate.o)

What is the problem with those templates!? 
Thereafter it just overwrite the .o just .lo containing timestamp...
And

ar cru .libs/libutilities.a 
util/_RWdeallocate_buffers__Q13std33list__TPCcQ13std15allocator__TPCcXv.o
....

And

ranlib .libs/libutilities.a

Which doesnot work since the .o (not the templates but the objects) are
not there anylonger but just 'timestamp'

I have suceeded to link manually and the recipe is 

Compile as libtool do it now
Archive with the following command

ar -ts libutilities_la-argparsing.o ..... util/*.o 
or maybe
ar -ts libutilities_la-argparsing.o ..... libutilities_la/*.o

Then when linking this library, everything work smoothly
cxx -c main.cpp
cxx main.o -o main -lutilities

Sincerely

Patrick Guio

======================================================================
                                  Patrick Guio
                    Institute of Physics, University of Oslo
                      P.O. box 1048, Blindern, N-0316 Oslo
               Tel : (+47) 22 84 40 60 - Fax : (+47) 22 85 56 71
                        E-mail : address@hidden 
                          URL : http://www.fys.uio.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]