diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8a490c876f..1f179d9e63 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,55 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-12 14:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/rules.cf + ! Changed CC_RULE and CPP_RULE to have CC_OUT option _before_ CC_IN. + Quick check didn't reveal any problems with this accross our supported + compiler, but I may be wrong, so pls check me, I didn't test this + change thoroughly. + This change fixes CC_OUT for bcc, where it was ignored before. + If this is breaks other compilers, bcc specific CC_RULE should be + added to win/bcc.cf. + + * utils/hbmk2/hbmk2.prg + * source/rtl/gtcrs/gtcrs.c + * source/rtl/gtcrs/gtcrs.h + * source/rtl/gtcrs/Makefile + * source/rtl/gttrm/Makefile + * source/rtl/gttrm/gttrm.c + * source/rtl/gtsln/mousesln.c + * source/rtl/gtsln/gtsln.c + * source/rtl/gtsln/Makefile + * HAVE_GPM_H -> HB_HAS_GPM + + * config/global.cf + + Added some compile-time macros in comment. + * Minor correction to MKFLAGS comment. + + * source/rtl/console.c + * source/rtl/hbgtcore.c + * Changed wording 'screen driver' to 'Harbour terminal (GT)'. + Former term isn't used by us. + + * config/bsd/gcc.cf + * config/darwin/gcc.cf + * config/hpux/gcc.cf + * config/dos/djgpp.cf + * config/linux/gcc.cf + * config/linux/icc.cf + * config/linux/sunpro.cf + * config/os2/gcc.cf + * config/sunos/gcc.cf + * config/sunos/sunpro.cf + + Readded accidentally deleted feature to include *nix system + libs needed for rtl, only if rtl is actually linked. + (IOW in practice don't link them for harbour/hbpp executables) + ! Fixed a few old problems where some extra libs were always + linked. Now m is the only one linked in all scenarios. + + Added linking pdcurses along with gtcrs for djgpp. + * Standardized LDFLAGS in linux/icc (left from previous modification). + ! Indentations corrected. + 2009-08-12 14:36 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * updated list of system libraries used in to create harbour*.dll diff --git a/harbour/config/bsd/gcc.cf b/harbour/config/bsd/gcc.cf index b060d85dd1..f7dca9c153 100644 --- a/harbour/config/bsd/gcc.cf +++ b/harbour/config/bsd/gcc.cf @@ -38,34 +38,36 @@ LD_OUT := -o LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library and other RTLs -ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses -endif -ifneq ($(findstring gtcrs, $(LIBS)),) - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang - # In BSD, slang still needs curses :( - ifeq ($(findstring gtcrs, $(LIBS)),) +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library and other RTLs + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + ifneq ($(findstring gtcrs, $(LIBS)),) LDLIBS += -l$(HB_CRS_LIB) endif -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib -endif + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + # In BSD, slang still needs curses :( + ifeq ($(findstring gtcrs, $(LIBS)),) + LDLIBS += -l$(HB_CRS_LIB) + endif + endif + ifneq ($(findstring gtxwc, $(LIBS)),) + LDLIBS += -lX11 + #LIBPATHS += -L/usr/X11R6/lib64 + LIBPATHS += -L/usr/X11R6/lib + endif -LIBPATHS += -L/usr/local/lib + LIBPATHS += -L/usr/local/lib -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif + ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif endif LDLIBS += -lm diff --git a/harbour/config/darwin/gcc.cf b/harbour/config/darwin/gcc.cf index 3109ae9477..a81956256b 100644 --- a/harbour/config/darwin/gcc.cf +++ b/harbour/config/darwin/gcc.cf @@ -51,32 +51,34 @@ LD_OUT := -o$(subst x,x, ) LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library and other RTLs -ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses -endif -ifneq ($(findstring gtcrs, $(LIBS)),) - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang - # In BSD, slang still needs curses :( - ifeq ($(findstring gtcrs, $(LIBS)),) +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library and other RTLs + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + ifneq ($(findstring gtcrs, $(LIBS)),) LDLIBS += -l$(HB_CRS_LIB) endif -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib -endif + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + # In BSD, slang still needs curses :( + ifeq ($(findstring gtcrs, $(LIBS)),) + LDLIBS += -l$(HB_CRS_LIB) + endif + endif + ifneq ($(findstring gtxwc, $(LIBS)),) + LDLIBS += -lX11 + #LIBPATHS += -L/usr/X11R6/lib64 + LIBPATHS += -L/usr/X11R6/lib + endif -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif + ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif endif LDLIBS += -lm diff --git a/harbour/config/dos/djgpp.cf b/harbour/config/dos/djgpp.cf index 2229be177c..7d75ec655a 100644 --- a/harbour/config/dos/djgpp.cf +++ b/harbour/config/dos/djgpp.cf @@ -38,6 +38,17 @@ LD_OUT := -o LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) + +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library and other RTLs + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := pdcurses + endif + ifneq ($(findstring gtcrs, $(LIBS)),) + LDLIBS += -l$(HB_CRS_LIB) + endif +endif + LDLIBS += -lm # NOTE: The empty line directly before 'endef' HAVE TO exist! diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 2ba20c73af..5e2cf292f1 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -178,6 +178,9 @@ ifeq ($(HB_CONFIG_SHOWN),) # HB_HOST_BUILD [yes|lib], HB_XBUILD, HB_WITHOUT_*, HB_REBUILD_PARSER, HB_DB_DRVEXT # HB_COMMERCE, HB_CRS_LIB, HB_BUILD_VERBOSE, HB_BIN_COMPILE, HB_INC_COMPILE # HB_POSTINST, HB_ROOTPOSTINST, HB_POSTINSTPARAM, HB_GCMODE + # HB_GPM_NOICE_DISABLE, HB_GT_CRS_BCEHACK, HB_NCURSES_194 + # Macros: + # -DHB_PCRE_REGEX, -DHB_POSIX_REGEX, -DHB_EXT_ZLIB, -DHB_HAS_GPM ifeq ($(HB_DYNLIB),yes) $(info ! Dynamic library creation phase) @@ -751,7 +754,7 @@ export HARBOURCMD := export CLIPPER := export CLIPPERCMD := -# relevant only for win/dos hosts +# relevant only for non-*nix hosts MKFLAGS := --no-print-directory include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf diff --git a/harbour/config/hpux/gcc.cf b/harbour/config/hpux/gcc.cf index d46afe1680..fa54da7de2 100644 --- a/harbour/config/hpux/gcc.cf +++ b/harbour/config/hpux/gcc.cf @@ -45,31 +45,35 @@ LD_OUT := -o LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library -ifneq ($(findstring gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library + ifneq ($(findstring gtcrs, $(LIBS)),) + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + LDLIBS += -l$(HB_CRS_LIB) endif - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + endif + ifneq ($(findstring gtxwc, $(LIBS)),) + LDLIBS += -lX11 + #LIBPATHS += -L/usr/X11R6/lib64 + LIBPATHS += -L/usr/X11R6/lib + endif + + ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif + + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif + + LDLIBS += -lrt endif -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif - -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz -endif - -LDLIBS += -lm -lrt +LDLIBS += -lm LDFLAGS += $(LIBPATHS) diff --git a/harbour/config/linux/gcc.cf b/harbour/config/linux/gcc.cf index 0ffde8efcd..9f4c32f8e9 100644 --- a/harbour/config/linux/gcc.cf +++ b/harbour/config/linux/gcc.cf @@ -44,36 +44,40 @@ LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library and other RTLs -ifneq ($(findstring gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library and other RTLs + ifneq ($(findstring gtcrs, $(LIBS)),) + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + LDLIBS += -l$(HB_CRS_LIB) endif - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + endif + ifneq ($(findstring 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 ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif + + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif + + LDLIBS += -lrt -ldl endif -# HB_GPM_MOUSE: use gpm mouse driver -ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm -endif - -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif - -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz -endif - -LDLIBS += -lm -lrt -ldl +LDLIBS += -lm LDFLAGS += $(LIBPATHS) diff --git a/harbour/config/linux/icc.cf b/harbour/config/linux/icc.cf index 5d3a9c267d..a3d10aace3 100644 --- a/harbour/config/linux/icc.cf +++ b/harbour/config/linux/icc.cf @@ -17,7 +17,10 @@ CC_IN := -c CC_OUT := -o CPPFLAGS := -I. -I$(HB_INC_COMPILE) -CFLAGS := -D_GNU_SOURCE +CFLAGS := +LDFLAGS := + +CFLAGS += -D_GNU_SOURCE #CFLAGS += -fast #CFLAGS += -xHOST #CFLAGS += -std=c99 @@ -46,38 +49,42 @@ LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library and other RTLs -ifneq ($(findstring gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library and other RTLs + ifneq ($(findstring gtcrs, $(LIBS)),) + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + LDLIBS += -l$(HB_CRS_LIB) endif - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - #LIBPATHS += -L/usr/X11R6/lib64 - LIBPATHS += -L/usr/X11R6/lib + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + endif + ifneq ($(findstring 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 ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif + + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif + + LDLIBS += -lrt -ldl endif -# HB_GPM_MOUSE: use gpm mouse driver -ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm -endif +LDLIBS += -lm -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif - -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz -endif - -LDLIBS += -lm -lrt -ldl - -LDFLAGS := $(LIBPATHS) +LDFLAGS += $(LIBPATHS) AR := xiar ARFLAGS := diff --git a/harbour/config/linux/sunpro.cf b/harbour/config/linux/sunpro.cf index 348f32eec2..e6e66d66d0 100644 --- a/harbour/config/linux/sunpro.cf +++ b/harbour/config/linux/sunpro.cf @@ -68,35 +68,39 @@ LD_OUT := -o$(subst x,x, ) LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) -# Add the specified GT driver library -ifneq ($(findstring gtcrs, $(LIBS)),) - ifeq ($(HB_CRS_LIB),) - HB_CRS_LIB := ncurses +ifneq ($(findstring hbrtl, $(LIBS)),) + # Add the specified GT driver library + ifneq ($(findstring gtcrs, $(LIBS)),) + ifeq ($(HB_CRS_LIB),) + HB_CRS_LIB := ncurses + endif + LDLIBS += -l$(HB_CRS_LIB) endif - LDLIBS += -l$(HB_CRS_LIB) -endif -ifneq ($(findstring gtsln, $(LIBS)),) - LDLIBS += -lslang -endif -ifneq ($(findstring gtxwc, $(LIBS)),) - LDLIBS += -lX11 - LIBPATHS += -L/usr/X11R6/lib + ifneq ($(findstring gtsln, $(LIBS)),) + LDLIBS += -lslang + endif + ifneq ($(findstring 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 ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) + LDLIBS += -lpcre + endif + + ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) + LDLIBS += -lz + endif + + LDLIBS += -lrt -ldl endif -# HB_GPM_MOUSE: use gpm mouse driver -ifeq ($(HB_GPM_MOUSE),yes) - LDLIBS += -lgpm -endif - -ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) - LDLIBS += -lpcre -endif - -ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) - LDLIBS += -lz -endif - -LDLIBS += -lm -lrt -ldl +LDLIBS += -lm LDFLAGS += $(LIBPATHS) diff --git a/harbour/config/os2/gcc.cf b/harbour/config/os2/gcc.cf index 2551c41a75..cdaf6fcf95 100644 --- a/harbour/config/os2/gcc.cf +++ b/harbour/config/os2/gcc.cf @@ -47,7 +47,7 @@ LIBPATHS := -L$(LIB_DIR) LDLIBS := $(foreach lib,$(LIBS),-l$(lib)) # Add the specified GT driver library -ifeq ($(findstring hbrtl,$(LIBS)),hbrtl) +ifneq ($(findstring hbrtl, $(LIBS)),) ifeq ($(C_MAIN),) ifeq ($(findstring os2pm,$(HB_GT_LIB)),os2pm) # Special handling for PM mode @@ -55,10 +55,9 @@ ifeq ($(findstring hbrtl,$(LIBS)),hbrtl) LDLIBS += -lgtos2 endif endif -endif -# add socket library -LDLIBS += -lsocket + LDLIBS += -lsocket +endif # statical linking with GCC 3.2.2 libc as not require its presence on user system LDFLAGS += $(LIBPATHS) diff --git a/harbour/config/rules.cf b/harbour/config/rules.cf index a8364b7088..9a3e514696 100644 --- a/harbour/config/rules.cf +++ b/harbour/config/rules.cf @@ -33,12 +33,12 @@ HB_RULE = $(HB) $? -n1 $(HB_INC_DEPEND) $(HB_FLAGS) -gc$(HB_GCMODE) $(HB_FLAGSEX # The rule to compile a C source file. ifeq ($(CC_RULE),) - CC_RULE = $(CC) $(HB_INC_DEPEND) $(CPPFLAGS) $(CFLAGS) $(HB_CDBG) $(HB_USER_CFLAGS) $(HB_CDYNLIB) $(HB_CUNICODE) $(CC_IN) $< $(CC_OUT)$(mouse_type == MOUSE_GPM && gpm_visiblepointer ) { Gpm_DrawPointer( ioBase->mLastEvt.col, ioBase->mLastEvt.row, @@ -1245,7 +1245,7 @@ static void mouse_init( InOutBase * ioBase ) if ( ioBase->mButtons < 1 ) ioBase->mButtons = 3; } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) else if ( ioBase->terminal_type == TERM_LINUX ) { ioBase->Conn.eventMask = @@ -1291,7 +1291,7 @@ static void mouse_exit( InOutBase * ioBase ) /* disable mouse tracking & restore old hilit tracking */ write_ttyseq( ioBase, "\033[?1002l\033[?1001r" ); } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) else if ( ioBase->mouse_type == MOUSE_GPM && gpm_fd >= 0 ) { del_efds( ioBase, gpm_fd ); @@ -2708,7 +2708,7 @@ static void hb_gt_crs_mouse_Show( PHB_GT pGT ) HB_SYMBOL_UNUSED( pGT ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( s_ioBase->mouse_type == MOUSE_GPM ) gpm_visiblepointer = 1; #endif @@ -2723,7 +2723,7 @@ static void hb_gt_crs_mouse_Hide( PHB_GT pGT ) HB_SYMBOL_UNUSED( pGT ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( s_ioBase->mouse_type == MOUSE_GPM ) { gpm_visiblepointer = 0; diff --git a/harbour/source/rtl/gtcrs/gtcrs.h b/harbour/source/rtl/gtcrs/gtcrs.h index 7ad0eb86f8..27aec3192b 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.h +++ b/harbour/source/rtl/gtcrs/gtcrs.h @@ -79,8 +79,8 @@ # include # endif #endif -#ifdef HAVE_GPM_H -# include +#if defined( HB_HAS_GPM ) +# include #endif #include @@ -99,19 +99,19 @@ #include #include #if ( defined( HB_OS_LINUX ) || defined( HB_OS_BSD ) ) && !defined( __WATCOMC__ ) -# if defined( HB_OS_LINUX ) -# include /* for openpty and forkpty */ -# elif defined( HB_OS_DARWIN ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) -# include /* for openpty and forkpty */ -# if defined( __NetBSD__ ) -# include -# define tigetnum(id) tgetnum(id) -# define tigetstr(id) tgetstr(id,NULL) +# if defined( HB_OS_LINUX ) +# include /* for openpty and forkpty */ +# elif defined( HB_OS_DARWIN ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) +# include /* for openpty and forkpty */ +# if defined( __NetBSD__ ) +# include +# define tigetnum(id) tgetnum(id) +# define tigetstr(id) tgetstr(id,NULL) +# endif +# elif defined( HB_OS_BSD ) +# include /* for openpty and forkpty */ # endif -# elif defined( HB_OS_BSD ) -# include /* for openpty and forkpty */ -# endif -# include /* for login_tty */ +# include /* for login_tty */ #endif #ifndef O_ACCMODE diff --git a/harbour/source/rtl/gtsln/Makefile b/harbour/source/rtl/gtsln/Makefile index 5f84690a3f..6508287599 100644 --- a/harbour/source/rtl/gtsln/Makefile +++ b/harbour/source/rtl/gtsln/Makefile @@ -37,7 +37,7 @@ HB_INC_SLANG_OK += $(foreach d, $(HB_INC_SLANG), $(if $(wildcard $(d)/slang.h),$ ifneq ($(strip $(HB_INC_SLANG_OK)),) ifeq ($(HB_GPM_MOUSE),yes) - HB_USER_CFLAGS += -DHAVE_GPM_H + HB_USER_CFLAGS += -DHB_HAS_GPM ifeq ($(HB_GPM_NOICE_DISABLE),yes) HB_USER_CFLAGS += -DHB_GPM_NOICE_DISABLE endif diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index 4b51297b30..d1aecc600c 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -907,7 +907,7 @@ static BOOL hb_gt_sln_Resume( PHB_GT pGT ) hb_sln_Init_Terminal( 1 ) != -1 ) { SLsmg_refresh(); /* reinitialize a terminal */ -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) hb_gt_sln_mouse_FixTrash(); #endif s_bSuspended = FALSE; @@ -923,7 +923,7 @@ static BOOL hb_gt_sln_PreExt( PHB_GT pGT ) HB_SYMBOL_UNUSED( pGT ); SLsmg_refresh(); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) hb_gt_sln_mouse_FixTrash(); #endif return TRUE; diff --git a/harbour/source/rtl/gtsln/mousesln.c b/harbour/source/rtl/gtsln/mousesln.c index 86369d5dcf..84ff5d5cf9 100644 --- a/harbour/source/rtl/gtsln/mousesln.c +++ b/harbour/source/rtl/gtsln/mousesln.c @@ -54,7 +54,7 @@ #include "gtsln.h" #include -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) #include #include #include @@ -80,7 +80,7 @@ static struct timeval mRightDblckTime; /* *********************************************************************** */ -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) static BOOL GetGpmEvent( Gpm_Event *Evt ) { if( s_bMousePresent && gpm_fd >= 0 ) @@ -271,7 +271,7 @@ int hb_gt_sln_mouse_Inkey( int iEventMask, BOOL fCheckNew ) } } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) #define CHECK_BUTTON_DOWN(Mask,GpmBtn,InkBtn,InkDbl) \ if( ( iEventMask & Mask ) && ( Evt.buttons & GpmBtn ) ) \ @@ -348,7 +348,7 @@ void hb_gt_sln_mouse_Init( void ) s_bMousePresent = TRUE; } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) else if( hb_sln_UnderLinuxConsole ) { #ifdef HB_GPM_NOICE_DISABLE @@ -416,7 +416,7 @@ void hb_gt_sln_mouse_Exit( void ) /* force mouse usage under xterm */ (void)SLtt_set_mouse_mode( 0, 1 ); } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) else if( hb_sln_UnderLinuxConsole ) { if( gpm_fd >= 0 ) @@ -442,7 +442,7 @@ void hb_gt_sln_mouse_Show( PHB_GT pGT ) { HB_SYMBOL_UNUSED( pGT ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) gpm_visiblepointer = 1; if( hb_sln_UnderLinuxConsole && s_bMousePresent ) Gpm_DrawPointer( s_iMouseCol, s_iMouseRow, gpm_consolefd ); @@ -456,7 +456,7 @@ void hb_gt_sln_mouse_Hide( PHB_GT pGT ) { HB_SYMBOL_UNUSED( pGT ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) gpm_visiblepointer = 0; #endif ; @@ -481,7 +481,7 @@ void hb_gt_sln_mouse_SetPos( PHB_GT pGT, int iRow, int iCol ) /* it does really nothing */ s_iMouseRow = iRow; s_iMouseCol = iCol; -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( hb_sln_UnderLinuxConsole ) if( s_bMousePresent && gpm_visiblepointer ) Gpm_DrawPointer( iCol, iRow, gpm_consolefd ); @@ -520,7 +520,7 @@ int hb_gt_sln_mouse_CountButton( PHB_GT pGT ) void hb_gt_sln_mouse_FixTrash( void ) { -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( hb_sln_UnderLinuxConsole ) if( s_bMousePresent && gpm_visiblepointer ) Gpm_DrawPointer( s_iMouseCol, s_iMouseRow, gpm_consolefd ); diff --git a/harbour/source/rtl/gttrm/Makefile b/harbour/source/rtl/gttrm/Makefile index 7b8d1b2fb3..3ca139b44e 100644 --- a/harbour/source/rtl/gttrm/Makefile +++ b/harbour/source/rtl/gttrm/Makefile @@ -34,7 +34,7 @@ endif ifeq ($(HB_WITH_GTTRM),yes) ifeq ($(HB_GPM_MOUSE),yes) - HB_USER_CFLAGS += -DHAVE_GPM_H + HB_USER_CFLAGS += -DHB_HAS_GPM ifeq ($(HB_GPM_NOICE_DISABLE),yes) HB_USER_CFLAGS += -DHB_GPM_NOICE_DISABLE endif diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index f481e3cb99..95260df2ac 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -91,7 +91,7 @@ # include # include #endif -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) # include #endif @@ -361,7 +361,7 @@ typedef struct _HB_GTTRM int nTermMouseChars; unsigned char cTermMouseBuf[3]; mouseEvent mLastEvt; -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) Gpm_Connect Conn; #endif @@ -830,7 +830,7 @@ static int add_efds( PHB_GTTRM pTerm, int fd, int mode, return fd; } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) static void del_efds( PHB_GTTRM pTerm, int fd ) { int i, n = -1; @@ -1030,7 +1030,7 @@ static void set_tmevt( PHB_GTTRM pTerm, unsigned char *cMBuf, mouseEvent * mEvt return; } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) static int set_gpmevt( int fd, int mode, void *cargo ) { int nKey = 0; @@ -1094,7 +1094,7 @@ static void flush_gpmevt( PHB_GTTRM pTerm ) static void disp_mousecursor( PHB_GTTRM pTerm ) { -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( (pTerm->mouse_type & MOUSE_GPM) && gpm_visiblepointer ) { Gpm_DrawPointer( pTerm->mLastEvt.col, pTerm->mLastEvt.row, @@ -1116,7 +1116,7 @@ static void mouse_init( PHB_GTTRM pTerm ) pTerm->mouse_type |= MOUSE_XTERM; pTerm->mButtons = 3; } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( pTerm->terminal_type == TERM_LINUX ) { pTerm->Conn.eventMask = @@ -1160,7 +1160,7 @@ static void mouse_exit( PHB_GTTRM pTerm ) hb_gt_trm_termOut( pTerm, s_szMouseOff, strlen( s_szMouseOff ) ); hb_gt_trm_termFlush( pTerm ); } -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( (pTerm->mouse_type & MOUSE_GPM) && gpm_fd >= 0 ) { del_efds( pTerm, gpm_fd ); @@ -3055,7 +3055,7 @@ static void hb_gt_trm_mouse_Show( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Show(%p)", pGT ) ); pTerm = HB_GTTRM_GET( pGT ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( pTerm->mouse_type & MOUSE_GPM ) gpm_visiblepointer = 1; #endif @@ -3066,7 +3066,7 @@ static void hb_gt_trm_mouse_Hide( PHB_GT pGT ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Hide(%p)", pGT ) ); -#ifdef HAVE_GPM_H +#if defined( HB_HAS_GPM ) if( HB_GTTRM_GET( pGT )->mouse_type & MOUSE_GPM ) { gpm_visiblepointer = 0; diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index d732a689c2..ccf25835d2 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -3187,7 +3187,7 @@ PHB_GT hb_gtLoad( const char * szGtName, PHB_GT pGT, PHB_GT_FUNCS pSuperTable ) if( hb_stricmp( szGtName, "nul" ) == 0 || hb_stricmp( szGtName, "null" ) == 0 ) { if( pGT || pSuperTable ) - hb_errInternal( 9998, "Screen driver initialization failure", NULL, NULL ); + hb_errInternal( 9998, "Harbour terminal (GT) initialization failure", NULL, NULL ); pGT = ( PHB_GT_BASE ) hb_xgrab( sizeof( HB_GT_BASE ) ); memset( pGT, 0, sizeof( HB_GT_BASE ) ); @@ -3362,7 +3362,7 @@ void hb_gtStartupInit( void ) return; } - hb_errInternal( 9998, "Screen driver initialization failure", NULL, NULL ); + hb_errInternal( 9998, "Harbour terminal (GT) initialization failure", NULL, NULL ); /* not executed, only to force linking HB_GTSYS() */ HB_FUNC_EXEC( HB_GTSYS ); diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index affff0cafe..ef9839adce 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2098,7 +2098,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) AAdd( l_aLIBSYS, "z" ) l_lHB_ZLIB := .F. ENDIF - IF "-DHAVE_GPM_H" $ cSelfFlagC + IF "-DHB_HAS_GPM" $ cSelfFlagC AAdd( l_aLIBSYS, "gpm" ) ENDIF