Discussion:
Harbour 1.1.0dev unified binary release (20090331)
(too old to reply)
Viktor Szakáts
2009-04-01 00:30:36 UTC
Permalink
Hi All,

Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.

Downloads:
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)

To use:
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
4) For x64 executable type: 'hbmk2 ../tests/hello.prg -comp=mingw64'
5) For WinCE/ARM executable type: 'hbmk2 ../tests/hello.prg -comp=mingwce'

The package also contains Harbour libraries to build MSVC 2008,
MSVC 2008 x64, Open Watcom 1.8, Borland C 5.5.1,
Pelles C 5.0, Pelles C 5.0 x64 and Pelles C 5.0 WinCE/ARM
executables. For these, you need to have these compilers installed
on your computer. The libs will automatically be picked by hbmk2.
A native set of x64 Harbour tools is also included, and Harbour .dlls
for x86, x64, WinCE/ARM and Borland.

The package contains MinGW 4.3.3, MinGW 4.4.0 for x64 and
MinGW 4.1.0 for ARM/CE embedded.

The goal is to develop the format for the Windows/WinCE binary
release package for the next stable release of Harbour. Please
test and report you experiences.

Following external dependencies were used to build corresponding
Harbour libs:

ace 9.10, allegro 4.2.2, blat 2.6.2, libcurl 7.19.3, firebird
2.1.1, freeimage 3.11.0,
gd 2.0.34, mysql 5.0.67, openssl 0.9.8j, pgsql 8.3.3, qt 4.5.0 (2009.01)

Brgds,
Viktor
Pritpal Bedi
2009-04-01 05:05:37 UTC
Permalink
Hello Viktor
Post by Viktor Szakáts
Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
Did exactly the same as above and got:

C:\harbour-11\bin>hbmk2 ../tests/hello.prg
hbmk: Error: Running C compiler. -1:
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group


I think Harbour.exe is not being run before gcc.exe.

Regards
Pritpal Bedi
--
View this message in context: http://www.nabble.com/Harbour-1.1.0dev-unified-binary-release-%2820090331%29-tp22817597p22819897.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
Viktor Szakáts
2009-04-01 07:28:16 UTC
Permalink
Hi Pritpal,
I did a new install and cannot reproduce this problem
on my system.

Anyone else with similar issue? Could you try with -trace option?

Brgds,
Viktor
Post by Pritpal Bedi
Hello Viktor
Post by Viktor Szakáts
Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
C:\harbour-11\bin>hbmk2 ../tests/hello.prg
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group
I think Harbour.exe is not being run before gcc.exe.
Regards
Pritpal Bedi
--
http://www.nabble.com/Harbour-1.1.0dev-unified-binary-release-%2820090331%29-tp22817597p22819897.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list
http://lists.harbour-project.org/mailman/listinfo/harbour
Pritpal Bedi
2009-04-01 14:35:41 UTC
Permalink
Hi
Post by Viktor Szakáts
I did a new install and cannot reproduce this problem
on my system.
Anyone else with similar issue? Could you try with -trace option?
Out-of-the-box means user has nothing to do except
Post by Viktor Szakáts
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
I mean no <set HB_*> settings. Am I right ? If yes, then
this installer does not work. But if I invoke console which
I use to build Harbour on MinGW, and then issue commands
as above, it works.

Probably on your system you test the same way so the
problem is not reproduced. Try with a new console without
having any Harbour env setting.

Regards
Pritpal Bedi
--
View this message in context: http://www.nabble.com/Harbour-1.1.0dev-unified-binary-release-%2820090331%29-tp22817597p22827909.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
Viktor Szakáts
2009-04-01 14:52:30 UTC
Permalink
Hi Pritpal,
Post by Pritpal Bedi
Out-of-the-box means user has nothing to do except
I know what out-of-the-box means.
Post by Pritpal Bedi
Post by Viktor Szakáts
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
I mean no <set HB_*> settings. Am I right ? If yes, then
this installer does not work. But if I invoke console which
You're right, nevertheless it works here and I have no such
envvars setup locally, in fact I never had any of those. Question
why it doesn't work on your system.
Post by Pritpal Bedi
I use to build Harbour on MinGW, and then issue commands
as above, it works.
Could you post the difference?

