[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: installing stripped kernel modules
From: |
Harlan Stenn |
Subject: |
Re: installing stripped kernel modules |
Date: |
Sun, 28 Apr 2002 21:35:44 -0400 |
User-agent: |
EMH/1.10.0 SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) |
> Harlan> The strip options for programs are "too aggressive" for kernel
> Harlan> modules.
>
> Harlan> Some Makefile.am's will install both programs and kernel
> Harlan> modules.
>
> Harlan> What are the choices for altering the strip flags?
>
> You have a few choices.
>
> You could set the INSTALL* macros at configure time to exactly what
> you want. You can even write your own install program, or modify
> install-sh (actually with install-sh you can set STRIPPROG in the
> environment).
I'm not sure this is possible:
...
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG)
$$p $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p
$(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
...
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
so the value of the INSTALL_STRIP_FLAG is hardwired by the install-strip
target and is used by the hardwired library install ... wait a minute, this
may not be a problem for *me* because I'm not installing a library (probably
- I haven't looked that far yet). Still, I think perhaps this may deserve
more attention.
So with kmod_PROGRAMS = foo.o it looks like the .o gets installed as a
*Program* target thru the *data* rule automagically by automake:
install-kmodPROGRAMS: $(kmod_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(kmoddir)
@list='$(kmod_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(kmoddir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM)
$$p $(DESTDIR)$(kmoddir)/$$f; \
else :; fi; \
done
install-data-am: install-kmodPROGRAMS
install: install-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
and in this case we're apparently not using INSTALL_STRIP_FLAGS to install
the kernel mods.
I think this may show, however, that we can't install stripped regular
programs and kmod stuff using the same makefile as they share the same
INSTALL_PROGRAM, which would have to have distinct flags for the two sets of
things being installed.
> Or if you always want to strip at install time you could use an
> install-exec-hook and strip the executables after they are installed.
Unfortunately this is not the case...
> Harlan> It would be ideal if we didn't have to separate programs from
> Harlan> modules into separate Makefile.am's.
>
> I don't think you'll need to do that.
Still?
> I don't know how kernel modules are built. I assume they are probably
> linked in a special way, and maybe even named specially. It is
> probably possible to do this using existing _PROGRAMS support:
>
> kernel_PROGRAMS = module.o
>
> module_o_SOURCES = ...
> module_o_CFLAGS = ...
> module_o_LINK = ...
I think that maybe module_o_INSTALL would help (ugh) but even that doesn't
handle the strip flags.
Something "classy" to define and augment/override "primaries" would be
useful, but probably difficult.
H