From 18bfd44b6835ec63c462f16d6dd3da49adadf1b8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Aug 2009 09:27:56 +0000 Subject: [PATCH] 2009-08-26 11:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Documented HB_CCPATH, HB_CCPREFIX, HB_CCPOSTFIX config variables. * source/Makefile * config/lib.mk + Added gtxwc to Harbour dynamic libs on *nixes. * config/global.mk ! Always set HB_INC_INSTALL on sh shells to make postinst.sh happy. * config/linux/global.mk * config/linux/gcc.mk * config/linux/icc.mk * config/linux/sunpro.mk % Moved 'system' library name and path list forming logic to platform global.mk. ; TODO: Also for other platforms. * source/Makefile ! Fixed to use '-' separator between dynlib name and version on *nixes too, except on darwin, where it's a '.'. --- harbour/ChangeLog | 25 ++++++++++++++++++- harbour/INSTALL | 8 ++++++ harbour/config/global.mk | 18 +++++++++----- harbour/config/lib.mk | 1 + harbour/config/linux/gcc.mk | 45 ++++------------------------------ harbour/config/linux/global.mk | 32 ++++++++++++++++++++++++ harbour/config/linux/icc.mk | 45 ++++------------------------------ harbour/config/linux/sunpro.mk | 44 ++++----------------------------- harbour/source/Makefile | 3 ++- 9 files changed, 94 insertions(+), 127 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3fbae48982..0842640a49 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,12 +17,35 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-26 11:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + + Documented HB_CCPATH, HB_CCPREFIX, HB_CCPOSTFIX config variables. + + * source/Makefile + * config/lib.mk + + Added gtxwc to Harbour dynamic libs on *nixes. + + * config/global.mk + ! Always set HB_INC_INSTALL on sh shells to make postinst.sh + happy. + + * config/linux/global.mk + * config/linux/gcc.mk + * config/linux/icc.mk + * config/linux/sunpro.mk + % Moved 'system' library name and path list forming logic to + platform global.mk. + ; TODO: Also for other platforms. + + * source/Makefile + ! Fixed to use '-' separator between dynlib name and version + on *nixes too, except on darwin, where it's a '.'. + 2009-08-26 11:16 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gtwvt/gtwvt.c ! fixed runtime font modification 2009-08-26 08:30 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) - * ChangeLog * config/global.mk ! Added 'SHELL := /bin/sh' lines after 'sh' HB_SHELL detection. Under certain circumstances SHELL will point to COMSPEC even diff --git a/harbour/INSTALL b/harbour/INSTALL index 9abba58800..c86760662c 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -451,6 +451,14 @@ OPTIONS AVAILABLE WHEN BUILDING HARBOUR developer modifying grammar rules (.y). Requires GNU Bison 1.28 or upper in PATH. Default: no + - HB_CCPATH=[/] Used with non-*nix gcc family compilers to + specify path to compiler/linker/archive tool + to help them run from *nix hosts as cross-build + tools. Ending slash must be used. + - HB_CCPREFIX=[] Used with gcc family to specify + compiler/linker/archive tool name prefix. + - HB_CCPOSTFIX=[] Used with gcc family to specify compiler/linker + tool postfix (usually version number). Cross-building -------------- diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 02e2d62761..b644d2b575 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -272,10 +272,10 @@ ifeq ($(HB_INIT_DONE),) # HB_DLLIBS -> (only used in place location, so it's a local matter) # # HB_CRS_LIB -> HB_LIB_CURSES - # HB_GPM_MOUSE -> HB_HAS_GPM ? - # HB_WITHOUT_* -> HB_HAS_* ? - # HB_INC_* -> ? - # HB_DIR_* -> ? + # HB_GPM_MOUSE -> HB_WITH_GPM + # HB_WITHOUT_* -> HB_WITH_*=no + # HB_INC_* -> HB_WITH_*= + # HB_DIR_* -> ? (only used for implib # HB_HAS_* -> ? # # Macros: @@ -1259,9 +1259,15 @@ ifneq ($(HB_INSTALL_PREFIX),) endif # Standard name: INCLUDEDIR ifeq ($(HB_INC_INSTALL),) - ifneq ($(HB_INSTALL_PREFIX),$(HB_INSTALL_PREFIX_TOP)) - export HB_INC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)include$(INCPOSTFIX) + HB_INC_INSTALL := $(HB_INSTALL_PREFIX)$(DIRSEP)include$(INCPOSTFIX) + # Don't 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 endif # Standard name: DOCDIR ifeq ($(HB_DOC_INSTALL),) diff --git a/harbour/config/lib.mk b/harbour/config/lib.mk index 41708a9809..bddb7aef96 100644 --- a/harbour/config/lib.mk +++ b/harbour/config/lib.mk @@ -35,6 +35,7 @@ HB_DYN_LIBS := \ gttrm \ gtcrs \ gtsln \ + gtxwc \ hbvm \ hbvmmt \ hbmaindllh diff --git a/harbour/config/linux/gcc.mk b/harbour/config/linux/gcc.mk index 2f870da729..64d4b52fd1 100644 --- a/harbour/config/linux/gcc.mk +++ b/harbour/config/linux/gcc.mk @@ -39,45 +39,10 @@ endif LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) LD_OUT := -o -LIBPATHS := -L$(LIB_DIR) -LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) +LIBPATHS := $(LIB_DIR) -ifneq ($(filter hbrtl, $(LIBS)),) - # Add the specified GT driver library - ifneq ($(filter gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses - endif - LDLIBS += -l$(HB_CRS_LIB) - endif - ifneq ($(filter gtsln, $(LIBS)),) - LDLIBS += -lslang - endif - ifneq ($(filter gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib - endif - - # HB_GPM_MOUSE: use gpm mouse driver - ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm - endif - - ifneq ($(filter -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre - endif - - ifneq ($(filter -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz - endif - - LDLIBS += -lrt -ldl -endif - -LDLIBS += -lm - -LDFLAGS += $(LIBPATHS) +LDLIBS := $(foreach lib,$(LIBS) $(SYSLIBS),-l$(lib)) +LDFLAGS += $(foreach dir,$(LIBPATHS) $(SYSLIBPATHS),-L$(dir)) AR := $(HB_CCPREFIX)ar ARFLAGS := @@ -86,7 +51,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) crs $(LIB_DIR)/$@ $(^F) || ( $(RM) DY := $(CC) DFLAGS := -shared -fPIC DY_OUT := -o$(subst x,x, ) -DLIBS := +DLIBS := $(foreach lib,$(SYSLIBS),-l$(lib)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dyn_object @@ -96,7 +61,7 @@ endef define create_dynlib $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) $(foreach file,$^,$(dyn_object)) - $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ @__dyn__.tmp + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ @__dyn__.tmp $(DLIBS) endef DY_RULE = $(create_dynlib) diff --git a/harbour/config/linux/global.mk b/harbour/config/linux/global.mk index 6f963cad3b..bc80e74e21 100644 --- a/harbour/config/linux/global.mk +++ b/harbour/config/linux/global.mk @@ -26,3 +26,35 @@ ifeq ($(HB_SHELL),sh) endif endif endif + +SYSLIBS := +SYSLIBPATHS := + +ifneq ($(filter hbrtl, $(LIBS)),) + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + ifneq ($(filter gtcrs, $(LIBS)),) + SYSLIBS += $(HB_CRS_LIB) + endif + ifneq ($(filter gtsln, $(LIBS)),) + SYSLIBS += slang + endif + ifneq ($(filter gtxwc, $(LIBS)),) + SYSLIBS += X11 + # SYSLIBPATHS += /usr/X11R6/lib64 + SYSLIBPATHS += /usr/X11R6/lib + endif + ifeq ($(HB_GPM_MOUSE),yes) + SYSLIBS += gpm + endif + ifneq ($(filter -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + SYSLIBS += pcre + endif + ifneq ($(filter -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + SYSLIBS += z + endif + SYSLIBS += rt dl +endif + +SYSLIBS += m diff --git a/harbour/config/linux/icc.mk b/harbour/config/linux/icc.mk index 359082a6d9..b2d3cf539a 100644 --- a/harbour/config/linux/icc.mk +++ b/harbour/config/linux/icc.mk @@ -44,45 +44,10 @@ endif LD := $(HB_CCACHE) $(HB_CMP) LD_OUT := -o -LIBPATHS := -L$(LIB_DIR) -LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) +LIBPATHS := $(LIB_DIR) -ifneq ($(filter hbrtl, $(LIBS)),) - # Add the specified GT driver library - ifneq ($(filter gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses - endif - LDLIBS += -l$(HB_CRS_LIB) - endif - ifneq ($(filter gtsln, $(LIBS)),) - LDLIBS += -lslang - endif - ifneq ($(filter gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib - endif - - # HB_GPM_MOUSE: use gpm mouse driver - ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm - endif - - ifneq ($(filter -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre - endif - - ifneq ($(filter -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz - endif - - LDLIBS += -lrt -ldl -endif - -LDLIBS += -lm - -LDFLAGS += $(LIBPATHS) +LDLIBS := $(foreach lib,$(LIBS) $(SYSLIBS),-l$(lib)) +LDFLAGS += $(foreach dir,$(LIBPATHS) $(SYSLIBPATHS),-L$(dir)) AR := xiar ARFLAGS := @@ -91,7 +56,7 @@ AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) crs $(LIB_DIR)/$@ $(^F) || ( $(RM) DY := $(CC) DFLAGS := -shared -fPIC DY_OUT := -o$(subst x,x, ) -DLIBS := +DLIBS := $(foreach lib,$(SYSLIBS),-l$(lib)) # NOTE: The empty line directly before 'endef' HAVE TO exist! define dyn_object @@ -101,7 +66,7 @@ endef define create_dynlib $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) $(foreach file,$^,$(dyn_object)) - $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ @__dyn__.tmp + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ @__dyn__.tmp $(DLIBS) endef DY_RULE = $(create_dynlib) diff --git a/harbour/config/linux/sunpro.mk b/harbour/config/linux/sunpro.mk index 2738785483..0f33460baa 100644 --- a/harbour/config/linux/sunpro.mk +++ b/harbour/config/linux/sunpro.mk @@ -62,44 +62,10 @@ endif LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) LD_OUT := -o$(subst x,x, ) -LIBPATHS := -L$(LIB_DIR) -LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) +LIBPATHS := $(LIB_DIR) -ifneq ($(filter hbrtl, $(LIBS)),) - # Add the specified GT driver library - ifneq ($(filter gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses - endif - LDLIBS += -l$(HB_CRS_LIB) - endif - ifneq ($(filter gtsln, $(LIBS)),) - LDLIBS += -lslang - endif - ifneq ($(filter gtxwc, $(LIBS)),) - LDLIBS += -lX11 - LIBPATHS += -L/usr/X11R6/lib - endif - - # HB_GPM_MOUSE: use gpm mouse driver - ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm - endif - - ifneq ($(filter -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre - endif - - ifneq ($(filter -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz - endif - - LDLIBS += -lrt -ldl -endif - -LDLIBS += -lm - -LDFLAGS += $(LIBPATHS) +LDLIBS := $(foreach lib,$(LIBS) $(SYSLIBS),-l$(lib)) +LDFLAGS += $(foreach dir,$(LIBPATHS) $(SYSLIBPATHS),-L$(dir)) AR := $(HB_CCPREFIX)ar ARFLAGS := @@ -111,8 +77,8 @@ ifneq ($(HB_BUILD_OPTIM),no) DFLAGS += -fast -xnolibmopt endif DY_OUT := -o$(subst x,x, ) -DLIBS := +DLIBS := $(foreach lib,$(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ +DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/source/Makefile b/harbour/source/Makefile index 6fa10d373b..3aeae6c7a7 100644 --- a/harbour/source/Makefile +++ b/harbour/source/Makefile @@ -19,7 +19,7 @@ else ifneq ($(HB_BUILD_DLL),no) - ifneq ($(HB_PLATFORM_UNIX),) + ifeq ($(HB_PLATFORM),darwin) DYNNAME_POST := .$(HB_DYN_VER) else DYNNAME_POST := -$(HB_DYN_VER) @@ -97,6 +97,7 @@ else DYNDIRLIST_BASE += source/rtl/gttrm DYNDIRLIST_BASE += source/rtl/gtcrs DYNDIRLIST_BASE += source/rtl/gtsln + DYNDIRLIST_BASE += source/rtl/gtxwc endif ifeq ($(HB_COMPILER),watcom) DYNDIRLIST_BASE += source/vm/maindllh