mypaint / libmypaint

libmypaint, a.k.a. "brushlib", is a library for making brushstrokes which is used by MyPaint and other projects.
http://mypaint.org
Other
307 stars 87 forks source link

libmypaint fails to reconfigure with autoconf 2.70 #178

Open hosiet opened 3 years ago

hosiet commented 3 years ago

Environment: Debian Unstable/Sid with autoconf 2.70 installed

Downstream bug report: https://bugs.debian.org/978854

% autoreconf --install --verbose --force              
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4macros
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
autoreconf: running: intltoolize --copy --force
ERROR: 'IT_PROG_INTLTOOL' must appear in configure.ac for intltool to work.
autoreconf: error: intltoolize failed with exit status: 1
% autoconf --version
autoconf (GNU Autoconf) 2.70
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>, <https://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

I have a very dirty and ugly workaround as shown below:

diff --git a/configure.ac b/configure.ac
index 1aae7ab..b6e1e06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,7 +245,7 @@ if test "x$enable_i18n" != "xno"; then
   AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
                      [The prefix for our gettext translation domains.])
   AC_SUBST(GETTEXT_PACKAGE)
-  IT_PROG_INTLTOOL
+IT_PROG_INTLTOOL
   AM_GLIB_GNU_GETTEXT

   dnl Debian: stdlib

The reasoning behind the patch is shown below:

% intltoolize --copy --force --debug
intltoolize: enabling shell trace mode
+ test -f configure.ac
+ configure=configure.ac
+ files=po/Makefile.in.in
+ test -z 
+ egrep ^(AC|IT)_PROG_INTLTOOL configure.ac
+ echo ERROR: 'IT_PROG_INTLTOOL' must appear in configure.ac for intltool to work.
ERROR: 'IT_PROG_INTLTOOL' must appear in configure.ac for intltool to work.
+ exit 1

It seems that intltoolize requires the IT_PROG_INTLTOOL macro to be located at the beginning of the line. This is understandable because the macro is not supposed to be located inside an if statement (which is conditional). However, this does not suit the need of libmypaint project.

jplloyd commented 3 years ago

Thank you @hosiet. As far as autotools goes, I don't think your workaround is ugly at all. I will add it to master and the upcoming 1.6.2 release. Moving forward our use of intltoolize needs to be replaced anyway.

That egrep check has been there for at least 9 years, so I assume autoconf 2.70 got stricter, or fixed some bug that ignored the error.

kloczek commented 3 years ago

Here is proposition to resolve that:

--- a//configure.ac~    2020-05-11 17:24:35.000000000 +0100
+++ b//configure.ac     2021-03-27 17:32:18.502438606 +0000
@@ -235,27 +235,13 @@
   [test x$enable_debug = xyes && LDFLAGS="-fsanitize=undefined $LDFLAGS"],
   [], [-Werror], [])

-## Internationalization ##
-AC_ARG_ENABLE(i18n,
-  AS_HELP_STRING([--disable-i18n],
-    [disable internationalization (default=no)])
-)
-
-if test "x$enable_i18n" != "xno"; then
-  enable_i18n="yes"
-  GETTEXT_PACKAGE=libmypaint
-  AC_SUBST(GETTEXT_PACKAGE)
-  AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
-                     [The prefix for our gettext translation domains.])
-  AC_SUBST(GETTEXT_PACKAGE)
-  IT_PROG_INTLTOOL
-  AM_GLIB_GNU_GETTEXT
-
-  dnl Debian: stdlib
-  dnl Windows, and OSX: -lintl
-  AC_SEARCH_LIBS([dgettext], [intl], [], AC_MSG_ERROR([no dgettext]))
-fi
-AM_CONDITIONAL(HAVE_I18N, test "x$enable_i18n" = "xyes")
+IT_PROG_INTLTOOL
+GETTEXT_PACKAGE=libmypaint
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
+                   [The prefix for our gettext translation domains.])
+AC_SUBST(GETTEXT_PACKAGE)
+AM_GLIB_GNU_GETTEXT

 GOBJECT_INTROSPECTION_CHECK(introspection_required_version)

--- a/Makefile.am~      2020-05-11 17:34:25.000000000 +0100
+++ b/Makefile.am       2021-03-27 17:28:21.535107144 +0000
@@ -146,13 +146,9 @@
        tilemap.h                                               \
        glib/mypaint-brush.c

-if HAVE_I18N
-PODIRS = po
-endif
-
 SUBDIRS = \
        .                       \
        doc                     \
        gegl            \
        tests           \
-       $(PODIRS)
+       po

This patch removes --{enable|disable}-i18n configure option which is alreaduy duplication already provided by standard gettext/intltool m4 macro --{enable|disable}-nls Please let me know if you want me to make PR out ot that patch.

