Hi Przemek, > 2. -hbdyn should automatically disable all static harbour > libraries (-nohblib) but it should be possible to enable > shared harbour library using -*shared option. > I do not see any normal situation when harbour static libraries > can be linked with PCODE shared library. It's usable only when > user wants to create his own custom harbour*.dll replacement so > rather very seldom. In such he can enable static libraries explicitly > or using -nohblib-. But in all other cases linking static libraries > will cause that the same code is replicated in PCODE DLL and final > application with all internal structures like HVM stack so usually > broken binaries are created.
I'll make -nohblib default when using -hbdyn, this also allows to turn it back on using -nohblib-. > 3. Why have we these lines: > # always export symbols > HB_CFLAGS += -DHB_DYNLIB > in src/vm/maindllp/Makefile? Which C compiler does need it? > It breaks autoexport functionality in MinGW builds. > I also do not see any reason to export wrappers to real functions. > 4. Why have we these lines: > # always export symbols > HB_CFLAGS += -DHB_DYNLIB > in src/vm/maindllh/Makefile? > 5. Why do we keep src/vm/maindll.c? > IMO it should be removed. You are most probably right. We can remove them. > 6. It's time to create from scratch new maindllp.c which will work using > internal HVM function to extract function addresses and will report > errors if some functions are not available. > From current code I'll take your macros for harbour*dll names and > create completely new implementation in src/vm/maindllp/ directory. > At the beginning I'll add support only for hb_vmProcessSymbols() > and hb_vmExecute(). > Later we can add wrappers also two other functions, i.e. the ones > which are present in current maindllp.c (I'll left it as reference > file for some time). Okay. > 7. It's necessary to add to HBMK2 link time option which add this > code to final binaries: > #include "hbapi.h" > HB_EXPORT_ATTR PHB_FUNC dll_hb_vmProcAddress( const char * szFuncName ) > { > return hb_vmProcAddress( szFuncName ); > } > I'll update Harbour header files and add HB_EXPORT_ATTR and > hb_vmProcAddress() declaration to them. > We only have to choose name for this new option. > My propositions: -hasdyn or -usedyn -expdyn > Sorry but I'm the last person for such jobs but I believe that other > users can help us. What is the exact case when this option is required for users? Maybe I'm off, but if this is required for all "pcode" .dlls, we may just enable it automatically in -hbdyn mode when .prg source files are specified. (of course there is the side case, when Harbour .objs are also passed, but I'm not sure this is very typical case.) Brgds, Viktor _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour