From 4e153b277385dad281cbdb4b667356a09a5c218c Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 21 Jun 2009 18:56:11 +0000 Subject: [PATCH] 2009-06-21 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Added iccia64 build example. * source/vm/fm.c + Added C++ new/delete operator override to hb_xgrab()/hb_xfree(). Thanks to Xavi. Please make any required correction, I didn't do tests with it. * utils/hbmk2/hbmk2.prg + Added support for linux/icc compiler. (untested) ; Tested win/icc support (static exe, shared exe, lib, dll). It worked, except that in shared mode it will display this, when the MinGW built .dll is used (instead of its own): Unrecoverable error 9012: Can't locate the starting procedure: 'MAIN' --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/INSTALL | 11 +++++++++++ harbour/source/vm/fm.c | 12 ++++++++++++ harbour/utils/hbmk2/hbmk2.prg | 18 +++++++++++++----- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ba3b8571c3..d1970b678d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,22 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-21 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + + Added iccia64 build example. + + * source/vm/fm.c + + Added C++ new/delete operator override to hb_xgrab()/hb_xfree(). + Thanks to Xavi. + Please make any required correction, I didn't do tests with it. + + * utils/hbmk2/hbmk2.prg + + Added support for linux/icc compiler. (untested) + ; Tested win/icc support (static exe, shared exe, lib, dll). + It worked, except that in shared mode it will display this, + when the MinGW built .dll is used (instead of its own): + Unrecoverable error 9012: Can't locate the starting procedure: 'MAIN' + 2009-06-21 11:42 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbxbp/xbpcombobox.prg ! Changed inheritance to avoid duplicate objects. diff --git a/harbour/INSTALL b/harbour/INSTALL index 2e0cb28c11..f7edf21cc4 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -407,6 +407,17 @@ EXAMPLES call make_gnu.bat %1 %2 > log-%HB_COMPILER%.txt 2>&1 --- + --- Intel(R) C++ for IA-64 (requires native x86 Harbour binaries) + call "%ProgramFiles%\Intel\Compiler\C++\10.1.025\Itanium\Bin\iclvars.bat" + rem + set HB_BIN_COMPILE=C:\hb-icc\bin + set HB_PPGEN_PATH=%HB_BIN_COMPILE% + rem + set HB_COMPILER=iccia64 + set HB_INSTALL_PREFIX=C:\hb-%HB_COMPILER% + call make_gnu.bat %1 %2 > log-%HB_COMPILER%.txt 2>&1 + --- + --- Borland/CodeGear C++ set PATH=C:\Borland\BCC55\Bin;%PATH% rem diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index 3dfcbebf5e..66d5e3a95e 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -1288,3 +1288,15 @@ HB_FUNC( HB_FM_STAT ) {} #else HB_FUNC( HB_FM_NOSTAT ) {} #endif + +#if defined( __cplusplus ) && defined( HB_FM_STATISTICS ) +void * operator new( size_t nSize ) +{ + return hb_xgrab( nSize ); +} + +void operator delete( void * p ) +{ + hb_xfree( p ); +} +#endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5cd95967c5..374fcff922 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2020,7 +2020,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ( hbmk[ _HBMK_cARCH ] == "hpux" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; ( hbmk[ _HBMK_cARCH ] == "sunos" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; ( hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; - ( hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "gpp" ) + ( hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "gpp" ) .OR. ; + ( hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ) nOpt_Esc := _ESC_NIX IF hbmk[ _HBMK_lDEBUG ] @@ -2034,10 +2035,19 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) cBin_Lib := "libtool" cOpt_Lib := "-static {FA} -o {OL} {LO}" ELSE - cBin_Lib := hbmk[ _HBMK_cCCPREFIX ] + "ar" + IF hbmk[ _HBMK_cCOMP ] == "icc" + cBin_Lib := "xiar" + ELSE + cBin_Lib := hbmk[ _HBMK_cCCPREFIX ] + "ar" + ENDIF cOpt_Lib := "{FA} rcs {OL} {LO}" ENDIF - cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + iif( l_lCPP != NIL .AND. l_lCPP, "g++", "gcc" ) + hbmk[ _HBMK_cCCPOSTFIX ] + IF hbmk[ _HBMK_cCOMP ] == "icc" + cBin_CompC := iif( l_lCPP != NIL .AND. l_lCPP, "icpc", "icc" ) + AAdd( hbmk[ _HBMK_aOPTC ], "-D_GNU_SOURCE" ) + ELSE + cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + iif( l_lCPP != NIL .AND. l_lCPP, "g++", "gcc" ) + hbmk[ _HBMK_cCCPOSTFIX ] + ENDIF cOpt_CompC := "-c" IF hbmk[ _HBMK_lOPTIM ] cOpt_CompC += " -O3" @@ -2931,8 +2941,6 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) l_aLIBSHAREDPOST := { "hbmainstd", "hbmainwin" } - /* TODO */ - CASE hbmk[ _HBMK_cARCH ] == "linux" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ENDCASE /* NOTE: We only use different shared object flags when compiling for