From 7f657c2bb45f330db4c58a2830acc70e4f6560a6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 1 Apr 2012 14:31:16 +0000 Subject: [PATCH] 2012-04-01 16:30 UTC+0200 Viktor Szakats (harbour syenar.net) * config/win/mingw.mk + solved mingw harbour dll and unicows problem, so now -shared Harbour executables built using mingw will be able to run on Win9x, "out of the box". (has a downside that now separate compile pass is needed to build objects with -DHB_DYNLIB (like with all the other C compilers), but I left it enabled anyways to give uniform support for unicows by default, including the nightly and official builds. Look into the diff for an undocumented way to disable this) * config/win/watcom.mk * config/win/xcc.mk * config/win/icc.mk * config/win/pocc.mk * config/win/bcc.mk * config/win/msvc.mk * restored to link 3rd libs (currently unicows, if available) to harbour-*.dll with above compilers. These are currently noops (except for bcc, where it just doesn't work), they are fundemantally correct, but may require further C compiler specific mods. ; TODO: problem with bcc harbour-*.dll remains. unicows is present, specified, but ignored when linking, even though it's not ignored when contrib dlls are built using similar method. I leave resolving this problem to bcc users. --- harbour/ChangeLog | 29 +++++++++++++++++++++++++++++ harbour/config/win/bcc.mk | 2 +- harbour/config/win/icc.mk | 2 +- harbour/config/win/mingw.mk | 19 ++++++++++++++++++- harbour/config/win/msvc.mk | 2 +- harbour/config/win/pocc.mk | 2 +- harbour/config/win/watcom.mk | 1 + harbour/config/win/xcc.mk | 2 +- 8 files changed, 53 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 84ec7ffb13..a11f074482 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,35 @@ The license applies to all entries newer than 2009-04-28. */ +2012-04-01 16:30 UTC+0200 Viktor Szakats (harbour syenar.net) + * config/win/mingw.mk + + solved mingw harbour dll and unicows problem, so now + -shared Harbour executables built using mingw will be able + to run on Win9x, "out of the box". + (has a downside that now separate compile pass is needed + to build objects with -DHB_DYNLIB (like with all the other + C compilers), but I left it enabled anyways to give uniform + support for unicows by default, including the nightly and + official builds. Look into the diff for an undocumented + way to disable this) + + * config/win/watcom.mk + * config/win/xcc.mk + * config/win/icc.mk + * config/win/pocc.mk + * config/win/bcc.mk + * config/win/msvc.mk + * restored to link 3rd libs (currently unicows, if available) + to harbour-*.dll with above compilers. These are currently + noops (except for bcc, where it just doesn't work), + they are fundemantally correct, but may require further + C compiler specific mods. + + ; TODO: problem with bcc harbour-*.dll remains. unicows is present, + specified, but ignored when linking, even though it's not ignored + when contrib dlls are built using similar method. I leave + resolving this problem to bcc users. + 2012-04-01 11:55 UTC+0200 Viktor Szakats (harbour syenar.net) * config/win/watcom.mk * config/win/xcc.mk diff --git a/harbour/config/win/bcc.mk b/harbour/config/win/bcc.mk index ea65c26bad..eb9a557825 100644 --- a/harbour/config/win/bcc.mk +++ b/harbour/config/win/bcc.mk @@ -107,7 +107,7 @@ DY := ilink32.exe DFLAGS += -q -Gn -C -aa -Tpd -Gi -x $(LIBPATHS) DY_OUT := # NOTE: .lib extension not added to keep line short enough to work on Win9x/ME -DLIBS := $(HB_USER_LIBS) $(LIBS) $(SYSLIBS) cw32mt import32 +DLIBS := $(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS) cw32mt import32 # NOTE: The empty line directly before 'endef' HAVE TO exist! define dynlib_object diff --git a/harbour/config/win/icc.mk b/harbour/config/win/icc.mk index 492241e696..194cf63156 100644 --- a/harbour/config/win/icc.mk +++ b/harbour/config/win/icc.mk @@ -55,7 +55,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) -nologo -out:$(LIB_DIR DY := $(LD) DFLAGS += -nologo -dll -subsystem:console $(LIBPATHS) DY_OUT := $(LD_OUT) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dynlib_object diff --git a/harbour/config/win/mingw.mk b/harbour/config/win/mingw.mk index 045cda2cdf..14fbe273a2 100644 --- a/harbour/config/win/mingw.mk +++ b/harbour/config/win/mingw.mk @@ -12,6 +12,23 @@ OBJ_EXT := .o LIB_PREF := lib LIB_EXT := .a +3RDLIBS_DYN := $(3RDLIBS) + +ifneq ($(HB_COMPILER),mingw64) + + # Since unicows support in harbour-*.dll effectively + # doubles build time for core, allow it to be disabled. + ifeq ($(__HB_HARBOUR_DLL_UNICOWS),no) + 3RDLIBS_DYN := $(filter-out $(3RDLIBS_DYN),unicows) + endif + + ifneq ($(findstring unicows,$(3RDLIBS_DYN)),) + # Required to be able to link harbour-*.dll against unicows lib + # without it 'Cannot export <*>: symbol not found' errors occur. + HB_DYN_COPT := -DHB_DYNLIB + endif +endif + CC := $(HB_CCPATH)$(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) CC_IN := -c CC_OUT := -o @@ -119,7 +136,7 @@ AR_RULE = $(create_library) DY := $(CC) DFLAGS += -shared $(LIBPATHS) DY_OUT := $(LD_OUT) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(3RDLIBS_DYN) $(SYSLIBS),-l$(lib)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dynlib_object diff --git a/harbour/config/win/msvc.mk b/harbour/config/win/msvc.mk index 9560b27681..3f6054db69 100644 --- a/harbour/config/win/msvc.mk +++ b/harbour/config/win/msvc.mk @@ -88,7 +88,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) -nologo -out:$(LIB_DIR DY := $(LD) DFLAGS += -nologo -dll -subsystem:console $(LIBPATHS) DY_OUT := $(LD_OUT) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dynlib_object diff --git a/harbour/config/win/pocc.mk b/harbour/config/win/pocc.mk index 340e954b57..7baeb38666 100644 --- a/harbour/config/win/pocc.mk +++ b/harbour/config/win/pocc.mk @@ -53,7 +53,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) -out:$(LIB_DIR)/$@ $(^ DY := $(LD) DFLAGS += -nologo -dll $(LIBPATHS) DY_OUT := $(LD_OUT) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dynlib_object diff --git a/harbour/config/win/watcom.mk b/harbour/config/win/watcom.mk index f0482057e0..d7010c2d78 100644 --- a/harbour/config/win/watcom.mk +++ b/harbour/config/win/watcom.mk @@ -74,6 +74,7 @@ DFLAGS += OP quiet SYS nt_dll DY_OUT := DLIBS := $(foreach lib,$(HB_USER_LIBS),$(lib)) DLIBS += $(foreach lib,$(LIBS),$(LIB_DIR)/$(lib)) +DLIBS += $(foreach lib,$(3RDLIBS),$(3RDLIB_DIR)/$(lib)) DLIBS += $(foreach lib,$(SYSLIBS),$(lib)) DLIBS := $(strip $(DLIBS)) diff --git a/harbour/config/win/xcc.mk b/harbour/config/win/xcc.mk index bed9c25349..844318fb48 100644 --- a/harbour/config/win/xcc.mk +++ b/harbour/config/win/xcc.mk @@ -56,7 +56,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) -out:$(LIB_DIR)/$@ $(^ DY := $(LD) DFLAGS += -nologo -dll -noexpobj $(LIBPATHS) DY_OUT := $(LD_OUT) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS),$(lib)$(LIB_EXT)) ifeq ($(HB_SHELL),sh) DYNFIX = && mv $(DYN_DIR)/$(@:.dll=.LIB) $(LIB_DIR)/$(@:.dll=.lib)