Bug 12481

Summary: minicom fails when output directory path contains "m4"
Product: buildroot Reporter: Heiko Thiery <heiko.thiery>
Component: OtherAssignee: Giulio Benetti <giulio.benetti>
Status: RESOLVED FIXED    
Severity: normal CC: buildroot, yann.morin.1998
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Heiko Thiery 2020-01-16 21:23:17 UTC
Building minicom package fails when the output directory path contains the string "m4".

e.g.

make O=output-m4 qemu_x86_64_defconfig
make minicom

The build output looks like:

>>> minicom a6a507dcb8bd4cb5da7af9e2dc75b8e495fedbb6 Configuring
>>> minicom a6a507dcb8bd4cb5da7af9e2dc75b8e495fedbb6 Autoreconfiguring
configure.ac:27: warning: macro 'AM_ICONV_LINK' not found in library
configure.ac:125: warning: macro 'AM_GNU_GETTEXT' not found in library
configure.ac:126: warning: macro 'AM_GNU_GETTEXT_VERSION' not found in library
autoreconf: configure.ac: AM_GNU_GETTEXT_VERSION is used, but not AM_GNU_GETTEXT
configure.ac:27: error: possibly undefined macro: AM_ICONV_LINK
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:125: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:126: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
autoreconf: /home/hthiery/sources/mainline/buildroot/output-m4/host/bin/autoconf failed with exit status: 1
make[1]: *** [package/pkg-generic.mk:249: /home/hthiery/sources/mainline/buildroot/output-m4/build/minicom-a6a507dcb8bd4cb5da7af9e2dc75b8e495fedbb6/.stamp_configured] Fehler 1
make: *** [Makefile:23: _all] Fehler 2


I also observed that a directory is created where the "m4" part of the path is replaced by the next part of the host directory. This directory contains links to m4 files. In this example:

output-host/
output-host/share
output-host/share/aclocal
output-host/share/aclocal/codeset.m4
output-host/share/aclocal/wchar_t.m4
output-host/share/aclocal/fcntl-o.m4
output-host/share/aclocal/size_max.m4
output-host/share/aclocal/lib-link.m4
output-host/share/aclocal/progtest.m4
output-host/share/aclocal/intdiv0.m4
output-host/share/aclocal/iconv.m4
output-host/share/aclocal/uintmax_t.m4
output-host/share/aclocal/xsize.m4
output-host/share/aclocal/inttypes-pri.m4
output-host/share/aclocal/intldir.m4
output-host/share/aclocal/lock.m4
output-host/share/aclocal/longlong.m4
output-host/share/aclocal/nls.m4
output-host/share/aclocal/glibc21.m4
output-host/share/aclocal/lib-prefix.m4
output-host/share/aclocal/visibility.m4
output-host/share/aclocal/lib-ld.m4
output-host/share/aclocal/configheader.m4
output-host/share/aclocal/wint_t.m4
output-host/share/aclocal/printf-posix.m4
output-host/share/aclocal/intlmacosx.m4
output-host/share/aclocal/threadlib.m4
output-host/share/aclocal/stdint_h.m4
output-host/share/aclocal/lcmessage.m4
output-host/share/aclocal/intmax.m4
output-host/share/aclocal/po.m4
output-host/share/aclocal/ansi-c++.m4
output-host/share/aclocal/intl.m4
output-host/share/aclocal/glibc2.m4
output-host/share/aclocal/inttypes_h.m4
output-host/share/aclocal/gettext.m4


The same can be reproduced by:
utils/test-pkg -d ~/pkg-test-m4 -p minicom
Comment 1 Heiko Thiery 2020-01-17 07:45:26 UTC
The issues is also seens with the "pdbg" and "dropwatch" packages.
Comment 2 Giulio Benetti 2020-01-17 11:46:59 UTC
Hi Heiko,

I've just tried to rebuild with gettext instead of gettext-tiny, so at the moment
it seems a gettext-tiny problem. I'm going to dig deeper and in the meanwhile I opened an issue on gettext-tiny Github:
https://github.com/sabotage-linux/gettext-tiny/issues/48
Comment 3 Arnout Vandecappelle 2020-01-17 12:08:20 UTC
It seems to be caused by host-gettext-tiny, which installs stuff in the wrong directory, so the relevant m4 files can't be found.

I've done a quick check and found no upstream commits or PRs or issues that seem relevant.

This one looks funny:

gettext-gnu/gettext-tools/misc/autopoint.in:    m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
Comment 4 Giulio Benetti 2020-01-17 12:18:36 UTC
Heiko,

you've discovered a bug that is covered at the moment, since minicom needs NLS, then gettext(entire). So at the moment the bug is hidden.

Arnout,

thank you for pointing that. Maybe I'm going to manage it and open PR ;-)
Comment 5 Giulio Benetti 2020-01-17 12:32:50 UTC
This happens only with folder ending with "m4". If you try rebuild with:

make O=output-m4-tiny qemu_x86_64_defconfig
make minicom

It passes that point.
Comment 6 Heiko Thiery 2020-01-17 14:28:31 UTC
(In reply to Giulio Benetti from comment #5)

I see .. thank you.
Comment 7 Giulio Benetti 2020-01-17 17:44:25 UTC
I've opened a PR to fix it:
https://github.com/sabotage-linux/gettext-tiny/pull/49

This solves the bug.
I'm going to send the patch to Buildroot ML.

Heiko, can you please check if this patch solve the problem?

Thank you
Comment 8 Giulio Benetti 2020-01-17 17:55:07 UTC
I've wrongly marked as fixed.

This is the patch for Buildroot to test:
https://patchwork.ozlabs.org/patch/1224921/

Best regards
Comment 9 Yann E. MORIN 2020-01-18 22:22:38 UTC
Fixed with: https://git.buildroot.org/buildroot/commit/?id=41b9a64526b7bbd28ba2d084f3786cb536750daa

Thanks both for the report, investigation and fix! :-)