Locally I store no permanent Harbour setting in my environment,
nor any C or Harbour compiler is setup in my default PATH since
at least 10 years.
Post by Pritpal Bedi
Probably on your system you test the same way so the
problem is not reproduced. Try with a new console without
having any Harbour env setting.
I'm working with a heavily multicompiler setup here, so such
settings were killed long ago here, rest assured.

To double check, I've tested it in my XP x64 VM, which doesn't
have *anything* installed on it, plain default setup, and it also
worked as "advertized".

Please post your -trace output and above mentioned environment
difference (or both 'set' outputs). I wonder what makes hbmk2
confused on your system.

Brgds,
Viktor
Pritpal Bedi
2009-04-01 15:31:00 UTC
Permalink
Viktor
Post by Viktor Szakáts
I know what out-of-the-box means.
Don't expect I did not know that. I was just emphasizing my point. Sorry..

C:\harbour-11\bin>hbmk2 ..\tests\hello.prg -trace
hbmk: Harbour compiler command:
C:/harbour-11/bin\harbour.exe -n2 ../tests/hello.prg -iC:/harbour-11/include
hbmk: C compiler command:
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group
hbmk: Error: Running C compiler. -1:
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group

Regards
Pritpal Bedi

PS : I do not see the hello.c after above execution, which must be there
IMO.
--
View this message in context: http://www.nabble.com/Harbour-1.1.0dev-unified-binary-release-%2820090331%29-tp22817597p22829183.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
Viktor Szakáts
2009-04-01 15:55:14 UTC
Permalink
Post by Pritpal Bedi
Post by Viktor Szakáts
I know what out-of-the-box means.
Don't expect I did not know that. I was just emphasizing my point. Sorry..
No prob!
Post by Pritpal Bedi
C:\harbour-11\bin>hbmk2 ..\tests\hello.prg -trace
C:/harbour-11/bin\harbour.exe -n2 ../tests/hello.prg
-iC:/harbour-11/include
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group
C:\harbour-11\mingw\bin\gcc.exe hello.c -O3 -ohello.exe
-IC:/harbour-11/incl
ude -LC:/harbour-11/lib/win/mingw -mconsole -Wl,--start-group -lhbcpage
-lhblang
-lhbcommon -lhbcplr -lhbdebug -lhbvm -lhbrdd -lhbusrrdd -lhbuddall -lhbhsx
-lhb
six -lrddntx -lrddnsx -lrddcdx -lrddfpt -lhbrtl -lhbpp -lhbmacro -lhbextern
-lgt
cgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbpcre -lhbzlib -luser32
-lgdi32 -
ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -lole32
-loleaut32
-luuid -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -Wl,--end-group
Thanks. I suspect you have a CLIPPER or HARBOUR envvar set to
some (invalid to Harbour?) settings. I'm thinking this because by default
hbmk2 should call harbour.exe without -q/-q0, while in your case
Harbour is called with that since the logo header is missing from the
output.

Can you check this?

PS : I do not see the hello.c after above execution, which must be there
Post by Pritpal Bedi
IMO.
It should be deleted in this case.

Brgds,
Viktor
Pritpal Bedi
2009-04-01 16:54:02 UTC
Permalink
Hello Vktor
Post by Viktor Szakáts
Thanks. I suspect you have a CLIPPER or HARBOUR envvar set to
some (invalid to Harbour?) settings. I'm thinking this because by default
hbmk2 should call harbour.exe without -q/-q0, while in your case
Harbour is called with that since the logo header is missing from the
output.
Can you check this?
You are right.
I was invoking it from console which I use to compile Clipper applns.
With new cmd.exe console it works as described.

Thanks for this very handy tool.

Please outline how can I compile .lib hbmk2 and then join
so produced libs and more prg to final .exe. Asking just not
to spend more time to figure out how.

I would like to transfer my projects to hbmk2 to start with.
Also I am thinking of invoking hbmk2 through xMate, and if I could,
then we have a killer build environment. For sure it would been
easy but I am not able to contact to Andy Wos. Andy ?

Regards
Pritpal Bedi
--
View this message in context: http://www.nabble.com/Harbour-1.1.0dev-unified-binary-release-%2820090331%29-tp22817597p22830974.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
Xavi
2009-04-01 08:59:45 UTC
Permalink
Sorry for newbie questions.
How do I add another directory to search Libs hbmk2 for gcc?
gcc ... -LD:/Qt/harbour/lib and -LD:/Qt/2009.01/qt/lib ...

