I'm trying to create a libtool static library (a shared library is not
needed in this case) that can be used as part of a shared library in
another project. Thus, I need to ensure that PIC code is used in the
static library. Since this is a private project, I wanted to set the
defaults in 'LT_INIT' to attain my goals without having to insist that
the user specify various options on the 'configure' command line. Here's
my 'LT_INIT' macro call in 'configure.ac':

...
LT_INIT([disable-shared static pic-only])
...

While playing with these options, I noticed that the 'disable-shared'
and 'static' options seem to have the desired effect, but the 'pic-only'
option does not. Whether I use 'pic-only' or not, I get the following
output from 'configure --help':

...
Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic              try to use only PIC/non-PIC objects [default=*use
                          both*]
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
...

When using the 'pic-only' option in 'LT_INIT', would expect to see the
following output:

...
Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic              try to use only PIC/non-PIC objects [default=*use
                          pic only*]
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
...

Of course, the result of this apparent discrepancy is that my user is
forced to use '--with-pic' on the 'configure' command line in order to
get a static library that is usable within a shared library.

While looking for a solution, I found this thread (from Oct 2010) on the
libtool mailing list:

   http://www.mail-archive.com/libtool@gnu.org/msg12408.html

Because this thread is so recent, I'm wondering if this issue ever been
resolved (or even noticed) by the libtool maintainers.

Thanks in advance,
John
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to