2010-05-12 22:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* INSTALL
    * Two minor cleanups

  * config/postinst.prg
    + Will now honor HB_CONTRIBLIBS and HB_CONTRIB_ADDONS
      when creating import libraries. IOW it will only create
      implibs to the contribs actually built.

  * utils/hbmk2/hbmk2.prg
    + Added trick when using real xhb toolchain to detect
      -tW C flag and in this case automatically select the ST
      C RTL library. (Notice that -tW will only be detected
      when passed normally via cmdline or script, and not
      when using legacy HB_BUILD_CFLAGS envvar or inherited
      compiler flags).
This commit is contained in:
Viktor Szakats
2010-05-12 20:19:12 +00:00
parent 78ff060214
commit 90ef2137c0
4 changed files with 79 additions and 13 deletions

View File

@@ -17,6 +17,23 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-05-12 22:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* INSTALL
* Two minor cleanups
* config/postinst.prg
+ Will now honor HB_CONTRIBLIBS and HB_CONTRIB_ADDONS
when creating import libraries. IOW it will only create
implibs to the contribs actually built.
* utils/hbmk2/hbmk2.prg
+ Added trick when using real xhb toolchain to detect
-tW C flag and in this case automatically select the ST
C RTL library. (Notice that -tW will only be detected
when passed normally via cmdline or script, and not
when using legacy HB_BUILD_CFLAGS envvar or inherited
compiler flags).
2010-05-12 18:34 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/postinst.prg
- Deleted -trace option left there.

View File

@@ -534,7 +534,7 @@ HARBOUR
wce
---
mingw - MinGW GNU C x86
mingwarm - MinGW GNU C ARM (from CEGCC 0.55 and above)
mingwarm - MinGW GNU C ARM (CEGCC 0.55 and above)
msvcarm - Microsoft Visual C++ ARM
poccarm - Pelles C 5.0 ARM
@@ -652,9 +652,9 @@ HARBOUR
- HB_UTIL_ADDONS=<list> Build space separated <list> of additional
utilities stored in the utils directory.
- HB_COMPILER_VER=[<ver>] Set C compiler version. This is used with msvc
targets currently.
and mingw/cygwin targets currently.
<ver> format:
<9><0><0> = <major><minor>[.<revision>]
<9><0>[<0>] = <major><minor>[.<revision>]
Default: filled by compiler autodetection or empty
- HB_USER_LIBS=[<list>] Add space separated <list> of libs to link process.
Lib names should be without extension and path.

View File

