public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* making .so files...
@ 2005-10-17 22:13 Jason Pyeron
  2005-10-18 20:46 ` Brian Dessent
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jason Pyeron @ 2005-10-17 22:13 UTC (permalink / raw)
  To: cygwin


I am not sure if this can be done on windows but here it goes.


I am working with the Asterisk application, it uses "modules" these are 
.so files which are linked against the main executable.


Asterisk will load a module, which may or may not make use of code 
exported by the main executable.


Is this two way DLL allowed under windows? Restated, can a DLL call code 
from the main executable?



-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-17 22:13 making .so files Jason Pyeron
@ 2005-10-18 20:46 ` Brian Dessent
  2005-10-19 15:56 ` Gerrit P. Haase
  2005-10-20 22:26 ` Yaakov S (Cygwin Ports)
  2 siblings, 0 replies; 7+ messages in thread
From: Brian Dessent @ 2005-10-18 20:46 UTC (permalink / raw)
  To: cygwin

Jason Pyeron wrote:

> I am not sure if this can be done on windows but here it goes.
> 
> I am working with the Asterisk application, it uses "modules" these are
> .so files which are linked against the main executable.
> 
> Asterisk will load a module, which may or may not make use of code
> exported by the main executable.
> 
> Is this two way DLL allowed under windows? Restated, can a DLL call code
> from the main executable?

This gets asked regularly.  You should search the archives.  This is the
last one that I remember, and it was just a few weeks ago:
http://cygwin.com/ml/cygwin/2005-09/msg00875.html

Yes, it's possible.  But there are some drawbacks.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-17 22:13 making .so files Jason Pyeron
  2005-10-18 20:46 ` Brian Dessent
@ 2005-10-19 15:56 ` Gerrit P. Haase
  2005-10-19 19:47   ` Jason Pyeron
  2005-10-20 22:26 ` Yaakov S (Cygwin Ports)
  2 siblings, 1 reply; 7+ messages in thread
From: Gerrit P. Haase @ 2005-10-19 15:56 UTC (permalink / raw)
  To: Jason Pyeron; +Cc: cygwin

Jason Pyeron wrote:
> I am not sure if this can be done on windows but here it goes.
> 
> 
> I am working with the Asterisk application, it uses "modules" these are 
> ..so files which are linked against the main executable.
> 
> 
> Asterisk will load a module, which may or may not make use of code 
> exported by the main executable.
> 
> 
> Is this two way DLL allowed under windows? Restated, can a DLL call code 
> from the main executable?

A better solution would be to put all Asterisk code into a shared libray
besides Asterisk main() and link asterisk.exe and the modules against
this libray.

You know that there is a project which already has ported asterisk to
Cygwin:  http://www.asteriskwin32.com/ ?


