Consider a like so:

        bin_PROGRAMS = aprogram
        sbin_PROGRAMS = otherprogram
        lib_LTLIBRARIES =
        pkglib_LTLIBRARIES =
        library2_la_LIBADD =

this will produce, under automake 1.15/1.16, a which has a
particular line:

        install-binPROGRAMS: install-libLTLIBRARIES

However, there is a _lack_ of any other relationships.
In particular,

        install-sbinPROGRAMS: install-libLTLIBRARIES
        install-pkglibLTLIBRARIES: install-libLTLIBRARIES

is absent. As a result, `make install -j` can end up in a situation
where it tried to install something before has been

Executing install-pkglibLTLIBRARIES (though somewhat an "internal"
target) directly is sufficient to showcase the issue.

$ make install-pkglibLTLIBRARIES DESTDIR=$PWD/rt 
 /usr/bin/mkdir -p '/home/linux/rt/usr/local/lib/test'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c 
libtool: warning: relinking ''
libtool: install: (cd /home/linux; /bin/sh "/home/linux/libtool"  --silent 
--tag CC --mode=relink gcc -g -O2 -o -rpath /usr/local/lib/test 
library2.lo -inst-prefix-dir /home/linux/rt)
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot 
find -lrary1
collect2: error: ld returned 1 exit status
libtool:   error: error: relink '' with the above command before 
installing it
make: *** [Makefile:453: install-pkglibLTLIBRARIES] Error 1

(The testcase is temporarily uploaded to )

The install-binPROGRAMS line comes from bin/ here:

  # FIXME: Gross!                                                               
  if (var ('lib_LTLIBRARIES') && var ('bin_PROGRAMS'))                          
      $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n";       
  if (var ('nobase_lib_LTLIBRARIES') && var ('bin_PROGRAMS'))                   
      $output_rules .= "install-binPROGRAMS: 

Barring the use of complete deps on ${DESTDIR} objects, I think that 
this gross hack needs extending of all install-* targets to gain a dep 
on install-libLTLIBRARIES.

[ Ideally, Makefile could contain

install-pkglibLTLIBRARIES: ${DESTDIR}${libdir}/
        libtool relink .....

but I figure this may be much more work than extending install-*; and 
it may turn out not be portable. ]

Reply via email to