diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 706a094ace..c7a78a4b0d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,56 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-03-06 10:13 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmk2/hbmk2.prg + ! Fixed -gh switch detection and workings. + (Francesco, pls check now allmod.hbm) + + -gt switch can now be filtered. (-gtwin{win}) + ! -gui switch won't anymore add '-Wl,-mwindows' C compiler switch + on *nix systems. Someone pls confirm this is right. + * icc will use -vc postfixed .dlls. They seem to be binary + compatible, but I didn't test. + % Using __PLATFORM__UNIX macro where applicable. + ! Ignoring -o Harbour option passed using '-prgflag:' + + * INSTALL + + Added some details. + + * mpkg_win.bat + ! Don't create install files if the make process returned + with error. + + * source/lang/msg_tpl.c + ! Removed ending ';'. + + * source/vm/Makefile + + Added icc to generate maindllh.lib. + + * source/common/hbfsapi.c + ! Removed obsolete 'extern hb_fhnd_ForceLink()'. + + * config/rules.cf + * config/lib.cf + * config/bin.cf + % Compiling all .prg files with -n1 switch. + + * contrib/examples/uhttpd/uhttpdc.c + * Cleaned Windows headers usage. + #define HB_OS_WIN_USED is safe to use on all platforms, + it just requests the Windows headers, and if compiled on + Windows, it will #include them. + + * contrib/examples/uhttpd/uhttpd.prg + + Automatically sets USE_HB_INET on non-Windows platforms. + + - contrib/examples/uhttpd/uhttpd-inet.hbm + - contrib/examples/uhttpd/uhttpdgd-inet.hbm + - Removed files no longer necessary. + + * contrib/examples/uhttpd/uhttpd.hbm + + Added comment about -DUSE_HB_INET option. + % Removed -lhbct + 2009-03-06 04:25 UTC+0100 Francesco Saverio Giudice (info/at/fsgiudice.com) * harbour/contrib/examples/uhttpd/uhttpdc.c * Fixed error in windows header include @@ -171,7 +221,7 @@ * utils/hbmk2/hbmk2.prg + Added Intel(R) C++ compiler support for Windows. + Added initial support also in hbmk2. - ; This compile is actively developed and its famous of + ; This compiler is actively developed and its famous of generating the fastest running code of all C compilers. It also outputs an extremely detailed warning list. And the best thing: It compiled Harbour without a single diff --git a/harbour/INSTALL b/harbour/INSTALL index 9ff7742be8..3fc04de326 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -67,12 +67,10 @@ HOW TO BUILD AND INSTALL HARBOUR Platform specific prerequisites: 1.) Windows NT or compatible system is required to build Harbour. - 2.) Make sure to have your C compiler of choice properly installed, - please refer to your C compiler installation and setup - instructions for details. It's recommended to make sure no - tools in your PATH belonging to other C compilers are interfering - with your setup (put all these _after_ your selected C compiler - in PATH). + 2.) Make sure to have your C compiler of choice properly installed. + Refer to your C compiler installation and setup instructions for + details. It's recommended to make sure no tools in your PATH + belonging to other C compilers are interfering with your setup. For the list of supported compilers, please look up the relevant section of this file. 3.) Make sure to have GNU Make. We recommend the one distributed @@ -151,6 +149,8 @@ HOW TO ENABLE OPTIONAL COMPONENTS BEFORE BUILD NOTES: - For mingw and cygwin you have to use forward slashes and also cygwin drive notation for cygwin. - Space in directory names isn't currently supported. + - Don't put the dir inside double quotes. + - Use absolute paths. SUPPORTED C COMPILERS UNDER DIFFERENT PLATFORMS @@ -181,9 +181,9 @@ SUPPORTED C COMPILERS UNDER DIFFERENT PLATFORMS pocc64 - Pelles C 5.0 x64 poccce - Pelles C 5.0 (Windows CE / ARM) xcc - Pelles C for xhb + owatcom - Open Watcom C++ icc - Intel(R) C/C++ bcc - Borland/CodeGear C++ 4.x and above - owatcom - Open Watcom C++ cygwin - Cygwin GNU C DOS (32-bit) @@ -244,7 +244,9 @@ OPTIONS AVAILABLE WHEN BUILDING HARBOUR You need these when building for a platform different to host. For this to work, you will need to point above envvars to - a native Harbour build available on your system. + a native Harbour build available on your system. You don't need + a full native build, harbour.exe and hbpp.exe are enough for + the process to succeed. FOR MORE INFORMATION diff --git a/harbour/config/bin.cf b/harbour/config/bin.cf index 4d01350d2e..32e1b136f8 100644 --- a/harbour/config/bin.cf +++ b/harbour/config/bin.cf @@ -10,7 +10,6 @@ include $(TOP)$(ROOT)config/c.cf include $(TOP)$(ROOT)config/prg.cf HB_GCMODE=0 -HB_NFLAG=-n EXE_NAME= diff --git a/harbour/config/lib.cf b/harbour/config/lib.cf index dfa6b35050..af1064a4d2 100644 --- a/harbour/config/lib.cf +++ b/harbour/config/lib.cf @@ -14,8 +14,6 @@ include $(TOP)$(ROOT)config/global.cf include $(TOP)$(ROOT)config/c.cf include $(TOP)$(ROOT)config/prg.cf -HB_NFLAG=-n1 - LIB_NAME := $(LIB_PREF)$(LIBNAME)$(LIB_EXT) LIB_ARCH := $(LIB_DIR)/$(LIB_NAME) diff --git a/harbour/config/rules.cf b/harbour/config/rules.cf index 25ba900df6..60ad2f9e16 100644 --- a/harbour/config/rules.cf +++ b/harbour/config/rules.cf @@ -23,11 +23,8 @@ HB := $(HB)harbour$(EXE_EXT) ifeq ($(HB_GCMODE),) HB_GCMODE=3 endif -ifeq ($(HB_NFLAG),) - HB_NFLAG= -endif HB_FLAGS := -i$(HB_INC_COMPILE) -q0 -w3 -es2 -km -l -HB_RULE = $(HB) $? $(HB_NFLAG) $(HB_FLAGS) -gc$(HB_GCMODE) $(HB_USER_PRGFLAGS) +HB_RULE = $(HB) $? -n1 $(HB_FLAGS) -gc$(HB_GCMODE) $(HB_USER_PRGFLAGS) # The rule to link an executable. ifeq ($(LD_RULE),) diff --git a/harbour/contrib/examples/uhttpd/uhttpd-inet.hbm b/harbour/contrib/examples/uhttpd/uhttpd-inet.hbm deleted file mode 100644 index acdd4d061c..0000000000 --- a/harbour/contrib/examples/uhttpd/uhttpd-inet.hbm +++ /dev/null @@ -1,5 +0,0 @@ -# -# $Id: uhttpd.hbm 10546 2009-03-05 20:12:47Z vszakats $ -# - --mt uhttpd.prg cgifunc.prg cookie.prg session.prg uhttpdc.c -DUSE_HB_INET diff --git a/harbour/contrib/examples/uhttpd/uhttpd.hbm b/harbour/contrib/examples/uhttpd/uhttpd.hbm index c2c328da30..a103066402 100644 --- a/harbour/contrib/examples/uhttpd/uhttpd.hbm +++ b/harbour/contrib/examples/uhttpd/uhttpd.hbm @@ -2,4 +2,7 @@ # $Id$ # --mt -gui uhttpd.prg cgifunc.prg cookie.prg session.prg uhttpdc.c socket.c -lhbct +# Use -DUSE_HB_INET if you want to turn on Harbour internet socket. +# It's always on on non-Windows systems. + +-mt -gui uhttpd.prg cgifunc.prg cookie.prg session.prg uhttpdc.c socket.c diff --git a/harbour/contrib/examples/uhttpd/uhttpd.prg b/harbour/contrib/examples/uhttpd/uhttpd.prg index 8f4eb437c1..98cf7d7d4a 100644 --- a/harbour/contrib/examples/uhttpd/uhttpd.prg +++ b/harbour/contrib/examples/uhttpd/uhttpd.prg @@ -96,21 +96,26 @@ #include "hbextern.ch" // need this to use with HRB #ifdef GD_SUPPORT - // adding GD support - REQUEST GDIMAGE, GDIMAGECHAR, GDCHART - #define APP_GD_SUPPORT "_GD" - #stdout "Lib GD support enabled" + // adding GD support + REQUEST GDIMAGE, GDIMAGECHAR, GDCHART + #define APP_GD_SUPPORT "_GD" + #stdout "Lib GD support enabled" #else - #define APP_GD_SUPPORT "" - #stdout "Lib GD support disabled" + #define APP_GD_SUPPORT "" + #stdout "Lib GD support disabled" +#endif + +/* Force Harbour socket on non-Window systems */ +#if ! defined( __PLATFORM__WINDOWS ) .AND. ! defined( USE_HB_INET ) + #define USE_HB_INET #endif #ifdef USE_HB_INET - #define APP_INET_SUPPORT "_INET" - #stdout "Harbour socket" + #define APP_INET_SUPPORT "_INET" + #stdout "Harbour socket" #else - #define APP_INET_SUPPORT "" - #stdout "Mindaugas socket" + #define APP_INET_SUPPORT "" + #stdout "Mindaugas socket" #endif #define APP_NAME "uhttpd" diff --git a/harbour/contrib/examples/uhttpd/uhttpdc.c b/harbour/contrib/examples/uhttpd/uhttpdc.c index 565d576699..18e6259282 100644 --- a/harbour/contrib/examples/uhttpd/uhttpdc.c +++ b/harbour/contrib/examples/uhttpd/uhttpdc.c @@ -57,14 +57,12 @@ * */ -/* #define HB_OS_WIN_USED */ /* Temporaly disabled Viktor could you check it */ +#define HB_OS_WIN_USED #include "hbapi.h" -#ifndef HB_OS_WIN +#if !defined( HB_OS_WIN ) #include -#else - #include #endif #if defined( HB_OS_WIN ) @@ -133,6 +131,7 @@ HB_FUNC( WIN_SYSREFRESH ) { hb_retl( TRUE ); } + #endif HB_FUNC( HB_UTCOFFSET ) @@ -170,7 +169,7 @@ HB_FUNC( HB_UTCOFFSET ) struct tm tmTime; time_t current; - memcpy( (void *) &tmTime, (void *) localtime( ¤t ), sizeof(tmTime) ); + memcpy( ( void * ) &tmTime, ( void * ) localtime( ¤t ), sizeof( tmTime ) ); nLen = strftime( szRet, 6, "%z", &tmTime ); } #endif @@ -180,4 +179,3 @@ HB_FUNC( HB_UTCOFFSET ) hb_retclen_buffer( szRet, nLen ); } - diff --git a/harbour/contrib/examples/uhttpd/uhttpdgd-inet.hbm b/harbour/contrib/examples/uhttpd/uhttpdgd-inet.hbm deleted file mode 100644 index f81d86c455..0000000000 --- a/harbour/contrib/examples/uhttpd/uhttpdgd-inet.hbm +++ /dev/null @@ -1,7 +0,0 @@ -# -# $Id: uhttpd.hbm 10546 2009-03-05 20:12:47Z vszakats $ -# - -@uhttpd-inet.hbm --DGD_SUPPORT -lhbgd -lbgd -lhbct - diff --git a/harbour/mpkg_win.bat b/harbour/mpkg_win.bat index 42a99c0e10..dece647604 100644 --- a/harbour/mpkg_win.bat +++ b/harbour/mpkg_win.bat @@ -51,6 +51,8 @@ call make_gnu.bat :MK_PKG +if errorlevel 1 goto MK_ERROR + rem ; Post build cleanup if exist "%HB_BIN_INSTALL%\*.tds" del "%HB_BIN_INSTALL%\*.tds" @@ -67,6 +69,8 @@ cd %HB_INSTALL_BASE% zip -X -r -o %~dp0%HB_PKGNAME%.zip * popd +:MK_ERROR + rem ; Cleanup if "%1" == "--deltemp" rmdir /q /s %HB_INSTALL_BASE% diff --git a/harbour/source/common/hbfsapi.c b/harbour/source/common/hbfsapi.c index ae55c0e362..9c31498435 100644 --- a/harbour/source/common/hbfsapi.c +++ b/harbour/source/common/hbfsapi.c @@ -80,10 +80,6 @@ #include #endif -/* NOTE: Not really belongs here, but until we can't find a better place - it will do it. [vszakats] */ -extern void hb_fhnd_ForceLink( void ); - /* * Function that adds zero or more paths to a list of pathnames to search */ diff --git a/harbour/source/lang/msg_tpl.c b/harbour/source/lang/msg_tpl.c index a47cbef553..86bd5c7665 100644 --- a/harbour/source/lang/msg_tpl.c +++ b/harbour/source/lang/msg_tpl.c @@ -200,7 +200,7 @@ static HB_LANG s_lang = } }; -HB_LANG_ANNOUNCE( TPL ); +HB_LANG_ANNOUNCE( TPL ) HB_CALL_ON_STARTUP_BEGIN( hb_lang_Init_TPL ) hb_langRegister( &s_lang ); diff --git a/harbour/source/vm/Makefile b/harbour/source/vm/Makefile index c820e17a95..2ebdd52d83 100644 --- a/harbour/source/vm/Makefile +++ b/harbour/source/vm/Makefile @@ -29,6 +29,9 @@ ifeq ($(HB_ARCHITECTURE),win) ifeq ($(HB_COMPILER),bcc) DIRS += maindllh endif + ifeq ($(HB_COMPILER),icc) + DIRS += maindllh + endif ifeq ($(HB_COMPILER),msvc) DIRS += maindllh endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 5944b472c5..7bcea07622 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -105,7 +105,11 @@ to use -p option, .ppo files will be generated in temp dir. */ /* TODO: Sync default C/linker switches with the ones in Harbour GNU make system. */ /* TODO: Support for more compilers/platforms. */ -/* TODO: Cross compilation support. */ +/* TODO: Cross compilation support. + -D__PLATFORM__WINCE ? + -D__PLATFORM__WINDOWS + -undef:__PLATFORM__UNIX + -undef:__PLATFORM__LINUX */ /* TODO: Add support for library creation. */ /* TODO: Cleanup on variable names and compiler configuration. */ /* TODO: Optimizations (speed/memory). */ @@ -713,18 +717,8 @@ FUNCTION Main( ... ) cParamL == "-hblnk" .OR. ; cParamL == "-info" - CASE Left( cParamL, 2 ) == "-gh" .OR. ; - ( ! lNIX .AND. Left( cParamL, 2 ) == "/gh" ) - - lStopAfterHarbour := .T. - /* Simply ignore. They were already processed in the first pass. */ - CASE ! lNIX .AND. Left( cParamL, 2 ) == "/o" .AND. ! lStopAfterHarbour - - /* Swallow this switch. We don't pass it to Harbour, as it may badly - interact with hbmk. */ - CASE cParamL == "-gui" .OR. ; cParamL == "-mwindows" ; s_lGUI := .T. /* Compatibility */ CASE cParamL == "-std" .OR. ; @@ -772,7 +766,7 @@ FUNCTION Main( ... ) CASE Left( cParamL, 3 ) == "-gt" - cParam := SubStr( cParam, 2 ) + cParam := ArchCompFilter( SubStr( cParam, 2 ) ) IF s_cGT == NIL IF ! SetupForGT( cParam, @s_cGT, @s_lGUI ) OutErr( "hbmk: Warning: Invalid -gt value ignored: " + cParam + hb_osNewLine() ) @@ -786,6 +780,11 @@ FUNCTION Main( ... ) ENDIF ENDIF + CASE ! lNIX .AND. Left( cParamL, 2 ) == "/o" .AND. ! lStopAfterHarbour + + /* Swallow this switch. We don't pass it to Harbour, as it may badly + interact with hbmk. */ + CASE Left( cParam, 2 ) == "-o" .AND. ! lStopAfterHarbour tmp := PathSepToSelf( SubStr( cParam, 3 ) ) @@ -822,7 +821,12 @@ FUNCTION Main( ... ) cParam := ArchCompFilter( SubStr( cParam, Len( "-prgflag:" ) + 1 ) ) IF Left( cParam, 1 ) $ cOptPrefix - AAdd( s_aOPTPRG , PathSepToTarget( cParam, 2 ) ) + IF SubStr( cParamL, 2 ) == "gh" + lStopAfterHarbour := .T. + ENDIF + IF !( SubStr( cParamL, 2, 1 ) == "o" ) + AAdd( s_aOPTPRG , PathSepToTarget( cParam, 2 ) ) + ENDIF ENDIF CASE Left( cParamL, Len( "-cflag:" ) ) == "-cflag:" @@ -851,6 +855,9 @@ FUNCTION Main( ... ) AAddNotEmpty( s_aOPTC , ArchCompFilter( PathSepToTarget( cParam, 2 ) ) ) ENDIF OTHERWISE + IF SubStr( cParamL, 2 ) == "gh" + lStopAfterHarbour := .T. + ENDIF AAddNotEmpty( s_aOPTPRG , PathSepToTarget( cParam, 2 ) ) ENDCASE @@ -1088,9 +1095,6 @@ FUNCTION Main( ... ) cOpt_CompC += " {LL}" aLIB_BASE2 := ArrayAJoin( { aLIB_BASE2, { "hbcommon", "hbrtl" }, s_aLIBVM } ) ENDIF - IF s_lGUI - cOpt_CompC += " -Wl,-mwindows" - ENDIF IF s_lMAP cOpt_CompC += " -Wl,-Map {OM}" ENDIF @@ -1514,7 +1518,7 @@ FUNCTION Main( ... ) ENDIF s_aLIBSYS := ArrayJoin( s_aLIBSYS, { "user32", "wsock32", "advapi32", "gdi32" } ) DO CASE - CASE t_cCOMP == "msvc" + CASE t_cCOMP $ "msvc|icc" s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_Alter + "-vc",; "harbour-" + cDL_Version_Alter + "-vc" ),; "hbmainstd",; @@ -1529,11 +1533,6 @@ FUNCTION Main( ... ) "harbour-" + cDL_Version_Alter + "-vc-ia64" ),; "hbmainstd",; "hbmainwin" } - CASE t_cCOMP == "icc" - s_aLIBSHARED := { iif( s_lMT, "harbourmt-" + cDL_Version_Alter + "-icc",; - "harbour-" + cDL_Version_Alter + "-icc" ),; - "hbmainstd",; - "hbmainwin" } ENDCASE IF !( t_cCOMP == "icc" ) @@ -1895,10 +1894,10 @@ FUNCTION Main( ... ) PauseForKey() ELSEIF s_lRUN s_cPROGNAME := FN_ExtSet( s_cPROGNAME, cBinExt ) - #if !( defined( __PLATFORM__WINDOWS ) .OR. defined( __PLATFORM__DOS ) .OR. defined( __PLATFORM__OS2 ) ) - IF Empty( FN_DirGet( s_cPROGNAME ) ) - s_cPROGNAME := "." + hb_osPathSeparator() + s_cPROGNAME - ENDIF + #if defined( __PLATFORM__UNIX ) + IF Empty( FN_DirGet( s_cPROGNAME ) ) + s_cPROGNAME := "." + hb_osPathSeparator() + s_cPROGNAME + ENDIF #endif IF s_lTRACE OutStd( "hbmk: Running executable:" + hb_osNewLine() + PathSepToTarget( s_cPROGNAME ) + hb_osNewLine() ) @@ -2263,16 +2262,14 @@ STATIC PROCEDURE HBP_ProcessAll( lConfigOnly,; LOCAL aCFGDirs - #if defined( __PLATFORM__WINDOWS ) .OR. ; - defined( __PLATFORM__DOS ) .OR. ; - defined( __PLATFORM__OS2 ) - aCFGDirs := { hb_DirBase() } - #else + #if defined( __PLATFORM__UNIX ) aCFGDirs := { GetEnv( "HOME" ) + "/.harbour/",; "/etc/harbour",; DirAddPathSep( hb_DirBase() ) + "../etc/harbour",; DirAddPathSep( hb_DirBase() ) + "../etc",; hb_DirBase() } + #else + aCFGDirs := { hb_DirBase() } #endif FOR EACH cDir IN aCFGDirs