NetworkManager/libnm-core/Makefile.am
Dan Winship 53f5e9afa4 libnm*: fix library gettext usage
Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _()
will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than
"gettext (string)" (which will use the program's default domain, which
works fine for programs in the NetworkManager tree, but not for
external users). Likewise, we need to call bindtextdomain() so that
gettext can find the translations if the library is installed in a
different prefix from the program using it (and
bind_textdomain_codeset(), so it will know the translations are in
UTF-8 even if the locale isn't).

(The fact that no one noticed this was broken before is because the
libraries didn't really start returning useful translated strings much
until 0.9.10, and none of the out-of-tree clients have been updated to
actually show those strings to users yet.)
2014-11-13 17:18:42 -05:00

48 lines
1.2 KiB
Makefile

include $(GLIB_MAKEFILE)
SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
-DG_LOG_DOMAIN=\""libnm"\" \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
noinst_LTLIBRARIES = libnm-core.la
# header/source defines are in Makefile.libnm-core, so they can be shared
# with libnm/Makefile.am
include Makefile.libnm-core
libnmincludedir = $(includedir)/libnm
libnminclude_HEADERS = $(libnm_core_headers)
libnm_core_la_SOURCES = \
$(libnm_core_sources) \
$(libnm_core_private_headers)
GLIB_GENERATED = nm-core-enum-types.h nm-core-enum-types.c
nm_core_enum_types_sources = $(notdir $(libnminclude_HEADERS))
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
libnm_core_la_LIBADD = \
$(GLIB_LIBS) \
$(UUID_LIBS)
if WITH_GNUTLS
AM_CPPFLAGS += $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS)
libnm_core_la_SOURCES += crypto_gnutls.c
libnm_core_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS)
endif
if WITH_NSS
AM_CPPFLAGS += $(NSS_CFLAGS)
libnm_core_la_SOURCES += crypto_nss.c
libnm_core_la_LIBADD += $(NSS_LIBS)
endif
BUILT_SOURCES = $(GLIB_GENERATED)
CLEANFILES = $(BUILT_SOURCES)