When building the cygwin1.dll and associated pieces, it is desirable to
use the proper runtime --prefix parameters to 'configure'. After
building the tree, one might want to install it into a different base
directory than 'prefix' using, e.g., 'make install
DESTDIR=/my/own/dest', rather than installing into the running system.
Unfortunately as it stands, the build system will install only a portion
of the code into 'DESTDIR/prefix', and another portion simply into 'prefix'.
The attached patch corrects the relevant Makefiles to honor the DESTDIR
variable.
-Karl Brose
diff -ru orig/winsup/mingw/Makefile.in src/winsup/mingw/Makefile.in
--- orig/winsup/mingw/Makefile.in 2009-07-27 16:27:09.000000000 -0400
+++ src/winsup/mingw/Makefile.in 2009-08-18 21:56:33.968750000 -0400
@@ -86,10 +86,11 @@
# configure script should simply assign appropriate values to
# the standard macros, which should be used herein.
#
-inst_bindir:=$(tooldir)/bin
-inst_includedir:=$(tooldir)/include/mingw
-inst_libdir:=$(tooldir)/lib/mingw
-inst_docdir:=$(tooldir)/share/doc/mingw-runtime
+inst_bindir:=$(DESTDIR)$(tooldir)/bin
+inst_includedir:=$(DESTDIR)$(tooldir)/include/mingw
+inst_libdir:=$(DESTDIR)$(tooldir)/lib/mingw
+inst_docdir:=$(DESTDIR)$(tooldir)/share/doc/mingw-runtime
+inst_mandir:=$(DESTDIR)$(mandir)
else
ifneq (,$(with_cross_host))
#
@@ -100,15 +101,17 @@
# of these settings is the prerogative of the configure script,
# and they should use standard names, as noted above.
#
-inst_bindir:=$(tooldir)/bin
-inst_includedir:=$(tooldir)/include
-inst_libdir:=$(tooldir)/lib
-inst_docdir:=$(tooldir)/share/doc/mingw-runtime
+inst_bindir:=$(DESTDIR)$(tooldir)/bin
+inst_includedir:=$(DESTDIR)$(tooldir)/include
+inst_libdir:=$(DESTDIR)$(tooldir)/lib
+inst_docdir:=$(DESTDIR)$(tooldir)/share/doc/mingw-runtime
+inst_mandir:=$(DESTDIR)$(mandir)
else
-inst_bindir:=$(bindir)
-inst_includedir:=$(includedir)
-inst_libdir:=$(libdir)
-inst_docdir:=$(prefix)/doc/runtime
+inst_bindir:=$(DESTDIR)$(bindir)
+inst_includedir:=$(DESTDIR)$(includedir)
+inst_libdir:=$(DESTDIR)$(libdir)
+inst_docdir:=$(DESTDIR)$(prefix)/doc/runtime
+inst_mandir:=$(DESTDIR)$(mandir)
endif
endif
@@ -195,6 +198,7 @@
# FIXME: Most of these are either redundant, or should be set
# directly in the subdirectories' Makefiles, by `configure'.
FLAGS_TO_PASS:=\
+ DESTDIR="$(DESTDIR)" \
AS="$(AS)" \
CC="$(CC)" \
CFLAGS="$(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \
@@ -498,7 +502,7 @@
$(mkinstalldirs) $(inst_includedir)
$(mkinstalldirs) $(inst_libdir)
$(mkinstalldirs) $(inst_docdir)
- $(mkinstalldirs) $(mandir)/man$(mansection)
+ $(mkinstalldirs) $(inst_mandir)/man$(mansection)
install: all install-dirs $(install_dlls_host)
for i in $(LIBS); do \
@@ -521,10 +525,10 @@
# 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) $(inst_mandir)/man$(mansection)
+ $(INSTALL_DATA) $(srcdir)/man/dirname.man
$(inst_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
$(inst_mandir)/man$(mansection)/`\
echo basename.man|sed '$(manpage_transform);s,man$$,$(mansection),'`
#
# End provisional hack.
diff -ru orig/winsup/w32api/lib/Makefile.in src/winsup/w32api/lib/Makefile.in
--- orig/winsup/w32api/lib/Makefile.in 2008-01-29 16:18:49.000000000 -0500
+++ src/winsup/w32api/lib/Makefile.in 2009-08-18 21:24:16.281250000 -0400
@@ -41,15 +41,15 @@
datadir = @datadir@
infodir = @infodir@
ifneq (,$(findstring cygwin,$(target_alias)))
-inst_includedir:=$(tooldir)/include/w32api
-inst_libdir:=$(tooldir)/lib/w32api
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api
+inst_libdir:=$(DESTDIR)$(tooldir)/lib/w32api
else
ifneq (,$(with_cross_host))
-inst_includedir:=$(tooldir)/include/w32api
-inst_libdir:=$(tooldir)/lib
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api
+inst_libdir:=$(DESTDIR)$(tooldir)/lib
else
-inst_includedir:=$(includedir)
-inst_libdir:=$(libdir)
+inst_includedir:=$(DESTDIR)$(includedir)
+inst_libdir:=$(DESTDIR)$(libdir)
endif
endif
diff -ru orig/winsup/w32api/lib/ddk/Makefile.in
src/winsup/w32api/lib/ddk/Makefile.in
--- orig/winsup/w32api/lib/ddk/Makefile.in 2006-09-11 20:29:04.000000000
-0400
+++ src/winsup/w32api/lib/ddk/Makefile.in 2009-08-18 21:32:45.468750000
-0400
@@ -37,15 +37,15 @@
datadir = @datadir@
infodir = @infodir@
ifneq (,$(findstring cygwin,$(target_alias)))
-inst_includedir:=$(tooldir)/include/w32api/ddk
-inst_libdir:=$(tooldir)/lib/w32api
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api/ddk
+inst_libdir:=$(DESTDIR)$(tooldir)/lib/w32api
else
ifneq (,$(with_cross_host))
-inst_includedir:=$(tooldir)/include/w32api/ddk
-inst_libdir:=$(tooldir)/lib
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api/ddk
+inst_libdir:=$(DESTDIR)$(tooldir)/lib
else
-inst_includedir:=$(includedir)/ddk
-inst_libdir:=$(libdir)
+inst_includedir:=$(DESTDIR)$(includedir)/ddk
+inst_libdir:=$(DESTDIR)$(libdir)
endif
endif
diff -ru orig/winsup/w32api/lib/directx/Makefile.in
src/winsup/w32api/lib/directx/Makefile.in
--- orig/winsup/w32api/lib/directx/Makefile.in 2006-09-11 20:29:04.000000000
-0400
+++ src/winsup/w32api/lib/directx/Makefile.in 2009-08-18 21:39:49.750000000
-0400
@@ -37,15 +37,15 @@
datadir = @datadir@
infodir = @infodir@
ifneq (,$(findstring cygwin,$(target_alias)))
-inst_includedir:=$(tooldir)/include/w32api
-inst_libdir:=$(tooldir)/lib/w32api
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api
+inst_libdir:=$(DESTDIR)$(tooldir)/lib/w32api
else
ifneq (,$(with_cross_host))
-inst_includedir:=$(tooldir)/include/w32api
-inst_libdir:=$(tooldir)/lib
+inst_includedir:=$(DESTDIR)$(tooldir)/include/w32api
+inst_libdir:=$(DESTDIR)$(tooldir)/lib
else
-inst_includedir:=$(includedir)
-inst_libdir:=$(libdir)
+inst_includedir:=$(DESTDIR)$(includedir)
+inst_libdir:=$(DESTDIR)$(libdir)
endif
endif
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple