]> sourceware.org Git - newlib-cygwin.git/commitdiff
Honor DESTDIR for winsup/mingw and winsup/w32api
authorCharles Wilson <cygwin@cwilson.fastmail.fm>
Thu, 29 Oct 2009 21:53:47 +0000 (21:53 +0000)
committerCharles Wilson <cygwin@cwilson.fastmail.fm>
Thu, 29 Oct 2009 21:53:47 +0000 (21:53 +0000)
winsup/mingw/ChangeLog
winsup/mingw/Makefile.in
winsup/mingw/mingwex/Makefile.in
winsup/mingw/profile/Makefile.in
winsup/w32api/ChangeLog
winsup/w32api/Makefile.in
winsup/w32api/lib/Makefile.in
winsup/w32api/lib/ddk/Makefile.in
winsup/w32api/lib/directx/Makefile.in

index e9ed69a418f23cb63b15295e6cd46ad701c8f8a5..abe67bbda9a61d5e6ce545fca854d377eae7003a 100644 (file)
@@ -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
index ef67da89347be2508d99230ae2e48a86e75151a5..7a51a9f16ad8c31426ce1c9c17a3b07390b0c418 100644 (file)
@@ -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.
index 2ccffe1ab19649a0dac8e80999f5304198857e46..a495d5269cecf4aaaf86c7e7426c2fcc3e31aaf5 100644 (file)
@@ -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:
index b918bfbb0b05b686fa066a3d6e6b8776fc489f52..83a2880332b69affd23b62afa0b20b907064fbd4 100644 (file)
@@ -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
 
index 329e4b54ce855a037a6310587fefb67bd2dc8f87..e0d9449de5ab2f8a0086e917ef62948d04bfc897 100644 (file)
@@ -1,3 +1,20 @@
+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 (install, uninstall): Use FLAGS_TO_PASS
+       when invoking make in subdirs.
+       * lib/Makefile.in (DESTDIR): Honor per convention.
+       (need-DESTDIR-compatibility): New macro; define it and a
+       corresponding rule.
+       (fail-DESTDIR-compatibility): New dependency goal.
+       (install-libraries, install-headers, uninstall-libraries,
+       uninstall-headers): Require need-DESTDIR-compatibility.
+       * lib/ddk/Makefile.in: Ditto.
+       * lib/directx/Makefile.in: Ditto.
+
 2009-10-04  Corinna Vinschen  <corinna@vinschen.de>
 
        * include/winbase.h (CreateRestrictedToken): Declare for >= Win 2000.
index e97cdd36b7fcbdd5cfb5c7436bc3804696870622..e48e1de099964a91eb94e3e6b9da89f5bc19ec33 100644 (file)
@@ -89,7 +89,7 @@ test:
 
 install uninstall:
        for i in $(SUBDIRS); do \
-               (cd $$i; $(MAKE) $@); \
+               (cd $$i; $(MAKE) $@ $(FLAGS_TO_PASS)); \
        done
 
 ifdef SNAPDATE
index d1bcebffcdb39f5f7ccc3e6eb3ed004913bb23af..9439627c36593a861b8d11f141713ede09fa0387 100644 (file)
@@ -208,24 +208,36 @@ lib%.a: %.o
        $(AR) rc $@ $*.o
        $(RANLIB) $@
 
+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)
+
 .PHONY: install install-libraries install-headers install-ddk
 # install headers and libraries in a target specified directory.
 install: install-libraries install-headers install-ddk install-directx
 
-install-libraries: all
-       $(mkinstalldirs) $(inst_libdir)
+install-libraries: 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
 
-install-headers:
-       $(mkinstalldirs) $(inst_includedir)
+install-headers: $(need-DESTDIR-compatibility)
+       $(mkinstalldirs) $(DESTDIR)$(inst_includedir)
        for i in $(HEADERS); do \
-               $(INSTALL_DATA) $(srcdir)/../include/$$i $(inst_includedir)/$$i ; \
+               $(INSTALL_DATA) $(srcdir)/../include/$$i $(DESTDIR)$(inst_includedir)/$$i ; \
        done
-       $(mkinstalldirs) $(inst_includedir)/GL
+       $(mkinstalldirs) $(DESTDIR)$(inst_includedir)/GL
        for i in $(GL_HEADERS); do \
-               $(INSTALL_DATA) $(srcdir)/../include/GL/$$i $(inst_includedir)/GL/$$i ; \
+               $(INSTALL_DATA) $(srcdir)/../include/GL/$$i $(DESTDIR)$(inst_includedir)/GL/$$i ; \
        done
 
 install-ddk: install-libraries install-headers
@@ -237,17 +249,17 @@ install-directx: install-libraries install-headers
 # uninstall headers and libraries from a target specified directory
 uninstall: uninstall-ddk uninstall-directx uninstall-libraries uninstall-headers
 
