How does `autoreconf` create m4/ folder?

314 views Asked by At

I hit a problem - and I detected the very strange situation:

  1. I run Docker image locally and run there autoreconf -i and I get correct and robust ./configure script.
  2. Then I run autoreconf -i in the same Docker image but under Gitlab CI. And I get broken ./configure script - some of M4 macro were not substituted to their shell code, so Bash cannot execute them and treats them as syntax errors.

The difference is in m4/ folder in the both runs: successful m4/ folder contains files like:

aria2_arg.m4
ax_check_compile_flag.m4
ax_cxx_compile_stdcxx_11.m4
codeset.m4
fallocate.m4
fcntl-o.m4
gettext.m4
... # and so on

but in the failed (Gitlab CI) m4/ folder there are:

gettext.m4
fcntl-o.m4
# ... and so on

and aria2_arg.m4, ax_check_compile_flag.m4, ax_cxx_compile_stdcxx_11.m4, fallocate.m4 and others are missing. I don't know how is it possible if the Docker image is the same in both cases, but... how does autoreconf create m4/ folder? If its content's source is the Docker image itself (I don't know is it true, it's my suggestion only), then why is the content different in both cases?

1

There are 1 answers

0
RandomB On

No any magic. The missing m4 files do exist in the original Aria2 Github repository (in m4/) folder. autoreconf -i adds another .m4 files to this folder. But it has .gitignore with .m4 rule. I added it to another git repo (to build it in Gitlab) but m4/ folder was ignored. So:

 Aria2   ->   local folder   ->   run docker ->     OK
Github          with m4/            locally      m4/ exists

works fine, but:

Aria2   ->  another git repo   ->   run Gitlab CI ->      Failure
Github        (now no m4/)                             (.m4 missing)

So, it seems the reason of the problem was - the miss of m4/ in the second git repo (at least I have got the first successful build)