Menu

#6 Doesn't find gettext although it is installed

unread
nobody
None
5
2019-11-04
2019-11-04
No

On macOS, the kcd 7.15.0 configure script doesn't find gettext, even though gettext 0.19.8.1 is installed with MacPorts:

checking for GNU gettext in libintl... no

The build proceeds normally, but linking fails because -lintl wasn't specified because LIBINTL was empty:

Undefined symbols for architecture x86_64:
  "_libintl_gettext", referenced from:
      PrintErrorCommand(char const*) in conffile.o
      PrintErrorMessage(char const*, char const*, char const*) in conffile.o
      ExtraChar(char const*, char const*) in conffile.o
      CommaExpected(char const*, char const*) in conffile.o
      InvalidValue(char const*, char const*) in conffile.o
      InvalidAttr(char const*, char const*) in conffile.o
      InvalidColor(char const*, char const*) in conffile.o
      ...
ld: symbol(s) not found for architecture x86_64

The config.log shows the reason why libintl wasn't found:

configure:11238: checking for GNU gettext in libintl
configure:11275: /usr/bin/clang++ -o conftest -pipe -Os -stdlib=libc++ -arch x86_64 -W -Wall -I. -I/opt/local/include  -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 conftest.cpp  -lncurses -lz /opt/local/lib/libintl.dylib >&5
conftest.cpp:154:8: error: cast from pointer to smaller type 'int' loses information
return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0)
       ^~~~~~~~~~~~~~~~~~
conftest.cpp:154:49: error: no matching function for call to '_nl_expand_alias'
return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0)
                                                ^~~~~~~~~~~~~~~~
conftest.cpp:149:13: note: candidate function not viable: requires 0 arguments, but 1 was provided
const char *_nl_expand_alias ();
            ^
2 errors generated.

I would guess this is because the bundled copy of gettext.m4 is too old. It can probably be fixed by updating to a newer copy of gettext.m4 from a more recent version of gettext and regenerating the configure script. But when I try to do that, the resulting configure script does not run for other unrelated reasons, probably because other syntax or methods used in configure.ac or in the other bundled m4 files are incompatible with today's autoconf.

A workaround is to use the attached patch. This is not the correct solution and should not be committed to your repository, but it is enough to allow users to build it until the proper fix can be made.

1 Attachments

Discussion


Log in to post a comment.