Skip to content

Update autogen.sh#167

Open
Anagastes wants to merge 1 commit intoeonpatapon:masterfrom
Anagastes:master
Open

Update autogen.sh#167
Anagastes wants to merge 1 commit intoeonpatapon:masterfrom
Anagastes:master

Conversation

@Anagastes
Copy link
Copy Markdown

fix compile issue on modern systems.

[PC mpDris2]# ./autogen.sh --sysconfdir=/etc
configure.ac:21: warning: AM_NLS is m4_require'd but not m4_defun'd
aclocal.m4:26: IT_PROG_INTLTOOL is expanded from...
configure.ac:21: the top level
configure:3264: error: possibly undefined macro: AM_NLS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: error: /usr/bin/autoconf failed with exit status: 1

fix compile issue on actually systems.

```text
[PC mpDris2]# ./autogen.sh --sysconfdir=/etc
configure.ac:21: warning: AM_NLS is m4_require'd but not m4_defun'd
aclocal.m4:26: IT_PROG_INTLTOOL is expanded from...
configure.ac:21: the top level
configure:3264: error: possibly undefined macro: AM_NLS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: error: /usr/bin/autoconf failed with exit status: 1
```
Comment thread autogen.sh
#!/bin/sh

autoreconf -f -i || exit
autoreconf -fvi -I /usr/share/gettext/m4 || exit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary; on my system (Fedora 42 using autoconf-2.72, automake-1.17), running autoreconf -f -i will put the definition for AM_NLS into aclocal.m4.

(It also runs intltoolize itself, so the call on line 5 probably isn't necessary. I think it's the intltoolize call that actually inserts the AM_NLS definition.)

$ git clean --force -X
$ autoreconf -f -i -v
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: intltoolize --copy --force
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory '.'

$ grep NLS aclocal.m4 
AC_REQUIRE([AM_NLS])dnl
AC_DEFUN([AM_NLS],
  AC_MSG_CHECKING([whether NLS is requested])
  dnl Default is enabled NLS
    USE_NLS=$enableval, USE_NLS=yes)
  AC_MSG_RESULT([$USE_NLS])
  AC_SUBST([USE_NLS])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, in fact, this change isn't universal because there's no /usr/share/gettext/m4/ on my system at all. The gettext m4 files are all in /usr/share/aclocal/ where they belong:

$ rpm -ql gettext-devel |grep m4
/usr/share/aclocal/build-to-host.m4
/usr/share/aclocal/gettext.m4
/usr/share/aclocal/host-cpu-c-abi.m4
/usr/share/aclocal/iconv.m4
/usr/share/aclocal/intlmacosx.m4
/usr/share/aclocal/lib-ld.m4
/usr/share/aclocal/lib-link.m4
/usr/share/aclocal/lib-prefix.m4
/usr/share/aclocal/nls.m4
/usr/share/aclocal/po.m4
/usr/share/aclocal/progtest.m4

It sounds like you may have a non-standard installation of gettext and/or intltool and/or autoconf.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! Nope, my mistake. It looks like you actually have a newer version of gettext than I do (mine is 0.23.1)

But if your version is 0.24.1, and has this fix to the 0.24 release...

author	Bruno Haible <bruno@clisp.org>	
Tue, 1 Apr 2025 10:16:18 -0400 (16:16 +0200)
committer	Bruno Haible <bruno@clisp.org>	
Tue, 1 Apr 2025 10:18:07 -0400 (16:18 +0200)
commit	02c475e2f3a64a9cc4e1caa9e712e5e643178579
tree	5cc01bc62cb7fbfb4a944faf7633d1b40c5c94eb	tree | snapshot
parent	34840cd57f8bea5b323f5243b6c8e00044a427bd	commit | diff
gettextize: Fix bad interactions between autoreconf and autopoint.

Reported by Sebastian Pipping <sebastian@pipping.org>
in <https://savannah.gnu.org/bugs/index.php?66968>.

* gettext-tools/m4/Makefile.am (aclocaldir): Remove variable.
(pkgdatadir, macrosdir): Add variables.
(macros_DATA): Renamed from aclocal_DATA.
(install-data-local, uninstall-local, uninstall-macros): New targets.
* gettext-tools/misc/gettextize.in: Copy the *.m4 files from
$datadir/gettext/m4, not from $datadir/aclocal.
* gettext-tools/doc/gettext.texi (aclocal): Don't recommend to add option
--install to ACLOCAL_MFLAGS. Instead, recommend one-time use of --system-acdir.
* PACKAGING: Expect *.m4 files in $prefix/share/gettext/m4, not in
$prefix/share/aclocal.
* NEWS: Mention the fix.

...then that's a bad sign.

I assume gettextize would do the right thing, but autoreconf detects "Not using Gettext" which I assume means it won't run it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this change to configure.ac caused autoreconf to stop emitting the "Not using Gettext" message, and to copy in m4/nls.m4 when it's run, which contains the AM_NLS definition. Does that also work with Gettext 0.24.1?

diff --git a/configure.ac b/configure.ac
index dcc3c3d..9e5ad21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,8 @@ define([gitversion], esyscmd([sh -c "which git > /dev/null && (git describe | tr
 GITVERSION="gitversion"
 AC_SUBST(GITVERSION)
 
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_REQUIRE_VERSION(0.20)
 GETTEXT_PACKAGE=mpDris2
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im sorry for my absence. :D

Hope you've find an better solution now. My "work" isn't perfect (shame on me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants