From c01ec57fe716c38ceb1a2f3d2f5e9478cbbf0e62 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 16 Jul 2009 15:20:36 +0000 Subject: [PATCH] 2009-07-16 17:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/global.cf * config/instsh.cf * config/dirsh.cf * config/globsh.cf * Restored compatibility with pre-3.81 GNU Make versions. (some user feedback features are now disabled for older versions) --- harbour/ChangeLog | 8 ++ harbour/config/dirsh.cf | 12 ++- harbour/config/global.cf | 216 ++++++++++++++++++++++++++------------- harbour/config/globsh.cf | 12 ++- harbour/config/instsh.cf | 20 +++- 5 files changed, 185 insertions(+), 83 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1b5ffca821..a9b2228727 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-16 17:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/global.cf + * config/instsh.cf + * config/dirsh.cf + * config/globsh.cf + * Restored compatibility with pre-3.81 GNU Make versions. + (some user feedback features are now disabled for older versions) + 2009-07-16 16:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * source/pp/Makefile * config/rules.cf diff --git a/harbour/config/dirsh.cf b/harbour/config/dirsh.cf index a1d551e72e..8a761dec65 100644 --- a/harbour/config/dirsh.cf +++ b/harbour/config/dirsh.cf @@ -25,17 +25,23 @@ DIR_RULE =\ fi \ done -else ifeq ($(HB_SHELL),nt) +endif + +ifeq ($(HB_SHELL),nt) DIR_RULE =\ $(CMDPREF)for %d in ($(DIRS_OS)) do $(MK_OS) -C %d $@ -else ifeq ($(HB_SHELL),os2) +endif + +ifeq ($(HB_SHELL),os2) DIR_RULE =\ $(CMDPREF)for %d in ($(DIRS_OS)) do $(MK_OS) -C %d $@ -else ifeq ($(HB_SHELL),dos) +endif + +ifeq ($(HB_SHELL),dos) # We have to use script to overcome the DOS limit of max 128 characters # NOTE: The empty line directly before 'endef' HAVE TO exist! diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 9b69f57c27..693ac79f47 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -22,6 +22,9 @@ all: ; @echo Error: GNU Make version $(MAKE_VERSION) found, $(need) or upper nee else +need := 3.81 +ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))) + GRANDP = ../../../ ARCH_COMP := $(HB_ARCHITECTURE)/$(HB_COMPILER) OBJ_BASE := obj @@ -32,36 +35,66 @@ define check_host ifneq ($(findstring MINGW,$(1)),) HB_HOST_ARCH := win -else ifneq ($(findstring MSys,$(1)),) - HB_HOST_ARCH := win -else ifneq ($(findstring Windows,$(1)),) - HB_HOST_ARCH := win -else ifneq ($(findstring CYGWIN,$(1)),) - HB_HOST_ARCH := win -else ifneq ($(findstring Darwin,$(1)),) - HB_HOST_ARCH := darwin -else ifneq ($(findstring darwin,$(1)),) - HB_HOST_ARCH := darwin -else ifneq ($(findstring Linux,$(1)),) - HB_HOST_ARCH := linux -else ifneq ($(findstring linux,$(1)),) - HB_HOST_ARCH := linux -else ifneq ($(findstring HP-UX,$(1)),) - HB_HOST_ARCH := hpux -else ifneq ($(findstring hp-ux,$(1)),) - HB_HOST_ARCH := hpux -else ifneq ($(findstring SunOS,$(1)),) - HB_HOST_ARCH := sunos -else ifneq ($(findstring sunos,$(1)),) - HB_HOST_ARCH := sunos -else ifneq ($(findstring BSD,$(1)),) - HB_HOST_ARCH := bsd -else ifneq ($(findstring bsd,$(1)),) - HB_HOST_ARCH := bsd -else ifneq ($(findstring OS/2,$(1)),) - HB_HOST_ARCH := os2 -else ifneq ($(findstring msdos,$(1)),) - HB_HOST_ARCH := dos +else + ifneq ($(findstring MSys,$(1)),) + HB_HOST_ARCH := win + else + ifneq ($(findstring Windows,$(1)),) + HB_HOST_ARCH := win + else + ifneq ($(findstring CYGWIN,$(1)),) + HB_HOST_ARCH := win + else + ifneq ($(findstring Darwin,$(1)),) + HB_HOST_ARCH := darwin + else + ifneq ($(findstring darwin,$(1)),) + HB_HOST_ARCH := darwin + else + ifneq ($(findstring Linux,$(1)),) + HB_HOST_ARCH := linux + else + ifneq ($(findstring linux,$(1)),) + HB_HOST_ARCH := linux + else + ifneq ($(findstring HP-UX,$(1)),) + HB_HOST_ARCH := hpux + else + ifneq ($(findstring hp-ux,$(1)),) + HB_HOST_ARCH := hpux + else + ifneq ($(findstring SunOS,$(1)),) + HB_HOST_ARCH := sunos + else + ifneq ($(findstring sunos,$(1)),) + HB_HOST_ARCH := sunos + else + ifneq ($(findstring BSD,$(1)),) + HB_HOST_ARCH := bsd + else + ifneq ($(findstring bsd,$(1)),) + HB_HOST_ARCH := bsd + else + ifneq ($(findstring OS/2,$(1)),) + HB_HOST_ARCH := os2 + else + ifneq ($(findstring msdos,$(1)),) + HB_HOST_ARCH := dos + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif + endif endif endef @@ -99,10 +132,12 @@ else endif ifneq ($(findstring COMMAND,$(COMSPEC)),) HB_SHELL := dos - else ifneq ($(findstring command,$(COMSPEC)),) - HB_SHELL := dos else - HB_SHELL := nt + ifneq ($(findstring command,$(COMSPEC)),) + HB_SHELL := dos + else + HB_SHELL := nt + endif endif endif endif @@ -131,33 +166,42 @@ endif ifeq ($(HB_HOST_ARCH),) ifneq ($(OS2_SHELL),) HB_HOST_ARCH := os2 - else ifneq ($(windir),) - HB_HOST_ARCH := win - else ifneq ($(WINDIR),) - HB_HOST_ARCH := win else - HB_HOST_ARCH := dos + ifneq ($(windir),) + HB_HOST_ARCH := win + else + ifneq ($(WINDIR),) + HB_HOST_ARCH := win + else + HB_HOST_ARCH := dos + endif + endif endif endif - ifeq ($(HB_BUILD_VERBOSE),yes) - $(info Detected host platform: $(HB_HOST_ARCH)) + ifeq ($(ok),) + $(info Detected host platform: $(HB_HOST_ARCH)) + endif endif HB_HOST_CPU := ifeq ($(HB_HOST_ARCH),win) ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) HB_HOST_CPU := x86_64 - else ifeq ($(PROCESSOR_ARCHITECTURE),IA64) - HB_HOST_CPU := ia64 else - HB_HOST_CPU := x86 + ifeq ($(PROCESSOR_ARCHITECTURE),IA64) + HB_HOST_CPU := ia64 + else + HB_HOST_CPU := x86 + endif endif endif ifeq ($(HB_BUILD_VERBOSE),yes) - $(info Detected host CPU: $(HB_HOST_CPU)) + ifeq ($(ok),) + $(info Detected host CPU: $(HB_HOST_CPU)) + endif endif # TODO: Set this in /.cf @@ -165,21 +209,31 @@ HB_CPU := ifeq ($(HB_ARCHITECTURE),win) ifeq ($(HB_COMPILER),msvc64) HB_CPU := x86_64 - else ifeq ($(HB_COMPILER),mingw64) - HB_CPU := x86_64 - else ifeq ($(HB_COMPILER),pocc64) - HB_CPU := x86_64 - else ifeq ($(HB_COMPILER),msvcia64) - HB_CPU := ia64 - else ifeq ($(HB_COMPILER),iccia64) - HB_CPU := ia64 else - HB_CPU := x86 + ifeq ($(HB_COMPILER),mingw64) + HB_CPU := x86_64 + else + ifeq ($(HB_COMPILER),pocc64) + HB_CPU := x86_64 + else + ifeq ($(HB_COMPILER),msvcia64) + HB_CPU := ia64 + else + ifeq ($(HB_COMPILER),iccia64) + HB_CPU := ia64 + else + HB_CPU := x86 + endif + endif + endif + endif endif endif ifeq ($(HB_BUILD_VERBOSE),yes) - $(info Detected target CPU: $(HB_CPU)) + ifeq ($(ok),) + $(info Detected target CPU: $(HB_CPU)) + endif endif ifneq ($(findstring $(HB_HOST_ARCH),win wce dos os2),) @@ -189,7 +243,9 @@ else endif ifeq ($(HB_BUILD_VERBOSE),yes) - $(info Detected host executable extension: $(HB_HOST_BIN_EXT)) + ifeq ($(ok),) + $(info Detected host executable extension: $(HB_HOST_BIN_EXT)) + endif endif HB_CROSS_BUILD := @@ -210,7 +266,9 @@ ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU)) ifeq ($(HB_BIN_COMPILE),) $(warning Warning: HB_BIN_COMPILE not specified. Couldn't find native build.) else - $(info HB_BIN_COMPILE not specified. Automatically set to: $(HB_BIN_COMPILE)) + ifeq ($(ok),) + $(info HB_BIN_COMPILE not specified. Automatically set to: $(HB_BIN_COMPILE)) + endif endif endif endif @@ -220,25 +278,39 @@ ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU)) HB_FLAGSEXTRA := ifeq ($(HB_CROSS_BUILD),yes) # Setup platform macros (undefine host, define target) - ifeq ($(HB_HOST_ARCH),win) + ifeq ($(HB_HOST_ARCH),win) HB_FLAGSEXTRA += -undef:__PLATFORM__WINDOWS - else ifeq ($(HB_HOST_ARCH),dos) - HB_FLAGSEXTRA += -undef:__PLATFORM__DOS - else ifeq ($(HB_HOST_ARCH),os2) - HB_FLAGSEXTRA += -undef:__PLATFORM__OS2 - else ifeq ($(HB_HOST_ARCH),linux) - HB_FLAGSEXTRA += -undef:__PLATFORM__LINUX -undef:__PLATFORM__UNIX + else + ifeq ($(HB_HOST_ARCH),dos) + HB_FLAGSEXTRA += -undef:__PLATFORM__DOS + else + ifeq ($(HB_HOST_ARCH),os2) + HB_FLAGSEXTRA += -undef:__PLATFORM__OS2 + else + ifeq ($(HB_HOST_ARCH),linux) + HB_FLAGSEXTRA += -undef:__PLATFORM__LINUX -undef:__PLATFORM__UNIX + endif + endif + endif endif - ifeq ($(HB_ARCHITECTURE),win) + ifeq ($(HB_ARCHITECTURE),win) HB_FLAGSEXTRA += -D__PLATFORM__WINDOWS - else ifeq ($(HB_ARCHITECTURE),wce) - HB_FLAGSEXTRA += -D__PLATFORM__WINDOWS -D__PLATFORM__WINCE - else ifeq ($(HB_ARCHITECTURE),dos) - HB_FLAGSEXTRA += -D__PLATFORM__DOS - else ifeq ($(HB_ARCHITECTURE),os2) - HB_FLAGSEXTRA += -D__PLATFORM__OS2 - else ifeq ($(HB_ARCHITECTURE),linux) - HB_FLAGSEXTRA += -D__PLATFORM__LINUX -D__PLATFORM__UNIX + else + ifeq ($(HB_ARCHITECTURE),wce) + HB_FLAGSEXTRA += -D__PLATFORM__WINDOWS -D__PLATFORM__WINCE + else + ifeq ($(HB_ARCHITECTURE),dos) + HB_FLAGSEXTRA += -D__PLATFORM__DOS + else + ifeq ($(HB_ARCHITECTURE),os2) + HB_FLAGSEXTRA += -D__PLATFORM__OS2 + else + ifeq ($(HB_ARCHITECTURE),linux) + HB_FLAGSEXTRA += -D__PLATFORM__LINUX -D__PLATFORM__UNIX + endif + endif + endif + endif endif endif endif diff --git a/harbour/config/globsh.cf b/harbour/config/globsh.cf index 2b127cdc95..d026e77fe0 100644 --- a/harbour/config/globsh.cf +++ b/harbour/config/globsh.cf @@ -41,7 +41,9 @@ dirbase:: clean:: -$(RD) $(OBJ_DIR) $(LIB_FILE) $(EXE_FILE) -else ifeq ($(HB_SHELL),nt) +endif + +ifeq ($(HB_SHELL),nt) MK = $(subst \,/,$(subst \~,~,$(MAKE))) RM = del /q /f @@ -60,7 +62,9 @@ clean:: $(if $(LIB_FILE_OS),-@$(CMDPREF)if exist $(LIB_FILE_OS) $(RM) $(LIB_FILE_OS),) $(if $(EXE_FILE_OS),-@$(CMDPREF)if exist $(EXE_FILE_OS) $(RM) $(EXE_FILE_OS),) -else ifeq ($(HB_SHELL),os2) +endif + +ifeq ($(HB_SHELL),os2) MK = $(subst /,\,$(subst \~,~,$(MAKE))) RM = del /n @@ -80,7 +84,9 @@ clean:: $(if $(LIB_FILE_OS),-if exist $(LIB_FILE_OS) $(RM) $(LIB_FILE_OS),) $(if $(EXE_FILE_OS),-if exist $(EXE_FILE_OS) $(RM) $(EXE_FILE_OS),) -else ifeq ($(HB_SHELL),dos) +endif + +ifeq ($(HB_SHELL),dos) # QUESTION: Anyone knows why is this needed? [vszakats] ifeq ($(HB_COMPILER),watcom) diff --git a/harbour/config/instsh.cf b/harbour/config/instsh.cf index 57a5aff203..121f33011d 100644 --- a/harbour/config/instsh.cf +++ b/harbour/config/instsh.cf @@ -14,7 +14,9 @@ ifeq ($(INSTALL_FILES),) # Empty install list INSTALL_RULE =\ @echo Done -else ifeq ($(INSTALL_DIR),) # Empty install dir +else + +ifeq ($(INSTALL_DIR),) # Empty install dir INSTALL_RULE =\ @echo Done @@ -43,13 +45,17 @@ INSTALL_RULE =\ done \ fi -else ifeq ($(HB_SHELL),nt) +endif + +ifeq ($(HB_SHELL),nt) INSTALL_RULE =\ -$(CMDPREF)if not exist "$(INSTALL_DIR_OS)" $(MD) "$(INSTALL_DIR_OS)" &\ for %%f in ($(INSTALL_FILES_OS)) do copy "%%f" "$(INSTALL_DIR_OS)" -else ifeq ($(HB_SHELL),os2) +endif + +ifeq ($(HB_SHELL),os2) define inst_file_all if not exist $(INSTALL_DIR_OS) $(MD) $(INSTALL_DIR_OS) @@ -68,7 +74,9 @@ endef INSTALL_RULE =\ $(inst_file_all) -else ifeq ($(HB_SHELL),dos) +endif + +ifeq ($(HB_SHELL),dos) # NOTE: Usage of HB_INSTALL_PREFIX is just a hack which works in basic cases. define inst_file_all @@ -91,4 +99,6 @@ INSTALL_RULE =\ endif -endif # Empty install list/dir +endif # Empty install dir + +endif # Empty install list