From: | Kartik Ohri <kartikohri13(at)gmail(dot)com> |
---|---|
To: | Chapman Flack <chap(at)anastigmatix(dot)net> |
Cc: | pljava-dev(at)lists(dot)postgresql(dot)org |
Subject: | Re: the ScriptingMojo |
Date: | 2020-08-26 16:55:08 |
Message-ID: | CAASLQ4MH5JaVbrG9O_S+9dnp=tj_8N3jArxxpf-dJD1ezd5SfQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
Hi,
> Yes ... because not only is it done by the nar-maven-plugin (which is not
> what we want to imitate), it is also done that way by the PGXS makefiles
> (which are what we want to imitate). In fact it has been the usual practice
> for about as long as there have been makefiles.
>
> One reason is that compiling C programs is a kind of local activity.
> Each .c file is transformed into a .o file, without needing to know
> very much about the others. (What little it does need to know, it
> gets from .h files.)
>
> Conceptually, it's a different operation once you have all of those .o
> files and you want to edit and link all of them together into some kind
> of binary image with the references resolved. On top of that, there are
> choices in what kind of result to produce. A standalone executable?
> A static library? A dynamic library? A loadable plugin? (The Mac OS
> linker really makes a distinction between a regular dynamic library
> and a plugin. The unresolved references in a dynamic library have to
> be findable in the other libraries given as its dependencies. For a
> plugin, the assumption is they will be findable in the program that
> the plugin gets loaded into. The Mac linker actually checks that at
> link time, which is why there is a -bundle_loader option added in
> the Mac OS profile in pljava-so.)
>
> Even when you can just pile all the compiling and linking options onto
> one gcc command line, that still is just the gcc wrapper command being
> clever and sorting the options out and running the preprocessor and
> compiler and then the linker. But for clarity in makefiles, it is very
> common to separate the rules for compiling the components from the rules
> for linking the final product.
>
Understood, that makes sense.
-------------------------------------------
I have made some progress on the plugin. The Mac OS X configuration is
working and passing the CI. I have also begun work on completing the
Windows configuration. I am having some issues with the File.separator
being used in paths. Once I am able to resolve it, we should have all the
basic functionality ready. Also, I noticed that running pg_config in the
Windows command line (MSVC) environment gives values of cc, cflags and
ldflags so on as not recorded.
Thanks.
Regards,
Kartik
From | Date | Subject | |
---|---|---|---|
Next Message | Chapman Flack | 2020-08-26 19:25:02 | Re: the ScriptingMojo |
Previous Message | Chapman Flack | 2020-08-26 05:09:19 | Re: the ScriptingMojo |