Another topic
In contrib/hbwin/wapi_commctrl.c line 784 .-
hwnd = ( HWND ) hb_parnint( 1 );
It should be .-
hwnd = wapi_par_HWND( 1 );
to avoid gcc warning.

Xavi
Viktor Szakáts
2009-04-01 09:12:33 UTC
Permalink
Hi Xavi,
Post by Xavi
Sorry for newbie questions.
How do I add another directory to search Libs hbmk2 for gcc?
gcc ... -LD:/Qt/harbour/lib and -LD:/Qt/2009.01/qt/lib ...
Same way:
hbmk2 ... -LD:/Qt/harbour/lib -LD:/Qt/2009.01/qt/lib
Post by Xavi
Another topic
In contrib/hbwin/wapi_commctrl.c line 784 .-
hwnd = ( HWND ) hb_parnint( 1 );
It should be .-
hwnd = wapi_par_HWND( 1 );
to avoid gcc warning.
I'll commit a fix for this plus some more minor issues in this file.

Brgds,
Viktor
Xavi
2009-04-01 19:31:15 UTC
Permalink
Thanks Viktor and sorry,
I read your help but I don't know why not worked. Too many new things for my!
Now is Ok and I've solved my print problem. ;)
Thanks a lot to all and tomorrow more. :)

Xavi
Post by Viktor Szakáts
Hi Xavi,
Sorry for newbie questions.
How do I add another directory to search Libs hbmk2 for gcc?
gcc ... -LD:/Qt/harbour/lib and -LD:/Qt/2009.01/qt/lib ...
hbmk2 ... -LD:/Qt/harbour/lib -LD:/Qt/2009.01/qt/lib
Another topic
In contrib/hbwin/wapi_commctrl.c line 784 .-
hwnd = ( HWND ) hb_parnint( 1 );
It should be .-
hwnd = wapi_par_HWND( 1 );
to avoid gcc warning.
I'll commit a fix for this plus some more minor issues in this file.
Brgds,
Viktor
------------------------------------------------------------------------
_______________________________________________
Harbour mailing list
http://lists.harbour-project.org/mailman/listinfo/harbour
Przemyslaw Czerpak
2009-04-01 10:23:23 UTC
Permalink
On Wed, 01 Apr 2009, Szak�ts Viktor wrote:

Hi,
Post by Viktor Szakáts
Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
4) For x64 executable type: 'hbmk2 ../tests/hello.prg -comp=mingw64'
5) For WinCE/ARM executable type: 'hbmk2 ../tests/hello.prg -comp=mingwce'
Very nice. Looks that using Harbour in Windows begins to be as simple
as in *nixes ;-). Thank you very much.
I have one request here. Please add to hbmk2 support for detecting
CLIPPER and RTLINK as base names and switch to -hbcmp/-hblnk mode
automatically plus add support for rtlink @file.lnk in such link mode.
It should greatly help existing Clipper users to make some tests
with Harbour. F.e. it will be enough to make:
copy hbmk2.exe clipper.exe
copy hbmk2.exe rtlink.exe
and make tests using existing Clipper build scripts, f.e. with rmake.exe
Of course if user does not use any 3-rd party libraries.
Post by Viktor Szakáts
From .lnk file important is only list of files after FILE directive
but we can add also support for LIB parsing and some basic translation
for used lib names. AFAIR other directives can be ignored. Such parser
can be implemented as separated single function and probably can be used
also for BLINKER .lnk files.

The whole distro is rather huge though it should not be big problem
for normal usage. But if we have support for above CLIPPER/RTLINK
emulation then we should think also about creating some minimal
Harbour distribution with some small C compiler (f.e. POCC) for
***@32 only as startup and for Clipper users who want to make some
tests with Harbour.

