diff options
author | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-30 00:53:47 +0300 |
---|---|---|
committer | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-30 00:53:47 +0300 |
commit | c16cd856651c5d8fde6bfad41de6f24acd811e46 (patch) | |
tree | b9e89844e7c014b9e612ecce7bc6c58677a0b412 /winsup/mingw | |
parent | d952e44c44093126b9b6dcfb9c8e0e338728f11b (diff) |
Honor DESTDIR for winsup/mingw and winsup/w32api
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 18 | ||||
-rw-r--r-- | winsup/mingw/Makefile.in | 42 | ||||
-rw-r--r-- | winsup/mingw/mingwex/Makefile.in | 18 | ||||
-rw-r--r-- | winsup/mingw/profile/Makefile.in | 24 |
4 files changed, 79 insertions, 23 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index e9ed69a41..abe67bbda 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,21 @@ +2009-10-29 Charles Wilson <mingw@cwilson.fastmail.fm> + + Honor DESTDIR for winsup/mingw and winsup/w32api. + Detect and report error if installation paths are win32 + format, but DESTDIR is non-empty. + + * Makefile.in (DESTDIR): Honor per convention. + (need-DESTDIR-compatibility): New macro; define it and a + corresponding rule. + (fail-DESTDIR-compatibility): New dependency goal. + (install-dirs): Require need-DESTDIR-compatibility. + * mingwex/Makefile.in (DESTDIR): Honor per convention. + (need-DESTDIR-compatibility): New macro; define it and a + corresponding rule. + (fail-DESTDIR-compatibility): New dependency goal. + (install): Require need-DESTDIR-compatibility. + * profile/Makefile.in: Ditto. + 2009-10-25 Charles Wilson <mingw@cwilson.fastmail.fm> Sync pseudo-reloc.c with mingw64 diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in index ef67da893..7a51a9f16 100644 --- a/winsup/mingw/Makefile.in +++ b/winsup/mingw/Makefile.in @@ -90,6 +90,7 @@ inst_bindir:=$(tooldir)/bin inst_includedir:=$(tooldir)/include/mingw inst_libdir:=$(tooldir)/lib/mingw inst_docdir:=$(tooldir)/share/doc/mingw-runtime +need-DESTDIR-compatibility = prefix exec_prefix tooldir mandir else ifneq (,$(with_cross_host)) # @@ -104,11 +105,13 @@ inst_bindir:=$(tooldir)/bin inst_includedir:=$(tooldir)/include inst_libdir:=$(tooldir)/lib inst_docdir:=$(tooldir)/share/doc/mingw-runtime +need-DESTDIR-compatibility = prefix exec_prefix tooldir mandir else inst_bindir:=$(bindir) inst_includedir:=$(includedir) inst_libdir:=$(libdir) inst_docdir:=$(prefix)/doc/runtime +need-DESTDIR-compatibility = prefix bindir includedir libdir mandir endif endif @@ -274,7 +277,7 @@ all_dlls_host: $(DLLS) install_dlls_host: for i in $(DLLS); do \ - $(INSTALL_PROGRAM) $$i $(inst_bindir)/$$i ; \ + $(INSTALL_PROGRAM) $$i $(DESTDIR)$(inst_bindir)/$$i ; \ done _libm_dummy.o: @@ -493,25 +496,36 @@ info-html: install-info: info -install-dirs: - $(mkinstalldirs) $(inst_bindir) - $(mkinstalldirs) $(inst_includedir) - $(mkinstalldirs) $(inst_libdir) - $(mkinstalldirs) $(inst_docdir) - $(mkinstalldirs) $(mandir)/man$(mansection) +.PHONY: $(need-DESTDIR-compatibility) fail-DESTDIR-compatibility + +$(need-DESTDIR-compatibility): + @test -z "$(DESTDIR)" || case "$($@)" in ?:*) \ + $(MAKE) --no-print-directory reject="$@" fail-DESTDIR-compatibility ;; \ + esac + +fail-DESTDIR-compatibility: + $(error DESTDIR is not supported when $(reject) contains Win32 path `$($(reject))'; \ + try `make install $(reject)=$(shell echo '$($(reject))' | sed s,:,:$(DESTDIR),) ...' instead) + +install-dirs: $(need-DESTDIR-compatibility) + $(mkinstalldirs) $(DESTDIR)$(inst_bindir) + $(mkinstalldirs) $(DESTDIR)$(inst_includedir) + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) + $(mkinstalldirs) $(DESTDIR)$(inst_docdir) + $(mkinstalldirs) $(DESTDIR)$(mandir)/man$(mansection) install: all install-dirs $(install_dlls_host) for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done for i in $(CRT0S); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done for i in $(INSTDOCS); do \ - $(INSTALL_DATA) $(srcdir)/$$i $(inst_docdir)/$$i ; \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(inst_docdir)/$$i ; \ done for sub in . sys ; do \ - dstdir=$(inst_includedir)/$$sub ; \ + dstdir=$(DESTDIR)$(inst_includedir)/$$sub ; \ $(mkinstalldirs) $$dstdir ; \ for i in $(srcdir)/include/$$sub/*.h ; do \ $(INSTALL_DATA) $$i $$dstdir/`basename $$i` ; \ @@ -521,10 +535,10 @@ install: all install-dirs $(install_dlls_host) # This provisional hack installs the only manpage we have at present... # It simply CANNOT suffice, when we have more manpages to ship. # - $(mkinstalldirs) $(mandir)/man$(mansection) - $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\ + $(mkinstalldirs) $(DESTDIR)$(mandir)/man$(mansection) + $(INSTALL_DATA) $(srcdir)/man/dirname.man $(DESTDIR)$(mandir)/man$(mansection)/`\ echo dirname.man|sed '$(manpage_transform);s,man$$,$(mansection),'` - $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\ + $(INSTALL_DATA) $(srcdir)/man/dirname.man $(DESTDIR)$(mandir)/man$(mansection)/`\ echo basename.man|sed '$(manpage_transform);s,man$$,$(mansection),'` # # End provisional hack. diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in index 2ccffe1ab..a495d5269 100644 --- a/winsup/mingw/mingwex/Makefile.in +++ b/winsup/mingw/mingwex/Makefile.in @@ -255,10 +255,22 @@ info-html: install-info: info -install: all - $(mkinstalldirs) $(inst_libdir) +need-DESTDIR-compatibility = prefix libdir +.PHONY: $(need-DESTDIR-compatibility) fail-DESTDIR-compatibility + +$(need-DESTDIR-compatibility): + @test -z "$(DESTDIR)" || case "$($@)" in ?:*) \ + $(MAKE) --no-print-directory reject="$@" fail-DESTDIR-compatibility ;; \ + esac + +fail-DESTDIR-compatibility: + $(error DESTDIR is not supported when $(reject) contains Win32 path `$($(reject))'; \ + try `make install $(reject)=$(shell echo '$($(reject))' | sed s,:,:$(DESTDIR),) ...' instead) + +install: all $(need-DESTDIR-compatibility) + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done clean: diff --git a/winsup/mingw/profile/Makefile.in b/winsup/mingw/profile/Makefile.in index b918bfbb0..83a288033 100644 --- a/winsup/mingw/profile/Makefile.in +++ b/winsup/mingw/profile/Makefile.in @@ -128,18 +128,30 @@ info-html: install-info: info -install: all - $(mkinstalldirs) $(inst_libdir) +need-DESTDIR-compatibility = prefix libdir includedir +.PHONY: $(need-DESTDIR-compatibility) fail-DESTDIR-compatibility + +$(need-DESTDIR-compatibility): + @test -z "$(DESTDIR)" || case "$($@)" in ?:*) \ + $(MAKE) --no-print-directory reject="$@" fail-DESTDIR-compatibility ;; \ + esac + +fail-DESTDIR-compatibility: + $(error DESTDIR is not supported when $(reject) contains Win32 path `$($(reject))'; \ + try `make install $(reject)=$(shell echo '$($(reject))' | sed s,:,:$(DESTDIR),) ...' instead) + +install: all $(need-DESTDIR-compatibility) + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done for i in $(CRT0S); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done for sub in . ; do \ - $(mkinstalldirs) $(inst_includedir)/$$sub ; \ + $(mkinstalldirs) $(DESTDIR)$(inst_includedir)/$$sub ; \ for i in $(srcdir)/$$sub/*.h ; do \ - $(INSTALL_DATA) $$i $(inst_includedir)/$$sub/`basename $$i` ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_includedir)/$$sub/`basename $$i` ; \ done ; \ done |