This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mkinstalldirs and conditional building/installation


In a Makefile.am, I have the following (summary):

pkglibdir = $(cups_conf_serverbin)
cupsexec_filterdir = $(pkglibdir)/filter
if BUILD_CUPS
cupsexec_filter_PROGRAMS = rastertoprinter commandtoepson commandtocanon
endif

Thus, if --with-cups is given to configure, AM_CONDITIONAL is used to
conditionally build some programs.

The generated rule for installation in Makefile.in is this:

install-cupsexec_filterPROGRAMS: $(cupsexec_filter_PROGRAMS)
	@$(NORMAL_INSTALL)
	$(mkinstalldirs) $(DESTDIR)$(cupsexec_filterdir)
	@list='$(cupsexec_filter_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)$(cupsexec_filterdir)/$$f"; \
	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(cupsexec_filterdir)/$$f; \
	  else :; fi; \
	done

The installation directory $(DESTDIR)$(cupsexec_filterdir) will be
created *whether or not any program is built*!  This should be fairly
easy to correct:

$(mkinstalldirs) $(DESTDIR)$(cupsexec_filterdir)

becomes:

if test -n '$(cupsexec_filter_PROGRAMS)'; then \
  $(mkinstalldirs) $(DESTDIR)$(cupsexec_filterdir) \
fi

In the gimp-print project, due to the nature of the package, just about
every part can be compiled conditionally, because you generally only
want a driver for one printing system.  At the moment, every possible
installation directory is created, leaving unused empty directories
after installation.

I don't have a patch, but I can make one if you would like--do I just
need to update the .am files?  Is automake CVS available anonymously?

Regards,
Roger

-- 
Roger Leigh
                ** Registration Number: 151826, http://counter.li.org **
                Need Epson Stylus Utilities? http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848 available on public keyservers


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]