-uninstall-libraries:
+uninstall-libraries: $(need-DESTDIR-compatibility)
        @for i in $(LIBS); do \
-               rm -f $(inst_libdir)/$$i ; \
+               rm -f $(DESTDIR)$(inst_libdir)/$$i ; \
        done
-       rmdir $(inst_libdir)
+       rmdir $(DESTDIR)$(inst_libdir)
 
-uninstall-headers:
+uninstall-headers: $(need-DESTDIR-compatibility)
        @for i in $(HEADERS); do \
-               rm -r $(inst_includedir)/$$i ; \
+               rm -r $(DESTDIR)$(inst_includedir)/$$i ; \
        done
-       rmdir $(inst_includedir)
+       rmdir $(DESTDIR)$(inst_includedir)
 
 uninstall-ddk:
        cd ddk && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
index 80b148c2a3c22fd29e66a430d701b44a056e402a..d6040f3cc5dfcbb29ffd26e63580d4a5bbc6f7d6 100644 (file)
@@ -141,35 +141,47 @@ lib%.a: %.o
        $(AR) rc $@ $*.o
        $(RANLIB) $@
 
+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 headers and libraries in a target specified directory.
 install: install-libraries install-headers
 
-install-libraries: all
-       $(mkinstalldirs) $(inst_libdir)
+install-libraries: 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
 
-install-headers:
-       $(mkinstalldirs) $(inst_includedir)
+install-headers: $(need-DESTDIR-compatibility)
+       $(mkinstalldirs) $(DESTDIR)$(inst_includedir)
        for i in $(HEADERS); do \
-               $(INSTALL_DATA) $(srcdir)/../../include/ddk/$$i $(inst_includedir)/$$i ; \
+               $(INSTALL_DATA) $(srcdir)/../../include/ddk/$$i $(DESTDIR)$(inst_includedir)/$$i ; \
        done
 
 # uninstall headers and libraries from a target specified directory
 uninstall: uninstall-libraries uninstall-headers
 
-uninstall-libraries:
+uninstall-libraries: $(need-DESTDIR-compatibility)
        @for i in $(LIBS); do \
-               rm -f $(inst_libdir)/$$i ; \
+               rm -f $(DESTDIR)$(inst_libdir)/$$i ; \
        done
-       rmdir $(inst_libdir)
+       rmdir $(DESTDIR)$(inst_libdir)
 
-uninstall-headers:
+uninstall-headers: $(need-DESTDIR-compatibility)
        @for i in $(HEADERS); do \
-               rm -r $(inst_includedir)/$$i ; \
+               rm -r $(DESTDIR)$(inst_includedir)/$$i ; \
        done
-       rmdir $(inst_includedir)
+       rmdir $(DESTDIR)$(inst_includedir)
 
 
 dist:
index a56c398d5a43b6f529bc7cfa31d9b9d7e671c1c7..89a3cc602cb421a4338dbeed5bd80ceb914566f3 100644 (file)
@@ -166,35 +166,47 @@ lib%.a: %.o
        $(AR) rc $@ $*.o
        $(RANLIB) $@
 
+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 headers and libraries in a target specified directory.
 install: install-libraries install-headers
 
-install-libraries: all
-       $(mkinstalldirs) $(inst_libdir)
+install-libraries: 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
 
-install-headers:
-       $(mkinstalldirs) $(inst_includedir)
+install-headers: $(need-DESTDIR-compatibility)
+       $(mkinstalldirs) $(DESTDIR)$(inst_includedir)
        for i in $(HEADERS); do \
-               $(INSTALL_DATA) $(srcdir)/../../include/directx/$$i $(inst_includedir)/$$i ; \
+               $(INSTALL_DATA) $(srcdir)/../../include/directx/$$i $(DESTDIR)$(inst_includedir)/$$i ; \
        done
 
 # uninstall headers and libraries from a target specified directory
 uninstall: uninstall-libraries uninstall-headers
 
-uninstall-libraries:
+uninstall-libraries: $(need-DESTDIR-compatibility)
        @for i in $(LIBS); do \
-               rm -f $(inst_libdir)/$$i ; \
+               rm -f $(DESTDIR)$(inst_libdir)/$$i ; \
        done
-       rmdir $(inst_libdir)
+       rmdir $(DESTDIR)$(inst_libdir)
 
-uninstall-headers:
+uninstall-headers: $(need-DESTDIR-compatibility)
        @for i in $(HEADERS); do \
-               rm -r $(inst_includedir)/$$i ; \
+               rm -r $(DESTDIR)$(inst_includedir)/$$i ; \
        done
-       rmdir $(inst_includedir)
+       rmdir $(DESTDIR)$(inst_includedir)
 
 
 dist:
This page took 0.052791 seconds and 5 git commands to generate.