Alexandre Duret-Lutz <[EMAIL PROTECTED]> writes: > >>> "Roger" == Roger Leigh <[EMAIL PROTECTED]> writes: > > [...] > > Roger> However, this makes one very big assumption: every > Roger> installation directory will use $prefix as the path > Roger> prefix. > > Yes. This way we make sure people can install the package with > --prefix=/usr, --prefix=/opt, --prefix ~/usr, or whatever.
You could use /both/ --prefix= and DESTDIR= to ensure that the package works with --prefix and then still set DESTDIR so that rules that don't (can't) use $(prefix) will still get installed into =inst. BTW, setting DESTDIR could also ensure that the package also respects DESTDIR, by making sure that no data is installed into $(prefix), because $(prefix) will be $(DESTDIR)$(prefix). Packages that inconsistently handle DESTDIR are really annoying, possibly because people don't even realise it exists. You could set dc_prefix_base=`$(am__cd) $(distdir)/=error && pwd` and use --prefix=$$dc_prefix_base and DESTDIR=$$dc_install_base: --- am-distcheck Thu Sep 19 21:54:37 2002 +++ am-distcheck.new Thu Sep 19 22:04:19 2002 @@ -6,19 +6,25 @@ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build + mkdir $(distdir)/=error mkdir $(distdir)/=inst chmod a-w $(distdir) + dc_prefix_base=`$(am__cd) $(distdir)/=error && pwd` \ dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && ../configure --srcdir=.. --prefix=$$dc_prefix_base \ --with-included-gettext \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base uninstall \ + && (test `find $$dc_prefix_base -type f -print | wc -l` -le 1 \ + || { echo "ERROR: files and directories not installed into DESTDIR:" ; \ + find $$dc_prefix_base -print ; \ + exit 1; } >&2 ) \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ > Roger> This is usually the case, but not always. For example, > Roger> in the gimp-print project, we build a CUPS driver. For > Roger> this, the install path is obtained from "cups-config", > > How about you honor the user's flags, and just issue a warning > if it's different from the output of cups-config? The user never gets a say. I have in my Makefile.am something like: if BUILD_GIMP gimp_plug_in_PROGRAMS = print endif and in configure.ac, I have a custom autoconf macro STP_GIMP_PLUG_IN_DIR which extracts gimp_plug_indir from "gimptool". Another macro gets the "foomatic" data directory location, too. I have a similar arrangement for CUPS, with the exception that --enable-cups will accept a prefix as well as yes or no. cups-config (if present) overrides the users preference, since its information is definitive. In all three cases, the path should never need to be set by the user, and is something like "cupsexec_filterdir = $(pkglibdir)/filter" where pkglibdir is `cups-config --datadir`. There is no way of tacking a $prefix on to these, especially for the GIMP and foomatic data, where it is /always/ automatic, and adding an override would only ever be used with "make distcheck", and I would rather not write more m4 (there's already > 50 kB of my own custom macros) just to work around automake. > Another idea is the have a --without-cups-config option that you > will set in DISTCHECK_CONFIGURE_FLAGS. This is already possible--for cups, but it would require a separate option for every other driver (CUPS is just one example). > [...] > > Roger> && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base install \ > Roger> && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base installcheck \ > Roger> && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$dc_install_base uninstall \ > > Unfortunately `make installcheck' isn't expected to run in a > DESTDIR installation as it might run programs which read files > using the real $prefix. I have looked at the generated Makefile.ins under 1.5 and 1.6.3, and I can't see installcheck being used (except empty rules/for recursion). Surely any user who wrote an installcheck-local target could use $(prefix) and $(DESTDIR)$(prefix) as required to distinguish between the intended and actual destinations? If the programs being run will /only/ run correctly in the configured prefix, then I would rather simply disable the "installcheck" test than the alternative. Regards, Roger -- Roger Leigh "Liberty and Livelihood" Support the Countryside Alliance