2009-02-23 14:51 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* utils/hbmk2/hbmk2.prg
    ! Fixed bug which made gtwvt the default GT for mingw.
    ! Fixed to create final exe in current dir if no output
      filename was specified and the first input file
      contained a path.
    * Changed to use version-less harbour shared lib names
      on *nixes.
    ! Fixed to pass full path with harbour.so to gcc.
      (even when Harbour isn't run from a system location)
    ! Fixed compilation/linking/cleanup if an input file
      wasn't in current dir.
    * Temp stub file is now created in system default temp dir,
      instead of the current one.
    + Harbour shared lib path is normalized when Harbour
      is found on system locations. (so '*/bin/../lib/' becomes
      '*/lib')
    * Better I hope handling of .so/.dylib/.sl/.dll files passed
      on the command line.

  * bin/hb-mkdll.bat
    ! Fixed typo in Borland MT .dll name.
    ! Fixed to not include maindll.obj, maindllp.obj in
      Borland .dlls.
    * Minor formatting and cleanup on internal names.
    + Added checking for source lib existence, showing
      message if not found.
    + Better user feedback.

  * bin/postinst.bat
    + Added running hb_mkdll.bat at the end of the build
      process. For now users have to use 'set HB_DLL=yes'
      to enable this features. It's experimental yet,
      see previous comments.

  * source/vm/Makefile
    + Now generating hbmainstd and hbmainwin for remaining
      (non-mingw and non-mingwce) compilers. MSVC and BCC
      need this for -shared linkage, I'm not sure about the
      rest, anyhow we can disable it for other compilers
      if it isn't needed in future.

  * bin/hb-func.sh
    % Refined hbmkcfg.hbp setup to better detect conditions.

  * contrib/hbcurl/hbcurl.c
    ! Pacified this only one new gcc 4.3.3 warning.

  * config/win/gcc.cf
  * config/win/mingw.cf
    + Added -mtune=pentiumpro gcc optimization.
This commit is contained in:
Viktor Szakats
2009-02-23 13:53:42 +00:00
parent 643d0291d2
commit 1a0ef66629
9 changed files with 359 additions and 203 deletions

View File

@@ -8,6 +8,57 @@
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-02-23 14:51 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
! Fixed bug which made gtwvt the default GT for mingw.
! Fixed to create final exe in current dir if no output
filename was specified and the first input file
contained a path.
* Changed to use version-less harbour shared lib names
on *nixes.
! Fixed to pass full path with harbour.so to gcc.
(even when Harbour isn't run from a system location)
! Fixed compilation/linking/cleanup if an input file
wasn't in current dir.
* Temp stub file is now created in system default temp dir,
instead of the current one.
+ Harbour shared lib path is normalized when Harbour
is found on system locations. (so '*/bin/../lib/' becomes
'*/lib')
* Better I hope handling of .so/.dylib/.sl/.dll files passed
on the command line.
* bin/hb-mkdll.bat
! Fixed typo in Borland MT .dll name.
! Fixed to not include maindll.obj, maindllp.obj in
Borland .dlls.
* Minor formatting and cleanup on internal names.
+ Added checking for source lib existence, showing
message if not found.
+ Better user feedback.
* bin/postinst.bat
+ Added running hb_mkdll.bat at the end of the build
process. For now users have to use 'set HB_DLL=yes'
to enable this features. It's experimental yet,
see previous comments.
* source/vm/Makefile
+ Now generating hbmainstd and hbmainwin for remaining
(non-mingw and non-mingwce) compilers. MSVC and BCC
need this for -shared linkage, I'm not sure about the
rest, anyhow we can disable it for other compilers
if it isn't needed in future.
* bin/hb-func.sh
% Refined hbmkcfg.hbp setup to better detect conditions.
* contrib/hbcurl/hbcurl.c
! Pacified this only one new gcc 4.3.3 warning.
* config/win/gcc.cf
* config/win/mingw.cf
+ Added -mtune=pentiumpro gcc optimization.
2009-02-22 19:32 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* harbour/contrib/gtwvg/wvgwin.c
@@ -27,16 +78,16 @@
* harbour/contrib/gtwvg/wvgtreev.prg
* harbour/contrib/gtwvg/wvgwnd.prg
! Code cleanup.
! Implemented generic callback functionality taking
use of SetProp()/GetProp() functions of WINAPI. It
effectively eliminates the use of AsCallBack()
! Implemented generic callback functionality taking
use of SetProp()/GetProp() functions of WINAPI. It
effectively eliminates the use of AsCallBack()
function which has been discussed as non-scalable
in multi-processor architect.
; TODO: To use hb_gcAlloc() mechanism to hold the
; TODO: To use hb_gcAlloc() mechanism to hold the
codeblock. Please review wvgwnd():SetWindowProcCallback()
and wvgwin:WVG_SetWindowProcBlock( ::hWnd, bBlock ).
I did try but could not resolve it properly.
I did try but could not resolve it properly.
2009-02-22 22:39 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* make_vc.mak

View File

@@ -178,10 +178,13 @@ mk_hbtools()
fi
if [ "${HB_COMPILER}" = "mingw" ]; then
HB_SYS_LIBS="${HB_SYS_LIBS} -luser32 -lwinspool -lgdi32 -lcomctl32 -lcomdlg32 -lole32 -loleaut32 -luuid -lwsock32 -lws2_32"
HB_WITHOUT_X11="yes"
elif [ "${HB_COMPILER}" = "mingwce" ]; then
HB_SYS_LIBS="${HB_SYS_LIBS} -lwininet -lws2 -lcommdlg -lcommctrl -luuid -lole32"
HB_WITHOUT_X11="yes"
elif [ "${HB_COMPILER}" = "djgpp" ]; then
HB_SYS_LIBS="${HB_SYS_LIBS}"
HB_WITHOUT_X11="yes"
else
HB_CRS_LIB=""
if [ "${HB_ARCHITECTURE}" = "linux" ]; then
@@ -240,10 +243,10 @@ mk_hbtools()
if [ "${HB_WITHOUT_X11}" != "yes" ]; then
echo "libdynhas=gtxwc">> ${hb_hbmkcfg}
fi
if [ "${HB_WITHOUT_GTCRS}" != "yes" ]; then
if [ "${HB_WITHOUT_GTCRS}" != "yes" ] && [ -n "${HB_CRS_LIB}" ]; then
echo "libdynhas=gtcrs">> ${hb_hbmkcfg}
fi
if [ "${HB_WITHOUT_GTSLN}" != "yes" ]; then
if [ "${HB_WITHOUT_GTSLN}" != "yes" ] && [ -n "${HB_SLN_LIB}" ]; then
echo "libdynhas=gtsln">> ${hb_hbmkcfg}
fi

View File

@@ -20,87 +20,90 @@ 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
set HB_DLL_LIBS_ST=hbvm
set HB_DLL_LIBS_MT=hbvmmt
if not "%HB_COMPILER%" == "msvc" goto NOT_MSVC
rem Generating Harbour .dll for MSVC
echo Making .dlls for %HB_COMPILER%...
md _dll
cd _dll
rem ; Extract core objects
echo.> _hbocore.txt
rem ; Extract neutral objects
echo.> _hboneut.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo %%p>> _hbocore.txt
)
del _hboraw.txt
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo %%p>> _hboneut.txt
)
del _hboraw.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
md vm
cd vm
set HB_DLL_LIBS=hbvm
rem ; Extract VM objects
echo.> ..\_hbovm.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo vm\%%p>> ..\_hbovm.txt
md _st
cd _st
rem ; Extract ST objects
echo.> ..\_hbost.txt
for %%f in (%HB_DLL_LIBS_ST%) do (
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo _st\%%p>> ..\_hbost.txt
)
)
)
)
)
del _hboraw.txt
del _hboraw.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
cd ..
md vmmt
cd vmmt
set HB_DLL_LIBS=hbvmmt
rem ; Extract VM (MT) objects
echo.> ..\_hbovmmt.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo vmmt\%%p>> ..\_hbovmmt.txt
md _mt
cd _mt
rem ; Extract MT objects
echo.> ..\_hbomt.txt
for %%f in (%HB_DLL_LIBS_MT%) do (
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /list > _hboraw.txt
for /F %%p in (_hboraw.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
lib "%HB_LIB_INSTALL%\%%f.lib" /nologo /extract:%%p
echo _mt\%%p>> ..\_hbomt.txt
)
)
)
)
)
del _hboraw.txt
del _hboraw.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
cd ..
link /dll /out:"%HB_BIN_INSTALL%\harbour-%HB_DLL_VERSION%-vc.dll" @_hbocore.txt @_hbovm.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul
link /dll /out:"%HB_BIN_INSTALL%\harbourmt-%HB_DLL_VERSION%-vc.dll" @_hbocore.txt @_hbovmmt.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul
set _DST_NAME_ST=%HB_BIN_INSTALL%\harbour-%HB_DLL_VERSION%-vc.dll
set _DST_NAME_MT=%HB_BIN_INSTALL%\harbourmt-%HB_DLL_VERSION%-vc.dll
echo Making %_DST_NAME_ST%... && link /dll /out:"%_DST_NAME_ST%" @_hboneut.txt @_hbost.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul
echo Making %_DST_NAME_MT%... && link /dll /out:"%_DST_NAME_MT%" @_hboneut.txt @_hbomt.txt user32.lib wsock32.lib advapi32.lib gdi32.lib > nul
rem ; Cleanup
for /F %%o in (_hbovm.txt) do (
del %%o
)
del _hbovm.txt
rmdir vm
for /F %%o in (_hbost.txt) do ( del %%o )
del _hbost.txt
rmdir _st
for /F %%o in (_hbovmmt.txt) do (
del %%o
)
del _hbovmmt.txt
rmdir vmmt
for /F %%o in (_hbomt.txt) do ( del %%o )
del _hbomt.txt
rmdir _mt
for /F %%o in (_hbocore.txt) do (
del %%o
)
del _hbocore.txt
for /F %%o in (_hboneut.txt) do ( del %%o )
del _hboneut.txt
cd ..
rmdir _dll
@@ -110,109 +113,118 @@ goto END
if not "%HB_COMPILER%" == "bcc32" goto NOT_BCC32
rem Generating Harbour .dll for Borland C/C++
echo Making .dlls for %HB_COMPILER%...
md _dll
cd _dll
echo. c0d32.obj +> _hball.txt
echo. c0d32.obj +> _hballvm.txt
echo. c0d32.obj +> _hballst.txt
echo. c0d32.obj +> _hballmt.txt
rem ; Extract core objects
echo.> _hbocore.txt
rem ; Extract neutral objects
echo.> _hboneut.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
)
)
)
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo %%p +>> _hball.txt
echo %%p +>> _hballvm.txt
echo %%p>> _hbocore.txt
)
del _hboraw2.txt
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo %%p +>> _hballst.txt
echo %%p +>> _hballmt.txt
echo %%p>> _hboneut.txt
)
del _hboraw2.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
md vm
cd vm
set HB_DLL_LIBS=hbvm
rem ; Extract VM objects
echo.> ..\_hbovm.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
md _st
cd _st
rem ; Extract ST objects
echo.> ..\_hbost.txt
for %%f in (%HB_DLL_LIBS_ST%) do (
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
)
)
)
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo vm\%%p +>> ..\_hball.txt
echo vm\%%p>> ..\_hbovm.txt
)
del _hboraw2.txt
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo _st\%%p +>> ..\_hballst.txt
echo _st\%%p>> ..\_hbost.txt
)
)
)
del _hboraw2.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
cd ..
md vmmt
cd vmmt
set HB_DLL_LIBS=hbvmmt
rem ; Extract VM (MT) objects
echo.> ..\_hbovmmt.txt
for %%f in (%HB_DLL_LIBS%) do (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
md _mt
cd _mt
rem ; Extract MT objects
echo.> ..\_hbomt.txt
for %%f in (%HB_DLL_LIBS_MT%) do (
if exist "%HB_LIB_INSTALL%\%%f.lib" (
echo Processing library: %%f
tlib "%HB_LIB_INSTALL%\%%f.lib", _hboraw.txt > nul
echo.> _hboraw2.txt
for /F "tokens=1,2" %%f in (_hboraw.txt) do (
if "%%g" == "size" (
echo %%f.obj >> _hboraw2.txt
)
)
)
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo vmmt\%%p +>> ..\_hballvm.txt
echo vmmt\%%p>> ..\_hbovmmt.txt
)
del _hboraw2.txt
del _hboraw.txt
for /F %%p in (_hboraw2.txt) do (
if not "%%p" == "maindll.obj" (
if not "%%p" == "maindllp.obj" (
tlib "%HB_LIB_INSTALL%\%%f.lib" * %%p > nul
echo _mt\%%p +>> ..\_hballmt.txt
echo _mt\%%p>> ..\_hbomt.txt
)
)
)
del _hboraw2.txt
) else ( echo Library not found: %HB_LIB_INSTALL%\%%f.lib )
)
cd ..
echo. , "%HB_BIN_INSTALL%\harbour-%HB_DLL_VERSION%-b32.dll" ,, cw32mt.lib import32.lib >> _hball.txt
echo. , "%HB_BIN_INSTALL%\harbourvm-%HB_DLL_VERSION%-b32.dll",, cw32mt.lib import32.lib >> _hballvm.txt
set _DST_NAME_ST=%HB_BIN_INSTALL%\harbour-%HB_DLL_VERSION%-b32.dll
set _DST_NAME_MT=%HB_BIN_INSTALL%\harbourmt-%HB_DLL_VERSION%-b32.dll
ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hball.txt > nul
ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballvm.txt > nul
echo. , "%_DST_NAME_ST%",, cw32mt.lib import32.lib >> _hballst.txt
echo. , "%_DST_NAME_ST%",, cw32mt.lib import32.lib >> _hballmt.txt
del _hball.txt
del _hballvm.txt
echo Making %_DST_NAME_ST%... && ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballst.txt > nul
echo Making %_DST_NAME_MT%... && ilink32 -Gn -C -aa -Tpd -Gi -x c0d32.obj @_hballmt.txt > nul
del _hballst.txt
del _hballmt.txt
rem ; Cleanup
for /F %%o in (_hbovm.txt) do (
del %%o
)
del _hbovm.txt
rmdir vm
for /F %%o in (_hbost.txt) do ( del %%o )
del _hbost.txt
rmdir _st
for /F %%o in (_hbovmmt.txt) do (
del %%o
)
del _hbovmmt.txt
rmdir vmmt
for /F %%o in (_hbomt.txt) do ( del %%o )
del _hbomt.txt
rmdir _mt
for /F %%o in (_hbocore.txt) do (
del %%o
)
del _hbocore.txt
for /F %%o in (_hboneut.txt) do ( del %%o )
del _hboneut.txt
cd ..
rmdir _dll

