Files
harbour-core/harbour/make_gnu.cmd
Przemyslaw Czerpak 4ee1406dd5 2006-03-21 02:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/make_gnu.bat
  * harbour/make_gnu.cmd
  * harbour/make_gnu.sh
    * added information about GTWVT to GT description for Windows

  * harbour/contrib/rdd_ads/ads1.c
  * harbour/contrib/rdd_ads/adsfunc.c
  * harbour/source/rdd/dbf1.c
    * synced with xHarbour

  * harbour/source/rtl/console.c
    ! fixed PROW() updating to be Clipper compatible when row number
      exceed 16bit integer value

  * harbour/source/rtl/filesys.c
    ! fixed possible GPF when hb_fsCurDirBuff()

  * harbour/source/rtl/str.c
  * harbour/source/rtl/strzero.c
    * minor optimizations

  * harbour/source/rtl/strpeek.c
    ! fixed accessing the last character in STRPEEK() and STRPOKE()

  * harbour/include/hbgtinfo.ch
  * harbour/source/rtl/gtwin/gtwin.c
    + synced with recent xHarbour modifications

  * harbour/source/rtl/gtwvt/gtwvt.c
    * cleaned BCC warning

  * harbour/include/hbapi.h
  * harbour/source/vm/codebloc.c
    * declare BYTE * passed to hb_codeblockNew() as const

  * harbour/include/hbpcode.h
    ! fixed the PCODE numbers in PCODE description, 122 was repeated for
      two different PCODEs: HB_P_ONE and HB_P_MACROLIST

  * harbour/source/compiler/genc.c
    ! fixed hb_p_functionshort pcode size returned by genc function
    ! fixed double value presented in verbose genc mode for HB_P_PUSHDOUBLE
    ! fixed number of cases presented in verbose genc mode for HB_P_SWITCH

  * harbour/source/compiler/hbdead.c
    + added support for dead code elimination in functions which uses
      SWITCH ...; CASE ...; ...; END syntax

  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/hbfix.c
    ! fixed optimization for HB_P_PUSHLOCALNEAR and HB_P_POPLOCALNEAR.
      It was a long existing bug not reported so far because 0, 1 and 2
      PCODEs uses only one BYTE and bad PCODE tracing in hbfix.c didn't
      caused bad side effects as long as number of locals in function
      was smaller then 768. Now for functions HB_P_PUSHLOCAL and
      HB_P_POPLOCAL is used and later changed to NEAR version in hbfix.c
      if possible.

  * harbour/source/compiler/hbfix.c
    * join sequential jumps to optimize constructions like:
         while ...
            ...
            if ...
               exit
            endif
         enddo

  * harbour/source/compiler/hbdead.c
    * remove HB_P_END PCODE also at the and of function if is repeated
      just before, f.e. in code like (source/rtl/color53.prg):
         Function RADGRDEFCO( cColor )
            if isdefcolor()
               Return applydefau( cColor, "W/N", "W/N", "W+/N")
            Else
               Return applydefau( cColor, 3, 1, 4)
            endif
         Return nil
      Now such redundant constructions like above are fully stripped by
      compiler anyhow if someone has time and think is important then can
      clean also this .prg code.


  * harbour/include/Makefile
  * harbour/include/hbcomp.h
  + harbour/include/hbxvm.h
  * harbour/source/compiler/Makefile
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/genc.c
  + harbour/source/compiler/gencc.c
  + harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/vm/hvm.c
    + added support for generating real C code not PCODE in .c files.
      Now with  -gc3 Harbour will generate .c files with real .c code
      which is later compiled to real machine code.
      I left PCODE only for code block definitions though it's also
      possible to have even code block compiled to machine code but
      we will have to add a flag to codeblock structure which will
      be checked at runtime and proper method of execution in EVAL
      will be chosen. If you think it's worth of afford then I can
      add it too in some spare time.
      The final binaries are noticable longer then the one which has
      only PCODE but they are faster. The speed improvement depends
      on type of operations. The pure Clipper code which does not
      execute any external time consuming C functions compiled with
      -gc3 is from 10% to 50% faster.
      The side effect of generating pure machine code is also harder
      recompilation but it does not mean that is impossible. If sth
      can be executed by some machines (virtual or hardware) then it
      can always be decompiled by definition.
      This modification opens door for farther optimization, f.e. when
      we will have fully working strong type support then we can add
      using native .c types.
      In fact this module is PCODE to .c translater not part of compiler
      and can be used as separate module to translate generated PCODE,
      f.e. .hrb files.
      Maybe in the future we will change the compiler to generate meta
      code not directly PCODE and it will be possible to make optimizations
      on this meta code which will depend on selected output type:
      VHM PCODE, C code, .NET code, etc. but at this moment adding support
      for .c compilation directly into compiler will make the compiler code
      too much complicated for me - IMHO it's better to invest time into
      clear separation to FRONT_END->REAL_COMPILER->BACK_END
      Please make test with your code. I rebuild whole Harbour code with
      -gc3 set in HB_FLAGS in harbour/config/rules.cf and all seems to
      work correctly. hbtest returns exactly the same results.
      I also made tests with my programs and they work correctly but
      I had to define actions for all PCODEs and it's possible that made
      some typos in some of them which are very seldom used so your tests
      will be very important.