best regards,
Przemek
Massimo Belgrano
2009-04-01 10:29:28 UTC
Permalink
Imo also a light mingw with only used part of bin,lib,lincude No doc, no
unused tool, no debug lib
Post by Viktor Szakáts
Hi,
Post by Viktor Szakáts
Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
4) For x64 executable type: 'hbmk2 ../tests/hello.prg -comp=mingw64'
5) For WinCE/ARM executable type: 'hbmk2 ../tests/hello.prg
-comp=mingwce'
Very nice. Looks that using Harbour in Windows begins to be as simple
as in *nixes ;-). Thank you very much.
I have one request here. Please add to hbmk2 support for detecting
CLIPPER and RTLINK as base names and switch to -hbcmp/-hblnk mode
It should greatly help existing Clipper users to make some tests
copy hbmk2.exe clipper.exe
copy hbmk2.exe rtlink.exe
and make tests using existing Clipper build scripts, f.e. with rmake.exe
Of course if user does not use any 3-rd party libraries.
Post by Viktor Szakáts
From .lnk file important is only list of files after FILE directive
but we can add also support for LIB parsing and some basic translation
for used lib names. AFAIR other directives can be ignored. Such parser
can be implemented as separated single function and probably can be used
also for BLINKER .lnk files.
The whole distro is rather huge though it should not be big problem
for normal usage. But if we have support for above CLIPPER/RTLINK
emulation then we should think also about creating some minimal
Harbour distribution with some small C compiler (f.e. POCC) for
tests with Harbour.
best regards,
Przemek
_______________________________________________
Harbour mailing list
http://lists.harbour-project.org/mailman/listinfo/harbour
--
Massimo Belgrano
Viktor Szakáts
2009-04-01 11:51:03 UTC
Permalink
Post by Viktor Szakáts
Post by Viktor Szakáts
Second issue of the unified and self-contained Windows release
package, which is able to create x86, x64, WinCE/ARM executables
(both shared and static) out of the box without the need of any
external tools or settings. This time also in the form of installer,
with (de)selectable options.
http://www.syenar.hu/harbour/harbour-11-win-20090331.7z (size: 146MB)
http://www.syenar.hu/harbour/harbour-11-win-20090331.exe (size: 148MB)
1) unpack/install to any directory (C:\harbour-11)
2) go to bin dir (optional if you specify path for hbmk2)
3) For x86 executable type: 'hbmk2 ../tests/hello.prg'
4) For x64 executable type: 'hbmk2 ../tests/hello.prg -comp=mingw64'
5) For WinCE/ARM executable type: 'hbmk2 ../tests/hello.prg
-comp=mingwce'
Very nice. Looks that using Harbour in Windows begins to be as simple
as in *nixes ;-). Thank you very much.
:) You're welcome.
Post by Viktor Szakáts
I have one request here. Please add to hbmk2 support for detecting
CLIPPER and RTLINK as base names and switch to -hbcmp/-hblnk mode
It should greatly help existing Clipper users to make some tests
copy hbmk2.exe clipper.exe
copy hbmk2.exe rtlink.exe
and make tests using existing Clipper build scripts, f.e. with rmake.exe
Of course if user does not use any 3-rd party libraries.
Post by Viktor Szakáts
From .lnk file important is only list of files after FILE directive
but we can add also support for LIB parsing and some basic translation
for used lib names. AFAIR other directives can be ignored. Such parser
can be implemented as separated single function and probably can be used
also for BLINKER .lnk files.
I've added clipper/rtlink recognition, but I miss the .lnk parser
code, and to be frank I don't really know its exact details (used
to use "FI hello1, hello2"), so if you happen to have some/any
piece of such parser code I'll can tackle it to hbmk2.
Post by Viktor Szakáts
The whole distro is rather huge though it should not be big problem
for normal usage. But if we have support for above CLIPPER/RTLINK
Yes, it's not small. For me it's a problem only because it's a very heavy
job to update them, takes hours to be assembled / uploaded even without
counting the build-times themselves. Anyhow, it's well suited for final
releases, because we don't have that many of those anyway, and target
builds have to be generated anyway. So it's much better than current
dozen of harbour-1.1-win-*.zip files.
Post by Viktor Szakáts
emulation then we should think also about creating some minimal
Harbour distribution with some small C compiler (f.e. POCC) for
tests with Harbour.
I did a quick test with a 'lite' package and the .7z file is 17MB (same is
the install .exe), installed size 117MB. This contains MinGW libs
and also MinGW x86 embedded version. POCC has a few problems, so
I'm not really interested in investing more time in it, it's slower, has
bugs,
bad 3rd party support (not QT support f.e.), and also needs special
environment
setup to make its compiler work, MinGW looks superior choice from all
aspects besides distro size.