View File

@@ -18,6 +18,8 @@ goto inst_%HB_ARCHITECTURE%
:inst_win
rem Windows post install part
if "%HB_DLL%" == "yes" call %~dp0hb-mkdll.bat
echo @"%%~dp0hbmk2.exe" -hbcc %%*> %HB_BIN_INSTALL%\hbcc.bat
echo @"%%~dp0hbmk2.exe" -hbcmp %%*> %HB_BIN_INSTALL%\hbcmp.bat
echo @"%%~dp0hbmk2.exe" -hblnk %%*> %HB_BIN_INSTALL%\hblnk.bat

View File

@@ -13,7 +13,7 @@ CC = gcc
CC_IN = -c
CC_OUT = -o
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
CFLAGS = -Wall -W -O3 -march=i586
CFLAGS = -Wall -W -O3 -march=i586 -mtune=pentiumpro
LD = gcc
LD_OUT = -o

View File

@@ -13,7 +13,7 @@ CC = $(CCPREFIX)gcc
CC_IN = -c
CC_OUT = -o
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
CFLAGS = -Wall -W -O3 -march=i586
CFLAGS = -Wall -W -O3 -march=i586 -mtune=pentiumpro
LD = $(CCPREFIX)gcc
LD_OUT = -o

View File

@@ -71,8 +71,8 @@
/* NOTE: Harbour requires libcurl 7.17.0 or upper.
This was the version where curl_easy_setopt() started to
make copies of passed strings, which we currently require.
Update: This requirement is now sorted out by local string
buffering logic used with pre-7.17.0 versions of
Update: This requirement is now sorted out by local string
buffering logic used with pre-7.17.0 versions of
libcurl.
[vszakats] */
@@ -130,7 +130,7 @@ static HB_HASH_FUNC( hb_curl_HashKey ) /* ULONG func( void * Value, void * Ca
{
ULONG ulSum = 0;
char * szName = ( char * ) Value;
while( *szName )
ulSum += *szName++;
@@ -1671,7 +1671,7 @@ HB_FUNC( CURL_EASY_GETINFO )
break;
case HB_CURLINFO_CERTINFO:
#if LIBCURL_VERSION_NUM >= 0x071301
res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CERTINFO, &ret_ptr );
res = HB_CURL_EASY_GETINFO( hb_curl, CURLINFO_CERTINFO, ( struct curl_slist * ) &ret_ptr );
#endif
type = HB_CURL_INFO_TYPE_PTR;
break;

View File

@@ -14,6 +14,7 @@ ifeq ($(HB_ARCHITECTURE),win)
DIRS = mainstd mainwin
else
C_MAIN = mainstd.c mainwin.c
DIRS = mainstd mainwin
endif
endif
else

View File

@@ -221,6 +221,8 @@ FUNCTION Main( ... )
LOCAL cObjExt
LOCAL cLibPathPrefix
LOCAL cLibPathSep
LOCAL cDynLibNamePrefix
LOCAL cDynLibExt
LOCAL cCommand
LOCAL cOpt_CompC
@@ -235,6 +237,8 @@ FUNCTION Main( ... )
LOCAL lNOHBP
LOCAL lSysLoc
LOCAL cSelfCOMP
LOCAL cPrefix
LOCAL cPostfix
LOCAL lStopAfterHarbour := .F.
LOCAL lStopAfterCComp := .F.
@@ -365,16 +369,21 @@ FUNCTION Main( ... )
/* Setup architecture dependent data */
DO CASE
CASE t_cARCH $ "bsd|hpux|sunos" .OR. t_cARCH == "darwin" /* Separated to avoid match with 'win' */
aCOMPSUP := { "gcc" }
CASE t_cARCH $ "bsd|hpux|sunos|linux" .OR. t_cARCH == "darwin" /* Separated to avoid match with 'win' */
IF t_cARCH == "linux"
aCOMPSUP := { "gcc", "gpp", "owatcom", "mingw", "mingwce" }
ELSE
aCOMPSUP := { "gcc" }
ENDIF
cBin_CompPRG := "harbour"
s_aLIBHBGT := { "gttrm", "gtxwc" }
t_cGTDEFAULT := "gttrm"
CASE t_cARCH == "linux"
aCOMPSUP := { "gcc", "gpp", "owatcom", "mingw", "mingwce" }
cBin_CompPRG := "harbour"
s_aLIBHBGT := { "gttrm", "gtxwc" }
t_cGTDEFAULT := "gtstd"
cDynLibNamePrefix := "lib"
SWITCH t_cARCH
CASE "darwin" ; cDynLibExt := ".dylib" ; EXIT
CASE "hpux" ; cDynLibExt := ".sl" ; EXIT
OTHERWISE ; cDynLibExt := ".so"
ENDSWITCH
CASE t_cARCH == "dos"
aCOMPDET := { { {|| FindInPath( "gcc" ) != NIL }, "djgpp" },;
{ {|| FindInPath( "wpp386" ) != NIL }, "owatcom" } } /* TODO: Add full support for wcc386 */
@@ -382,6 +391,8 @@ FUNCTION Main( ... )
cBin_CompPRG := "harbour.exe"
s_aLIBHBGT := { "gtdos" }
t_cGTDEFAULT := "gtdos"
cDynLibNamePrefix := ""
cDynLibExt := ""
CASE t_cARCH == "os2"
aCOMPDET := { { {|| FindInPath( "gcc" ) != NIL }, "gcc" },;
{ {|| FindInPath( "wpp386" ) != NIL }, "owatcom" },; /* TODO: Add full support for wcc386 */
@@ -390,6 +401,8 @@ FUNCTION Main( ... )
cBin_CompPRG := "harbour.exe"
s_aLIBHBGT := { "gtos2" }
t_cGTDEFAULT := "gtos2"
cDynLibNamePrefix := ""
cDynLibExt := ".dll"
CASE t_cARCH == "win"
/* Order is significant.
owatcom also keeps a cl.exe in it's binary dir. */
@@ -406,6 +419,8 @@ FUNCTION Main( ... )
cBin_CompPRG := "harbour.exe"
s_aLIBHBGT := { "gtwin", "gtwvt", "gtgui" }
t_cGTDEFAULT := "gtwin"
cDynLibNamePrefix := ""
cDynLibExt := ".dll"
OTHERWISE
OutErr( "hbmk: Error: HB_ARCHITECTURE value unknown: " + t_cARCH + hb_osNewLine() )
PauseForKey()
@@ -741,14 +756,15 @@ FUNCTION Main( ... )
@s_lRUN,;
@s_cGT )
CASE Lower( FN_ExtGet( cParam ) ) == ".prg" ; AAdd( s_aPRG , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) == ".rc" ; AAdd( s_aRESSRC , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) == ".res" ; AAdd( s_aRESCMP , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) == ".a" ; AAdd( s_aOBJA , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) $ ".o|.obj" ; AAdd( s_aOBJUSER, PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) $ ".c|.cpp" ; AAdd( s_aC , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) $ ".lib" ; AAddNotEmpty( s_aLIBUSER, PathSepToTarget( ArchCompFilter( cParam ) ) )
OTHERWISE ; AAdd( s_aPRG , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) == ".prg" ; AAdd( s_aPRG , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) == ".rc" ; AAdd( s_aRESSRC , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) == ".res" ; AAdd( s_aRESCMP , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) == ".a" ; AAdd( s_aOBJA , PathSepToTarget( cParam ) )
CASE Lower( FN_ExtGet( cParam ) ) $ ".o|.obj" ; AAdd( s_aOBJUSER, PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) $ ".c|.cpp" ; AAdd( s_aC , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
CASE Lower( FN_ExtGet( cParam ) ) == ".lib" .OR. ;
Lower( FN_ExtGet( cParam ) ) == cDynLibExt ; AAddNotEmpty( s_aLIBUSER, PathSepToTarget( ArchCompFilter( cParam ) ) )
OTHERWISE ; AAdd( s_aPRG , PathSepToTarget( cParam ) ) ; DEFAULT s_cFIRST TO PathSepToSelf( cParam )
ENDCASE
NEXT
@@ -761,9 +777,10 @@ FUNCTION Main( ... )
/* If -o with full name wasn't specified, let's
make it the first source file specified. */
DEFAULT s_cPROGNAME TO s_cFIRST
DEFAULT s_cPROGNAME TO FN_NameGet( s_cFIRST )
IF t_cCOMP $ "mingwce|poccce"
IF t_cCOMP == "mingwce" .OR. ;
t_cCOMP == "poccce"
t_cGTDEFAULT := "gtwvt"
ENDIF
@@ -789,19 +806,25 @@ FUNCTION Main( ... )
s_cPROGNAME := FN_ExtSet( s_cPROGNAME )
ENDIF
IF lSysLoc
cPrefix := PathNormalize( s_cHB_LIB_INSTALL )
ELSE
cPrefix := DirAddPathSep( s_cHB_LIB_INSTALL )
ENDIF
#if 1
cPostfix := ""
HB_SYMBOL_UNUSED( cDL_Version )
#else
cPostfix := "-" + cDL_Version
#endif
DO CASE
CASE t_cARCH $ "bsd|linux|sunos"
s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version + ".so",;
"harbour-" + cDL_Version + ".so" ) }
CASE t_cARCH == "hpux"
s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version + ".sl",;
"harbour-" + cDL_Version + ".sl" ) }
CASE t_cARCH == "darwin"
s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version + ".dylib",;
"harbour-" + cDL_Version + ".dylib" ) }
CASE t_cARCH $ "bsd|linux|hpux|sunos" .OR. t_cARCH == "darwin" /* Separated to avoid match with 'win' */
s_aLIBSHARED := { iif( s_lMT, cPrefix + cDynLibNamePrefix + "harbourmt" + cPostfix + cDynLibExt,;
cPrefix + cDynLibNamePrefix + "harbour" + cPostfix + cDynLibExt ) }
CASE t_cARCH $ "os2|win"
s_aLIBSHARED := { iif( s_lMT, "harbourmt",;
"harbour" ) }
s_aLIBSHARED := { iif( s_lMT, cDynLibNamePrefix + "harbourmt",;
cDynLibNamePrefix + "harbour" ) }
OTHERWISE
s_aLIBSHARED := NIL
ENDCASE
@@ -1173,7 +1196,7 @@ FUNCTION Main( ... )
ENDIF
CASE t_cCOMP == "icc"
cLibPrefix := ""
cLibPrefix := NIL
cLibExt := ".lib"
cObjExt := ".obj"
cLibPathPrefix := NIL /* TODO */
@@ -1349,7 +1372,7 @@ FUNCTION Main( ... )
s_cGT != NIL .OR. ;
s_lFMSTAT != NIL
fhnd := hb_FTempCreateEx( @s_cCSTUB, ".", "hbsc_", ".c" )
fhnd := hb_FTempCreateEx( @s_cCSTUB, NIL, "hbsc_", ".c" )
IF fhnd != F_ERROR
/* NOTE: This has to be kept synced with Harbour HB_IMPORT values. */
@@ -1428,7 +1451,7 @@ FUNCTION Main( ... )
FClose( fhnd )
ELSE
OutErr( "hbmk: Warning: Stub helper .c program couldn't be created." + hb_osNewLine() )
AEval( ListCook( s_aPRG, NIL, ".c" ), {|tmp| FErase( tmp ) } )
AEval( ListDirExt( s_aPRG, "", ".c" ), {|tmp| FErase( tmp ) } )
PauseForKey()
RETURN 5
ENDIF
@@ -1454,17 +1477,9 @@ FUNCTION Main( ... )
/* Merge lib lists. */
s_aLIB := ArrayAJoin( { s_aLIBHB, s_aLIBUSER, s_aLIB3RD, s_aLIBSYS } )
/* Dress lib names. */
s_aLIB := ListCook( s_aLIB, cLibPrefix, cLibExt )
/* Strip 'lib' prefix when the target is gcc family. */
IF t_cCOMP $ "gcc|gpp|mingw|djgpp|rsxnt|rsx32"
FOR EACH tmp IN s_aLIB
IF Left( tmp, 3 ) == "lib"
tmp := SubStr( tmp, 4 )
ENDIF
NEXT
ENDIF
s_aLIB := ListCookLib( s_aLIB, cDynLibExt, cLibPrefix, cLibExt )
/* Dress obj names. */
s_aOBJ := ListCook( ArrayJoin( s_aPRG, s_aC ), NIL, cObjExt )
s_aOBJ := ListDirExt( ArrayJoin( s_aPRG, s_aC ), "", cObjExt )
s_aOBJUSER := ListCook( s_aOBJUSER, NIL, cObjExt )
nErrorLevel := 0
@@ -1476,7 +1491,7 @@ FUNCTION Main( ... )
/* Compiling */
/* Order is significant */
cOpt_CompC := StrTran( cOpt_CompC, "{LC}" , ArrayToList( ArrayJoin( ListCook( s_aPRG, NIL, ".c" ), s_aC ) ) )
cOpt_CompC := StrTran( cOpt_CompC, "{LC}" , ArrayToList( ArrayJoin( ListDirExt( s_aPRG, "", ".c" ), s_aC ) ) )
cOpt_CompC := StrTran( cOpt_CompC, "{LO}" , ArrayToList( ListCook( s_aOBJUSER, cObjPrefix ) ) )
cOpt_CompC := StrTran( cOpt_CompC, "{LA}" , ArrayToList( s_aOBJA ) )
cOpt_CompC := StrTran( cOpt_CompC, "{LL}" , ArrayToList( s_aLIB ) )
@@ -1580,7 +1595,7 @@ FUNCTION Main( ... )
IF ! Empty( s_cCSTUB )
FErase( s_cCSTUB )
ENDIF
AEval( ListCook( s_aPRG, NIL, ".c" ), {|tmp| FErase( tmp ) } )
AEval( ListDirExt( s_aPRG, "", ".c" ), {|tmp| FErase( tmp ) } )
IF ! lStopAfterCComp
AEval( s_aOBJ, {|tmp| FErase( tmp ) } )
ENDIF
@@ -1735,17 +1750,61 @@ STATIC FUNCTION AAddNotEmpty( aArray, xItem )
RETURN aArray
/* Append optional prefix and optional extension to all members */
STATIC FUNCTION ListCook( arraySrc, cPrefix, cExt )
STATIC FUNCTION ListDirExt( arraySrc, cDirNew, cExtNew )
LOCAL array := AClone( arraySrc )
LOCAL tmp
LOCAL cFileName
LOCAL cDir, cName, cExt
DEFAULT cPrefix TO ""
FOR EACH cFileName IN array
hb_FNameSplit( cFileName, @cDir, @cName, @cExt )
IF cDirNew != NIL
cDir := cDirNew
ENDIF
IF cExtNew != NIL
cExt := cExtNew
ENDIF
cFileName := hb_FNameMerge( cDir, cName, cExt )
NEXT
FOR tmp := 1 TO Len( array )
array[ tmp ] := cPrefix + array[ tmp ]
IF ISCHARACTER( cExt )
array[ tmp ] := FN_ExtSet( array[ tmp ], cExt )
RETURN array
/* Forms the list of libs as to appear on the command line */
STATIC FUNCTION ListCookLib( arraySrc, cDynLibExt, cPrefix, cExtNew )
LOCAL array := AClone( arraySrc )
LOCAL cDir, cName, cExt
LOCAL cLibName
FOR EACH cLibName IN array
hb_FNameSplit( cLibName, @cDir, @cName, @cExt )
IF !( cExt == cDynLibExt )
IF cExtNew != NIL
cExt := cExtNew
ENDIF
IF t_cCOMP $ "gcc|gpp|mingw|djgpp|rsxnt|rsx32"
IF Left( cName, 3 ) == "lib"
cName := SubStr( cName, 4 )
ENDIF
ENDIF
IF cPrefix != NIL
cName := cPrefix + cName
ENDIF
cLibName := hb_FNameMerge( cDir, cName, cExtNew )
ENDIF
NEXT
RETURN array
/* Append optional prefix and optional extension to all members */
STATIC FUNCTION ListCook( arraySrc, cPrefix, cExtNew )
LOCAL array := AClone( arraySrc )
LOCAL cItem
FOR EACH cItem IN array
IF cPrefix != NIL
cItem := cPrefix + cItem
ENDIF
IF cExtNew != NIL
cItem := FN_ExtSet( cItem, cExtNew )
ENDIF
NEXT
@@ -1778,6 +1837,34 @@ STATIC FUNCTION ListToArray( cList )
RETURN array
/* NOTE: Can hurt if there are symlinks on the way. */
/* NOTE: This function also add an ending separator. */
STATIC FUNCTION PathNormalize( cPath )
LOCAL nLastSep
LOCAL nNextSep
cPath := DirAddPathSep( cPath )
nLastSep := 0
DO WHILE ( nNextSep := hb_At( hb_osPathSeparator(), cPath, nLastSep + 1 ) ) > 0
SWITCH SubStr( cPath, nLastSep + 1, nNextSep - nLastSep - 1 )
CASE ".."
nLastSep := hb_Rat( hb_osPathSeparator(), cPath, 1, nLastSep - 1 )
IF nLastSep == 0
/* Underflow. Return where we are. */
RETURN cPath
ENDIF
CASE "."
CASE ""
cPath := Left( cPath, nLastSep ) + SubStr( cPath, nNextSep + 1 )
EXIT
OTHERWISE
nLastSep := nNextSep
ENDSWITCH
ENDDO
RETURN cPath
STATIC FUNCTION PathSepToSelf( cFileName )
#if defined( __PLATFORM__WINDOWS ) .OR. ;
defined( __PLATFORM__DOS ) .OR. ;