From b057507e3cc94e1afc3dec990e0e02aeac0ae6d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 13 Dec 2009 21:48:02 +0000 Subject: [PATCH] 2009-12-13 22:47 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/compiler/hbmain.c * src/compiler/cmdcheck.c * src/compiler/hbcomp.c * src/compiler/hbusage.c * include/hbcompdf.h + Added support for -i- and -i+ options. They will disable/enable handling of INCLUDE envvar. * config/rules.mk + Added -i- Harbour compiler switch to avoid any interference with user set INCLUDE envvars. --- harbour/ChangeLog | 17 +++++++++++++++-- harbour/config/rules.mk | 2 +- harbour/include/hbcompdf.h | 1 + harbour/src/compiler/cmdcheck.c | 14 +++++++++++++- harbour/src/compiler/hbcomp.c | 1 + harbour/src/compiler/hbmain.c | 3 ++- harbour/src/compiler/hbusage.c | 1 + 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 444d157e99..53e3ffd7bc 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,13 +17,26 @@ past entries belonging to author(s): Viktor Szakats. */ -2009-12-03 12:43 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) +2009-12-13 22:47 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/compiler/hbmain.c + * src/compiler/cmdcheck.c + * src/compiler/hbcomp.c + * src/compiler/hbusage.c + * include/hbcompdf.h + + Added support for -i- and -i+ options. They will disable/enable + handling of INCLUDE envvar. + + * config/rules.mk + + Added -i- Harbour compiler switch to avoid any interference + with user set INCLUDE envvars. + +2009-12-13 12:43 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/hbqt_hbqmainwindow.cpp * contrib/hbqt/hbqt_hbqmainwindow.h * contrib/hbxbp/xbpwindow.prg + Implemented GC collectible pointer for HBQMainWindow(). - /* Please do not commit anything in HBQT/HBXBP/HBIDE as I will be cleaning + /* Please do not commit anything in HBQT/HBXBP/HBIDE as I will be cleaning up the code. BTW how can I invoke HBXBP_DEBUG() functionality. I was just busy with the preparations of my daughter's wedding. diff --git a/harbour/config/rules.mk b/harbour/config/rules.mk index 79b8b23d5c..d723671178 100644 --- a/harbour/config/rules.mk +++ b/harbour/config/rules.mk @@ -24,7 +24,7 @@ endif # How to run Harbour HB := $(HB_HOST_BIN_DIR)/harbour$(HB_HOST_BIN_EXT) -HB_FLAGS := -n1 -q0 -w3 -es2 -kmo $(HB_PRGFLAGS) +HB_FLAGS := -n1 -q0 -w3 -es2 -kmo -i- $(HB_PRGFLAGS) HB_RULE = $(HB) $? $(HB_INC_DEPEND) -i$(HB_INC_COMPILE) $(HB_FLAGS) $(HB_USER_PRGFLAGS) # Use default rules if platform/compiler specific rule is not defined diff --git a/harbour/include/hbcompdf.h b/harbour/include/hbcompdf.h index 230dede076..e41cf0ccf2 100644 --- a/harbour/include/hbcompdf.h +++ b/harbour/include/hbcompdf.h @@ -719,6 +719,7 @@ typedef struct _HB_COMP BOOL fError; /* error appeared during compilation */ BOOL fNoArchDefs; /* do not define architecture dependent macros: __PLATFORM__*, __ARCH??BIT__, __*_ENDIAN__ */ BOOL fMeaningful; /* do not generate warnings about meaningless expression usage */ + BOOL fINCLUDE; /* use INCLUDE envvar as header path (default) */ } HB_COMP, * HB_COMP_PTR; diff --git a/harbour/src/compiler/cmdcheck.c b/harbour/src/compiler/cmdcheck.c index fcebf0780d..42a28c4e94 100644 --- a/harbour/src/compiler/cmdcheck.c +++ b/harbour/src/compiler/cmdcheck.c @@ -298,7 +298,19 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch ) */ case 'i': case 'I': - hb_pp_addSearchPath( HB_COMP_PARAM->pLex->pPP, s + 1, FALSE ); + switch( *( s + 1 ) ) + { + case '-': + HB_COMP_PARAM->fINCLUDE = FALSE; + break; + + case '+': + HB_COMP_PARAM->fINCLUDE = TRUE; + break; + + default: + hb_pp_addSearchPath( HB_COMP_PARAM->pLex->pPP, s + 1, FALSE ); + } break; case 'j': diff --git a/harbour/src/compiler/hbcomp.c b/harbour/src/compiler/hbcomp.c index 4e508a980e..90db2ea7a2 100644 --- a/harbour/src/compiler/hbcomp.c +++ b/harbour/src/compiler/hbcomp.c @@ -231,6 +231,7 @@ HB_COMP_PTR hb_comp_new( void ) pComp->fLogo = TRUE; /* print logo */ pComp->fSingleModule = FALSE; pComp->fError = FALSE; + pComp->fINCLUDE = TRUE; pComp->iSyntaxCheckOnly = 0; /* syntax check only */ pComp->iStartProc = 0; /* no implicit starting procedure */ diff --git a/harbour/src/compiler/hbmain.c b/harbour/src/compiler/hbmain.c index de6ffdf7d4..fb69fbaa99 100644 --- a/harbour/src/compiler/hbmain.c +++ b/harbour/src/compiler/hbmain.c @@ -113,7 +113,8 @@ int hb_compMain( int argc, const char * const argv[], } /* Set Search Path */ - hb_compChkPaths( HB_COMP_PARAM ); + if( HB_COMP_PARAM->fINCLUDE ) + hb_compChkPaths( HB_COMP_PARAM ); /* Set standard rules */ hb_compInitPP( HB_COMP_PARAM, argc, argv ); diff --git a/harbour/src/compiler/hbusage.c b/harbour/src/compiler/hbusage.c index 51800e30e5..5bb96e1013 100644 --- a/harbour/src/compiler/hbusage.c +++ b/harbour/src/compiler/hbusage.c @@ -79,6 +79,7 @@ void hb_compPrintUsage( HB_COMP_DECL, const char * szSelf ) "\n %cgh output type: Harbour Portable Object (.hrb)", "\n %cgd[.] generate dependencies list into (.d) file", "\n %ci #include file search path", + "\n %ci[-|+] disable/enable support for INCLUDE envvar", "\n %cj[] generate i18n gettext file (.pot)", "\n %ck compilation mode (type -k? for more data)", "\n %cl suppress line number information",