BTW, for comparison a pure POCC build with POCC included has a 12MB
installer and installed size is 77MB. 5MB dl and 40MB installed overhead
is well worth being on the standard path with a heavy duty, standard tool
like MinGW/GCC IMO.

So ideally we should distribute these Windows files on sf.net:
- harbour-1.1.0-win.exe
- harbour-1.1.0-win.7z
- harbour-1.1.0-win-mingw.exe (aka 'lite' or 'minimal')
- harbour-1.1.0-win-mingw.7z (aka 'lite' or 'minimal')
- harbour-1.1.0-src.zip

How to name it? mingw / minimal / light / lite?

Brgds,
Viktor
Przemyslaw Czerpak
2009-04-01 19:24:05 UTC
Permalink
Post by Viktor Szakáts
I've added clipper/rtlink recognition, but I miss the .lnk parser
code, and to be frank I don't really know its exact details (used
to use "FI hello1, hello2"), so if you happen to have some/any
piece of such parser code I'll can tackle it to hbmk2.
I've just written such simple parser.
It does not check full syntax and try to only extract interesting parts:
file list, library list and output file name. Other commands are ignored.
It recognize comments and @included .lnk files.
It should work also with blinker .lnk scripts. I tried to merge both syntax.
I haven't made any deep analyzes of used syntax in both linkers and haven't
tried to replicate all existing and undocumented features but it should work
for valid .lnk scripts though probaly it can be confused by some extended
and not stripped commands. I was to lazy to add full list of blinker commands
to be sure they are well stripped. If user will report some problems with
example then we can update the parser if necessary.
Self contain code below. You can use it for some tests.
Post by Viktor Szakáts
How to name it? mingw / minimal / light / lite?
IMHO minimal. If possible it should have all .prg tools linked dynamically
to reduce the size.

best regards,
Przemek


proc main( ... )
local cCommandLine := "", cParam
local cFileOut := ""
local aFileList, aLibList
local lOK

set filecase lower
set dircase lower
set dirseparator "\"

/* take all parameters as rtlink/blinker ones
* here some local only parameters can be stripped if necessary
*/
for each cParam in hb_aParams()
cCommandLine += cParam + " "
next

altd()

lOK := rtlnk_process( cCommandLine, @cFileOut, @aFileList, @aLibList )
?
? iif( lOK, "linker parameters preporcessed correctly", ;
"error during preprocessing linker parameters" )
? "outputfile:", cFileOut
? "files: "
aeval( aFileList, {|f,i| iif( i > 1, qqout( ", " ), ), qqout( f ) } )
? "libraries: "
aeval( aLibList, {|f,i| iif( i > 1, qqout( ", " ), ), qqout( f ) } )
return

#define RTLNK_MODE_NONE 0
#define RTLNK_MODE_OUT 1
#define RTLNK_MODE_FILE 2
#define RTLNK_MODE_FILENEXT 3
#define RTLNK_MODE_LIB 4
#define RTLNK_MODE_LIBNEXT 5
#define RTLNK_MODE_SKIP 6
#define RTLNK_MODE_SKIPNEXT 7

static function rtlnk_read( cFileName, aPrevFiles )
local cFileBody
local cPath, cFile, cExt
local hFile

hb_FNameSplit( cFileName, @cPath, @cFile, @cExt )
if empty( cExt )
cExt := ".lnk"
endif

cFileName := hb_FNameMerge( cPath, cFile, ".lnk" )
/* it's blinker extnession, look for .lnk file in paths
* specified by LIB envvar
*/
if !hb_fileExists( cFileName ) .and. ;
!left( cFileName, 1 ) $ hb_osPathDelimiters() .and. ;
!substr( cFileName, 2, 1 ) == hb_osDriveSeparator()
for each cPath in hb_aTokens( getenv( "LIB" ), hb_osPathListSeparator() )
cFile := hb_FNameMerge( cPath, cFileName )
if hb_fileExists( cFile )
cFileName := cFile
exit
endif
next
endif

