On 4/25/22 9:44 AM, Robert E. Griffith wrote:
Should I just copy and modify
<bashSource>examples/loadable/Makefile.inc ? (This makefile has a
comment saying its intended for development of new builtins).
You could, as long as you are ok with restricting yourself to Debian/
Ubuntu.
Since Makefile.inc is derived from Makefile.inc.in, should I be
concerned that it could configure differently when built for another
architecture so the one I copy might not work for other architectures?
The file has to be created by configure because it contains the cc and ld
options to create loadable shared objects. If you know a priori that your
builtin will always be used on systems that have the same set of options,
you can use the one you ship.
I dont think that I
should make a configure.ac for my package because the builtin needs
to be built to whatever bash's configure created, right?
Correct.
The bash-builtin package in ubuntu's repo installs the headers
including config.h that I compile my builtin against.
The `make install' target installs it as well.
Despite its name, I think its meant to be copied and modified because
it has an "all" target that builds a non-existent "example.c" builtin
so it does not really work to be included.
Yes. It has all the mechanism you need to create loadable builtins on
your
local system. You can copy it and use it for your own builtin.