2010-08-05 07:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* config/hbextern.hbs
    + Added HB_REBUILD_EXTERN support for msvc, pocc, watcom and bcc
      compilers.

  * contrib/make.hbs
  * config/postinst.hbs
    ! Fixed to convert input file for extern generation to native format.
This commit is contained in:
Viktor Szakats
2010-08-05 05:59:30 +00:00
parent 878e9a84f0
commit a0bab8110b
4 changed files with 54 additions and 8 deletions

View File

@@ -16,6 +16,15 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-08-05 07:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/hbextern.hbs
+ Added HB_REBUILD_EXTERN support for msvc, pocc, watcom and bcc
compilers.
* contrib/make.hbs
* config/postinst.hbs
! Fixed to convert input file for extern generation to native format.
2010-08-05 01:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Added ${hb_dynsuffix} macro which returns a dynlib suffix

View File

@@ -37,29 +37,64 @@
#define _HB_SELF_SUFFIX "__"
STATIC FUNCTION __hb_extern_get_list( cInputName )
LOCAL aExtern := NIL
LOCAL cStdOut
LOCAL cTempFile
LOCAL hRegex
LOCAL aResult
LOCAL aExtern
LOCAL tmp
IF GetEnv( "HB_COMPILER" ) $ "gcc|mingw|mingw64|cygwin"
LOCAL cCommand
LOCAL cRegex
DO CASE
CASE "|" + GetEnv( "HB_COMPILER" ) $ "|gcc|mingw|mingw64|cygwin|djgpp"
cCommand := "nm -g" + iif( GetEnv( "HB_PLATFORM" ) == "darwin", "", " --defined-only -C" ) + " {I}"
cRegex := "[[:blank:]]HB_FUN_(.*)[[:space:]]"
CASE "|" + GetEnv( "HB_COMPILER" ) $ "|msvc|msvc64|pocc|pocc64"
IF "|" + GetEnv( "HB_COMPILER" ) $ "|msvc|msvc64"
cCommand := "dumpbin -symbols {I}"
ELSE
cCommand := "podump -symbols {I}"
ENDIF
cRegex := "SECT[0-9A-Z][0-9A-Z ].*[Ee]xternal.*_?HB_FUN_(.*)[[:space:]]"
CASE GetEnv( "HB_COMPILER" ) == "watcom"
cCommand := "wlib {I}"
cRegex := "[[:space:]]_?HB_FUN_([A-Z0-9_]*)[[:space:]]"
CASE GetEnv( "HB_COMPILER" ) == "bcc"
cCommand := "tlib {I}, {T}"
cRegex := "[[:space:]]_?HB_FUN_([A-Z0-9_]*)"
ENDCASE
IF ! Empty( cCommand ) .AND. ;
! Empty( cRegex )
IF hb_FileExists( cInputName )
IF hb_processRun( "nm -g --defined-only -C " + cInputName,, @cStdOut ) == 0
IF ! Empty( hRegex := hb_regexComp( "[[:blank:]]HB_FUN_(.*)[[:space:]]", .T., .T. ) )
cCommand := StrTran( cCommand, "{I}", cInputName )
IF "{T}" $ cCommand
FClose( hb_FTempCreateEx( @cTempFile,,, ".tmp" ) )
cCommand := StrTran( cCommand, "{T}", cTempFile )
ENDIF
IF hb_processRun( cCommand,, @cStdOut ) == 0
IF ! Empty( cTempFile )
cStdOut := MemoRead( cTempFile )
ENDIF
IF ! Empty( hRegex := hb_regexComp( cRegex, .T., .T. ) )
aResult := hb_regexAll( hRegex, StrTran( cStdOut, Chr( 13 ) ),,,,, .T. )
aExtern := {}
FOR EACH tmp IN aResult
AAdd( aExtern, tmp[ 2 ] )
NEXT
ASort( aExtern,,, {| tmp, tmp1 | tmp < tmp1 } )
RETURN aExtern
ENDIF
ENDIF
IF ! Empty( cTempFile )
FErase( cTempFile )
ENDIF
ENDIF
ENDIF
RETURN NIL
RETURN aExtern
STATIC PROCEDURE __hb_extern_get_neg_list( cInputName, /* @ */ aInclude, /* @ */ aExclude )
LOCAL cFile

View File

@@ -543,7 +543,8 @@ STATIC FUNCTION mk_extern_core()
IF GetEnv( "HB_REBUILD_EXTERN" ) == "yes" .AND. ;
! Empty( GetEnv( "HB_DYNLIB_ST" ) )
IF ( aExtern := __hb_extern_get_list( GetEnv( "HB_DYNLIB_DIR" ) + hb_ps() + GetEnv( "HB_DYNLIB_ST" ) + GetEnv( "HB_DYNLIB_EXT" ) ) ) != NIL
/* TOFIX: Use list of libs instead of dynamic lib */
IF ( aExtern := __hb_extern_get_list( PathToSelf( GetEnv( "HB_DYNLIB_DIR" ) ) + hb_ps() + GetEnv( "HB_DYNLIB_ST" ) + GetEnv( "HB_DYNLIB_EXT" ) ) ) != NIL
OutStd( "! Generating core extern headers..." + hb_eol() )

View File

@@ -440,7 +440,8 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption
/* Create EXTERN list */
IF lPrimary .AND. hProjectList[ cProject ][ "cType" ] $ "hblib|hbdyn"
mk_extern_lib( hProjectList[ cProject ][ "cOutputName" ], FNameExtSet( PathSepToSelf( cProjectPath ), ".hbx" ) )
mk_extern_lib( PathSepToSelf( hProjectList[ cProject ][ "cOutputName" ] ),;
FNameExtSet( PathSepToSelf( cProjectPath ), ".hbx" ) )
ENDIF
ENDIF
NEXT