Re: Installing something nonstandard in $(libdir)
On 2020-02-07, Tom Tromey wrote: >> "Zack" == Zack Weinberg writes: > > Zack> Makefile.am:158: error: 'libfoo$(SOEXT).1' is not a standard library > name > Zack> Makefile.am:158: did you mean 'libfoo$(SOEXT).a'? > > Zack> and lib_DATA is the obvious alternative but that doesn't work either: > > Zack> Makefile.am:145: error: 'libdir' is not a legitimate directory for > 'DATA' > > Zack> So, the question is, is there a lib_SOMETHING variable that I can use > Zack> to install to $(libdir) arbitrary stuff that automake doesn't > Zack> understand? If not, is there some other option? > > I believe you can work around the checks by providing your own install > directory variable, like: > > myexeclibdir = $(libdir) > myexeclib_DATA = ... > > The "exec" is in the name to ensure that "make install-exec" installs > these files, see (info "(automake) The Two Parts of Install") for this > detail. Nice! The install-exec versus install-data was actually why I didn't suggest a similar trick, I had no idea that simply putting "exec" in the directory variable name has this effect. Learn something every day! Cheers, Nick
Re: Installing something nonstandard in $(libdir)
> "Zack" == Zack Weinberg writes: Zack> Makefile.am:158: error: 'libfoo$(SOEXT).1' is not a standard library name Zack> Makefile.am:158: did you mean 'libfoo$(SOEXT).a'? Zack> and lib_DATA is the obvious alternative but that doesn't work either: Zack> Makefile.am:145: error: 'libdir' is not a legitimate directory for 'DATA' Zack> So, the question is, is there a lib_SOMETHING variable that I can use Zack> to install to $(libdir) arbitrary stuff that automake doesn't Zack> understand? If not, is there some other option? I believe you can work around the checks by providing your own install directory variable, like: myexeclibdir = $(libdir) myexeclib_DATA = ... The "exec" is in the name to ensure that "make install-exec" installs these files, see (info "(automake) The Two Parts of Install") for this detail. Tom
Re: Installing something nonstandard in $(libdir)
Hi Zack, On 2/6/20, Zack Weinberg wrote: > For reasons too complicated to get into here, I have been > experimenting with building shared libraries in an autoconf+automake > build *without* using libtool. [Please do not try to talk me out of > this.] I have something that works correctly on ELF-based operating > systems with GCC, *except* for installation, where automake is > refusing to do what I want. [...] > So, the question is, is there a lib_SOMETHING variable that I can use > to install to $(libdir) arbitrary stuff that automake doesn't > understand? If not, is there some other option? You can use an install-exec-hook to install your libraries. Hope that helps, Nick
Installing something nonstandard in $(libdir)
For reasons too complicated to get into here, I have been experimenting with building shared libraries in an autoconf+automake build *without* using libtool. [Please do not try to talk me out of this.] I have something that works correctly on ELF-based operating systems with GCC, *except* for installation, where automake is refusing to do what I want. Specifically, suppose I have custom rules like this: if ENABLE_SHARED noinst_LIBRARIES += libfoo-pic.a libfoo_pic_a_SOURCES = $(libfoo_a_SOURCES) libfoo_pic_a_CFLAGS = $(libfoo_a_CFLAGS) $(PICFLAGS) libfoo_so = libfoo$(SOEXT).1 $(libfoo_so): libcrypt-pic.a Makefile $(AM_V_CCLD)$(LINK) $(SO_LDFLAGS) $(SONAME)$(libfoo_so) \ $(WHOLE_A) libfoo-pic.a $(END_WHOLE_A) $(SO_LIBS) libfoo.so: Makefile -$(AM_V_at)rm -f libfoo.so $(AM_V_GEN)$(LN_S) $(libfoo_so) $@ endif where $(PICFLAGS), $(SO_LDFLAGS), etc. are set by autoconf, then the only missing piece is to install $(libfoo_so) and libfoo.so in $(libdir), but I can't find any magic variable that will do that. lib_LIBRARIES is the obvious choice but that throws errors like Makefile.am:158: error: 'libfoo$(SOEXT).1' is not a standard library name Makefile.am:158: did you mean 'libfoo$(SOEXT).a'? and lib_DATA is the obvious alternative but that doesn't work either: Makefile.am:145: error: 'libdir' is not a legitimate directory for 'DATA' So, the question is, is there a lib_SOMETHING variable that I can use to install to $(libdir) arbitrary stuff that automake doesn't understand? If not, is there some other option? (Please cc: me on replies, I'm not subscribed.) zw