/* protection against recursive calls */
if ascan( aPrevFiles, { |x| x == cFileName } ) == 0
if ( hFile := fopen( cFileName ) ) != -1
cFileBody := space( fseek( hFile, 0, 2 ) )
fseek( hFile, 0, 0 )
if fread( hFile, @cFileBody, len( cFileBody ) ) != len( cFileBody )
cFileBody := NIL
endif
fclose( hFile )
endif
aadd( aPrevFiles, cFileName )
else
cFileBody := ""
endif
return cFileBody

static function rtlnk_process( cCommands, cFileOut, aFileList, aLibList, ;
aPrevFiles )
local nCh, nMode
local cLine, cWord

cCommands := strtran( strtran( cCommands, chr( 13 ) ), ",", " , " )
for each nCh in @cCommands
switch asc( nCh )
case 9
case 11
case 12
case asc( ";" )
nCh := " "
endswitch
next
nMode := RTLNK_MODE_NONE
if !valtype( aFileList ) == "A"
aFileList := {}
endif
if !valtype( aLibList ) == "A"
aLibList := {}
endif
if !valtype( aPrevFiles ) == "A"
aPrevFiles := {}
endif
for each cLine in hb_aTokens( cCommands, chr( 10 ) )
cLine := alltrim( cLine )
if !empty( cLine ) .and. !cLine = "#" .and. !cLine = "//"
if nMode == RTLNK_MODE_NONE
/* blinker extenssion */
if upper( cLine ) = "ECHO "
? "=>", substr( cLine, 6 )
loop
elseif upper( cLine ) = "BLINKER "
/* skip blinker commands */
loop
else /* TODO: add other blinker commands */
endif
endif
for each cWord in hb_aTokens( cLine )
if nMode == RTLNK_MODE_OUT
cFileOut := cWord
nMode := RTLNK_MODE_FILENEXT
elseif nMode == RTLNK_MODE_FILE
if !cWord == ","
if ascan( aFileList, { |x| x == cWord } ) == 0
aadd( aFileList, cWord )
endif
nMode := RTLNK_MODE_FILENEXT
endif
elseif nMode == RTLNK_MODE_LIB
if !cWord == ","
aadd( aLibList, cWord )
nMode := RTLNK_MODE_LIBNEXT
endif
elseif nMode == RTLNK_MODE_SKIP
if !cWord == ","
aadd( aLibList, cWord )
nMode := RTLNK_MODE_SKIPNEXT
endif
elseif cWord == ","
if nMode == RTLNK_MODE_FILENEXT
nMode := RTLNK_MODE_FILE
elseif nMode == RTLNK_MODE_LIBNEXT
nMode := RTLNK_MODE_LIB
elseif nMode == RTLNK_MODE_SKIPNEXT
nMode := RTLNK_MODE_SKIP
endif
elseif cWord = "@"
cWord := substr( cWord, 2 )
cCommands := rtlnk_read( @cWord, aPrevFiles )
if cCommands == NIL
? "cannot open:", cWord, "file."
return .f.
endif
if !rtlnk_process( cCommands, @cFileOut, @aFileList, @aLibList, ;
aPrevFiles )
return .f.
endif
else
cWord := upper( cWord )
if len( cWord ) >= 2
if "OUTPUT" = cWord
nMode := RTLNK_MODE_OUT
elseif "FILE" = cWord
nMode := RTLNK_MODE_FILE
elseif "LIBRARY" = cWord
nMode := RTLNK_MODE_LIB
elseif "MODULE" = cWord .or. ;
"EXCLUDE" = cWord .or. ;
"REFER" = cWord .or. ;
"INTO" = cWord
nMode := RTLNK_MODE_SKIP
endif
endif
endif
next
endif
next

return .t.
Przemyslaw Czerpak
2009-04-01 20:59:05 UTC
Permalink
Post by Przemyslaw Czerpak
I've just written such simple parser.
[...]

Below is corrected version.
I removed one redundant line I left by mistake in copy and past
and added some basic translation for well know Clipper, Blinker,
ExoSpace, SIX, Class(y) files.
For sure it does not cover all possibilities but for many users
should be enough and if they will want then can extend this list.

best regards,
Przemek


proc main( ... )
local cCommandLine := "", cParam
local cFileOut := ""
local aFileList, aLibList
local lOK

