j4x
j4x

Reputation: 3716

Automake: different install to target and to toolchain

Maybe I am asking a silly question, but is there any way I can tell automake to put my project include files when I do a "make dist" but not when I do a "make install"?

Maybe I am not acting the right way, so to make it clearer I will tell what I need.

  1. I need to deploy my applications in an embedded board and I use "make install" in a script to create a package that can be copied to the target board.

  2. On the other side, I'd like to be able to update my toolchain with my libraries and include files.

In the first situation, I can't have any fat wasting my limited flash memory but just the necessary things to make the application to run.

In the second one, I need to have headers, pkgconfig and all of the stuff needed for development.

How I am supposed to configure my "Makefile.am" and which rules to expect so that I can reach my goals?

Really thanks.

Upvotes: 0

Views: 516

Answers (2)

user3149355
user3149355

Reputation: 49

I just want to be able to set a given script SUID, other data files R/W arbitrary permissions and so on.

I think adding the $(DESTDIR) 's makefile user variable do that. As it is not define by automake, "make install" use it empty, but dpkg-buildpackage define it with the "make dist" target.

(see: http://www.gnu.org/prep/standards/html_node/DESTDIR.html#DESTDIR)

It help me to manage setuid install:

configure.ac:

# Add option to disable setuid during install, use in distcheck
AC_ARG_ENABLE(setuid-install, 
 AS_HELP_STRING(
 [--disable-setuid-install       do not set setuid flags during install]), 
 [enable_setuid_install=$enableval], [enable_setuid_install="yes"])
AM_CONDITIONAL(SETUID_INSTALL, test x"$enable_setuid_install" = "xyes")

Makefile.am:

if SETUID_INSTALL
install-data-hook:
        /bin/chmod 4755 $(DESTDIR)$(bindir)myBinary
endif

Upvotes: 2

ldav1s
ldav1s

Reputation: 16305

I don't think autoconf was really designed to be a generic installer/uninstaller that'll give you that kind of control without at least some pain. You're looking for something like dpkg-buildpackage or rpmbuild where you can split up the output of make install into specific subpackages so you can have:

  • Package foo be for the embedded board and possibly toolchain, depending on what's in the package (DSOs, executables, and other files necessary at runtime)
  • Package foo-dev or foo-devel for the toolchain (headers, static libs, other files needed for development).

Upvotes: 0

Related Questions