From c4094316b191c211efc113a65607985862d0eadb Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 24 Sep 2009 13:21:13 +0000 Subject: [PATCH] 2009-09-24 15:21 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/instsh.mk ! added global protection against installing files to source location * harbour/config/global.mk * removed previous partial protection --- harbour/ChangeLog | 7 +++++++ harbour/config/global.mk | 15 ++------------- harbour/config/instsh.mk | 6 ++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fc8ce25d21..de903d7082 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-24 15:21 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/config/instsh.mk + ! added global protection against installing files to source location + + * harbour/config/global.mk + * removed previous partial protection + 2009-09-24 14:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/contrib/hbmemio/memio.c * pacified warning diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 739192c0d9..c43070b780 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1138,7 +1138,6 @@ export HB_PKGNAME export HB_PKGNAMI HB_INSTALL_PREFIX_ORI := $(HB_INSTALL_PREFIX) -HB_INSTALL_PREFIX_TOP := $(subst /,$(DIRSEP),$(realpath $(TOP)$(ROOT))) ifeq ($(HB_BUILD_PKG),yes) ifeq ($(HB_INIT_DONE),) export HB_TOP := $(subst /,$(DIRSEP),$(realpath $(TOP)$(ROOT))) @@ -1274,23 +1273,13 @@ ifneq ($(HB_INSTALL_PREFIX),) endif # Standard name: INCLUDEDIR ifeq ($(HB_INC_INSTALL),) - HB_INC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)include$(INCPOSTFIX) - # Do not set include install dir if it's inside the source tree - # to avoid 'source same as dest' warnings on 'install' copy operation. - ifneq ($(HB_SHELL),sh) - ifeq ($(HB_INSTALL_PREFIX),$(HB_INSTALL_PREFIX_TOP)) - HB_INC_INSTALL := - endif - endif - export HB_INC_INSTALL + export HB_INC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)include$(INCPOSTFIX) endif # Standard name: DOCDIR ifeq ($(HB_DOC_INSTALL),) # Do not set doc dir for *nix targets ifeq ($(HB_PLATFORM_UNIX),) - ifneq ($(HB_INSTALL_PREFIX),$(HB_INSTALL_PREFIX_TOP)) - export HB_DOC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)doc - endif + export HB_DOC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)doc endif endif endif diff --git a/harbour/config/instsh.mk b/harbour/config/instsh.mk index 1ed0fae025..38913e7a1e 100644 --- a/harbour/config/instsh.mk +++ b/harbour/config/instsh.mk @@ -13,6 +13,10 @@ ifeq ($(INSTALL_DIR),) # Empty install dir INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Can't install, install dir isn't set$(ECHOQUOTE) else +ifeq ($(realpath $(INSTALL_DIR)),$(realpath .)) + INSTALL_RULE := @$(ECHO) $(ECHOQUOTE)! Skip install, destination dir '$(INSTALL_DIR)' is the same as source$(ECHOQUOTE) +else + ifneq ($(HB_SHELL),sh) INSTALL_DIR_OS := $(subst /,\,$(INSTALL_DIR)) INSTALL_FILES_OS := $(subst /,\,$(INSTALL_FILES)) @@ -89,6 +93,8 @@ ifeq ($(HB_SHELL),dos) endif +endif # Source and destination directories are equal + endif # Empty install dir endif # Empty install list