From 09621b1eed940c9fa7cbfa5500ab8a4877227e6d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 26 Feb 2009 18:48:17 +0000 Subject: [PATCH] 2009-02-26 19:44 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * bin/hb-mkdyn.bat * Cleaned tool outputs. + Added hbmaindllh lib to included liblist. (dunno what this serves, but we had it in non-GNU make) Do we need this at all? + Added support for msvc64 dll name. * Some tweak to owatcom, but it's just guessing, it still doesn't work. + Added generating hbrun-dll executable. * source/vm/hvm.c * source/vm/mainstd.c * Random tweak for owatcom/win dll support without success. Best result so far is: "Unrecoverable error 9012: Can't locate the starting procedure: 'MAIN'" * source/vm/Makefile + Added mainddllp generation for msvc, msvc64, bcc32, owatcom. * source/vm/maindllp.c + Added msvc64 and msvcia64 .dll names. * source/vm/extrap.c * Minor tweak to use alternate (documented) CPU detection macro. * utils/hbmk2/hbmk2.prg + Added msvc64 .dll name. * Removed automatic addition of hbcommon lib for shared mode for win compilers. * utils/hbtest/hbtest.hbm * utils/hbrun/hbrun.hbm + Added make files. --- harbour/ChangeLog | 35 +++++++++++++++++++++++++++++++++ harbour/bin/hb-mkdyn.bat | 33 +++++++++++++++++++------------ harbour/source/vm/Makefile | 15 ++++++++++++++ harbour/source/vm/extrap.c | 2 +- harbour/source/vm/hvm.c | 2 +- harbour/source/vm/maindllp.c | 10 +++++++--- harbour/source/vm/mainstd.c | 2 +- harbour/utils/hbmk2/hbmk2.prg | 22 ++++++++++++--------- harbour/utils/hbrun/hbrun.hbm | 6 ++++++ harbour/utils/hbtest/hbtest.hbm | 19 ++++++++++++++++++ 10 files changed, 118 insertions(+), 28 deletions(-) create mode 100644 harbour/utils/hbrun/hbrun.hbm create mode 100644 harbour/utils/hbtest/hbtest.hbm diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0149b11d58..fa85cd0ddb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,41 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-26 19:44 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * bin/hb-mkdyn.bat + * Cleaned tool outputs. + + Added hbmaindllh lib to included liblist. + (dunno what this serves, but we had it in non-GNU make) + Do we need this at all? + + Added support for msvc64 dll name. + * Some tweak to owatcom, but it's just guessing, it still + doesn't work. + + Added generating hbrun-dll executable. + + * source/vm/hvm.c + * source/vm/mainstd.c + * Random tweak for owatcom/win dll support without success. + Best result so far is: + "Unrecoverable error 9012: Can't locate the starting procedure: 'MAIN'" + + * source/vm/Makefile + + Added mainddllp generation for msvc, msvc64, bcc32, owatcom. + + * source/vm/maindllp.c + + Added msvc64 and msvcia64 .dll names. + + * source/vm/extrap.c + * Minor tweak to use alternate (documented) CPU detection macro. + + * utils/hbmk2/hbmk2.prg + + Added msvc64 .dll name. + * Removed automatic addition of hbcommon lib for shared + mode for win compilers. + + * utils/hbtest/hbtest.hbm + * utils/hbrun/hbrun.hbm + + Added make files. + 2009-02-26 12:54 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/gtwvt/gtwvt.c ! Attempt to fix SetMode() always returning FALSE when diff --git a/harbour/bin/hb-mkdyn.bat b/harbour/bin/hb-mkdyn.bat index e21cb02e41..aa4c63b392 100644 --- a/harbour/bin/hb-mkdyn.bat +++ b/harbour/bin/hb-mkdyn.bat @@ -18,7 +18,7 @@ if "%HB_COMPILER%" == "" ( echo HB_COMPILER needs to be set. && goto END ) if not "%HB_ARCHITECTURE%" == "win" goto END set HB_DLL_VERSION=11 -set HB_DLL_LIBS=hbcommon hbpp hbrtl hbmacro hblang hbcpage hbpcre hbzlib hbextern hbrdd rddntx rddnsx rddcdx rddfpt hbsix hbhsx hbusrrdd gtcgi gtpca gtstd gtwin gtwvt gtgui +set HB_DLL_LIBS=hbcommon hbpp hbrtl hbmacro hblang hbcpage hbpcre hbzlib hbextern hbrdd rddntx rddnsx rddcdx rddfpt hbsix hbhsx hbusrrdd gtcgi gtpca gtstd gtwin gtwvt gtgui hbmaindllh set HB_DLL_LIBS_ST=hbvm set HB_DLL_LIBS_MT=hbvmmt @@ -93,11 +93,13 @@ for %%f in (%HB_DLL_LIBS_MT%) do ( ) cd .. -set _DST_NAME_ST=harbour-%HB_DLL_VERSION%-vc -set _DST_NAME_MT=harbourmt-%HB_DLL_VERSION%-vc +if "%HB_COMPILER%" == "msvc64" set _DST_NAME_ST=harbour-%HB_DLL_VERSION%-vc-x64 +if "%HB_COMPILER%" == "msvc64" set _DST_NAME_MT=harbourmt-%HB_DLL_VERSION%-vc-x64 +if not "%HB_COMPILER%" == "msvc64" set _DST_NAME_ST=harbour-%HB_DLL_VERSION%-vc +if not "%HB_COMPILER%" == "msvc64" set _DST_NAME_MT=harbourmt-%HB_DLL_VERSION%-vc -echo Making %_DST_NAME_ST%.dll... && link /dll /out:"%HB_BIN_INSTALL%\%_DST_NAME_ST%.dll" @_hboneut.txt @_hbost.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul -echo Making %_DST_NAME_MT%.dll... && link /dll /out:"%HB_BIN_INSTALL%\%_DST_NAME_MT%.dll" @_hboneut.txt @_hbomt.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul +echo Making %_DST_NAME_ST%.dll... && link /nologo /dll /out:"%HB_BIN_INSTALL%\%_DST_NAME_ST%.dll" @_hboneut.txt @_hbost.txt user32.lib wsock32.lib advapi32.lib gdi32.lib +echo Making %_DST_NAME_MT%.dll... && link /nologo /dll /out:"%HB_BIN_INSTALL%\%_DST_NAME_MT%.dll" @_hboneut.txt @_hbomt.txt user32.lib wsock32.lib advapi32.lib gdi32.lib if exist "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_ST%.lib" if exist "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_MT%.lib" @@ -118,7 +120,7 @@ del _hboneut.txt cd .. rmdir _dll -goto END +goto MK_BINDLL :DO_BCC32 @@ -217,8 +219,8 @@ set _DST_NAME_MT=harbourmt-%HB_DLL_VERSION%-b32 echo. , "%HB_BIN_INSTALL%\%_DST_NAME_ST%.dll",, cw32mt.lib import32.lib >> _hballst.txt echo. , "%HB_BIN_INSTALL%\%_DST_NAME_MT%.dll",, cw32mt.lib import32.lib >> _hballmt.txt -echo Making %_DST_NAME_ST%.dll... && ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballst.txt -echo Making %_DST_NAME_MT%.dll... && ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballmt.txt +echo Making %_DST_NAME_ST%.dll... && ilink32 -q -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballst.txt +echo Making %_DST_NAME_MT%.dll... && ilink32 -q -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballmt.txt if exist "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_ST%.lib" if exist "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_MT%.lib" @@ -242,7 +244,7 @@ del _hboneut.txt cd .. rmdir _dll -goto END +goto MK_BINDLL :DO_OWATCOM @@ -258,8 +260,8 @@ for %%f in (%HB_DLL_LIBS%) do ( echo FILE '%HB_LIB_INSTALL%\%%f.lib'>> _hbsmt.txt ) -copy /b /y "%HB_LIB_INSTALL%\%HB_DLL_LIBS_ST%.lib" . && wlib -b "%HB_DLL_LIBS_ST%.lib" - mainstd.obj -copy /b /y "%HB_LIB_INSTALL%\%HB_DLL_LIBS_MT%.lib" . && wlib -b "%HB_DLL_LIBS_MT%.lib" - mainstd.obj +copy /b /y "%HB_LIB_INSTALL%\%HB_DLL_LIBS_ST%.lib" . > nul && wlib -q -b "%HB_DLL_LIBS_ST%.lib" - mainwin.obj +copy /b /y "%HB_LIB_INSTALL%\%HB_DLL_LIBS_MT%.lib" . > nul && wlib -q -b "%HB_DLL_LIBS_MT%.lib" - mainwin.obj echo FILE '%HB_DLL_LIBS_ST%.lib'>> _hbsst.txt echo FILE '%HB_DLL_LIBS_MT%.lib'>> _hbsmt.txt @@ -267,8 +269,8 @@ echo FILE '%HB_DLL_LIBS_MT%.lib'>> _hbsmt.txt set _DST_NAME_ST=harbour-%HB_DLL_VERSION%-ow set _DST_NAME_MT=harbourmt-%HB_DLL_VERSION%-ow -echo Making %_DST_NAME_ST%.dll... && wlink SYS NT_DLL NAME '%HB_BIN_INSTALL%\%_DST_NAME_ST%.dll' OP IMPLIB @_hbsst.txt LIB user32.lib, wsock32.lib, advapi32.lib, gdi32.lib > nul -echo Making %_DST_NAME_MT%.dll... && wlink SYS NT_DLL NAME '%HB_BIN_INSTALL%\%_DST_NAME_MT%.dll' OP IMPLIB @_hbsmt.txt LIB user32.lib, wsock32.lib, advapi32.lib, gdi32.lib > nul +echo Making %_DST_NAME_ST%.dll... && wlink OP QUIET SYS NT_DLL NAME '%HB_BIN_INSTALL%\%_DST_NAME_ST%.dll' OP IMPLIB @_hbsst.txt LIB user32.lib, wsock32.lib, advapi32.lib, gdi32.lib +echo Making %_DST_NAME_MT%.dll... && wlink OP QUIET SYS NT_DLL NAME '%HB_BIN_INSTALL%\%_DST_NAME_MT%.dll' OP IMPLIB @_hbsmt.txt LIB user32.lib, wsock32.lib, advapi32.lib, gdi32.lib if exist "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_ST%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_ST%.lib" if exist "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" move "%HB_BIN_INSTALL%\%_DST_NAME_MT%.lib" "%HB_LIB_INSTALL%\%_DST_NAME_MT%.lib" @@ -283,6 +285,11 @@ del _hbsmt.txt cd .. rmdir _dll +goto MK_BINDLL + +:MK_BINDLL + +hbmk2 -q0 -n -shared ..\utils\hbrun\hbrun.prg -o%HB_BIN_INSTALL%\hbrun-dll -lhbcplr -lhbpp -lhbcommon goto END :END diff --git a/harbour/source/vm/Makefile b/harbour/source/vm/Makefile index 9125861dd4..dad4048753 100644 --- a/harbour/source/vm/Makefile +++ b/harbour/source/vm/Makefile @@ -25,6 +25,21 @@ else endif endif +ifeq ($(HB_ARCHITECTURE),win) + ifeq ($(HB_COMPILER),bcc32) + DIRS += maindllh + endif + ifeq ($(HB_COMPILER),msvc) + DIRS += maindllh + endif + ifeq ($(HB_COMPILER),msvc64) + DIRS += maindllh + endif + ifeq ($(HB_COMPILER),owatcom) + DIRS += maindllh + endif +endif + C_SOURCES=\ hvm.c \ arrays.c \ diff --git a/harbour/source/vm/extrap.c b/harbour/source/vm/extrap.c index 4fddffb8ea..77608e66c4 100644 --- a/harbour/source/vm/extrap.c +++ b/harbour/source/vm/extrap.c @@ -105,7 +105,7 @@ LONG WINAPI hb_win32ExceptionHandler( struct _EXCEPTION_POINTERS * pExceptionInf errmsg[ 0 ] = '\0'; -#if defined(HB_OS_WIN_64) && defined(_M_AMD64) +#if defined(HB_OS_WIN_64) && defined(_M_X64) { PCONTEXT pCtx = pExceptionInfo->ContextRecord; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index d803fc6fdc..1f24cfd106 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -11071,7 +11071,7 @@ HB_LANG_REQUEST( HB_LANG_DEFAULT ) # define HB_FORCE_LINK_MAIN hb_forceLinkMainWin -#elif defined(__WATCOMC__) && ( defined(HB_OS_LINUX) || defined(HB_OS_OS2) ) +#elif defined(__WATCOMC__) && ( defined(HB_OS_LINUX) || defined(HB_OS_OS2) || defined(HB_OS_WIN) ) # define HB_FORCE_LINK_MAIN hb_forceLinkMainStd diff --git a/harbour/source/vm/maindllp.c b/harbour/source/vm/maindllp.c index 97c5d95326..d28437cb75 100644 --- a/harbour/source/vm/maindllp.c +++ b/harbour/source/vm/maindllp.c @@ -61,11 +61,15 @@ #define HB_DLL_NAME "harbour.dll" #if defined( __BORLANDC__ ) -#define HB_DLL_NAME2 "harbour-11-b32.dll" + #define HB_DLL_NAME2 "harbour-11-b32.dll" #elif defined( __WATCOMC__ ) -#define HB_DLL_NAME2 "harbour-11-ow.dll" + #define HB_DLL_NAME2 "harbour-11-ow.dll" +#elif defined( _MSC_VER ) && defined( _M_X64 ) + #define HB_DLL_NAME2 "harbour-11-vc-x64.dll" +#elif defined( _MSC_VER ) && defined( _M_IA64 ) + #define HB_DLL_NAME2 "harbour-11-vc-ia64.dll" #elif defined( _MSC_VER ) -#define HB_DLL_NAME2 "harbour-11-vc.dll" + #define HB_DLL_NAME2 "harbour-11-vc.dll" #endif #if defined(HB_OS_WIN) diff --git a/harbour/source/vm/mainstd.c b/harbour/source/vm/mainstd.c index cd4cd59b84..db482ce5d9 100644 --- a/harbour/source/vm/mainstd.c +++ b/harbour/source/vm/mainstd.c @@ -77,7 +77,7 @@ char ** __crt0_glob_function( char * _arg ) } #endif -#if defined(__WATCOMC__) && ( defined(HB_OS_LINUX) || defined(HB_OS_OS2) ) +#if defined(__WATCOMC__) && ( defined(HB_OS_LINUX) || defined(HB_OS_OS2) || defined(HB_OS_WIN) ) void hb_forceLinkMainStd( void ) {} #endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 66e263a64f..d79636b1be 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -1195,8 +1195,7 @@ FUNCTION Main( ... ) s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_NonGNU + "-ow",; "harbour-" + cDL_Version_NonGNU + "-ow" ),; "hbmainstd",; - "hbmainwin",; - "hbcommon" } + "hbmainwin" } IF Len( s_aRESSRC ) > 0 IF Len( s_aRESSRC ) == 1 @@ -1346,8 +1345,7 @@ FUNCTION Main( ... ) s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_NonGNU + "-b32",; "harbour-" + cDL_Version_NonGNU + "-b32" ),; "hbmainstd",; - "hbmainwin",; - "hbcommon" } + "hbmainwin" } CASE t_cARCH == "win" .AND. t_cCOMP $ "msvc|msvc64" IF s_lDEBUG @@ -1384,11 +1382,17 @@ FUNCTION Main( ... ) s_aLIBSYS := ArrayJoin( s_aLIBSYS, { "user32", "wsock32", "advapi32", "gdi32" } ) /* TOFIX: The two build systems should generate the same .dll names, otherwise we can only be compatible with one of them. non-GNU is the common choice here. */ - s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_NonGNU + "-vc",; - "harbour-" + cDL_Version_NonGNU + "-vc" ),; - "hbmainstd",; - "hbmainwin",; - "hbcommon" } + IF t_cCOMP == "msvc64" + s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_NonGNU + "-vc-x64",; + "harbour-" + cDL_Version_NonGNU + "-vc-x64" ),; + "hbmainstd",; + "hbmainwin" } + ELSE + s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_NonGNU + "-vc",; + "harbour-" + cDL_Version_NonGNU + "-vc" ),; + "hbmainstd",; + "hbmainwin" } + ENDIF cBin_Res := "rc.exe" cOpt_Res := "/r {LR}" diff --git a/harbour/utils/hbrun/hbrun.hbm b/harbour/utils/hbrun/hbrun.hbm new file mode 100644 index 0000000000..08d397577e --- /dev/null +++ b/harbour/utils/hbrun/hbrun.hbm @@ -0,0 +1,6 @@ +# +# $Id$ +# + +-n +hbrun.prg diff --git a/harbour/utils/hbtest/hbtest.hbm b/harbour/utils/hbtest/hbtest.hbm new file mode 100644 index 0000000000..c3eb6e4d26 --- /dev/null +++ b/harbour/utils/hbtest/hbtest.hbm @@ -0,0 +1,19 @@ +# +# $Id$ +# + +-n +hbtest.prg +rt_array.prg +rt_date.prg +rt_file.prg +rt_hvm.prg +rt_hvma.prg +rt_math.prg +rt_misc.prg +rt_mt.prg +rt_str.prg +rt_stra.prg +rt_trans.prg +rt_class.prg +rt_miscc.c