tbursztyka / connman-ui

A full-featured GTK based trayicon UI for ConnMan
GNU General Public License v2.0
38 stars 13 forks source link

ALL_LINGUAS env variable being set breaks compilation #13

Closed stevenhoneyman closed 9 years ago

stevenhoneyman commented 10 years ago

it does this when ALL_LINGUAS is set (to en_GB in this case):

$ make
make --no-print-directory all-recursive
Making all in po
make[2]: *** No rule to make target 'en_GB.gmo', needed by 'all-yes'.  Stop.
Makefile:1077: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:496: recipe for target 'all' failed
make: *** [all] Error 2

If the .gmo files are supposed to be generated, then the makefile is missing a step (I don't really know how gettext etc works... I --disable-nls when possible!)

tbursztyka commented 9 years ago

What are your versions of gettext/automake/autoconf ? How do you exactly trigger this? (build env, exact configure options etc...)

It seems to work well here, with/without ALL_LINGUAS/--disable-nls

stevenhoneyman commented 9 years ago
$ autoconf --version|head -1
autoconf (GNU Autoconf) 2.69
$ automake --version|head -1
automake (GNU automake) 1.14.1
$ gettext --version|head -1
gettext (GNU gettext-runtime) 0.19.3
$ echo $ALL_LINGUAS
en_GB

It should be repeatable just with:

export ALL_LINGUAS="not_valid_gmo"
./autogen.sh
./configure --prefix=/usr
make

The po/Makefile takes the value of ALL_LINGUAS from the environment and the "all-yes" target of that makefile tries to look for that as a file. I can work around this problem by either adding a "test -f" to the Makefile, or unset ALL_LINGUAS before compiling... but I don't think these are the right solution!

If you still can't repeat results, let me know and I'll find a clean chroot or VM or something and get some more info for you.

tbursztyka commented 9 years ago

Ok you are ahead of me with your automake/gettext versions. Clean everything and try this: intltoolize --force

Then try to rebuild again.

stevenhoneyman commented 9 years ago

Unfortunately no different. Here's the full output, from a clean git clone:

$ intltoolize --force
You should update your 'aclocal.m4' by running aclocal.
$ aclocal
$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
autoreconf: Leaving directory `.'
$ ./configure 
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 whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... 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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... print -r
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 whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-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... print -r --
checking for ar... ar
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 mt... no
checking if : 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 NLS is requested... yes
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.20.1
checking for XML::Parser... ok
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for catalogs to be installed...  en_GB
checking for GTK... yes
checking for GLIB... yes
checking for DBUS... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/version.h
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
$ make
make --no-print-directory all-recursive
Making all in po
make[2]: *** No rule to make target 'en_GB.gmo', needed by 'all-yes'.  Stop.
Makefile:1078: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:497: recipe for target 'all' failed
make: *** [all] Error 2
tbursztyka commented 9 years ago

Exact same output until your make.

I'll switch to your versions, let's see.

stevenhoneyman commented 9 years ago

Hmm! They're the current Arch Linux stock repo versions if that makes any difference to you

tbursztyka commented 9 years ago

Ok I could reproduce it if only I remove po/LINGUAS Without that one, it allways fallsback on ALL_LINGUAS, which then might be bogus (if a language has no .po file, it cannot work full stop.)

Do you still have this file or?

stevenhoneyman commented 9 years ago

I do. From the previous test directory:

$ ls po
total 36K
-rw-r--r-- 1 steven steven    0 2014-12-04 11:29 ChangeLog
-rw-r--r-- 1 steven steven 7.0K 2014-12-04 11:29 fr.po
-rw-r--r-- 1 steven steven    3 2014-12-04 11:29 LINGUAS
-rw-r--r-- 1 steven steven 7.4K 2014-12-04 11:34 Makefile
-rw-r--r-- 1 steven steven 7.1K 2014-12-04 11:34 Makefile.in
lrwxrwxrwx 1 steven steven   34 2014-12-04 11:31 Makefile.in.in -> /usr/share/intltool/Makefile.in.in
-rw-r--r-- 1 steven steven  411 2014-12-04 11:34 POTFILES
-rw-r--r-- 1 steven steven  434 2014-12-04 11:29 POTFILES.in
-rw-r--r-- 1 steven steven    0 2014-12-04 11:34 stamp-it
$ cat po/LINGUAS 
fr
stevenhoneyman commented 9 years ago

hmm LINGUAS environment variable is also set to en_GB...

tbursztyka commented 9 years ago

Yes, and now I am wondering why are those variables set. I never saw those before (though it seems to be used somewhere)

stevenhoneyman commented 9 years ago

libreoffice I believe. I think it took about half an hour off the compile time! (was a while ago)

http://wiki.gentoo.org/wiki/Localization/HOWTO#LINGUAS

tbursztyka commented 9 years ago

Gentoo, which I use, will set these only on emerge time (if configured in make.conf). Thus why do you have it always set in your env vars?

stevenhoneyman commented 9 years ago

Just because I don't always use a package manager. It'd have the same behaviour on Arch Linux if it was set in makepkg.conf, and then I tried to build connman-ui-git package for example

tbursztyka commented 9 years ago

Can you verify it really does that? In Gentoo, a proper ebuild needs to set the available linguas_ through IUSE, which filters out I think.

That said, it does not prevent the Makefile.in generated by intltoolize to be dumb: if a linguas does not get a match in the LINGUAS file, it should not try to make anything... That's definitely a intltool bug, imo.

stevenhoneyman commented 9 years ago

Sure - I unset both globals, and added this "fake" value (so I could see for sure it was using it) to LINGUAS and ALL_LINGUAS in my makepkg.conf.

I've had these set for years, and this is the first makefile that has given an issue. Maybe it does just need a slight tweak/mod to check the file before using a value?

==> Building and installing package
==> Making package: connman-ui-git r24.706afd5-1 (Thu  4 Dec 13:26:44 GMT 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating connman-ui git repo...
Fetching origin
==> Validating source files with md5sums...
    connman-ui ... Skipped
==> Extracting sources...
  -> Creating working copy of connman-ui git repo...
Cloning into 'connman-ui'...
done.
==> Starting pkgver()...
==> Starting build()...
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/ltversion.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:21: installing './compile'
configure.ac:30: installing './config.guess'
configure.ac:30: installing './config.sub'
configure.ac:4: installing './install-sh'
configure.ac:4: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
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 whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... 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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... print -r
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 whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-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... print -r --
checking for ar... ar
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 mt... no
checking if : 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 NLS is requested... yes
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.20.1
checking for XML::Parser... ok
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for catalogs to be installed...  en_ZZ
checking for GTK... yes
checking for GLIB... yes
checking for DBUS... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/version.h
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
make --no-print-directory all-recursive
Making all in po
make[2]: *** No rule to make target 'en_ZZ.gmo', needed by 'all-yes'.  Stop.
Makefile:1077: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:496: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build connman-ui-git.
==> Restart building connman-ui-git ? [y/N]
==> ---------------------------------------
==> 
(code 1)
tbursztyka commented 9 years ago

Yeah the only way to fix this is to fix the autogenerated Makefile.in from intltoolize

Basically, changing the CATALOGS line so it adds a file check on every .gmo file names it thinks it will need.

tbursztyka commented 9 years ago

I mean Makefile.in.in

tbursztyka commented 9 years ago

which of course is a link to the original one... let's change that.

tbursztyka commented 9 years ago

Ok, try changing those in Makefile.in.in (be sure it's an actual file, and not a link):

Line 62 or about: POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do if test -f "$$lang.po"; then printf "$$lang.po "; fi; done)

and line 70 or about: CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do if test -f "$$lang.po"; then printf "$$lang.gmo "; fi; done)

stevenhoneyman commented 9 years ago

Yep, that works (is actually identical to what I thought was my 'messy workaround'!)

tbursztyka commented 9 years ago

Yes you got the right idea from the beginning. I am preparing a commit for it. Closing the issue.