Autoconf have been providing the option '--localedir' for a long time now,
so this patch removes the deprecated '--with-nls' option and makes use of
the standard '--localedir' instead.

Took opportunity to define the path in the 'config-paths.h' in the same way
the other paths are defined to be consistent, which also simplify the
compilation commands.

Signed-off-by: Christophe CURIS <[email protected]>
---
 Makefile.am                 |  3 +++
 WINGs/Makefile.am           |  2 +-
 WINGs/po/Makefile.am        |  8 +++-----
 WPrefs.app/Makefile.am      |  2 +-
 WPrefs.app/po/Makefile.am   |  8 +++-----
 configure.ac                | 17 ++++-------------
 doc/build/Translations.texi |  4 ++++
 po/Makefile.am              |  8 +++-----
 src/Makefile.am             |  3 +--
 util/Makefile.am            |  2 +-
 util/po/Makefile.am         |  8 +++-----
 11 files changed, 27 insertions(+), 38 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e2807bf..af8a64d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,9 @@ config-paths.h: Makefile
          echo '#define MENU_TEXTDOMAIN "$(menutextdomain)"' >> $@; \
        fi
        @echo '' >> $@
+       @echo '/* define where the translations are stored */' >> $@
+       @echo '#define LOCALEDIR "$(localedir)"' >> $@
+       @echo '' >> $@
        @echo '/* define an extra path for pixmaps */' >> $@
        @echo '#define PIXMAPDIR "$(pixmapdir)"' >> $@
        @echo '' >> $@
diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am
index 017f1d7..14b27f8 100644
--- a/WINGs/Makefile.am
+++ b/WINGs/Makefile.am
@@ -91,7 +91,7 @@ libWUtil_la_SOURCES =         \
 
 AM_CFLAGS =
 
-AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
+AM_CPPFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" \
         -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
        @XFTFLAGS@ @HEADER_SEARCH_PATH@
 
diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am
index 076c116..7c5d6ce 100644
--- a/WINGs/po/Makefile.am
+++ b/WINGs/po/Makefile.am
@@ -1,7 +1,5 @@
 DOMAIN = WINGs
 
-nlsdir      = $(NLSDIR)
-
 CATALOGS = @WINGSMOFILES@
 
 CLEANFILES = $(CATALOGS) $(DOMAIN).pot
@@ -93,12 +91,12 @@ endif
 
 
 install-data-local:  $(CATALOGS)
-       $(mkinstalldirs) $(DESTDIR)$(nlsdir)
+       $(mkinstalldirs) $(DESTDIR)$(localedir)
        for n in $(CATALOGS) __DuMmY ; do \
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
-                       $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
+                       $(mkinstalldirs) 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am
index f77ddd4..f13aeee 100644
--- a/WPrefs.app/Makefile.am
+++ b/WPrefs.app/Makefile.am
@@ -47,7 +47,7 @@ WPrefs_SOURCES = \
 
 AM_CFLAGS =
 
-AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(wpdatadir)\" 
-DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \
+AM_CPPFLAGS = -DRESOURCE_PATH=\"$(wpdatadir)\" 
-DWMAKER_RESOURCE_PATH=\"$(pkgdatadir)\" \
         -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@ 
 
 WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am
index cd5123f..4fad9aa 100644
--- a/WPrefs.app/po/Makefile.am
+++ b/WPrefs.app/po/Makefile.am
@@ -2,8 +2,6 @@ DOMAIN = WPrefs
 
 CATALOGS = @WPREFSMOFILES@
 
-nlsdir = $(NLSDIR)
-
 CLEANFILES = $(DOMAIN).pot $(CATALOGS)
 
 EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po hr.po hu.po \
@@ -59,12 +57,12 @@ endif
 
 
 install-data-local:  $(CATALOGS)
-       $(mkinstalldirs) $(DESTDIR)$(nlsdir)
+       $(mkinstalldirs) $(DESTDIR)$(localedir)
        for n in $(CATALOGS) __DuMmY ; do \
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
-                       $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
+                       $(mkinstalldirs) 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/configure.ac b/configure.ac
index d1161b5..b13d3b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -419,18 +419,11 @@ dnl that the gettext environment works
 WM_I18N_LANGUAGES
 WM_I18N_XGETTEXT
 
+dnl 2014/12/29: The option is deprecated, we should keep this message for at
+dnl least 2 years to ensure users see it and update their build scripts
+AC_ARG_WITH([nlsdir], [],
+    [AC_MSG_ERROR([option '--with-nlsdir' is deprecated, please use autoconf's 
standard '--localedir' instead])])
 
