From 388945fedfd38ad9b51aab32e0eb0c52db73cd26 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 4 Jul 2010 22:58:12 +0000 Subject: [PATCH] 2010-07-05 00:57 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/common/hbver.c * src/rtl/Makefile [t] * src/rdd/Makefile [t] * include/hbdefs.h * include/hbsetup.h + config/bsd/pcc.mk * config/rules.mk [t] + First step to add support for pcc (Portable C Compiler) on bsd. ; Patch by Tamas Tevesz. ; TODO: ? I guess the -gc3 and -l disabler hacks are temporary. (in files marked with [t]) --- harbour/ChangeLog | 31 ++++++++++++------ harbour/config/bsd/pcc.mk | 65 ++++++++++++++++++++++++++++++++++++++ harbour/config/rules.mk | 4 ++- harbour/include/hbdefs.h | 2 +- harbour/include/hbsetup.h | 1 + harbour/src/common/hbver.c | 13 ++++++++ harbour/src/rdd/Makefile | 4 ++- harbour/src/rtl/Makefile | 4 ++- 8 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 harbour/config/bsd/pcc.mk diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 103a00e5a0..3f7065634d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,9 +16,22 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-05 00:57 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/common/hbver.c + * src/rtl/Makefile [t] + * src/rdd/Makefile [t] + * include/hbdefs.h + * include/hbsetup.h + + config/bsd/pcc.mk + * config/rules.mk [t] + + First step to add support for pcc (Portable C Compiler) on bsd. + ; Patch by Tamas Tevesz. + ; TODO: ? I guess the -gc3 and -l disabler hacks are temporary. + (in files marked with [t]) + 2010-07-04 15:48 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/ideplugins.prg - + Extended auto execuable scripts to have .hbs extension + + Extended auto execuable scripts to have .hbs extension besides .prg. 2010-07-04 15:18 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) @@ -29,23 +42,23 @@ * contrib/hbide/hbide.prg + Implemented: execution of auto scripts. Any .prg placed in /plugins folder with "auto_" prefix, - f.e., /harbour/contrib/hbide/plugins/auto_setenv.prg + f.e., /harbour/contrib/hbide/plugins/auto_setenv.prg will be executed just after hbIDE dialog is made visible. - hbIDE itself is passed as only parameter sent to the + hbIDE itself is passed as only parameter sent to the script. The idea is to allow developers of miscllaneous GUI libraries to setup their own environment variables. - Another aspect of this feature could be changing the + Another aspect of this feature could be changing the behavior of hbIDE itself through its various component objects, though it may need some more API functions. - An idea which can be extended and offers developers + An idea which can be extended and offers developers greater control over the affairs. ! Modified last commit's missing entry. 2010-07-04 14:17 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbqt_hbqplaintextedit.cpp - ! Fixed: horizontal selection where background color was - missed by a couple of pixels to the left. + ! Fixed: horizontal selection where background color was + missed by a couple of pixels to the left. * contrib/hbide/idefindreplace.prg ! Fixed to not "find" twice if "Return" is pressed. @@ -55,11 +68,11 @@ 2010-07-04 21:25 UTC+0200 Jacek Kubica (kubica@wssk.wroc.pl) * examples/httpsrv/modules/tableservletdb.prg - ! Fixed: mismatch error in two methods declaration + ! Fixed: mismatch error in two methods declaration 2010-07-04 12:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/hbqt_hbqplaintextedit.cpp - ! Fixed: one more glitch in selected text background color + ! Fixed: one more glitch in selected text background color off by few pixels verically - now the bottom line. 2010-07-04 12:20 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) diff --git a/harbour/config/bsd/pcc.mk b/harbour/config/bsd/pcc.mk new file mode 100644 index 0000000000..ce3e74193f --- /dev/null +++ b/harbour/config/bsd/pcc.mk @@ -0,0 +1,65 @@ +# +# $Id$ +# + +ifeq ($(HB_BUILD_MODE),cpp) + HB_BUILD_MODE := c +endif + +HB_CMP := pcc + +OBJ_EXT := .o +LIB_PREF := lib +LIB_EXT := .a + +CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) +CC_IN := -c +CC_OUT := -o$(subst x,x, ) + +CFLAGS += -I. -I$(HB_INC_COMPILE) -fpic + +# Warning and optimization options are not stable yet +#ifneq ($(HB_BUILD_WARN),no) +# CFLAGS += +#else +# CFLAGS += +#endif +# +#ifneq ($(HB_BUILD_OPTIM),no) +# CFLAGS += -O +#endif + +ifeq ($(HB_BUILD_DEBUG),yes) + CFLAGS += -g +endif + +LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) +LD_OUT := -o$(subst x,x, ) + +LIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS),-L$(dir)) +LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib)) + +LDFLAGS += $(LIBPATHS) + +AR := $(HB_CCPREFIX)ar +AR_RULE = ( $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ $(^F) $(ARSTRIP) ) || ( $(RM) $(LIB_DIR)/$@ && $(FALSE) ) + +DY := $(CC) +DFLAGS += -shared $(LIBPATHS) +DY_OUT := -o$(subst x,x, ) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) + +# NOTE: The empty line directly before 'endef' HAVE TO exist! +define dynlib_object + @$(ECHO) $(ECHOQUOTE)INPUT($(subst \,/,$(file)))$(ECHOQUOTE) >> __dyn__.tmp + +endef +define create_dynlib + $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) + $(foreach file,$^,$(dynlib_object)) + $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ __dyn__.tmp $(DLIBS) $(DYSTRIP) +endef + +DY_RULE = $(create_dynlib) + +include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/rules.mk b/harbour/config/rules.mk index bef09b4bb2..edd78ba262 100644 --- a/harbour/config/rules.mk +++ b/harbour/config/rules.mk @@ -9,7 +9,9 @@ YACC_FLAGS := -d $(YACC_FLAGS) ifeq ($(HB_BUILD_DEBUG),yes) HB_CFLAGS := -DHB_TR_LEVEL_DEBUG $(HB_CFLAGS) else - HB_PRGFLAGS := -l $(HB_PRGFLAGS) + ifneq ($(HB_COMPILER),pcc) + HB_PRGFLAGS := -l $(HB_PRGFLAGS) + endif endif HB_CFLAGS := -DHB_LEGACY_TYPES_OFF $(HB_CFLAGS) diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 15069f2619..1251b0a6e3 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -839,7 +839,7 @@ typedef HB_U32 HB_FATTR; #if defined( __GNUC__ ) # if ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3 ) ) && \ - ! defined( __ICC ) && !defined( __OPENCC__ ) + ! defined( __ICC ) && !defined( __OPENCC__ ) && !defined( __PCC__ ) # define HB_BUILTIN_BSWAP 1 # else # define HB_BUILTIN_BSWAP 0 diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 960b41b438..656da09462 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -495,6 +495,7 @@ # endif # if ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 1 ) ) && \ !defined( __ICC ) && !defined( __clang__ ) && \ + !defined( __PCC__ ) && \ !defined( HB_NO_FLATTEN ) #define HB_FLATTEN_ATTR \ __attribute__ (( flatten )) diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index 7b5b34cf2c..32b09ed372 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -740,6 +740,19 @@ char * hb_verCompiler( void ) iVerPatch = 0; #endif +#elif defined( __PCC__ ) + + pszName = "Portable C Compiler"; + + iVerMajor = __PCC__; + iVerMinor = __PCC_MINOR__; + iVerPatch = __PCC_MINORMINOR__; + + #if defined( __GCC__ ) + hb_strncpy( szSub, "(with GCC %d.%d.%d emulation)", + __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__ ) + #endif + #elif defined( __GNUC__ ) #if defined( __DJGPP__ ) diff --git a/harbour/src/rdd/Makefile b/harbour/src/rdd/Makefile index f26854d51c..76e910f29a 100644 --- a/harbour/src/rdd/Makefile +++ b/harbour/src/rdd/Makefile @@ -7,7 +7,9 @@ ROOT := ../../ include $(TOP)$(ROOT)config/global.mk ifneq ($(HB_PLATFORM),wce) - HB_PRGFLAGS := -gc3 + ifneq ($(HB_COMPILER),pcc) + HB_PRGFLAGS := -gc3 + endif endif C_SOURCES := \ diff --git a/harbour/src/rtl/Makefile b/harbour/src/rtl/Makefile index 44063b5ec2..fc15444a7c 100644 --- a/harbour/src/rtl/Makefile +++ b/harbour/src/rtl/Makefile @@ -7,7 +7,9 @@ ROOT := ../../ include $(TOP)$(ROOT)config/global.mk ifneq ($(HB_PLATFORM),wce) - HB_PRGFLAGS := -gc3 + ifneq ($(HB_COMPILER),pcc) + HB_PRGFLAGS := -gc3 + endif endif C_SOURCES := \