Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
-- This is continuation from a other MSE topic --

>>On 2017-09-08 19:18, Martin Schreiber wrote: 
>> Free Pascal should allow to define the SONAME source in binding unit -
>> using 
>> dlopen()/dlsym() instead is a hack IMHO. 

>On 2017-09-08 20:18, Graeme wrote: 
>I think so too. 

OK, ok, I agree with you too.

But for "conventional" applications only.

Take the example of this project:

https://github.com/fredvs/uidesigner_ext

It allows "Only One Instance" feature.

So, if a instance is already running, a new instance will only sent a
message to the first instance and then close itself.
And then that second instance will not charge/load all the X11/Xft/PThread
stuffs before to sent the message.

I did try with integration into ideU and indeed the message is sent much
faster.

Fre;D





--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and docking.

2017-09-09 Thread fredvs
> Please take the attached patch for inspiration.

Wow, thanks Martin.
Will test it tonight.

Write you later.

Fre;D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
> > Maybe in compiler/link.pas:509 (TLinker.AddSharedCLibrary()). 

Procedure TLinker.AddSharedCLibrary(S:TCmdStr);
  begin
if s='' then
  exit;
{ remove prefix 'lib' }
if
Copy(s,1,length(target_info.sharedclibprefix))=target_info.sharedclibprefix
then
  Delete(s,1,length(target_info.sharedclibprefix));
{ remove extension if any }
if
Copy(s,length(s)-length(target_info.sharedclibext)+1,length(target_info.sharedclibext))=target_info.sharedclibext
then
 
Delete(s,length(s)-length(target_info.sharedclibext)+1,length(target_info.sharedclibext)+1);
{ ready to be added }
SharedLibFiles.Concat(S);
  end;

But... it is hypra-simple to fix.  And it would not make any trouble for
previous code, it will be still compatible.

Sincerely I do absolutely not understand.

Fre;D 
 



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
> I do not understand...

OK, I do understand now.
So it will not be possible to use ld-linux.so.2 for calling the library form
where/ when you want.

> Please do not confuse "static" linking and "dynamic" 

OK. Let do like this:

"shared/dynamic" linking using  ld-linux.so.2:
I will call it "ld dynamic linking".

"shared/dynamic" linking using libdl.so.2.:
I will call it "dl dynamic linking".

ot confuse "static" linking and "dynamic" 

> ld-linux.so.2 uses tables and library names built in in binary by "ld" at
> compile time
  Ha ok,   Huh, no way to create that tables at run time (and not use the
built in in binary) and use them at run time with  ld-linux.so.2 ?

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and docking.

2017-09-09 Thread fredvs
Hello Graeme.

For me the most important is that we are not in trouble ;-)

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and docking.

2017-09-09 Thread Graeme Geldenhuys

On 2017-09-08 19:18, Martin Schreiber wrote:

Free Pascal should allow to define the SONAME source in binding unit - using
dlopen()/dlsym() instead is a hack IMHO.


I think so too. I source of the problem is FPC, and that is where the 
fix should go.


I do applaud Fred for his efforts and energy to come up with something 
that solves his problem though.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread Martin Schreiber
On Saturday 09 September 2017 14:49:43 fredvs wrote:
> Re-hello.
>
> Huh, in previous mail, at end please read this:
>
> The last war would be "What is better: libdl.so.2 or ld-linux.so.2 ?
>
> Could it be possible to imagine a different dynlibs.pas ?
> Actual dynlibs.pas is using libdl.so.2.
> Could it be possible to use ld-linux.so.2 instead (with correspondent
> methods, of course) ?
>
I do not understand, ld-linux.so.2 uses tables and library names built in in 
binary by "ld" at compile time. libdl.so.2 (actually libc.so.6) uses library 
and function names provided as strings by the application at runtime. I 
assume internally dlopen()/dlsym() use functions from ld-linux.so.2.

> And for static linking that already uses ld-linux.so.2,
> if  if the "external" bug is fixed, a custom name/path of the library
> may be used and so have the advantage of a "dynlibs" way.
>
Static linking means combining *.o and *.a files by "ld" at compiletime and 
does not use libraries of the target system at runtime.
Please do not confuse "static" linking and "dynamic" or better named "shared" 
linking.
"shared/dynamic" linking comes in two flavors, either loading by ld-linux.so.2 
using link information stored in executable by "ld" at compiletime or by 
explicit calls of dlopen()/dlsym() in user code. Neither of them is 
named "static" linking.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
Re-hello.

Huh, in previous mail, at end please read this:

The last war would be "What is better: libdl.so.2 or ld-linux.so.2 ? 

Could it be possible to imagine a different dynlibs.pas ? 
Actual dynlibs.pas is using libdl.so.2. 
Could it be possible to use ld-linux.so.2 instead (with correspondent 
methods, of course) ? 

And for static linking that already uses ld-linux.so.2, 
if  if the "external" bug is fixed, a custom name/path of the library 
may be used and so have the advantage of a "dynlibs" way.


Fre;D




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
> Then the application can not start if the library is not found and 
> it can not be compiled if there is no libX11.so -> ibX11.so.6 link. 

Of course the "double advantage" works only if buggy "external" was fixed !
;-)

> Maybe in compiler/link.pas:509 (TLinker.AddSharedCLibrary()).

OK, I will check.
Many thanks.

Each day it becomes clearer.

So, it I understand ok:

- There are 2 ways to load a library with Unix:

1)- With ld-linux.so.2
2)- With libdl.so.2

It seems (not sure, I want confirmation) that ld-linux.so.2 is better than
libdl.so.2 for speed, ressource used,...

Could it be possible to imagine a different dynlibs.pas ?
Actual dynlibs.pas is using libdl.so.2.
Could it be possible to use ld-linux.so.2 instead (with correspondent
methods, of course) ?

All this if the "external" bug was not fixed.

Otherwise, if the "external" bug is fixed, a custom name/path of the library 
may be used (and so have the advantage of a "dynlibs" way).  


Fre;D





--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread Martin Schreiber
On Saturday 09 September 2017 13:35:18 fredvs wrote:
> Hello Martin.
>
> Do you know where in fpc code (or how to find it) "external" is assigned
> and 'so.n' deleted ?
>
Maybe in compiler/link.pas:509 (TLinker.AddSharedCLibrary()).

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread Martin Schreiber
On Saturday 09 September 2017 12:53:22 fredvs wrote:
> > Another advantage of ld-linux.so.2 is that it is possible to list the
>
> needed libraries by "ldd ".
>
> Huh, it is what I try to explain: you may use dlopen()/dlsym() and list
> list the needed libraries by "ldd".
> ---> Add in dynamic linking code a {$linklib} statement (or Procedure
> dummy() ; cdecl; external libX11; ).
>
> Fre;D
>
Then the application can not start if the library is not found and it can not 
be compiled if there is no libX11.so -> libX11.so.6 link.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
Hello Martin.

Do you know where in fpc code (or how to find it) "external" is assigned and
'so.n' deleted ?

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSE and XLib.

2017-09-09 Thread fredvs
> Another advantage of ld-linux.so.2 is that it is possible to list the
needed libraries by "ldd ".

Huh, it is what I try to explain: you may use dlopen()/dlsym() and list list
the needed libraries by "ldd".
---> Add in dynamic linking code a {$linklib} statement (or Procedure
dummy() ; cdecl; external libX11; ).

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk