From 6fd88596fc32f6c93df280bc00520b9e1e83b382 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 27 Aug 2009 06:28:18 +0000 Subject: [PATCH] 2009-08-27 08:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/detfun.mk * config/detect.mk + Added positive platform/compiler filters. + Simplified internal platform/compiler filter syntax, now it's one unified list where compiler/platform can be mixed and negative filters can be passed by using '!' char prefix. ! In comment text. * source/rtl/gtsln/Makefile ! Fixed silly copy-paste mistake in recent autodetection changes. Thanks to Tamas Tevesz for spotting it. * source/rtl/gtsln/mousesln.c * Using macros instead of a constants. (2 -> STDERR_FILENO) --- harbour/ChangeLog | 19 ++++++++++++- harbour/config/detect.mk | 28 +++++------------- harbour/config/detfun.mk | 44 ++++++++++++++++++----------- harbour/source/rtl/gtsln/Makefile | 4 +-- harbour/source/rtl/gtsln/mousesln.c | 6 ++-- 5 files changed, 58 insertions(+), 43 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9ea9591a4d..5d1ada86df 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,23 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-27 08:27 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/detfun.mk + * config/detect.mk + + Added positive platform/compiler filters. + + Simplified internal platform/compiler filter syntax, now it's + one unified list where compiler/platform can be mixed and + negative filters can be passed by using '!' char prefix. + ! In comment text. + + * source/rtl/gtsln/Makefile + ! Fixed silly copy-paste mistake in recent autodetection changes. + Thanks to Tamas Tevesz for spotting it. + + * source/rtl/gtsln/mousesln.c + * Using macros instead of a constants. + (2 -> STDERR_FILENO) + 2009-08-27 01:40 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/bsd/gcc.mk * config/darwin/gcc.mk @@ -32,7 +49,7 @@ 2009-08-26 19:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/lib.mk - + Added hack to make hbpp hack (in source/pp/Makefile) happy. + + Added hack to make hbpp hack (in source/pp/Makefile) happy. Should fix missing 'pow' symbols reported on the list. * config/detect.mk diff --git a/harbour/config/detect.mk b/harbour/config/detect.mk index 89f70af701..c1c0785e1f 100644 --- a/harbour/config/detect.mk +++ b/harbour/config/detect.mk @@ -20,7 +20,8 @@ # HB_HAS_* variable with following possible contents: # (empty) - We can't use this component # - Component headers were found at these locations -# config/conf.mk if found, will +# +# config/conf.mk if present, is able to override HB_HAS_* values. ifeq ($(DETECT_MK_),) export DETECT_MK_ := yes @@ -60,10 +61,7 @@ endif _DET_DSP_NAME := OpenSSL _DET_VAR_INC_ := HB_INC_OPENSSL _DET_VAR_HAS_ := HB_HAS_OPENSSL -_DET_SUP_PLAT := -_DET_SUP_COMP := -_DET_UNS_PLAT := dos -_DET_UNS_COMP := watcom +_DET_SUP_FILT := !dos !watcom _DET_INC_DEFP := /usr/include /usr/local/ssl/include _DET_INC_HEAD := /openssl/ssl.h @@ -74,10 +72,7 @@ include $(TOP)$(ROOT)config/detfun.mk _DET_DSP_NAME := GPM _DET_VAR_INC_ := HB_INC_GPM _DET_VAR_HAS_ := HB_HAS_GPM -_DET_SUP_PLAT := linux -_DET_SUP_COMP := -_DET_UNS_PLAT := -_DET_UNS_COMP := +_DET_SUP_FILT := linux _DET_INC_DEFP := /usr/include /usr/local/include _DET_INC_HEAD := /gpm.h @@ -88,10 +83,7 @@ include $(TOP)$(ROOT)config/detfun.mk _DET_DSP_NAME := slang _DET_VAR_INC_ := HB_INC_SLANG _DET_VAR_HAS_ := HB_HAS_SLANG -_DET_SUP_PLAT := -_DET_SUP_COMP := -_DET_UNS_PLAT := -_DET_UNS_COMP := +_DET_SUP_FILT := _DET_INC_DEFP := _DET_INC_HEAD := /slang.h @@ -111,10 +103,7 @@ include $(TOP)$(ROOT)config/detfun.mk _DET_DSP_NAME := curses _DET_VAR_INC_ := HB_INC_CURSES _DET_VAR_HAS_ := HB_HAS_CURSES -_DET_SUP_PLAT := -_DET_SUP_COMP := -_DET_UNS_PLAT := os2 -_DET_UNS_COMP := +_DET_SUP_FILT := !os2 _DET_INC_DEFP := _DET_INC_HEAD := /curses.h @@ -134,10 +123,7 @@ include $(TOP)$(ROOT)config/detfun.mk _DET_DSP_NAME := X11 _DET_VAR_INC_ := HB_INC_X11 _DET_VAR_HAS_ := HB_HAS_X11 -_DET_SUP_PLAT := -_DET_SUP_COMP := -_DET_UNS_PLAT := -_DET_UNS_COMP := +_DET_SUP_FILT := _DET_INC_DEFP := /usr/include _DET_INC_HEAD := /X11/Xlib.h diff --git a/harbour/config/detfun.mk b/harbour/config/detfun.mk index d88c96b390..f2b3836482 100644 --- a/harbour/config/detfun.mk +++ b/harbour/config/detfun.mk @@ -21,31 +21,43 @@ endif ifeq ($($(_DET_VAR_HAS_)),) ifneq ($($(_DET_VAR_INC_)),no) - ifeq ($(filter $(HB_PLATFORM),$(_DET_UNS_PLAT)),) - ifeq ($(filter $(HB_COMPILER),$(_DET_UNS_COMP)),) - $(_DET_VAR_HAS_) := $($(_DET_VAR_INC_)) - ifeq ($($(_DET_VAR_HAS_)),) - ifeq ($(HB_XBUILD),) - $(_DET_VAR_HAS_) := $(_DET_INC_DEFP) - endif - endif - ifneq ($($(_DET_VAR_HAS_)),) - $(_DET_VAR_HAS_) := $(strip $(foreach d,$($(_DET_VAR_HAS_)),$(if $(wildcard $(d)$(_DET_INC_HEAD)),$(d),))) - ifeq ($($(_DET_VAR_HAS_)),) - $(call do_info,$(_DET_DSP_NAME) not found) + _DET_POS := $(filter-out !%,$(_DET_SUP_FILT)) + _DET_NEG := $(subst !,,$(filter !%,$(_DET_SUP_FILT))) + ifneq ($(if $(_DET_POS),$(filter $(HB_PLATFORM),$(_DET_POS)),ok),) + ifeq ($(filter $(HB_PLATFORM),$(_DET_NEG)),) + ifneq ($(if $(_DET_POS),$(filter $(HB_COMPILER),$(_DET_POS)),ok),) + ifeq ($(filter $(HB_COMPILER),$(_DET_NEG)),) + $(_DET_VAR_HAS_) := $($(_DET_VAR_INC_)) + ifeq ($($(_DET_VAR_HAS_)),) + ifeq ($(HB_XBUILD),) + $(_DET_VAR_HAS_) := $(_DET_INC_DEFP) + endif + endif + ifneq ($($(_DET_VAR_HAS_)),) + $(_DET_VAR_HAS_) := $(strip $(foreach d,$($(_DET_VAR_HAS_)),$(if $(wildcard $(d)$(_DET_INC_HEAD)),$(d),))) + ifeq ($($(_DET_VAR_HAS_)),) + $(call do_info,$(_DET_DSP_NAME) not found) + else + $(call do_info,$(_DET_DSP_NAME) found in $($(_DET_VAR_HAS_))) + endif + else + $(call do_info,$(_DET_DSP_NAME) location not specified) + endif else - $(call do_info,$(_DET_DSP_NAME) found in $($(_DET_VAR_HAS_))) + $(call do_info,$(_DET_DSP_NAME) not supported with $(HB_COMPILER) compiler) endif else - $(call do_info,$(_DET_DSP_NAME) location not specified) + $(call do_info,$(_DET_DSP_NAME) not supported with $(HB_COMPILER) compiler) endif else - $(call do_info,$(_DET_DSP_NAME) not supported with $(HB_COMPILER) compiler) + $(call do_info,$(_DET_DSP_NAME) not supported on $(HB_PLATFORM) platform) endif else $(call do_info,$(_DET_DSP_NAME) not supported on $(HB_PLATFORM) platform) endif + _DET_POS := + _DET_NEG := else - $(call do_info,$(_DET_DSP_NAME) explicitly deselected) + $(call do_info,$(_DET_DSP_NAME) explicitly disabled) endif endif diff --git a/harbour/source/rtl/gtsln/Makefile b/harbour/source/rtl/gtsln/Makefile index 4c79968a6c..0ecb90a316 100644 --- a/harbour/source/rtl/gtsln/Makefile +++ b/harbour/source/rtl/gtsln/Makefile @@ -17,9 +17,9 @@ C_SOURCES := \ # LDFLAGS := -L/usr/local/lib $(LDFLAGS) # LDFLAGS := -L/usr/lib/slang -L/usr/local/lib -L/usr/local/lib/slang $(LDFLAGS) -ifneq ($(HB_HAS_CURSES),) +ifneq ($(HB_HAS_SLANG),) - HB_CFLAGS += $(foreach d,$(HB_HAS_CURSES),-I$(d)) + HB_CFLAGS += $(foreach d,$(HB_HAS_SLANG),-I$(d)) ifneq ($(HB_HAS_GPM),) HB_CFLAGS += -DHB_HAS_GPM diff --git a/harbour/source/rtl/gtsln/mousesln.c b/harbour/source/rtl/gtsln/mousesln.c index 84ff5d5cf9..3fcd99fb20 100644 --- a/harbour/source/rtl/gtsln/mousesln.c +++ b/harbour/source/rtl/gtsln/mousesln.c @@ -354,9 +354,9 @@ void hb_gt_sln_mouse_Init( void ) #ifdef HB_GPM_NOICE_DISABLE int iNull, iErr; - iErr = dup( 2 ); + iErr = dup( STDERR_FILENO ); iNull = open( "/dev/null", O_RDWR ); - dup2( iNull, 2 ); + dup2( iNull, STDERR_FILENO ); close( iNull ); #endif Conn.eventMask = GPM_MOVE | GPM_UP | GPM_DOWN | GPM_DRAG | GPM_DOUBLE; @@ -390,7 +390,7 @@ void hb_gt_sln_mouse_Init( void ) hb_gt_sln_mouse_FixTrash(); } #ifdef HB_GPM_NOICE_DISABLE - dup2( iErr, 2 ); + dup2( iErr, STDERR_FILENO ); close( iErr ); #endif }