Gerrit

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-19 15:56 ` Gerrit P. Haase
@ 2005-10-19 19:47   ` Jason Pyeron
  2005-10-20  5:40     ` Gerrit P. Haase
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Pyeron @ 2005-10-19 19:47 UTC (permalink / raw)
  To: cygwin



On Wed, 19 Oct 2005, Gerrit P. Haase wrote:

> You know that there is a project which already has ported asterisk to
> Cygwin:  http://www.asteriskwin32.com/ ?

yes, but the patching does not track very well to cvs HEAD, and even on 
its own branch it is pretty old.

My goal is to submit patches upstream to get it to compile.


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-19 19:47   ` Jason Pyeron
@ 2005-10-20  5:40     ` Gerrit P. Haase
  0 siblings, 0 replies; 7+ messages in thread
From: Gerrit P. Haase @ 2005-10-20  5:40 UTC (permalink / raw)
  To: Jason Pyeron; +Cc: cygwin

Jason Pyeron wrote:

> 
> On Wed, 19 Oct 2005, Gerrit P. Haase wrote:
> 
>> You know that there is a project which already has ported asterisk to
>> Cygwin:  http://www.asteriskwin32.com/ ?
> 
> 
> yes, but the patching does not track very well to cvs HEAD, and even on 
> its own branch it is pretty old.
> 
> My goal is to submit patches upstream to get it to compile.

Great!  Please feel free to ask me if you need help.


Gerrit
-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-17 22:13 making .so files Jason Pyeron
  2005-10-18 20:46 ` Brian Dessent
  2005-10-19 15:56 ` Gerrit P. Haase
@ 2005-10-20 22:26 ` Yaakov S (Cygwin Ports)
  2005-10-20 22:31   ` Jason Pyeron
  2 siblings, 1 reply; 7+ messages in thread
From: Yaakov S (Cygwin Ports) @ 2005-10-20 22:26 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Pyeron wrote:
> I am working with the Asterisk application, it uses "modules" these are
> .so files which are linked against the main executable.
> 
> Asterisk will load a module, which may or may not make use of code
> exported by the main executable.

If I understand you correctly, then it's not so difficult; I've done it
myself with bmp, gedit, gthumb, liferea, and xmms.

I don't know Asterisk, but it doesn't appear to use autotools; this
makes things more difficult, especially if you want to make a portable
patch.

First, make sure that the asterisk executable is built *first*; you may
need to precede '.' to the SUBDIRS variable (i.e. SUBDIRS = . subdir1
subdir2 etc.)

Add the following to the asterisk executable's LDFLAGS:
'-Wl,--export-all-symbols,--out-implib,libasterisk.dll.a'

Then, add the following to all the modules LDFLAGS, specifying the
correct location: '-Wl,/path/to/libasterisk.dll.a'.

Of course, make sure that all requisite link libraries are specified in
LIBS for both the executable and the modules.

You'll still need to find some way of making all this dependent on
Cygwin in the Makefiles in order to make this portable.


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDWBmQpiWmPGlmQSMRAmL3AKDsK1MMNFSvPA4GLcvC5NJ0ZqOpAACg+uWe
lS4WeqeOxgs5yMCDG/r1Dms=
=ievK
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: making .so files...
  2005-10-20 22:26 ` Yaakov S (Cygwin Ports)
@ 2005-10-20 22:31   ` Jason Pyeron
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Pyeron @ 2005-10-20 22:31 UTC (permalink / raw)
  To: cygwin

On Thu, 20 Oct 2005, Yaakov S (Cygwin Ports) wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jason Pyeron wrote:
>> I am working with the Asterisk application, it uses "modules" these are
>> .so files which are linked against the main executable.
>>
>> Asterisk will load a module, which may or may not make use of code
>> exported by the main executable.
>
> If I understand you correctly, then it's not so difficult; I've done it
> myself with bmp, gedit, gthumb, liferea, and xmms.
>
> I don't know Asterisk, but it doesn't appear to use autotools; this
> makes things more difficult, especially if you want to make a portable
> patch.
>
> First, make sure that the asterisk executable is built *first*; you may
> need to precede '.' to the SUBDIRS variable (i.e. SUBDIRS = . subdir1
> subdir2 etc.)
>
> Add the following to the asterisk executable's LDFLAGS:
> '-Wl,--export-all-symbols,--out-implib,libasterisk.dll.a'
>
> Then, add the following to all the modules LDFLAGS, specifying the
> correct location: '-Wl,/path/to/libasterisk.dll.a'.
>
> Of course, make sure that all requisite link libraries are specified in
> LIBS for both the executable and the modules.
>
> You'll still need to find some way of making all this dependent on
> Cygwin in the Makefiles in order to make this portable.
>
>

I will try it this weekend, this is good to know.

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-20 22:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-17 22:13 making .so files Jason Pyeron
2005-10-18 20:46 ` Brian Dessent
2005-10-19 15:56 ` Gerrit P. Haase
2005-10-19 19:47   ` Jason Pyeron
2005-10-20  5:40     ` Gerrit P. Haase
2005-10-20 22:26 ` Yaakov S (Cygwin Ports)
2005-10-20 22:31   ` Jason Pyeron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).