This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libtool


I don't believe the following behavior is possible in the current
libtool. However, if it is, please correct me.

In the upcoming libtool (1.4?) it would be nice on cygwin/windows-ish
platforms, if the libfoo.la file could instruct libtool that it may need
different -Ddefines when compiling an object file that is to be linked
to a static lib or to a dynamic lib (dll).

For instance, on cygwin, if compiling/linking my-file.c and I want to
link to libz statically, I need the following (when compiling/linking by
hand, no libtool):

gcc -c -DZLIB_STATIC -o my-file.o myfile.c
gcc -static -o my-file.exe my-file.o -L<path> -lz

If I want to link dynamically, I need:

gcc -c -o my-file.o myfile.c
gcc -o my-file.exe my-file.o -L<path> -lz

That is, both the compile and the link steps are different.  Is it
possible for this information to be embedded in libfoo.la (libz.la in
this case) -- so that libtool knows that 'statically linked packages
that depend on libz must have -DZLIB_STATIC in the compile step', while
'dynamically linked packages that depend on libz need no special
-Ddefines in the compile step'.

Similarly, you need -DPNG_STATIC for libpng, -DJPEG_STATIC for libjpeg,
etc...

--Chuck

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]