From cc2e8c09b980b7f9cb1ca75925bcac3451add745 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 31 Oct 2008 01:07:44 +0000 Subject: [PATCH] 2008-10-31 02:05 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * make_b32.mak * contrib/mtpl_b32.mak * config/w32/bcc32.cf - Added -4 switch, which means Intel 386 CPUs are not not supported by default. * make_vc.mak + Added -GA switch to MSVC 32/64 which creates smaller (and only slightly faster) TLS access code. * source/compiler/cmdcheck.c * source/compiler/hbusage.c + Added -/+ suboptions to -k? options to make it possible to set them to the opposite setting. ; NOTE: BTW, shouldn't -ki option also disable #pragma BEGINDUMP/ENDDUMP? IMO it should, otherwise it doesn't really enforce C out of .prg code. * config/w32/gcc.cf * config/w32/mingw.cf * Changed -march=i486 to -march=i586. ; NOTE: Please comment on CPU optimization switches, IMO we can quite safely target Pentium/586 as the minimum CPU requirement these days for default Harbour builds. If someone needs to run it on 386 (Win95) or 486 (Win98/WinME), a special built can be created. --- harbour/ChangeLog | 31 +++++++++++++++++ harbour/config/w32/bcc32.cf | 2 +- harbour/config/w32/gcc.cf | 2 +- harbour/config/w32/mingw.cf | 2 +- harbour/contrib/mtpl_b32.mak | 2 +- harbour/make_b32.mak | 2 +- harbour/make_vc.mak | 4 ++- harbour/source/compiler/cmdcheck.c | 56 ++++++++++++++++++++++++++---- harbour/source/compiler/hbusage.c | 14 ++++---- 9 files changed, 95 insertions(+), 20 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 1f4a22eec8..04ce3c5431 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,37 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-31 02:05 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * make_b32.mak + * contrib/mtpl_b32.mak + * config/w32/bcc32.cf + - Added -4 switch, which means Intel 386 CPUs are not + not supported by default. + + * make_vc.mak + + Added -GA switch to MSVC 32/64 which creates smaller + (and only slightly faster) TLS access code. + + * source/compiler/cmdcheck.c + * source/compiler/hbusage.c + + Added -/+ suboptions to -k? options to make it + possible to set them to the opposite setting. + ; NOTE: BTW, shouldn't -ki option also disable + #pragma BEGINDUMP/ENDDUMP? IMO it should, + otherwise it doesn't really enforce C + out of .prg code. + + * config/w32/gcc.cf + * config/w32/mingw.cf + * Changed -march=i486 to -march=i586. + + ; NOTE: Please comment on CPU optimization switches, IMO + we can quite safely target Pentium/586 as the + minimum CPU requirement these days for default + Harbour builds. If someone needs to run it on + 386 (Win95) or 486 (Win98/WinME), a special built + can be created. + 2008-10-30 21:56 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/make_b32_all.bat * contrib/make_vc_all.bat diff --git a/harbour/config/w32/bcc32.cf b/harbour/config/w32/bcc32.cf index 67e8052c9a..2997984023 100644 --- a/harbour/config/w32/bcc32.cf +++ b/harbour/config/w32/bcc32.cf @@ -15,7 +15,7 @@ CC = bcc32.exe CC_IN = -c CC_OUT = -o CPPFLAGS = -I. -I$(HB_INC_COMPILE) -CFLAGS = -O2 -q -d -w -w-sig- +CFLAGS = -4 -O2 -OS -Ov -Oi -Oc -q -d -w -w-sig- LD = bcc32.exe LDFLAGS = -O2 diff --git a/harbour/config/w32/gcc.cf b/harbour/config/w32/gcc.cf index 56e3a8f5db..53a55248a3 100644 --- a/harbour/config/w32/gcc.cf +++ b/harbour/config/w32/gcc.cf @@ -13,7 +13,7 @@ CC = gcc CC_IN = -c CC_OUT = -o CPPFLAGS = -I. -I$(HB_INC_COMPILE) -CFLAGS = -Wall -W -O3 -march=i486 +CFLAGS = -Wall -W -O3 -march=i586 LD = gcc LD_OUT = -o diff --git a/harbour/config/w32/mingw.cf b/harbour/config/w32/mingw.cf index 1d65d77898..89d94ef6bb 100644 --- a/harbour/config/w32/mingw.cf +++ b/harbour/config/w32/mingw.cf @@ -13,7 +13,7 @@ CC = $(CCPREFIX)gcc CC_IN = -c CC_OUT = -o CPPFLAGS = -I. -I$(HB_INC_COMPILE) -CFLAGS = -Wall -W -O3 -march=i486 +CFLAGS = -Wall -W -O3 -march=i586 LD = $(CCPREFIX)gcc LD_OUT = -o diff --git a/harbour/contrib/mtpl_b32.mak b/harbour/contrib/mtpl_b32.mak index bd52d13482..962b85f52e 100644 --- a/harbour/contrib/mtpl_b32.mak +++ b/harbour/contrib/mtpl_b32.mak @@ -113,7 +113,7 @@ CFLAGS = -I$(INCLUDE_DIR) $(C_USR) $(CFLAGS) !endif #----------- !if !$d(BCC_NOOPTIM) - CFLAGS = -O2 -OS -Ov -Oi -Oc $(CFLAGS) + CFLAGS = -4 -O2 -OS -Ov -Oi -Oc $(CFLAGS) !endif #----------- diff --git a/harbour/make_b32.mak b/harbour/make_b32.mak index f04d811c21..c090cae115 100644 --- a/harbour/make_b32.mak +++ b/harbour/make_b32.mak @@ -84,7 +84,7 @@ CFLAGSMT = -DHB_MT_VM #----------- !ifndef BCC_NOOPTIM - CFLAGS = -O2 -OS -Ov -Oi -Oc $(CFLAGS) + CFLAGS = -4 -O2 -OS -Ov -Oi -Oc $(CFLAGS) !endif #----------- !if "$(HB_BUILD_DEBUG)" == "yes" diff --git a/harbour/make_vc.mak b/harbour/make_vc.mak index 61e66d48ff..4af899aa4b 100644 --- a/harbour/make_vc.mak +++ b/harbour/make_vc.mak @@ -140,7 +140,9 @@ CFLAGS = -Zi $(CFLAGS) DBGMARKER = d !endif -CFLAGSMT = -MT$(DBGMARKER) -DHB_MT_VM +# NOTE: -GA flag should be disabled when building MT .dlls, +# as it creates bad code as per MS docs [vszakats]. +CFLAGSMT = -MT$(DBGMARKER) -DHB_MT_VM -GA !endif diff --git a/harbour/source/compiler/cmdcheck.c b/harbour/source/compiler/cmdcheck.c index 848df3bb14..e46ae99cd6 100644 --- a/harbour/source/compiler/cmdcheck.c +++ b/harbour/source/compiler/cmdcheck.c @@ -372,7 +372,13 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch ) case 'h': case 'H': /* default Harbour mode */ - HB_COMP_PARAM->supported |= HB_COMPFLAG_HARBOUR; + if( s[i] == '-' ) + { + i++; + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_HARBOUR; + } + else + HB_COMP_PARAM->supported |= HB_COMPFLAG_HARBOUR; break; case 'c': @@ -385,32 +391,68 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch ) case 'x': case 'X': - HB_COMP_PARAM->supported |= HB_COMPFLAG_XBASE; + if( s[i] == '-' ) + { + i++; + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_XBASE; + } + else + HB_COMP_PARAM->supported |= HB_COMPFLAG_XBASE; break; case 'i': case 'I': - HB_COMP_PARAM->supported |= HB_COMPFLAG_HB_INLINE; + if( s[i] == '-' ) + { + i++; + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_HB_INLINE; + } + else + HB_COMP_PARAM->supported |= HB_COMPFLAG_HB_INLINE; break; case 'j': case 'J': - HB_COMP_PARAM->supported &= ~HB_COMPFLAG_OPTJUMP; + if( s[i] == '+' ) + { + i++; + HB_COMP_PARAM->supported |= HB_COMPFLAG_OPTJUMP; + } + else + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_OPTJUMP; break; case 'm': case 'M': - HB_COMP_PARAM->supported &= ~HB_COMPFLAG_MACROTEXT; + if( s[i] == '+' ) + { + i++; + HB_COMP_PARAM->supported |= HB_COMPFLAG_MACROTEXT; + } + else + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_MACROTEXT; break; case 'r': case 'R': - HB_COMP_PARAM->supported |= HB_COMPFLAG_RT_MACRO; + if( s[i] == '-' ) + { + i++; + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_RT_MACRO; + } + else + HB_COMP_PARAM->supported |= HB_COMPFLAG_RT_MACRO; break; case 's': case 'S': - HB_COMP_PARAM->supported |= HB_COMPFLAG_ARRSTR; + if( s[i] == '-' ) + { + i++; + HB_COMP_PARAM->supported &= ~HB_COMPFLAG_ARRSTR; + } + else + HB_COMP_PARAM->supported |= HB_COMPFLAG_ARRSTR; break; default: diff --git a/harbour/source/compiler/hbusage.c b/harbour/source/compiler/hbusage.c index 07946af770..8db62f078c 100644 --- a/harbour/source/compiler/hbusage.c +++ b/harbour/source/compiler/hbusage.c @@ -130,13 +130,13 @@ void hb_compPrintModes( HB_COMP_DECL ) static const char * szOptions [] = { "\nOptions: c clear all flags (strict Clipper mode)", - "\n h Harbour mode", - "\n i enable support for HB_INLINE", - "\n r runtime settings enabled", - "\n s allow indexed assignment on all types", - "\n x extended Xbase++ mode", - "\n j turn off jump optimization in pcode", - "\n m turn off macrotext substitution", + "\n h[-] Harbour mode", + "\n i[-] enable support for HB_INLINE", + "\n r[-] runtime settings enabled", + "\n s[-] allow indexed assignment on all types", + "\n x[-] extended Xbase++ mode", + "\n j[+] turn off jump optimization in pcode", + "\n m[+] turn off macrotext substitution", "\n ? this info", "\n" };