From 3d884b5706134dee4d87b0be0fc7d08cd6fee44f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 29 Jul 2010 08:44:34 +0000 Subject: [PATCH] 2010-07-29 10:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbrun/hbrun.prg + Making available original hbrun location using __HBRUN__DIRBASE envvar. This information is lost when doing the argshift trick, pls shout if you see a better solution for it (or any concerns with this one). * contrib/make.hbs + Will now use unified method for both stdalone and GNU Make to find out the location of hbmk2. It will look for it in the same dir as of hbrun's. * config/postinst.hbs * Converting bash to .prg in progress. * INSTALL + Documented Mac OS X architecture flags. --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/INSTALL | 9 +++++++++ harbour/config/postinst.hbs | 21 +++++++-------------- harbour/contrib/make.hbs | 34 +++++++++++++++++----------------- harbour/utils/hbrun/hbrun.prg | 1 + 5 files changed, 52 insertions(+), 31 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b5f63ead3b..e8d55fe097 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,24 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-29 10:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbrun/hbrun.prg + + Making available original hbrun location using __HBRUN__DIRBASE + envvar. This information is lost when doing the argshift trick, + pls shout if you see a better solution for it (or any concerns + with this one). + + * contrib/make.hbs + + Will now use unified method for both stdalone and GNU Make to + find out the location of hbmk2. It will look for it in the same + dir as of hbrun's. + + * config/postinst.hbs + * Converting bash to .prg in progress. + + * INSTALL + + Documented Mac OS X architecture flags. + 2010-07-29 00:36 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/Makefile * include/hbapifs.h diff --git a/harbour/INSTALL b/harbour/INSTALL index 46a642b62e..d6f49df3bb 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -137,6 +137,15 @@ HARBOUR $ ./hello You should see 'Hello world!' on screen. + NOTE: You can override default (host) architecture by adding + values below to HB_USER_CFLAGS, HB_USER_LDFLAGS, HB_USER_DFLAGS + envvars, you can use multiple values: + + Intel 32-bit: "-arch i386" + Intel 64-bit: "-arch ppc" + PPC 32-bit: "-arch x86_64" + PPC 64-bit: "-arch ppc64" + on BSD/HP-UX/Solaris/BeOS/Haiku/QNX/*nix hosts ---------------------------------------------- (possible cross-build targets: Windows, Windows CE, MS-DOS) diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index 5b30edb34f..968ad2084e 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -130,21 +130,20 @@ PROCEDURE Main() /* TOFIX: Rewrite this in .prg */ #if 0 - for l in ${full_lib_name} ${full_lib_name_mt} - do - if [ -f $l ] - then + FOR EACH tmp IN { GetEnv( "HB_DYNLIB_ST" ), GetEnv( "HB_DYNLIB_MT" ) } + + OutStd( GetEnv( "HB_DYN_INSTALL" + hb_ps() + tmp + hb_eol() ) ll="` echo $l | sed 's!'${lib_suff}'$!!' `${lib_ext}" ln -sf $l $ll IF !( GetEnv( "HB_PLATFORM" ) $ "win|wce" ) - case $HB_LIB_INSTALL in - /usr/lib/harbour|/usr/lib64/harbour|/usr/local/lib/harbour|/usr/local/lib64/harbour) + DO CASE + CASE GetEnv( "HB_LIB_INSTALL" ) $ "/usr/lib/harbour|/usr/lib64/harbour|/usr/local/lib/harbour|/usr/local/lib64/harbour" ln -sf harbour/$l ../$ll ln -sf harbour/$l ../$l ;; - /usr/local/harbour/lib) + CASE GetEnv( "HB_LIB_INSTALL" ) $ "/usr/local/harbour/lib" ld="/usr/lib" if [ -n "${HB_INST_PKGPREF}" ] || [ -w $ld ] then @@ -155,13 +154,7 @@ PROCEDURE Main() ;; *) ;; - esac - ld := "/etc/ld.so.conf.d" - if [ -d $ld ] && ( [ -n "${HB_INST_PKGPREF}" ] || [ -w $ld ] ) - then - mkdir -p ${HB_INST_PKGPREF}$ld - echo "$HB_LIB_INSTALL" > ${HB_INST_PKGPREF}/$ld/harbour.conf - fi + ENDCASE ENDIF fi done diff --git a/harbour/contrib/make.hbs b/harbour/contrib/make.hbs index 4a3b5a818c..a69c8fc60f 100755 --- a/harbour/contrib/make.hbs +++ b/harbour/contrib/make.hbs @@ -68,6 +68,7 @@ STATIC hActions := {; STATIC s_cBase STATIC s_cHome STATIC s_cRoot +STATIC s_cBinDir PROCEDURE Main( ... ) LOCAL hPackageList @@ -76,6 +77,12 @@ PROCEDURE Main( ... ) s_cHome := StrTran( hb_DirBase(), hb_ps(), "/" ) s_cRoot := s_cHome + "../" + #if defined( __HBSCRIPT__HBRUN ) + s_cBinDir := PathSepToSelf( GetEnv( "__HBRUN__DIRBASE" ) ) + #else + s_cBinDir := hb_DirBase() + #endif + /* Load list of packages */ hPackageList := { => } @@ -107,7 +114,6 @@ PROCEDURE Standalone( aParams, hPackageList ) LOCAL aSortedList LOCAL cPWD - LOCAL cBinDir LOCAL cPackage LOCAL cMyPackage @@ -176,10 +182,8 @@ PROCEDURE Standalone( aParams, hPackageList ) ENDIF ENDIF - cBinDir := s_cRoot + "bin" + hb_ps() - IF lCustom - mk_hb_processRun( PathSepToSelf( cBinDir ) + "hbmk2" + cOptionsUser ) + mk_hb_processRun( s_cBinDir + "hbmk2" + cOptionsUser ) ELSE /* Converting build options to hbmk2 options */ @@ -196,15 +200,14 @@ PROCEDURE Standalone( aParams, hPackageList ) /* Query project information and dependencies and calculate build order */ aPairList := {} - call_hbmk2_hbinfo( cBinDir, s_cBase + hPackageList[ cMyPackage ][ "cFileName" ], hPackageList[ cMyPackage ] ) + call_hbmk2_hbinfo( s_cBase + hPackageList[ cMyPackage ][ "cFileName" ], hPackageList[ cMyPackage ] ) DeptLinesToDeptPairList( aPairList, cMyPackage, hPackageList[ cMyPackage ][ "aDept" ] ) aSortedList := TopoSort( aPairList ) /* Build the dependencies and ourselves in in sorted order */ FOR EACH cPackage IN aSortedList DESCEND - call_hbmk2( cBinDir,; - s_cBase + iif( cPackage == cMyPackage, "", s_cHome + cPackage + "/" ) + hPackageList[ cPackage ][ "cFileName" ],; + call_hbmk2( s_cBase + iif( cPackage == cMyPackage, "", s_cHome + cPackage + "/" ) + hPackageList[ cPackage ][ "cFileName" ],; iif( cPackage == cMyPackage, cOptions + cOptionsUser, " -inc" ), "" ) NEXT ENDIF @@ -228,7 +231,6 @@ PROCEDURE Standalone( aParams, hPackageList ) clean install clean _ACT_INC_CLEAN -inc -clean */ PROCEDURE GNUMake( aParams, hPackageList ) - LOCAL cBinDir LOCAL hProject LOCAL cProject LOCAL cPackage @@ -337,14 +339,12 @@ PROCEDURE GNUMake( aParams, hPackageList ) /* Preprocessing */ - cBinDir := GetEnv( "HB_HOST_BIN_DIR" ) + hb_ps() - OutStd( "! Calculating build order for packages..." + hb_eol() ) aPairList := {} FOR EACH hProject IN hPackageList - call_hbmk2_hbinfo( cBinDir, s_cBase + hProject:__enumKey() + "/" + hProject[ "cFileName" ], hProject ) + call_hbmk2_hbinfo( s_cBase + hProject:__enumKey() + "/" + hProject[ "cFileName" ], hProject ) DeptLinesToDeptPairList( aPairList, hProject:__enumKey(), hProject[ "aDept" ] ) NEXT @@ -381,14 +381,14 @@ PROCEDURE GNUMake( aParams, hPackageList ) cProject := s_cBase + cPackage + "/" + hPackageList[ cPackage ][ "cFileName" ] - call_hbmk2( cBinDir, cProject, cOptions, "" ) + call_hbmk2( cProject, cOptions, "" ) /* Highly experimental */ IF hPackageList[ cPackage ][ "cType" ] == "hblib" .AND. ; GetEnv( "HB_BUILD_CONTRIB_DLL" ) == "yes" .AND. ; hb_FileExists( PathSepToSelf( FNameExtSet( cProject, ".hbc" ) ) ) - call_hbmk2( cBinDir, cProject, cOptions, " -hbdyn -nohblib- -implib " + FNameExtSet( cProject, ".hbc" ) ) + call_hbmk2( cProject, cOptions, " -hbdyn -nohblib- -implib " + FNameExtSet( cProject, ".hbc" ) ) ENDIF /* Compile documentation */ @@ -419,7 +419,7 @@ STATIC PROCEDURE clear_hbmk2_envvars() RETURN -STATIC FUNCTION call_hbmk2_hbinfo( cBinDir, cProject, hProject ) +STATIC FUNCTION call_hbmk2_hbinfo( cProject, hProject ) LOCAL cStdOut LOCAL cDir LOCAL cName @@ -430,7 +430,7 @@ STATIC FUNCTION call_hbmk2_hbinfo( cBinDir, cProject, hProject ) clear_hbmk2_envvars() - IF hb_processRun( PathSepToSelf( cBinDir ) + "hbmk2 --hbinfo " + StrTran( cProject, "\", "/" ),, @cStdOut ) == 0 + IF hb_processRun( s_cBinDir + "hbmk2 --hbinfo " + StrTran( cProject, "\", "/" ),, @cStdOut ) == 0 hProject[ "cType" ] := hbmk2_hbinfo_getitem( cStdOut, "targettype" ) @@ -468,12 +468,12 @@ STATIC FUNCTION hbmk2_hbinfo_getitem( cString, cItem, lAll ) RETURN cRetVal -STATIC FUNCTION call_hbmk2( cBinDir, cProject, cOptionsPre, cOptionsPost ) +STATIC FUNCTION call_hbmk2( cProject, cOptionsPre, cOptionsPost ) LOCAL nErrorLevel clear_hbmk2_envvars() - nErrorLevel := mk_hb_processRun( PathSepToSelf( cBinDir ) + "hbmk2" +; + nErrorLevel := mk_hb_processRun( s_cBinDir + "hbmk2" +; " -quiet -lang=en -width=0" +; " @" + StrTran( s_cHome + "hbpre", "\", "/" ) +; cOptionsPre +; diff --git a/harbour/utils/hbrun/hbrun.prg b/harbour/utils/hbrun/hbrun.prg index 6a52a8b341..8aede01e4d 100644 --- a/harbour/utils/hbrun/hbrun.prg +++ b/harbour/utils/hbrun/hbrun.prg @@ -150,6 +150,7 @@ PROCEDURE _APPMAIN( cFile, ... ) ERRORLEVEL( 1 ) ENDIF OTHERWISE + hb_setenv( "__HBRUN__DIRBASE", hb_DirBase() ) hb_argShift( .T. ) hb_hrbRun( cFile, ... ) EXIT