-dnl Added by Oliver - Support for NLSDIR option
-dnl ===========================================
-AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the 
locale stuff should go]))
-
-if test "x$NLSDIR" = "x"; then
-       if test "x$with_nlsdir" != "x"; then
-               NLSDIR=$with_nlsdir
-       else
-               NLSDIR='$(prefix)/lib/locale'
-       fi
-fi
 
 menutextdomain=
 AC_ARG_WITH(menu-textdomain, AS_HELP_STRING([--with-menu-textdomain=DOMAIN], 
[specify gettext domain used for menu translations]),
@@ -916,8 +909,6 @@ echo "Unsupported features                :$unsupported"
 echo "Antialiased text support in WINGs   : $xft"
 echo "Pango text layout support in WINGs  : $pango"
 echo "Translated languages to support     :$supported_locales"
-AS_IF([test "x$supported_locales" != "x disabled"],
-       [echo "Installation path for translations  : $NLSDIR" | sed -e 
's|\$(prefix)|'"$prefix|"])
 AS_IF([test "x$debug" = "xyes"],
     [AS_ECHO(["Debug enabled: CFLAGS = $CFLAGS"]) ])
 echo
diff --git a/doc/build/Translations.texi b/doc/build/Translations.texi
index f00da78..995da7a 100644
--- a/doc/build/Translations.texi
+++ b/doc/build/Translations.texi
@@ -109,6 +109,10 @@ library); when you run @command{make} to compile the 
project, it will also compi
 (@code{mo} files) for the language(s) you asked (if available, of course), and 
during
 @command{make install} it will install them in the usual directory.
 
+The installation directory can be changed with the standard option 
@option{--localedir} to the
+@command{configure} script, the default path being
+@file{@emph{<prefix>}/share/locale/@emph{<lang>}/LC_MESSAGES}).
+
 
 @c --------------------------------------------------------------------- 
LINGUAS at system level ---
 @section Setting @env{LINGUAS} at system level
diff --git a/po/Makefile.am b/po/Makefile.am
index 578f30c..93f5f47 100644
--- a/po/Makefile.am
+++ b/po/Makefile.am
@@ -1,7 +1,5 @@
 DOMAIN = WindowMaker
 
-nlsdir      = $(NLSDIR)
-
 CATALOGS = @WMAKERMOFILES@
 
 CLEANFILES = $(CATALOGS) $(DOMAIN).pot
@@ -88,12 +86,12 @@ endif
 
 
 install-data-local:  $(CATALOGS)
-       $(mkinstalldirs) $(DESTDIR)$(nlsdir)
+       $(mkinstalldirs) $(DESTDIR)$(localedir)
        for n in $(CATALOGS) __DuMmY ; do \
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
-                       $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
+                       $(mkinstalldirs) 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 78b0a75..e149f7d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -146,8 +146,7 @@ endif
 
 AM_CFLAGS =
 
-AM_CPPFLAGS = \
-       $(DFLAGS) -DLOCALEDIR=\"$(NLSDIR)\" \
+AM_CPPFLAGS = $(DFLAGS) \
        -I$(top_srcdir)/wrlib \
        -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@ 
 
diff --git a/util/Makefile.am b/util/Makefile.am
index cf07fd5..dcca3a8 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -11,7 +11,7 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wkdemenu.pl
 
 EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wkdemenu.pl
 
-AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" \
+AM_CPPFLAGS = \
         $(DFLAGS) -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib \
        @HEADER_SEARCH_PATH@ \
        -DETCDIR=\"sysconfdir\" -DDATADIR=\"pkgdatadir\"
diff --git a/util/po/Makefile.am b/util/po/Makefile.am
index 53fa952..0d72d00 100644
--- a/util/po/Makefile.am
+++ b/util/po/Makefile.am
@@ -2,8 +2,6 @@ DOMAIN = wmgenmenu
 
 CATALOGS = @UTILMOFILES@
 
-nlsdir = $(NLSDIR)
-
 CLEANFILES = $(DOMAIN).pot $(CATALOGS)
 
 EXTRA_DIST = de.po es.po fr.po nl.po pt.po
@@ -34,11 +32,11 @@ endif
 
 
 install-data-local:  $(CATALOGS)
-       $(mkinstalldirs) $(DESTDIR)$(nlsdir)
+       $(mkinstalldirs) $(DESTDIR)$(localedir)
        for n in $(CATALOGS) __DuMmY ; do \
                if test "$$n" -a "$$n" != "__DuMmY" ; then \
                        l=`basename $$n .mo`; \
-                       $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
-                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
+                       $(mkinstalldirs) 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \
+                       $(INSTALL_DATA) -m 644 $$n 
$(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \
                fi; \
        done
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].

Reply via email to