2017-09-14 23:00 UTC Viktor Szakats (vszakats users.noreply.github.com)

* contrib/hbmisc/tests/pe.prg
  * contrib/hbpost.hbm
  * contrib/hbpre.hbm
  * contrib/make.hb
    * sync text and minor code/comment updates with the 3.4 fork
This commit is contained in:
Viktor Szakats
2017-09-14 23:01:30 +00:00
parent 0764e1b746
commit b16bd0a0fb
5 changed files with 71 additions and 67 deletions

View File

@@ -7,6 +7,13 @@
Entries may not always be in chronological/commit order. Entries may not always be in chronological/commit order.
See license at the end of file. */ See license at the end of file. */
2017-09-14 23:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* contrib/hbmisc/tests/pe.prg
* contrib/hbpost.hbm
* contrib/hbpre.hbm
* contrib/make.hb
* sync text and minor code/comment updates with the 3.4 fork
2017-09-13 21:33 UTC Viktor Szakats (vszakats users.noreply.github.com) 2017-09-13 21:33 UTC Viktor Szakats (vszakats users.noreply.github.com)
* bin/check.hb * bin/check.hb
* contrib/gtwvw/* * contrib/gtwvw/*

View File

@@ -45,30 +45,24 @@ STATIC FUNCTION Example_Text()
STATIC FUNCTION Example_Text_Raw() STATIC FUNCTION Example_Text_Raw()
#pragma __cstream | RETURN %s #pragma __cstream | RETURN %s
~2THE HARBOUR PROJECT LICENSE~1 ~2Lorem ipsum dolor sit amet, consectetur adipiscing elit.~1
~3 =========================== ~3 ========================================================
This program is free software; you can redistribute it and/or modify Integer a dolor eu lorem luctus cursus. Proin varius dui quis felis.
it under the terms of the GNU General Public License as published by Sed vitae lacus ac mauris cursus vehicula. Nulla sodales fringilla
the Free Software Foundation; either version 2 of the License, or lorem. Praesent odio mi, interdum eget, facilisis et, elementum
(at your option) any later version, with one exception: luctus, enim. Vivamus sed est. Cras leo dolor, mollis et, suscipit
sed, interdum ac, elit. Phasellus cursus, arcu nec bibendum cursus,
dolor mi vestibulum leo, ut cursus orci sem id dolor. Morbi porttitor
libero nec risus. Duis diam justo, blandit sed, fermentum eu,
consectetur at, arcu. Quisque felis ipsum, facilisis quis, ultrices
sed, venenatis aliquam, urna. Cras sit amet risus. Pellentesque
dictum. In hac habitasse platea dictumst.
The exception is that if you link the Harbour Runtime Library (HRL) Nunc odio elit, mattis et, rutrum id, faucibus vitae, ipsum. Donec
and/or the Harbour Virtual Machine (HVM) with other files to produce aliquet sem sed augue. Aliquam erat volutpat. Etiam ultrices, metus
an executable, this does not by itself cause the resulting executable a tristique ornare, tellus urna congue nunc, vitae iaculis risus
to be covered by the GNU General Public License. Your use of that enim quis magna.
executable is in no way restricted on account of linking the HRL
and/or HVM code into it.
This program is distributed in the hope that it will be useful,
but ~2WITHOUT ANY WARRANTY~1; without even the implied warranty of
~4MERCHANTABILITY~1 or ~5FITNESS FOR A PARTICULAR PURPOSE~1. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
their web site at https://www.gnu.org/).
~5This file have to be separated with CR/LF characters~1 ~5This file have to be separated with CR/LF characters~1
#pragma __endtext #pragma __endtext

View File

@@ -1,3 +1,5 @@
# Copyright 2010 Viktor Szakats (vszakats.net/harbour)
# These are mandatory inside Harbour repository, they will always # These are mandatory inside Harbour repository, they will always
# override project options. # override project options.

View File

@@ -1,3 +1,5 @@
# Copyright 2010 Viktor Szakats (vszakats.net/harbour)
# These may be overridden by local project options. # These may be overridden by local project options.
-q0 -q0
@@ -12,9 +14,4 @@
{(HB_BUILD_MODE='cpp')|(!HB_BUILD_MODE&allmsvc)}-cpp=yes {(HB_BUILD_MODE='cpp')|(!HB_BUILD_MODE&allmsvc)}-cpp=yes
{HB_BUILD_MODE='c'}-cpp=no {HB_BUILD_MODE='c'}-cpp=no
-c=iso90
# For cegcc Windows headers
-c=gnu90{wce&allmingw}
-warn=yes -warn=yes

View File

@@ -1,4 +1,4 @@
#!/usr/bin/hbrun --hb:gtcgi #!/usr/bin/env hbmk2
/* /*
* Package build orchestrator script * Package build orchestrator script
* *
@@ -15,9 +15,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software Foundation,
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* their web site at https://www.gnu.org/). * (or visit their website at https://www.gnu.org/licenses/).
* *
*/ */
@@ -103,7 +103,7 @@ PROCEDURE Main( ... )
#4 install install _ACT_INC_INST -inc -instpath= #4 install install _ACT_INC_INST -inc -instpath=
#5 clean install clean install _ACT_INC_REBUILD_INST -inc -rebuildall -instpath= #5 clean install clean install _ACT_INC_REBUILD_INST -inc -rebuildall -instpath=
*/ */
PROCEDURE Standalone( aParams, hProjectList ) STATIC PROCEDURE Standalone( aParams, hProjectList )
LOCAL hProjectReqList LOCAL hProjectReqList
@@ -116,7 +116,7 @@ PROCEDURE Standalone( aParams, hProjectList )
LOCAL lCustom LOCAL lCustom
LOCAL cCustomDir LOCAL cCustomDir
/* Processing cmdline options */ /* Processing command-line options */
DO CASE DO CASE
CASE AScanL( aParams, "clean" ) > 0 .AND. ; CASE AScanL( aParams, "clean" ) > 0 .AND. ;
@@ -142,24 +142,25 @@ PROCEDURE Standalone( aParams, hProjectList )
cOptionsUser := "" cOptionsUser := ""
lCustom := .F. lCustom := .F.
FOR EACH tmp IN aParams FOR EACH tmp IN aParams
IF !( Lower( tmp ) == "install" ) .AND. ; IF ! Lower( tmp ) == "install" .AND. ;
!( Lower( tmp ) == "clean" ) .AND. ; ! Lower( tmp ) == "clean" .AND. ;
!( Lower( tmp ) == "all" ) .AND. ; ! Lower( tmp ) == "all" .AND. ;
!( Lower( tmp ) == "first" ) .AND. ; ! Lower( tmp ) == "first" .AND. ;
!( Lower( tmp ) == "rebuild" ) .AND. ; ! Lower( tmp ) == "rebuild" .AND. ;
!( Lower( tmp ) == "verbose" ) ! Lower( tmp ) == "verbose"
cOptionsUser += " " + tmp cOptionsUser += " " + tmp
/* If anything else is passed than options or GNU Make keywords, /* If anything else is passed than options or GNU Make keywords,
consider it a custom project build, f.e. in tests */ consider it a custom project build, f.e. in tests */
IF !( Left( tmp, 1 ) == "-" ) IF ! Left( tmp, 1 ) == "-"
lCustom := .T. lCustom := .T.
ENDIF ENDIF
ENDIF ENDIF
NEXT NEXT
/* Assemble list of primary targets (registered projects in current directory) */ /* Assemble list of primary targets (registered projects in or under
current directory) */
hProjectReqList := { => } hProjectReqList := { => }
@@ -172,7 +173,8 @@ PROCEDURE Standalone( aParams, hProjectList )
ENDIF ENDIF
IF ! lCustom IF ! lCustom
/* Find out which projects are in current dir, these will be our primary targets */ /* Find out which projects are in current dir, these will be our
primary targets */
FOR EACH tmp IN hProjectList FOR EACH tmp IN hProjectList
tmp1 := hb_ps() + hb_FNameDir( hb_DirSepToOS( tmp:__enumKey() ) ) tmp1 := hb_ps() + hb_FNameDir( hb_DirSepToOS( tmp:__enumKey() ) )
IF tmp1 == Right( hb_cwd(), Len( tmp1 ) ) /* Not ultimate solution */ IF tmp1 == Right( hb_cwd(), Len( tmp1 ) ) /* Not ultimate solution */
@@ -216,7 +218,7 @@ PROCEDURE Standalone( aParams, hProjectList )
#6 install clean install install clean _ACT_INC_INST -inc -instpath= #6 install clean install install clean _ACT_INC_INST -inc -instpath=
clean install clean _ACT_INC_CLEAN -inc -clean clean install clean _ACT_INC_CLEAN -inc -clean
*/ */
PROCEDURE GNUMake( aParams, hProjectList ) STATIC PROCEDURE GNUMake( aParams, hProjectList )
LOCAL cProject LOCAL cProject
LOCAL hProjectReqList LOCAL hProjectReqList
@@ -255,11 +257,10 @@ PROCEDURE GNUMake( aParams, hProjectList )
IF AScanL( aGNUMakeParams, "clean" ) > 0 .AND. ; IF AScanL( aGNUMakeParams, "clean" ) > 0 .AND. ;
AScanL( aGNUMakeParams, "install" ) > 0 .AND. ; AScanL( aGNUMakeParams, "install" ) > 0 .AND. ;
AScanL( aGNUMakeParams, "install" ) > AScanL( aGNUMakeParams, "clean" ) AScanL( aGNUMakeParams, "install" ) > AScanL( aGNUMakeParams, "clean" )
/* Use rebuild mode. This is needed because the clean phase /* Use rebuild mode. This is needed because the clean phase might not
might not have been called previously by GNU Make, f.e. have been called previously by core GNU Make, f.e. because hbrun
because hbrun or hbmk2 wasn't available. -rebuildall is or hbmk2 wasn't available. -rebuildall is costless, so we do it to
costless, so we do it to make sure to build cleanly. make sure to build cleanly. [vszakats] */
[vszakats] */
nAction := _ACT_INC_REBUILD_INST nAction := _ACT_INC_REBUILD_INST
ELSE ELSE
nAction := _ACT_INC_INST nAction := _ACT_INC_INST
@@ -339,7 +340,7 @@ PROCEDURE GNUMake( aParams, hProjectList )
hb_SetEnv( "_HB_INSTALL_ETC", GetEnv( "HB_INSTALL_ETC" ) ) hb_SetEnv( "_HB_INSTALL_ETC", GetEnv( "HB_INSTALL_ETC" ) )
hb_SetEnv( "_HB_INSTALL_CONTRIB", GetEnv( "HB_INSTALL_CONTRIB" ) ) hb_SetEnv( "_HB_INSTALL_CONTRIB", GetEnv( "HB_INSTALL_CONTRIB" ) )
/* Override hbmk2 autodetection. WARNING: Must be in sync with global.mk logic */ /* Override hbmk2 auto-detection. WARNING: Must be in sync with global.mk logic */
hb_SetEnv( "HB_INSTALL_PREFIX", s_cRoot ) hb_SetEnv( "HB_INSTALL_PREFIX", s_cRoot )
hb_SetEnv( "HB_INSTALL_BIN", s_cRoot + "bin/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) hb_SetEnv( "HB_INSTALL_BIN", s_cRoot + "bin/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) )
hb_SetEnv( "HB_INSTALL_LIB", s_cRoot + "lib/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) ) hb_SetEnv( "HB_INSTALL_LIB", s_cRoot + "lib/" + GetEnv( "HB_PLATFORM" ) + "/" + GetEnv( "HB_COMPILER" ) + GetEnv( "HB_BUILD_NAME" ) )
@@ -392,7 +393,8 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption
aSortedList := TopoSort( aPairList ) aSortedList := TopoSort( aPairList )
/* Add referenced project not present in our list and featuring an .hbp file */ /* Add referenced project not present in our list and featuring an .hbp
file */
FOR EACH cProject IN aSortedList FOR EACH cProject IN aSortedList
IF AddProject( hProjectList, @cProject ) IF AddProject( hProjectList, @cProject )
call_hbmk2_hbinfo( s_cBase + s_cHome + cProject, hProjectList[ cProject ] ) call_hbmk2_hbinfo( s_cBase + s_cHome + cProject, hProjectList[ cProject ] )
@@ -404,9 +406,9 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption
(we need "cType" to decide about dynamic build) */ (we need "cType" to decide about dynamic build) */
IF GetEnv( "HB_BUILD_CONTRIB_DYN" ) == "yes" IF GetEnv( "HB_BUILD_CONTRIB_DYN" ) == "yes"
FOR EACH cProject IN aSortedList FOR EACH cProject IN aSortedList
IF !( cProject $ hProjectReqList ) .AND. ; IF ! cProject $ hProjectReqList .AND. ;
cProject $ hProjectList .AND. ; cProject $ hProjectList .AND. ;
!( "lChecked" $ hProjectList[ cProject ] ) ! "lChecked" $ hProjectList[ cProject ]
call_hbmk2_hbinfo( s_cBase + s_cHome + cProject, hProjectList[ cProject ] ) call_hbmk2_hbinfo( s_cBase + s_cHome + cProject, hProjectList[ cProject ] )
ENDIF ENDIF
NEXT NEXT
@@ -415,18 +417,20 @@ STATIC PROCEDURE build_projects( nAction, hProjectList, hProjectReqList, cOption
/* Convert action to hbmk2 options */ /* Convert action to hbmk2 options */
cOptions := " -inc" cOptions := " -inc"
IF nAction == _ACT_INC_CLEAN SWITCH nAction
CASE _ACT_INC_CLEAN
cOptions += " -clean" cOptions += " -clean"
ELSEIF nAction == _ACT_INC_REBUILD .OR. ; EXIT
nAction == _ACT_INC_REBUILD_INST CASE _ACT_INC_REBUILD
CASE _ACT_INC_REBUILD_INST
cOptions += " -rebuildall" cOptions += " -rebuildall"
ENDIF EXIT
ENDSWITCH
cMakeFlags := GetEnv( "MAKEFLAGS" ) cMakeFlags := GetEnv( "MAKEFLAGS" )
IF " -j " $ " " + cMakeFlags + " " IF " -j " $ " " + cMakeFlags + " "
/* GNU Make uses job server to limit number of concurrent operations /* GNU Make uses job server to limit number of concurrent operations
* We cannot read it from MAKEFLAGS so I set it to arbitrary value: 8 We cannot read it from MAKEFLAGS so I set it to arbitrary value: 8 */
*/
cOptions += " -jobs=8" cOptions += " -jobs=8"
ENDIF ENDIF
@@ -643,7 +647,7 @@ STATIC PROCEDURE DeptLinesToDeptPairList( aPairList, cParent, aFlatTree )
AddDeptPair( aPairList, "", cParent ) AddDeptPair( aPairList, "", cParent )
hNode := { "child" => {}, "name" => cParent, "parent" => NIL } hNode := { "child" => {}, "name" => cParent, "parent" => }
nLevel := 0 nLevel := 0
FOR EACH hFlatTreeElement IN aFlatTree FOR EACH hFlatTreeElement IN aFlatTree
/* Min() protects against jumping more than one level down in one step */ /* Min() protects against jumping more than one level down in one step */
@@ -699,7 +703,7 @@ STATIC FUNCTION TopoSort( aEdgeList )
FOR EACH tmp IN aEdgeList FOR EACH tmp IN aEdgeList
IF tmp[ 1 ] == n IF tmp[ 1 ] == n
m := tmp[ 2 ] m := tmp[ 2 ]
tmp[ 1 ] := tmp[ 2 ] := NIL /* set to invalid value. TOOPT: Delete this member from list */ tmp[ 1 ] := tmp[ 2 ] := NIL /* set to invalid value. TOOPT: Delete this member from list */
IF AScan( aEdgeList, {| tmp | tmp[ 2 ] == m } ) == 0 IF AScan( aEdgeList, {| tmp | tmp[ 2 ] == m } ) == 0
hTopNodes[ m ] := NIL hTopNodes[ m ] := NIL
ENDIF ENDIF
@@ -715,7 +719,7 @@ STATIC FUNCTION TopoSort( aEdgeList )
RETURN aList RETURN aList
FUNCTION AddProject( hProjectList, cFileName ) STATIC FUNCTION AddProject( hProjectList, cFileName )
LOCAL cDir LOCAL cDir
LOCAL cName LOCAL cName
@@ -727,11 +731,12 @@ FUNCTION AddProject( hProjectList, cFileName )
hb_FNameSplit( cFileName, @cDir, @cName, @cExt ) hb_FNameSplit( cFileName, @cDir, @cName, @cExt )
IF Empty( cName ) DO CASE
CASE Empty( cName )
cName := DirGetName( cDir ) cName := DirGetName( cDir )
ELSEIF Empty( cDir ) CASE Empty( cDir )
cDir := cName cDir := cName
ENDIF ENDCASE
IF Empty( cExt ) IF Empty( cExt )
cExt := ".hbp" cExt := ".hbp"
ENDIF ENDIF
@@ -745,12 +750,11 @@ FUNCTION AddProject( hProjectList, cFileName )
RETURN .T. RETURN .T.
ENDIF ENDIF
ENDIF ENDIF
ENDIF ENDIF
RETURN .F. RETURN .F.
PROCEDURE LoadProjectListFromFile( hProjectList, cFileName ) STATIC PROCEDURE LoadProjectListFromFile( hProjectList, cFileName )
LOCAL cItem LOCAL cItem
@@ -763,7 +767,7 @@ PROCEDURE LoadProjectListFromFile( hProjectList, cFileName )
RETURN RETURN
PROCEDURE LoadProjectListFromString( hProjectList, cString ) STATIC PROCEDURE LoadProjectListFromString( hProjectList, cString )
LOCAL cItem LOCAL cItem