/* I need it only to test the code in Linux */
set filecase lower
set dircase lower
set dirseparator "\"

/* take all parameters as rtlink/blinker ones
* here some local only parameters can be stripped if necessary
*/
for each cParam in hb_aParams()
cCommandLine += cParam + " "
next

altd()

lOK := rtlnk_process( cCommandLine, @cFileOut, @aFileList, @aLibList )
?
? iif( lOK, "linker parameters preporcessed correctly", ;
"error during preprocessing linker parameters" )
rtlnk_libtrans( aLibList )
rtlnk_filetrans( aFileList )
? "outputfile:", cFileOut
? "files: "
aeval( aFileList, {|f,i| iif( i > 1, qqout( ", " ), ), qqout( f ) } )
? "libraries: "
aeval( aLibList, {|f,i| iif( i > 1, qqout( ", " ), ), qqout( f ) } )
return

#define RTLNK_MODE_NONE 0
#define RTLNK_MODE_OUT 1
#define RTLNK_MODE_FILE 2
#define RTLNK_MODE_FILENEXT 3
#define RTLNK_MODE_LIB 4
#define RTLNK_MODE_LIBNEXT 5
#define RTLNK_MODE_SKIP 6
#define RTLNK_MODE_SKIPNEXT 7

static procedure rtlnk_libtrans( aLibList )
static hTrans := { ;
"CT" => "hbct" , ;
"CTP" => "hbct" , ;
"CLASSY" => NIL , ;
"CSYINSP" => NIL , ;
"SIX3" => NIL , ;
"NOMACH6" => NIL , ;
"BLXRATEX" => NIL , ;
"BLXCLP50" => NIL , ;
"BLXCLP52" => NIL , ;
"BLXCLP53" => NIL , ;
"EXOSPACE" => NIL , ;
"CLIPPER" => NIL , ;
"EXTEND" => NIL , ;
"TERMINAL" => NIL , ;
"PCBIOS" => NIL , ;
"ANSITERM" => NIL , ;
"DBFBLOB" => NIL , ;
"DBFMEMO" => NIL , ;
"DBFNTX" => NIL , ;
"DBFCDX" => NIL , ;
"_DBFCDX" => NIL , ;
"CLD" => NIL , ;
"CLDR" => NIL }
local cLib

for each cLib in aLibList descend
if upper( right( cLib, 4 ) ) == ".LIB"
cLib := left( cLib, len( cLib ) - 4 )
endif
if upper( cLib ) $ hTrans
cLib := hTrans[ upper( cLib ) ]
if cLib == NIL
hb_aDel( aLibList, cLib:__enumIndex(), .t. )
endif
endif
next
return

static procedure rtlnk_filetrans( aFileList )
static hTrans := { ;
"CTUS" => NIL , ;
"CTUSP" => NIL , ;
"CTINT" => NIL , ;
"CTINTP" => NIL , ;
"__WAIT" => NIL , ;
"__WAIT_4" => NIL , ;
"__WAIT_B" => NIL , ;
"BLXCLP50" => NIL , ;
"BLXCLP52" => NIL , ;
"BLXCLP53" => NIL , ;
"BLDCLP50" => NIL , ;
"BLDCLP52" => NIL , ;
"BLDCLP53" => NIL , ;
"SIXCDX" => NIL , ;
"SIXNSX" => NIL , ;
"SIXNTX" => NIL , ;
"DBT" => NIL , ;
"FPT" => NIL , ;
"SMT" => NIL , ;
"NOMEMO" => NIL , ;
"CLD.LIB" => NIL }
local cFile

for each cFile in aFileList descend
if upper( right( cFile, 4 ) ) == ".OBJ"
cFile := left( cFile, len( cFile ) - 4 )
endif
if upper( cFile ) $ hTrans
cFile := hTrans[ upper( cFile ) ]
if cFile == NIL
hb_aDel( aFileList, cFile:__enumIndex(), .t. )
endif
endif
next
return

static function rtlnk_read( cFileName, aPrevFiles )
local cFileBody
local cPath, cFile, cExt
local hFile

hb_FNameSplit( cFileName, @cPath, @cFile, @cExt )
if empty( cExt )
cExt := ".lnk"
endif

