Apache "mod_d" needs C to instantiate D interpreter?

JFD jfd at nospam.com
Mon Nov 8 16:37:50 PST 2010


Yes, you're right.  One should implement Apache module in D.

One thing is that Apache module entry point expects a "C" function.  I've figure
that that one could just add extern(C) in front of D function to be callable from
C, so that was easy.  Also, Apache expects .so shared library, and one could build
it roughly like this:

Let DMD build a .a library:
dmd -fPIC -lib libhello.d

Then convert it to shared library:
gcc -shared -Wl,-soname,libhello.so.0 -o libhello.so.0.0 libhello.a

Could DMD build .so shared library directly (did I miss something)?

Then it's all D from there on.  Cool!

Thank you.


More information about the Digitalmars-d mailing list