Add configuration option for charset.alias directory

Specifically controlling the location of this file, rather than simply
using $libdir, allows one to avoid conflicting with the same default
location as the gnulib localcharset module uses.

https://bugzilla.gnome.org/show_bug.cgi?id=346816
This commit is contained in:
Daniel Macks 2017-11-20 05:48:44 -05:00 committed by Philip Withnall
parent deeacce18a
commit 6bcc8b4034
3 changed files with 16 additions and 8 deletions

View File

@ -729,6 +729,12 @@ AC_STRUCT_DIRENT_D_TYPE
# Checks for libcharset # Checks for libcharset
AM_LANGINFO_CODESET AM_LANGINFO_CODESET
gl_GLIBC21 gl_GLIBC21
AC_ARG_WITH(charsetalias-dir,
AS_HELP_STRING([--with-charsetalias-dir=DIR], [directory for charset.alias file [LIBDIR]]),
[],
[with_charsetalias_dir='${libdir}'])
GLIB_CHARSETALIAS_DIR=$with_charsetalias_dir
AC_SUBST(GLIB_CHARSETALIAS_DIR)
# check additional type sizes # check additional type sizes
AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(size_t)

View File

@ -2,7 +2,8 @@
include $(top_srcdir)/glib.mk include $(top_srcdir)/glib.mk
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-DLIBDIR=\"$(libdir)\" \ $(gmodule_INCLUDES) \
-DGLIB_CHARSETALIAS_DIR=\"$(GLIB_CHARSETALIAS_DIR)\" \
$(config_h_INCLUDES) $(config_h_INCLUDES)
noinst_LTLIBRARIES += libcharset.la noinst_LTLIBRARIES += libcharset.la
@ -24,10 +25,10 @@ EXTRA_DIST += \
make-patch.sh \ make-patch.sh \
libcharset-glib.patch libcharset-glib.patch
charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_alias = $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp charset_tmp = $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)/charset.tmp
install-exec-local: all-local install-exec-local: all-local
$(mkinstalldirs) $(DESTDIR)$(libdir) $(mkinstalldirs) $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)
if test -f $(charset_alias); then \ if test -f $(charset_alias); then \
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \

View File

@ -65,9 +65,10 @@
# define relocate(pathname) (pathname) # define relocate(pathname) (pathname)
#endif #endif
/* Get LIBDIR. */ /* Get GLIB_CHARSETALIAS_DIR. */
#ifndef LIBDIR #ifndef GLIB_CHARSETALIAS_DIR
# include "configmake.h" # include "configmake.h"
# define GLIB_CHARSETALIAS_DIR LIBDIR
#endif #endif
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
@ -121,7 +122,7 @@ _g_locale_get_charset_aliases (void)
necessary for running the testsuite before "make install". */ necessary for running the testsuite before "make install". */
dir = getenv ("CHARSETALIASDIR"); dir = getenv ("CHARSETALIASDIR");
if (dir == NULL || dir[0] == '\0') if (dir == NULL || dir[0] == '\0')
dir = relocate (LIBDIR); dir = relocate (GLIB_CHARSETALIAS_DIR);
/* Concatenate dir and base into freshly allocated file_name. */ /* Concatenate dir and base into freshly allocated file_name. */
{ {