building Harbour from source: regenerating .hbx files

175 views
Skip to first unread message

Luigi Ferraris

unread,
Apr 27, 2017, 8:39:26 AM4/27/17
to Harbour Users
Hi friends,
I have a strange problem but I need some informations to investigate more.
I got Harbour sources from git using "download zip" option; I'm working on WinXp

AFAIK, to create .hbx file I can put next code in .hbp file (eg)
-hbx=${hb_name}.hbx

But reading many of Harbour/contrib/<libname>/<libname>.hbp I always see
${hb_name}.hbx
IOW without -hbx option

In fact, all .hbx files (where -hbx is missing) are the same as those in the download after building Harbour using
win-make

Why many of
<libname>.hbp doesn't has -hbx option? It's right?

Another problem.
Original .hbx file have function names in Camel style (eg DYNAMIC AddAscii). Using -hbx option I get upper case (eg DYNAMIC ANSITOHTML).
Can create problems? I think no, but...

TIA
Luigi Ferraris

Luigi Ferraris

unread,
Apr 29, 2017, 9:35:56 AM4/29/17
to Harbour Users
Hi friends,
I think to got answer by myself but (please) some developer can tell me if right.

Probably, it's related with Changelog 2012-03-04 20:31 UTC+0100 Viktor Szakats (vszakats.net/harbour)

Assumption: end program want use
REQUEST __HBEXTERN__MYLIBNAME__

Short description: Harbour (hbmk2 builder) need a "fixed" function[s] list (<libname>.hbx) to create a library
that contains a function with a particular name (eg) __HBEXTERN__LIBNAME__.

For this reason every contrib source library has its .hbx file, that is "fixed" and is not generated while
Harbour building process is running (eg win-make on Windows).

Take a look to (eg) hbct.hbp
It has
   ${hb_name}.hbx  (1)
instead of
   -hbx=${hb_name}.hbx (2)

Normally, to create a library and it's related function list I think: I must use "-hbx=" option. No, wrong or not exactly.

I found an important (hidden) difference:

(1) this line create a "hbct.c" file where you can find many HB_FUNC_EXTERN but (most important) these lines:
HB_FUNC( __HBEXTERN__HBCT__ );
than start library symbols
HB_INIT_SYMBOLS_BEGIN( hb_vm_SymbolInit_HBCT )
...........
{ "__HBEXTERN__HBCT__", {HB_FS_PUBLIC | HB_FS_LOCAL}, {HB_FUNCNAME( __HBEXTERN__HBCT__ )}, NULL }
HB_INIT_SYMBOLS_EX_END( hb_vm_SymbolInit_HBCT, "..\\contrib\\hbct\\hbct.hbx", 0x0, 0x0003 )
take a look to "__HBEXTERN__HBCT__" and last line
But hbct.hbx is "required" and it must already exist

(2) this line, doesn't create any "hbct.c" file so, none __HBEXTERN__HBCT__ extern function is created.

My Conclusion: If anyone want to build its library and later use "REQUEST __HBEXTERN....." he need next two steps

A) create a <libname>.hbx (eg <libname>.hbp) but unusable library
-hblib
-inc
-o${hb_name}
-w3 -es2
-hbx=${hb_name}.hbx

B)
create usable library <libname> (eg <libname>.hbp)
-hblib
-inc
-o${hb_name}
-w3 -es2
${hb_name}.hbx

I have done some test and seems work in this way... but is my conclusion correct?

Regards
Luigi Ferraris



W.

unread,
May 2, 2017, 8:08:40 AM5/2/17
to Harbour Users
Without getting deep into this topic... There is a option for Makefile which will regenrate libraries .hbx files.
make HB_REBUILD_EXTERN=yes 

Do not delete old *.hbx file manually if you want to preserve case of functions. The new ones will be uppercase, and you can correct them.
The previous ones would keep their case.

Regards, W.
Reply all
Reply to author
Forward
0 new messages