Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library Installation order in automake

Tags:

automake

When I am running make distcheck, one library (lib2 in this example) is not being installed because it requires lib1.

Is there any way to mandate the order of library installation?

Makefile.am:

lib_LTLIBRARIES = libTwo.la libOne.la

libOne_la_SOURCES = lib/one/example.cpp \
    lib/one/example.h 

libTwo_la_SOURCES = lib/two/Example2.cpp \
    lib/two/Example2.h 

libTwo_la_CPPFLAGS = -I$(srcdir)/lib/one
libTwo_la_LIBADD = libOne.la

I am using:

  • RedHatEnterpriseServer 5.5
  • automake (GNU automake) 1.9.6

*Edit: * Here is what I am seeing on the make distcheck output.

/usr/bin/ld: cannot find -lOne
collect2: ld returned 1 exit status
libtool: install: error: relink `libTwo.la' with the above command before installing it
/bin/sh ./libtool --mode=install /usr/bin/install -c  'libOne.la' '/tmp/xx-x-yy-21346    /home/foo/commonlib-1.0/_inst/lib/libOne.la'
like image 829
adpda Avatar asked Nov 29 '25 12:11

adpda


1 Answers

Try exchanging:

lib_LTLIBRARIES = libTwo.la libOne.la

for:

lib_LTLIBRARIES = libOne.la libTwo.la

IIRC, the order in lib_LTLIBRARIES matters at install time.

like image 164
ldav1s Avatar answered Dec 02 '25 05:12

ldav1s



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!