From 803c52d710e6e2bc41fab50f0a8ececb9ec7a8c6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 19 Sep 2009 14:56:55 +0000 Subject: [PATCH] 2009-09-19 16:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bin.mk + Added HB_BUILD_SHARED support for os2/watcom. * source/Makefile * Deleted env space saving optimization for dos platform and added support for gtdos when building dos .dlls. % Deleted line after prev changes. * config/global.mk + Added special .dll names when building dos based ones. (harbour / harbourm) * config/dos/watcom.mk + Enabled absolutely experimental dos .dll support. ; Current result: --- wlink OP quiet SYS cwdllr NAME '..\..\..\..\..\bin\dos\watcom\harbour' OP implib='../../. ./../../lib/dos/watcom/harbour.lib' @__dyn__.tmp Warning! W1027: file clib3r.lib(cstart): redefinition of ___begtext ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __nullarea ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __D16Infoseg ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __x386_zero_base_selector ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __exit_ ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __do_exit_with_msg__ ignored Warning! W1027: file clib3r.lib(cstart): redefinition of __GETDS ignored Warning! W1027: file clib3r.lib(cstart): redefinition of ___GETDSStart_ ignored Warning! W1027: file clib3r.lib(cstart): redefinition of ___GETDSEnd_ ignored Error! E2030: file clib3r.lib(cstart): multiple starting addresses found mingw32-make.exe[2]: *** [harbour] Error 1 --- ; TOFIX: hbpp object will be (or is) again a showstopper. * config/win/watcom.mk * Synced with dos/watcom.mk after above change. --- harbour/ChangeLog | 39 +++++++++++++++++++++++++++++++++++- harbour/config/bin.mk | 2 ++ harbour/config/dos/watcom.mk | 27 +++++++++++++++++++++++++ harbour/config/global.mk | 12 +++++++++-- harbour/config/win/watcom.mk | 11 +++++++--- harbour/source/Makefile | 4 +--- 6 files changed, 86 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cc303f94c0..e2632d4a17 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,43 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-19 16:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/bin.mk + + Added HB_BUILD_SHARED support for os2/watcom. + + * source/Makefile + * Deleted env space saving optimization for dos platform + and added support for gtdos when building dos .dlls. + % Deleted line after prev changes. + + * config/global.mk + + Added special .dll names when building dos based ones. + (harbour / harbourm) + + * config/dos/watcom.mk + + Enabled absolutely experimental dos .dll support. + ; Current result: + --- + wlink OP quiet SYS cwdllr NAME '..\..\..\..\..\bin\dos\watcom\harbour' OP implib='../../. + ./../../lib/dos/watcom/harbour.lib' @__dyn__.tmp + Warning! W1027: file clib3r.lib(cstart): redefinition of ___begtext ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of __nullarea ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of __D16Infoseg ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of __x386_zero_base_selector ignored + + Warning! W1027: file clib3r.lib(cstart): redefinition of __exit_ ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of __do_exit_with_msg__ ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of __GETDS ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of ___GETDSStart_ ignored + Warning! W1027: file clib3r.lib(cstart): redefinition of ___GETDSEnd_ ignored + Error! E2030: file clib3r.lib(cstart): multiple starting addresses found + mingw32-make.exe[2]: *** [harbour] Error 1 + --- + ; TOFIX: hbpp object will be (or is) again a showstopper. + + * config/win/watcom.mk + * Synced with dos/watcom.mk after above change. + 2009-09-19 16:31 UTC+0600 April White (april users.sourceforge.net) * examples/hbdoc2/hbdoc2.prg * bug fix when handling "--help" command line @@ -100,7 +137,7 @@ 2009-09-19 16:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bin.mk ! Fixed to leave sys libs for non-*nix systems in shared mode. - + Added support for win/watcom. + + Added HB_BUILD_SHARED support for win/watcom. * utils/hbmk2/Makefile * utils/hbrun/Makefile diff --git a/harbour/config/bin.mk b/harbour/config/bin.mk index 070c4cf8f4..c42b01a12a 100644 --- a/harbour/config/bin.mk +++ b/harbour/config/bin.mk @@ -22,6 +22,8 @@ ifeq ($(HB_BUILD_SHARED),yes) else HB_LIBS_TPL += hbmainstd hbmainwin endif + else ifeq ($(HB_PLATFORM)-$(HB_COMPILER),os2-watcom) + HB_LDFLAGS += FILE $(LIB_DIR)/hbmainstd.lib endif HB_LIBS_ST_RDD := $(HB_LIBS_TPL) $(HB_DYNLIB_ST) diff --git a/harbour/config/dos/watcom.mk b/harbour/config/dos/watcom.mk index 61e3465113..6e6b148b5c 100644 --- a/harbour/config/dos/watcom.mk +++ b/harbour/config/dos/watcom.mk @@ -71,4 +71,31 @@ ifneq ($(HB_LINKING_RTL),) endif endif +DY := $(LD) +DFLAGS := OP quiet SYS cwdllr +DY_OUT := +DLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) +DLIBS += $(foreach lib,$(SYSLIBS),$(lib)) +DLIBS := $(strip $(DLIBS)) + +ifneq ($(DLIBS),) + comma := , + DLIBS_COMMA := LIB $(subst $(subst x,x, ),$(comma) ,$(DLIBS)) +else + DLIBS_COMMA := +endif + +# NOTE: The empty line directly before 'endef' HAVE TO exist! +define dyn_object + @$(ECHO) $(ECHOQUOTE)FILE '$(file)'$(ECHOQUOTE) >> __dyn__.tmp + +endef +define create_dynlib + $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) + $(foreach file,$^,$(dyn_object)) + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) NAME '$(subst /,$(DIRSEP),$(DYN_DIR)/$@)' OP implib='$(IMP_FILE)' @__dyn__.tmp $(DLIBS_COMMA) +endef + +DY_RULE = $(create_dynlib) + include $(TOP)$(ROOT)config/common/watcom.mk diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 4418ef499f..ac387c971b 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1320,8 +1320,16 @@ ifeq ($(HB_INIT_DONE),) endif endif - export HB_DYNLIB_ST := harbour$(DYNNAME_POST) - export HB_DYNLIB_MT := harbourmt$(DYNNAME_POST) + ifeq ($(HB_PLATFORM)-$(HB_COMPILER),dos-watcom) + HB_DYNLIB_ST := harbour + HB_DYNLIB_MT := harbourm + else + HB_DYNLIB_ST := harbour$(DYNNAME_POST) + HB_DYNLIB_MT := harbourmt$(DYNNAME_POST) + endif + + export HB_DYNLIB_ST + export HB_DYNLIB_MT endif endif diff --git a/harbour/config/win/watcom.mk b/harbour/config/win/watcom.mk index 58ad205013..151fbe4dc4 100644 --- a/harbour/config/win/watcom.mk +++ b/harbour/config/win/watcom.mk @@ -69,9 +69,14 @@ DFLAGS := OP quiet SYS nt_dll DY_OUT := DLIBS := $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) DLIBS += $(foreach lib,$(SYSLIBS),$(lib)) +DLIBS := $(strip $(DLIBS)) -comma := , -DLIBS_COMMA := $(subst $(subst x,x, ),$(comma) ,$(strip $(DLIBS))) +ifneq ($(DLIBS),) + comma := , + DLIBS_COMMA := LIB $(subst $(subst x,x, ),$(comma) ,$(DLIBS)) +else + DLIBS_COMMA := +endif # NOTE: The empty line directly before 'endef' HAVE TO exist! define dyn_object @@ -81,7 +86,7 @@ endef define create_dynlib $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) $(foreach file,$^,$(dyn_object)) - $(DY) $(DFLAGS) $(HB_USER_DFLAGS) NAME '$(subst /,$(DIRSEP),$(DYN_DIR)/$@)' OP implib='$(IMP_FILE)' @__dyn__.tmp LIB $(DLIBS_COMMA) + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) NAME '$(subst /,$(DIRSEP),$(DYN_DIR)/$@)' OP implib='$(IMP_FILE)' @__dyn__.tmp $(DLIBS_COMMA) endef DY_RULE = $(create_dynlib) diff --git a/harbour/source/Makefile b/harbour/source/Makefile index 311107abae..e1f0e556b2 100644 --- a/harbour/source/Makefile +++ b/harbour/source/Makefile @@ -40,8 +40,7 @@ else source/rtl/gtstd ifeq ($(HB_PLATFORM),dos) - # Don't consume environment space - DYNDIRLIST_BASE := x + DYNDIRLIST_BASE += source/rtl/gtdos endif ifeq ($(HB_PLATFORM),os2) DYNDIRLIST_BASE += source/rtl/gtos2 @@ -73,7 +72,6 @@ else endif export DYNDIRLIST_BASE - export DYNNAME_POST endif ifeq ($(HB_BUILD_PART),lib)