After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696934 - goffice 0.10.1: locales are installed to /usr/lib instead of /usr/share
goffice 0.10.1: locales are installed to /usr/lib instead of /usr/share
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
0.10.x
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2013-03-30 23:06 UTC by Dominique Leuenberger
Modified: 2013-03-31 02:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configure: correct LOCALEDATADIR detection. (1.49 KB, patch)
2013-03-30 23:10 UTC, Dominique Leuenberger
none Details | Review

Description Dominique Leuenberger 2013-03-30 23:06:15 UTC
On a linux system (openSUSE for that matter), goffice 0.10.1 installs locale files to /usr/lib instead of /usr/share (as expected).

Analysis shows (from the config.log) that the 'root cause' is -Werror=nested-extern, that was added to configure.ac (commit 759c996), but AM_GLIB_GNU_GETTEXT is not 'compatible' to this.

Extract from config.log:

conftest.c:36:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
conftest.c: In function 'main':
conftest.c:38:1: error: nested extern declaration of '_nl_msg_cat_cntr' [-Werror=nested-externs]
cc1: some warnings being treated as errors
configure:15693: $? = 1

aclocal contains this extract:

# Set DATADIRNAME correctly if it is not set yet
# (copied from glib-gettext.m4)
if test -z "$DATADIRNAME"; then
  AC_LINK_IFELSE(
    [AC_LANG_PROGRAM([[]],
                     [[extern int _nl_msg_cat_cntr;
                       return _nl_msg_cat_cntr]])],
    [DATADIRNAME=share],
    [case $host in
    *-*-solaris*)
    dnl On Solaris, if bind_textdomain_codeset is in libc,
    dnl GNU format message catalog is always supported,
    dnl since both are added to the libc all together.
    dnl Hence, we'd like to go with DATADIRNAME=share
    dnl in this case.
    AC_CHECK_FUNC(bind_textdomain_codeset,
      [DATADIRNAME=share], [DATADIRNAME=lib])
    ;;
    *)
    [DATADIRNAME=lib]
    ;;
    esac])
fi
AC_SUBST(DATADIRNAME)


=> as AC_LANG_PROGRAM 'fails' to build (due to -Werror=nested-extern), the first DATADIRNAME=share is being skipped, then we're not solaris, so DATADIRNAME=lib is being assumed...

I worked around this in my builds for now by moving AM_GLIB_GNU_GETTEXT (and the relevant other Gettext stuff, to keep it together) before the setting of the strict compiler flags...

see attached patch.
Comment 1 Dominique Leuenberger 2013-03-30 23:10:03 UTC
Created attachment 240182 [details] [review]
configure: correct LOCALEDATADIR detection.

With gcc compiler flags -Werror=nested-extern, the AM_GLIB_GNU_GETTEXT
macros fail, resulting in all locales being installed in $prefix/lib.
Comment 2 Dominique Leuenberger 2013-03-30 23:39:24 UTC
Quick note: the exact same issue happens in gnumeric (not surprising). The solution was the same;
Comment 3 Morten Welinder 2013-03-31 01:36:33 UTC
and libgsf, one assumes.

Thanks.  I'll commit something like this.
Comment 4 Morten Welinder 2013-03-31 02:05:39 UTC
not libgsf.

I was wondering what the files were doing there.  It's especially weird
on a system that uses lib64 for the library files.

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.