@@ -76,14 +76,10 @@ PROCEDURE Main()
GetEnv( "HB_BUILD_IMPLIB" ) == "yes" .AND. ;
! Empty( GetEnv( "HB_HOST_BIN_DIR" ) )
FOR EACH tmp IN Directory( "contrib\*", "D" )
IF "D" $ tmp[ F_ATTR ] .AND. ;
!( tmp[ F_NAME ] == "." ) .AND. ;
!( tmp[ F_NAME ] == ".." ) .AND. ;
hb_FileExists( "contrib\" + tmp[ F_NAME ] + "\" + tmp[ F_NAME ] + ".hbi" )
FOR EACH tmp IN PackageList( "contrib\*", GetEnv( "HB_CONTRIBLIBS" ), GetEnv( "HB_CONTRIB_ADDONS" ) )
IF hb_FileExists( "contrib\" + tmp + "\" + tmp + ".hbi" )
hb_processRun( GetEnv( "HB_HOST_BIN_DIR" ) + _PS_ + "hbmk2" +;
" @" + "contrib\" + tmp[ F_NAME ] + "\" + tmp[ F_NAME ] + ".hbi " +;
" @" + "contrib\" + tmp + "\" + tmp + ".hbi " +;
"-o${HB_LIB_INSTALL}/" )
ENDIF
NEXT
@@ -169,3 +165,44 @@ PROCEDURE Main()
STATIC FUNCTION FN_Escape( cFN )
RETURN Chr( 34 ) + cFN + Chr( 34 )
/* NOTE: Must be in sync with contrib/Makefile logic */
STATIC FUNCTION PackageList( cMask, cBase, cAddOn )
LOCAL aList := {}
LOCAL aBase
LOCAL tmp
aBase := iif( Empty( cBase ), {}, hb_ATokens( cBase,, .T. ) )
DO CASE
CASE Len( aBase ) == 1 .AND. aBase[ 1 ] == "no"
/* fall through */
CASE Len( aBase ) > 1 .AND. aBase[ 1 ] == "no"
hb_ADel( aBase, 1, .T. )
FOR EACH tmp IN Directory( cMask, "D" )
IF "D" $ tmp[ F_ATTR ] .AND. !( tmp[ F_NAME ] == "." ) .AND. !( tmp[ F_NAME ] == ".." ) .AND. ;
AScan( aBase, {| tmp1 | tmp1 == tmp[ F_NAME ] } ) == 0
AAdd( aList, tmp[ F_NAME ] )
ENDIF
NEXT
CASE Len( aBase ) > 0
aList := hb_ATokens( cBase,, .T. )
OTHERWISE
FOR EACH tmp IN Directory( cMask, "D" )
IF "D" $ tmp[ F_ATTR ] .AND. !( tmp[ F_NAME ] == "." ) .AND. !( tmp[ F_NAME ] == ".." )
AAdd( aList, tmp[ F_NAME ] )
ENDIF
NEXT
ENDCASE
IF ! Empty( cAddOn )
FOR EACH tmp IN hb_ATokens( cAddOn,, .T. )
IF ! Empty( tmp )
IF AScan( aList, {| tmp1 | tmp1 == tmp } ) == 0
AAdd( aList, tmp )
ENDIF
ENDIF
NEXT
ENDIF
RETURN aList

View File

@@ -689,6 +689,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
LOCAL cPath_CompC
LOCAL nErrorLevel := 0
LOCAL tmp, tmp1, tmp2, tmp3, array
LOCAL cLibBCC_CRTL
LOCAL cScriptFile
LOCAL fhnd
LOCAL cFile
@@ -3183,10 +3184,21 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
cOptIncMask := "-I{DI}"
cBin_CompC := "bcc32.exe"
cBin_CompCPP := cBin_CompC
cOpt_CompC := "-c -q -tWM"
cOpt_CompC := "-c -q"
IF hbmk[ _HBMK_lOPTIM ]
cOpt_CompC += " -d -6 -O2 -OS -Ov -Oi -Oc"
ENDIF
cLibBCC_CRTL := "cw32mt.lib"
IF hbmk[ _HBMK_nHBMODE ] == _HBMODE_XHB
/* Adding weird hack for xhb to make it possible to force ST C mode. */
IF AScan( hbmk[ _HBMK_aOPTC ], {| tmp | tmp == "-tW" } ) == 0
AAdd( hbmk[ _HBMK_aOPTC ], "-tWM" )
ELSE
cLibBCC_CRTL := "cw32.lib"
ENDIF
ELSE
AAdd( hbmk[ _HBMK_aOPTC ], "-tWM" )
ENDIF
SWITCH hbmk[ _HBMK_nWARN ]
CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q" ) ; EXIT
CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q -w-sig-" ) ; EXIT
@@ -3199,8 +3211,8 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause )
cResExt := ".res"
cBin_Link := "ilink32.exe"
cBin_Dyn := cBin_Link
cOpt_Link := '-Gn -Tpe -L{DL} {FL} ' + iif( hbmk[ _HBMK_lGUI ], "c0w32.obj", "c0x32.obj" ) + " {LO}, {OE}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} cw32mt.lib import32.lib,, {LS}{SCRIPT}"
cOpt_Dyn := '-Gn -Tpd -L{DL} {FD} ' + "c0d32.obj" + " {LO}, {OD}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} cw32mt.lib import32.lib,, {LS}{SCRIPT}"
cOpt_Link := '-Gn -Tpe -L{DL} {FL} ' + iif( hbmk[ _HBMK_lGUI ], "c0w32.obj", "c0x32.obj" ) + " {LO}, {OE}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} " + cLibBCC_CRTL + " import32.lib,, {LS}{SCRIPT}"
cOpt_Dyn := '-Gn -Tpd -L{DL} {FD} ' + "c0d32.obj" + " {LO}, {OD}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} " + cLibBCC_CRTL + " import32.lib,, {LS}{SCRIPT}"
bBlk_ImpLib := {| cSourceDLL, cTargetLib, cFlags | win_implib_command( hbmk, "implib.exe {FI} {OL} {ID}", nCmd_Esc, cSourceDLL, cTargetLib, cFlags ) }
cLibPathPrefix := ""
cLibPathSep := ";"