@@ -, +, @@ 
 configure.ac                   |  6 ++++++
 glib/libcharset/Makefile.am    | 11 ++++++-----
 glib/libcharset/localcharset.c |  7 ++++---
 3 files changed, 16 insertions(+), 8 deletions(-)
--- a/configure.ac	
+++ a/configure.ac	
@@ -729,6 +729,12 @@ AC_STRUCT_DIRENT_D_TYPE
 # Checks for libcharset
 AM_LANGINFO_CODESET
 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
 AC_CHECK_SIZEOF(size_t)
--- a/glib/libcharset/Makefile.am	
+++ a/glib/libcharset/Makefile.am	
@@ -1,8 +1,9 @@ 
 ## Process this file with automake to produce Makefile.in
 include $(top_srcdir)/glib.mk
 
-AM_CPPFLAGS = 				\
-	-DLIBDIR=\"$(libdir)\" 		\
+AM_CPPFLAGS = 							\
+	$(gmodule_INCLUDES)					\
+	-DGLIB_CHARSETALIAS_DIR=\"$(GLIB_CHARSETALIAS_DIR)\"	\
 	$(config_h_INCLUDES)
 
 noinst_LTLIBRARIES += libcharset.la
@@ -24,10 +25,10 @@ EXTRA_DIST += 			\
 	make-patch.sh		\
 	libcharset-glib.patch
 
-charset_alias = $(DESTDIR)$(libdir)/charset.alias
-charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+charset_alias = $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)/charset.alias
+charset_tmp = $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)/charset.tmp
 install-exec-local: all-local
-	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(GLIB_CHARSETALIAS_DIR)
 	if test -f $(charset_alias); then \
 	  sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
 	  $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
--- a/glib/libcharset/localcharset.c	
+++ a/glib/libcharset/localcharset.c	
@@ -65,9 +65,10 @@ 
 # define relocate(pathname) (pathname)
 #endif
 
-/* Get LIBDIR.  */
-#ifndef LIBDIR
+/* Get CHARSETALIASDIR.  */
+#ifndef GLIB_CHARSETALIAS_DIR
 # include "configmake.h"
+# define GLIB_CHARSETALIAS_DIR LIBDIR
 #endif
 
 #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".  */
       dir = getenv ("CHARSETALIASDIR");
       if (dir == NULL || dir[0] == '\0')
-	dir = relocate (LIBDIR);
+	dir = relocate (GLIB_CHARSETALIAS_DIR);
 
       /* Concatenate dir and base into freshly allocated file_name.  */
       {
