From 9be6fe59408102ab770b6077d3b5b3fb1f39f301 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 22 May 2009 20:29:20 +0000 Subject: [PATCH] 2009-05-22 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg % mingw tool extensions now again have ".exe" extension, but only on Windows, it's slightly more optimal this way. --- harbour/ChangeLog | 5 +++++ harbour/utils/hbmk2/hbmk2.prg | 29 ++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 051663f5ff..6308fbe009 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-22 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmk2/hbmk2.prg + % mingw tool extensions now again have ".exe" extension, but + only on Windows, it's slightly more optimal this way. + 2009-05-22 19:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbwin/axcore.c ! Fixed 'this' -> 'lpThis' diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 9cc94b0ba6..e0851f4bbb 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -458,6 +458,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) LOCAL cPrefix LOCAL cPostfix LOCAL nEmbedLevel + LOCAL cCCEXT_mingw LOCAL lSkipBuild := .F. LOCAL lStopAfterInit := .F. @@ -482,8 +483,6 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) LOCAL cDir, cName, cExt LOCAL headstate - LOCAL lNIX := hb_Version( HB_VERSION_UNIX_COMPAT ) - LOCAL cSelfFlagPRG := hb_Version( HB_VERSION_FLAG_PRG ) LOCAL cSelfFlagC := hb_Version( HB_VERSION_FLAG_C ) LOCAL cSelfFlagL := hb_Version( HB_VERSION_FLAG_LINKER ) @@ -753,6 +752,12 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) hbmk[ _HBMK_cCCPATH ] := GetEnv( "HB_CCPATH" ) hbmk[ _HBMK_cCCPREFIX ] := GetEnv( "HB_CCPREFIX" ) + #if defined( __PLATFORM__UNIX ) + cCCEXT_mingw := "" + #else + cCCEXT_mingw := ".exe" + #endif + /* Setup architecture dependent data */ DO CASE @@ -921,9 +926,9 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) #if defined( __PLATFORM__WINDOWS ) - AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingw" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "win", "mingw" , "" } ) - AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingw64" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "win", "mingw64" , "x86_64-pc-mingw32-" } ) - AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingwce" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc.exe" ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-" } ) + AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingw" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + cCCEXT_mingw ), tmp1, NIL ) }, "win", "mingw" , "" } ) + AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingw64" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + cCCEXT_mingw ), tmp1, NIL ) }, "win", "mingw64" , "x86_64-pc-mingw32-" } ) + AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := PathNormalize( s_cHB_INSTALL_PREFIX ) + "mingwce" + hb_osPathSeparator() + "bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + cCCEXT_mingw ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-" } ) #elif defined( __PLATFORM__UNIX ) @@ -932,9 +937,9 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) DO CASE CASE hbmk[ _HBMK_cCOMP ] $ "mingw" - AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := "/opt/xmingw/bin" , iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" ), tmp1, NIL ) }, "win", "mingw" , "i386-mingw-" } ) + AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := "/opt/xmingw/bin" , iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + cCCEXT_mingw ), tmp1, NIL ) }, "win", "mingw" , "i386-mingw-" } ) CASE hbmk[ _HBMK_cCOMP ] $ "mingwarm" - AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := "/opt/mingw32ce/bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-" } ) + AAdd( aCOMPDET_LOCAL, { {| cPrefix | tmp1 := "/opt/mingw32ce/bin", iif( hb_FileExists( tmp1 + hb_osPathSeparator() + cPrefix + "gcc" + cCCEXT_mingw ), tmp1, NIL ) }, "wce", "mingwarm", "arm-wince-mingw32ce-" } ) ENDCASE ENDIF @@ -1351,10 +1356,12 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ENDIF ENDIF - CASE ! lNIX .AND. Left( cParamL, 2 ) == "/o" .AND. ! lStopAfterHarbour +#if ! defined( __PLATFORM__UNIX ) + CASE Left( cParamL, 2 ) == "/o" .AND. ! lStopAfterHarbour /* Swallow this switch. We don't pass it to Harbour, as it may badly interact with hbmk. */ +#endif CASE Left( cParam, 2 ) == "-o" .AND. ! lStopAfterHarbour @@ -1922,7 +1929,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) cLibPrefix := "-l" cLibExt := "" cObjExt := ".o" - cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + iif( s_lCPP != NIL .AND. s_lCPP, "g++", "gcc" ) /* Not using an .exe extension here. */ + cBin_CompC := hbmk[ _HBMK_cCCPREFIX ] + iif( s_lCPP != NIL .AND. s_lCPP, "g++", "gcc" ) + cCCEXT_mingw cOpt_CompC := "-c" IF hbmk[ _HBMK_lOPTIM ] cOpt_CompC += " -O3" @@ -1945,7 +1952,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) cLibPathPrefix := "-L" cLibPathSep := " " cLibLibExt := ".a" - cBin_Lib := hbmk[ _HBMK_cCCPREFIX ] + "ar" + cBin_Lib := hbmk[ _HBMK_cCCPREFIX ] + "ar" + cCCEXT_mingw cOpt_Lib := "{FA} rcs {OL} {LO}" cLibObjPrefix := NIL IF ! Empty( hbmk[ _HBMK_cCCPATH ] ) @@ -2002,7 +2009,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) s_aLIBSHAREDPOST := { "hbmainstd", "hbmainwin" } IF hbmk[ _HBMK_cCOMP ] $ "mingw|mingw64|mingwarm" .AND. Len( s_aRESSRC ) > 0 - cBin_Res := hbmk[ _HBMK_cCCPREFIX ] + "windres" + cBin_Res := hbmk[ _HBMK_cCCPREFIX ] + "windres" + cCCEXT_mingw cResExt := ".reso" cOpt_Res := "{FR} {IR} -O coff -o {OS}" IF ! Empty( hbmk[ _HBMK_cCCPATH ] )