2006-03-21 01:25:32 +00:00

118 lines
3.7 KiB
Batchfile

@echo off
rem
rem $Id$
rem
rem ---------------------------------------------------------------
rem Template to initialize the environment before starting
rem the GNU make system for Harbour
rem
rem For further information about the GNU make system please
rem check doc/gmake.txt
rem
rem Copyright 1999-2001 Viktor Szakats (viktor.szakats@syenar.hu)
rem See doc/license.txt for licensing terms.
rem ---------------------------------------------------------------
if "%HB_ARCHITECTURE%" == "" set HB_ARCHITECTURE=os2
if "%HB_COMPILER%" == "" set HB_COMPILER=gcc
if "%HB_GT_LIB%" == "" set HB_GT_LIB=
rem set PRG_USR=
rem set C_USR=
rem set L_USR=
rem Set to constant value to be consistent with the non-GNU make files.
if "%HB_BIN_INSTALL%" == "" set HB_BIN_INSTALL=bin\
if "%HB_LIB_INSTALL%" == "" set HB_LIB_INSTALL=lib\
if "%HB_INC_INSTALL%" == "" set HB_INC_INSTALL=include\
:START
if "%HB_ARCHITECTURE%" == "" goto BAD_ARCH
if "%HB_COMPILER%" == "" goto BAD_COMP
goto MAKE
:HELP
echo.
echo Usage: make_gnu [command]
echo.
echo The following commands are supported:
echo - all (default)
echo - clean
echo - install
echo.
echo Notes:
echo.
echo - HB_ARCHITECTURE and HB_COMPILER envvars must be set.
echo The following values are currently supported:
echo.
echo HB_ARCHITECTURE:
echo - dos (HB_GT_LIB=gtdos by default)
echo - w32 (HB_GT_LIB=gtw32 by default)
echo - linux (HB_GT_LIB=gtstd by default)
echo - os2 (HB_GT_LIB=gtos2 by default)
echo.
pause
echo HB_COMPILER:
echo - When HB_ARCHITECTURE=dos
echo - bcc16 (Borland C++ 3.x, 4.x, 5.0x, DOS 16-bit)
echo - djgpp (Delorie GNU C, DOS 32-bit)
echo - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)
echo - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)
echo - When HB_ARCHITECTURE=w32
echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)
echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)
echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)
echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)
echo - icc (IBM Visual Age C++, Windows 32-bit)
echo - msvc (Microsoft Visual C++, Windows 32-bit)
echo - When HB_ARCHITECTURE=linux
echo - gcc (GNU C, 32-bit)
echo - When HB_ARCHITECTURE=os2
echo - gcc (EMX GNU C, OS/2 32-bit)
echo - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)
echo.
pause
echo HB_GT_LIB:
echo - gtstd (Standard streaming) (for all architectures)
echo - gtdos (DOS console) (for dos architecture)
echo - gtwin (Win32 console) (for w32 architecture)
echo - gtwvt (Win32 win console) (for w32 architecture)
echo - gtos2 (OS/2 console) (for os2 architecture)
echo - gtpca (PC ANSI console) (for all architectures)
echo - gtcrs (Curses console) (for linux, w32 architectures)
echo - gtsln (Slang console) (for linux, w32 architectures)
echo.
echo - Use these optional envvars to configure the make process
echo when using the 'all' command:
echo.
echo PRG_USR - Extra Harbour compiler options
echo C_USR - Extra C compiler options
echo L_USR - Extra linker options
goto END
:BAD_ARCH
echo Error: HB_ARCHITECTURE is not set.
goto HELP
:BAD_COMP
echo Error: HB_COMPILER is not set.
goto HELP
:MAKE
rem ---------------------------------------------------------------
rem Start the GNU make system
make -r %1 %2 %3 %4 %5 %6 %7 %8 %9 > make_gnu.log
goto END
:END