Hello Qiu,

I think the easiest is to adjust the code so that it first obtains the
datadir from some environment variable, and if that is not set, falls
back to the hardcoded default. Then run-ptest can set the variable.
Such a patch can even be proposed upstream.

Alex

On Tue, 31 Oct 2023 at 09:27, Tingting Qiu (Fujitsu) <qi...@fujitsu.com> wrote:
>
> Hi, Alex
>
> I'm afraid DATADIR should be an absolute path.
> Tried to make a ptest.patch with relative path, but failed.
> As we know the ptest directory is not a fixed path, so making a patch may be 
> not suitable.
> For no 'make clean', we can modify the Makefile.am in do_patch().
> Any ideas?
>
> Best Regards,
> Qiu Tingting
> > -----Original Message-----
> > From: Alexander Kanavin <alex.kana...@gmail.com>
> > Sent: Tuesday, October 24, 2023 4:51 PM
> > To: Qiu, Tingting/仇 婷婷 <qi...@fujitsu.com>
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH V5] kbd:Add ptest support
> >
> > On Tue, 24 Oct 2023 at 06:12, qi...@fujitsu.com <qi...@fujitsu.com> wrote:
> > >
> > > Hi,Alex
> > >
> > > As you said, it is not-that-elegant bit of code.
> > > But DATADIR is used as a part of CPPFLAGS for compiling c files in
> > > tests, such as libkeymap/libkeymap-test01.c, 
> > > libkbdfile/libkbdfile-test13.c
> > and others.
> > > sample:
> > >
> > > libkeymap/libkeymap-test01.c: f = fopen(DATADIR
> > "/data/libkeymap/charset-keymap0.map", "r");
> > libkeymap/libkeymap-test09.c:   setenv("LOADKEYS_INCLUDE_PATH",
> > DATADIR "/data/libkeymap", 1);
> >
> > I see, thanks. I would suggest that Makefile.am is patched with a dedicated
> > patch that sets DATADIR to ptest directory on target (you can mark it
> > Inappropriate), so that the change is robust (sed expressions are prone to
> > silent regressions, and), and happens before actual build, so no 'make 
> > clean' is
> > needed.
> >
> > Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#189834): 
https://lists.openembedded.org/g/openembedded-core/message/189834
Mute This Topic: https://lists.openembedded.org/mt/102128673/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to