0

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.

j4x
  • 3,595
  • 3
  • 33
  • 64

2 Answers2

2

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
0

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).
ldav1s
  • 15,885
  • 2
  • 53
  • 56
  • Not in fact. My needs are far simple to justify such a thing. I just want to be able to set a given script SUID, other data files R/W arbitrary permissions and so on. I understand what you say and tend to agree that there is no provision for what I need, but I'd still hope to have a cleaner way other than "hooking-after-done". Really thanks. – j4x Jul 10 '12 at 17:54
  • But in #1 you said that you are already creating "a package". I was just suggesting that you use a tool designed for packaging. Those tools also set file permissions, amongst many other things. If it really is simpler than I imagine, you could look at the automake install hooks "install-data-local" or "install-data-hook" depending on when they need to run. – ldav1s Jul 10 '12 at 19:34
  • I understand what you say. My point, though, is that, when I use "hooks" I am first _doing it wrong_ for later fixing, and it seems no wise to me, so I wondered if it was any way to _make it right_ at first. From what you say and what I found across the web, it seems to be no way, and I have to live with the "-hook-" or any other _later fix_ workaround. Did I got clearer now? Thanks again! – j4x Jul 11 '12 at 14:25