I have a some fortran code compiled by libtool into a static
(convenience archive). Later I compile a C source file into a
shared library linking against the fortran library. Since
automake/libtool have no knowledge that the objects are from fortran, I
add in the necessary fortran libraries. The problem I get is with
PIC. libtool is changing the order of my library paths and
picking up a non-PIC PGI fortran library. I have fought with
libtool for days and cannot figure out why. I can provide the
debug output if necessary, but here are the few commands that show the
rearranging. Note that in the libtool --mode=link command
/usr/local/pgi/linux86-64/6.0/libso is before
/usr/local/pgi/linux86-64/6.0/lib, but in the actual command executed,
the order is reversed, Also, why is libtool not passing the PIC
flag to the pgcc command? I told it to use PIC and it uses PIC in
the compile stage. NOTE that this only happens on 64-bit platform
because the 32-bit platform has only one directory.