Use of gnulib's cfg.mk

View: New views
6 Messages — Rating Filter:   Alert me  

Use of gnulib's cfg.mk

by Reuben Thomas :: Rate this Message:

| View Threaded | Show Only this Message

I see that gnulib has its own cfg.mk which is used, for example, to
skip some syntax-check checks on gnulib's own code. It also has its
own Makefile.am. In GNU Zile I get these by virtue of having gnulib as
a git submodule. However, GNU Hello uses Bazaar, and I can't see a way
to include a git submodule. How do I get these files using just
gnulib-tool? For example, I can't see that gnulib's cfg.mk is
mentioned by any module.

hello stores all its gnulib files under TOPLEVEL/gnulib, but currently
adds "gnulib/lib" to its top-level Makefile.am's SUBDIRS; presumably I
want to change that to just "gnulib".

--
http://rrt.sc3d.org


Re: Use of gnulib's cfg.mk

by Bruno Haible :: Rate this Message:

| View Threaded | Show Only this Message

Reuben Thomas wrote:
> I see that gnulib has its own cfg.mk which is used, for example, to
> skip some syntax-check checks on gnulib's own code.
> ...
> I can't see that gnulib's cfg.mk is mentioned by any module.

Yes,
  $ ./gnulib-tool --find cfg.mk
shows that cfg.mk is not contained in any module. This is because it
describes syntax rules for the gnulib source code, not for the Zile
or Hello source code.

You are supposed to use a cfg.mk file of your own in Zile or Hello.

> It also has its own Makefile.am.

No, gnulib does not have a Makefile.am. It has a couple of Makefiles,
though. They are also not meant to be copied into your package.

> I can't see a way to include a git submodule. How do I get these files
> using just gnulib-tool?

gnulib-tool has an option --copy-file that can retrieve a single file
out of the gnulib repository, independently of any modules. It's sometimes
useful for config.guess and config.sub. But please think twice before using
it!

Bruno



Re: Use of gnulib's cfg.mk

by Reuben Thomas :: Rate this Message:

| View Threaded | Show Only this Message

On 14 April 2012 19:44, Bruno Haible <bruno@...> wrote:

> Reuben Thomas wrote:
>> I see that gnulib has its own cfg.mk which is used, for example, to
>> skip some syntax-check checks on gnulib's own code.
>> ...
>> I can't see that gnulib's cfg.mk is mentioned by any module.
>
> Yes,
>  $ ./gnulib-tool --find cfg.mk
> shows that cfg.mk is not contained in any module. This is because it
> describes syntax rules for the gnulib source code, not for the Zile
> or Hello source code.

OK, I'm obviously misunderstanding how Zile escapes performing the
syntax checks on files in gnulib.

--
http://rrt.sc3d.org


Re: Use of gnulib's cfg.mk

by Reuben Thomas :: Rate this Message:

| View Threaded | Show Only this Message

On 14 April 2012 20:17, Reuben Thomas <rrt@...> wrote:

> On 14 April 2012 19:44, Bruno Haible <bruno@...> wrote:
>> Reuben Thomas wrote:
>>> I see that gnulib has its own cfg.mk which is used, for example, to
>>> skip some syntax-check checks on gnulib's own code.
>>> ...
>>> I can't see that gnulib's cfg.mk is mentioned by any module.
>>
>> Yes,
>>  $ ./gnulib-tool --find cfg.mk
>> shows that cfg.mk is not contained in any module. This is because it
>> describes syntax rules for the gnulib source code, not for the Zile
>> or Hello source code.
>
> OK, I'm obviously misunderstanding how Zile escapes performing the
> syntax checks on files in gnulib.

On further investigation, my question reduces to the following: what
is the standard way to exclude gnulib files from inappropriate
syntax-check tests? As far as I can see, copying parts of
gnulib/cfg.mk into one's project's cfg.mk is the obvious way, but it's
a bit surprising that something like this doesn't happen
automatically, since other autotools integration is managed
automatically.

--
http://rrt.sc3d.org


Re: Use of gnulib's cfg.mk

by Jim Meyering :: Rate this Message:

| View Threaded | Show Only this Message

Reuben Thomas wrote:

> On 14 April 2012 20:17, Reuben Thomas <rrt@...> wrote:
>> On 14 April 2012 19:44, Bruno Haible <bruno@...> wrote:
>>> Reuben Thomas wrote:
>>>> I see that gnulib has its own cfg.mk which is used, for example, to
>>>> skip some syntax-check checks on gnulib's own code.
>>>> ...
>>>> I can't see that gnulib's cfg.mk is mentioned by any module.
>>>
>>> Yes,
>>>  $ ./gnulib-tool --find cfg.mk
>>> shows that cfg.mk is not contained in any module. This is because it
>>> describes syntax rules for the gnulib source code, not for the Zile
>>> or Hello source code.
>>
>> OK, I'm obviously misunderstanding how Zile escapes performing the
>> syntax checks on files in gnulib.

The syntax checks check only version-controlled files,
which does not include files in git submodules.


Re: version controlled files

by Bruno Haible :: Rate this Message:

| View Threaded | Show Only this Message

Hello Reuben,

Jim Meyering wrote:
> The syntax checks check only version-controlled files,
> which does not include files in git submodules.

Maybe the problem is that in GNU Hello, files copied from gnulib are
added to version control [1]? While that is a possible way to work with
gnulib, it is not the mainstream one. For me, it has become too much
work to 'add', 'remove', 'commit' lots of new files each time something
changed in gnulib.

For my projects, I classified the files into 7 categories and decided
about their version control separately:
  - Source
  - gnulib-cache.m4
  - Brought in by autotools, gnulib-tool
  - Generated by autotools
  - Generated by "make" and distributed (i.e. kept by "make distclean")
  - Generated by "make" and not distributed (i.e. erased by "make distclean")
  - Editor backup files

For most of the projects, the files are handled like this:


                                                   in              in
                                  Committed    .gitignore    .git/info/exclude

Source                                Y             N               N

gnulib-cache.m4                       Y             N               N

Brought in by autotools,              N             Y               N
gnulib-tool

Generated by autotools                N             Y               N

Generated by "make" and               N             Y               N
distributed (i.e. kept by
"make distclean")

Generated by "make" and               N             N               Y
not distributed (i.e. erased by
"make distclean")

Editor backup files                   N             Y               N


Only in one project, which has no autogen.sh file and is very rarely
modified, I am putting files brought in by autotools or gnulib-tool
under version control:


                                                   in              in
                                  Committed    .gitignore    .git/info/exclude

Source                                Y             N               N

gnulib-cache.m4                       Y             N               N

Brought in by autotools,              Y             N               N
gnulib-tool

Generated by autotools                Y             N               N

Generated by "make" and               Y             N               N
distributed (i.e. kept by
"make distclean")

Generated by "make" and               N             N               Y
not distributed (i.e. erased by
"make distclean")

Editor backup files                   N             N               Y


In this situation, the objective is that the user only needs a checkout.
He can build directly through "./configure; make". But as soon as you
have an 'autogen.sh' file, you can get away with much less files under
version control.

Bruno

[1] http://bzr.savannah.gnu.org/lh/hello/trunk/files/head: