Randy Kobes wrote:
On Sun, 16 May 2004, Stas Bekman wrote:


I'm not sure at the moment, but here's the test case
I used with VC++ (I'll try it tomorrow on linux).

[test case snipped]

That's neat, Randy. If it works on linux I suggest that we
post it to the apr-dev list and ask for an advice there.
After all we try to solve the problem for APR interface,
so it shouldn't be offtopic. And I'm sure folks there will
give us a definitive yes, no, and may be some extra
advice.


Hi Stas,
    I've tried the example on linux (gcc 3.2.2), and it
seems to work the same. Just to be explicit, how I compiled
things are as follows:

  export LD_LIBRARY_PATH=$HOME
  gcc -c -fPIC a.c
  gcc -shared -fPIC -o libmya.so a.o
  gcc -c -fPIC b.c
  gcc -shared -fPIC -o libmyb.so b.o
  gcc -c -fPIC c.c

Then tried making libmyc.so in two ways:
  1) gcc -shared -fPIC -o libmyc.so -L$HOME -lmya -lmyb
  2) gcc -shared -fPIC -o libmyc.so -L$HOME -lmyb -lmya

and compiling the testit application as
  gcc -o testit testit.c -L$HOME -lmyc

Using the 1st way of making libmyc.so (-lmya -lmyb), testit
outputs

  Hello from a
  Hello again from b

whereas the 2nd way of making libmyc.so (-lmyb -lmya) yields

  Hello from b
  Hello again from b

Excellent! Good work, Randy!

One apparent difference between Windows and linux is that,
in the 2nd way of compiling libmyc.so (-lmyb -lmya, where
both required symbols come from libmyb.so), on Linux
libmya.so still needs to be available, whereas on Windows
it doesn't.

That should be fine, since APR/Foo.o will be linked against APR.so only.

If everything else failing, it seems like we have a happy solution for
windows. But ideally I'd like to see one solution for all platforms if
such is possible. Do you think it's worth the try? I guess you will see
first how hard is it going to be to make the special case for windows. If
there is not too much mess, we may just do it for windows.


I'll try it for Windows and see how much is involved; if
this works as expected, it should just involve changing
how things are compiled, as well as the order (APR.so coming
first). But one of the joys of working with Windows is
that things are never as expected ;)

:)

But I keep on mentioning AIX, which also wants a similar
to .def file (.exp I think), so it probably will have the
same issues.


I don't have access to an AIX machine, but it looks like
it would be similar to Windows, and much of the special
handling seems to be already in place as far as link
options, etc. go.

Yes, the only change that will be needed is that .exp handling, similar to windows's .def.



-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to