cFileName := hb_FNameMerge( cPath, cFile, ".lnk" )
/* it's blinker extnession, look for .lnk file in paths
* specified by LIB envvar
*/
if !hb_fileExists( cFileName ) .and. ;
!left( cFileName, 1 ) $ hb_osPathDelimiters() .and. ;
!substr( cFileName, 2, 1 ) == hb_osDriveSeparator()
for each cPath in hb_aTokens( getenv( "LIB" ), hb_osPathListSeparator() )
cFile := hb_FNameMerge( cPath, cFileName )
if hb_fileExists( cFile )
cFileName := cFile
exit
endif
next
endif

/* protection against recursive calls */
if ascan( aPrevFiles, { |x| x == cFileName } ) == 0
if ( hFile := fopen( cFileName ) ) != -1
cFileBody := space( fseek( hFile, 0, 2 ) )
fseek( hFile, 0, 0 )
if fread( hFile, @cFileBody, len( cFileBody ) ) != len( cFileBody )
cFileBody := NIL
endif
fclose( hFile )
endif
aadd( aPrevFiles, cFileName )
else
cFileBody := ""
endif
return cFileBody

static function rtlnk_process( cCommands, cFileOut, aFileList, aLibList, ;
aPrevFiles )
local nCh, nMode
local cLine, cWord

cCommands := strtran( strtran( cCommands, chr( 13 ) ), ",", " , " )
for each nCh in @cCommands
switch asc( nCh )
case 9
case 11
case 12
case asc( ";" )
nCh := " "
endswitch
next
nMode := RTLNK_MODE_NONE
if !valtype( aFileList ) == "A"
aFileList := {}
endif
if !valtype( aLibList ) == "A"
aLibList := {}
endif
if !valtype( aPrevFiles ) == "A"
aPrevFiles := {}
endif
for each cLine in hb_aTokens( cCommands, chr( 10 ) )
cLine := alltrim( cLine )
if !empty( cLine ) .and. !cLine = "#" .and. !cLine = "//"
if nMode == RTLNK_MODE_NONE
/* blinker extenssion */
if upper( cLine ) = "ECHO "
? "=>", substr( cLine, 6 )
loop
elseif upper( cLine ) = "BLINKER "
/* skip blinker commands */
loop
else /* TODO: add other blinker commands */
endif
endif
for each cWord in hb_aTokens( cLine )
if nMode == RTLNK_MODE_OUT
cFileOut := cWord
nMode := RTLNK_MODE_FILENEXT
elseif nMode == RTLNK_MODE_FILE
if !cWord == ","
if ascan( aFileList, { |x| x == cWord } ) == 0
aadd( aFileList, cWord )
endif
nMode := RTLNK_MODE_FILENEXT
endif
elseif nMode == RTLNK_MODE_LIB
if !cWord == ","
aadd( aLibList, cWord )
nMode := RTLNK_MODE_LIBNEXT
endif
elseif nMode == RTLNK_MODE_SKIP
if !cWord == ","
nMode := RTLNK_MODE_SKIPNEXT
endif
elseif cWord == ","
if nMode == RTLNK_MODE_FILENEXT
nMode := RTLNK_MODE_FILE
elseif nMode == RTLNK_MODE_LIBNEXT
nMode := RTLNK_MODE_LIB
elseif nMode == RTLNK_MODE_SKIPNEXT
nMode := RTLNK_MODE_SKIP
endif
elseif cWord = "@"
cWord := substr( cWord, 2 )
cCommands := rtlnk_read( @cWord, aPrevFiles )
if cCommands == NIL
? "cannot open:", cWord, "file."
return .F.
endif
if !rtlnk_process( cCommands, @cFileOut, @aFileList, @aLibList, ;
aPrevFiles )
return .F.
endif
else
cWord := upper( cWord )
if len( cWord ) >= 2
if "OUTPUT" = cWord
nMode := RTLNK_MODE_OUT
elseif "FILE" = cWord
nMode := RTLNK_MODE_FILE
elseif "LIBRARY" = cWord
nMode := RTLNK_MODE_LIB
elseif "MODULE" = cWord .or. ;
"EXCLUDE" = cWord .or. ;
"REFER" = cWord .or. ;
"INTO" = cWord
nMode := RTLNK_MODE_SKIP
endif
endif
endif
next
endif
next

return .t.

Loading...