help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Makefile for my loadable builtin


From: Chet Ramey
Subject: Re: Makefile for my loadable builtin
Date: Mon, 25 Apr 2022 11:03:37 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

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.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]