On Sat, Mar 29, 2025 at 04:03:07PM +0000, Iain Sandoe wrote:
>
>
> > On 29 Mar 2025, at 15:56, Jakub Jelinek <[email protected]> wrote:
> >
> > On Sat, Mar 29, 2025 at 03:50:54PM +0000, Iain Sandoe wrote:
> >>> I'm not sure if sed -E is portable enough (sure, I know it is in POSIX,
> >>> but
> >>> that is not enough).
> >>> How about just
> >>> sed -e '/^#include/s,"\([^"]*.h\)","../../libgcobol/\1",' $& > $@
> >>
> >> This, unfortunately, works too well (with s/&/^) .. because it also
> >> processes #include “config.h”
> >> which then points to a non-existent file. I think we want to include
> >> config for both FE and
> >> library (so we cannot get around it by indenting the config.h include -
> >> well we could, but …)
> >
> > Neither libgcobol/charmaps.cc nor libgcobol/valconv.cc has config.h include.
>
> but it’s an approved patch (just waiting for the main config change to be
> reviewed) and needed
> for the other lib changes. I’ll investigate if we could find a way to drop
> it fro those two files.
config.h is the only header ending with g in there, so
sed -e '/^#include/s,"\([^"]*[^g"].h\)","../../libgcobol/\1",' $^ > $@
then?
Jakub