hosiet commented 3 years ago

@kloczek My understanding to the new patch is that intltool and gettext will have to be unconditionally present during configure no matter you use it or not. (In the old implementation, they can be missing if you disable i18n).

If this side effect is acceptable, the new patch might be better. Otherwise it looks like a regression.

kloczek commented 3 years ago

@kloczek My understanding to the new patch is that intltool and gettext will have to be unconditionally present during configure no matter you use it or not. (In the old implementation, they can be missing if you disable i18n).

No, no .. simple that case already is handled natively in aclocal macros :) If you will specify --disable-nls or if your system will be not gettext/intltool capabel i18n support will be not anabled and .mo files will be not installed.

hosiet commented 3 years ago

@kloczek Thanks for the info. However, when using your patch and call ./configure --disable-nls without intltool installed, the following error occurred:

./configure --disable-nls
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.16... yes
checking for platform... unix
checking whether to turn on debugging... no
checking whether to turn on profiling... no
checking for json-c... yes
checking for library containing floorf... -lm
checking for library containing powf... none required
checking for library containing expf... none required
checking for library containing fabsf... none required
checking whether C compiler accepts -fsanitize=undefined... yes
checking whether the linker accepts -fsanitize=undefined... yes
checking whether NLS is requested... no
./configure: line 13827: intltool-update: command not found
checking for intltool-update... no
checking for intltool-merge... no
checking for intltool-extract... no
configure: error: The intltool scripts were not found. Please install intltool.
hosiet commented 3 years ago

Besides, even if intltool is installed and ./configure --disable-nls is used, make install will still have libmypaint.mo compiled and installed. @klozcek Can you verify it?

kloczek commented 3 years ago

IMO that kind of things are really minor. If you really want to have that kind of functionality instead implementing standard acloca macros replacements you shoulsd work on fixing that in intltool/gettext. Other ways IMO are nothing more than waste of time :)

hosiet commented 3 years ago

Then perhaps we should keep the old implementation for now. At least the old one is working properly and we haven't found a new functioning substitute.

kloczek commented 3 years ago

Issue is that current implementation cannot be used with autoconf 2.7{0,1}.

hosiet commented 3 years ago

I believe current git HEAD ( fb450f8fc562b3c85a90678029b43c07d6fe6ff1 ) is working as expected with autoconf 2.70. What is the error message on your side?

kloczek commented 3 years ago

Without patch which I;ve copied here autoreconf fails with:

+ cd libmypaint-1.6.1
+ autoreconf -fiv
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4macros
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
autoreconf: running: intltoolize --copy --force
ERROR: 'IT_PROG_INTLTOOL' must appear in configure.ac for intltool to work.
autoreconf: error: intltoolize failed with exit status: 1

It fails because IT_PROG_INTLTOOL is used conditionally so my patch mainly removed that conditional use of IT_PROG_INTLTOOL.

kloczek commented 3 years ago

fb450f8 looks like it updates onlu some po/*.po files.

hosiet commented 3 years ago

I cannot reproduce your error:

> git clone https://github.com/mypaint/libmypaint
Cloning into 'libmypaint'...
remote: Enumerating objects: 109, done.
remote: Counting objects: 100% (109/109), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 5285 (delta 78), reused 63 (delta 36), pack-reused 5176
Receiving objects: 100% (5285/5285), 2.97 MiB | 11.83 MiB/s, done.
Resolving deltas: 100% (3811/3811), done.
> cd libmypaint/
> autoreconf -fiv
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4macros
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
autoreconf: running: intltoolize --copy --force
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4macros
autoreconf: running: /usr/bin/autoconf --force
configure.ac:83: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:83: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:83: the top level
configure.ac:249: warning: The macro `GLIB_GNU_GETTEXT' is obsolete.
configure.ac:249: You should run autoupdate.
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:249: the top level
configure.ac:249: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:249: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
aclocal.m4:73: GLIB_LC_MESSAGES is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:249: the top level
configure.ac:249: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:249: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:249: the top level
configure.ac:249: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:249: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:249: the top level
configure.ac:249: warning: The macro `AC_OUTPUT_COMMANDS' is obsolete.
configure.ac:249: You should run autoupdate.
./lib/autoconf/status.m4:1025: AC_OUTPUT_COMMANDS is expanded from...
aclocal.m4:172: GLIB_WITH_NLS is expanded from...
aclocal.m4:388: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:488: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:249: the top level
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:84: installing './ar-lib'
configure.ac:82: installing './compile'
configure.ac:90: installing './config.guess'
configure.ac:90: installing './config.sub'
configure.ac:58: installing './install-sh'
configure.ac:58: installing './missing'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: Leaving directory '.'
> autoconf --version
autoconf (GNU Autoconf) 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>, <https://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.