From f85a481a02f375dc0bbb65ce230ac544f67ba80c Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 27 Sep 2010 23:06:24 +0200 Subject: [PATCH] * add locale detection / fix naming of .mo files --- citadel/Makefile.in | 18 ++++++++++++++++-- citadel/configure.ac | 19 +++++++++++++++++-- citadel/po/Makefile.in | 4 ++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 89895dfa0..304596f70 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -66,6 +66,7 @@ SERVER_LDFLAGS=@SERVER_LDFLAGS@ SERVER_LIBS=@SERVER_LIBS@ SETUP_LIBS=@SETUP_LIBS@ YACC=@YACC@ +LOCALEDIR=@LOCALEDIR@ # End configuration section @@ -103,6 +104,7 @@ mkdir-init: (mkdir -p user_modules/$$d ) ; \ done mkdir -p utils utillib textclient + mkdir locale svn_revision.c: ${SOURCES} $(srcdir)/scripts/mk_svn_revision.sh @@ -224,13 +226,23 @@ msgform$(EXEEXT): utils/msgform.o .PHONY: install-data install-doc install-exec clean cleaner distclean -install: install-exec install-data install-doc +install-locale: + cd po; $(MAKE) + for i in `find locale -type d | grep -v .svn` \ + ; do \ + test -d $(DESTDIR)$(LOCALEDIR)/$$i || mkdir -p $(DESTDIR)$(LOCALEDIR)/$$i; \ + done + for i in `find locale -type f | grep -v .svn`; do \ + $(INSTALL) $$i $(DESTDIR)$(LOCALEDIR)/$$i; \ + done + +install: install-exec install-data install-doc install-locale @echo @echo Installation is complete. @echo Now go to your Citadel directory and run 'setup'. @echo -install-new: install-exec-new install-data-new install-doc-new +install-new: install-exec-new install-data-new install-doc-new install-locale @echo @echo Installation is complete. @echo Now go to your Citadel directory and run 'setup'. @@ -381,6 +393,7 @@ install-exec-new: all done clean: + rm -fr locale/* rm -f *.o rm -f utils/*.o ;\ rm -f utillib/*.o ;\ @@ -402,6 +415,7 @@ cleaner: clean distclean: cleaner find . -name '*~' -o -name '.#*' | xargs rm -f + rm -f po/Makefile rm -f Makefile sysdep.h config.cache config.log config.status *.d rm -f utils/*.d ; rm -f utillib/*.d ; diff --git a/citadel/configure.ac b/citadel/configure.ac index ce871bf7d..f59fe78e6 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -9,9 +9,11 @@ AC_PREFIX_DEFAULT(/usr/local/citadel) if test "$prefix" = NONE; then AC_DEFINE_UNQUOTED(CTDLDIR, "$ac_default_prefix", [define this to the Citadel home directory]) ssl_dir="$ac_default_prefix/keys" + localedir=$ac_default_prefix else AC_DEFINE_UNQUOTED(CTDLDIR, "$prefix", [define this to the Citadel home directory]) ssl_dir="$prefix/keys" + localedir=$prefix fi dnl Make sure we see all GNU and Solaris extensions. @@ -154,6 +156,19 @@ AC_ARG_WITH(docdir, ] ) +dnl where to put the locale files +AC_ARG_WITH(localedir, + [ --with-localedir directory to put the locale files to], + [ if test "x$withval" != "xno" ; then + localedir=$withval + fi + ] +) +AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir",[where to find our pot files]) +LOCALEDIR=$localedir +AC_SUBST(LOCALEDIR) + + dnl Checks for the zlib compression library. if test "x$with_zlib" != xno ; then @@ -422,11 +437,11 @@ if test "$ok_nls" != "no"; then fi if test "$ok_nls" != "no"; then - AC_MSG_RESULT(WebCit will be built with national language support.) + AC_MSG_RESULT(citadel will be built with national language support.) AC_DEFINE(ENABLE_NLS, [], [whether we have NLS support]) PROG_SUBDIRS="$PROG_SUBDIRS po" else - AC_MSG_RESULT(WebCit will be built without national language support.) + AC_MSG_RESULT(citadel will be built without national language support.) fi dnl disable backtrace if we don't want it. diff --git a/citadel/po/Makefile.in b/citadel/po/Makefile.in index b03f2f43a..e52afae95 100644 --- a/citadel/po/Makefile.in +++ b/citadel/po/Makefile.in @@ -3,7 +3,7 @@ include ../Make_sources SRCS:= $(wildcard *.po) OBJS:= $(patsubst %.po, \ - ../locale/%/LC_MESSAGES/citadel_setup.mo, \ + ../locale/%/LC_MESSAGES/citadel-setup.mo, \ $(SRCS)) # ../locale/%/LC_MESSAGES/citadel_client.mo, \ # ../locale/%/LC_MESSAGES/citadel_server.mo, \ @@ -17,7 +17,7 @@ all: $(OBJS) clean: rm -r ../locale/* -../locale/%/LC_MESSAGES/citadel_setup.mo: %.po +../locale/%/LC_MESSAGES/citadel-setup.mo: %.po mkdir -p $(patsubst %.po, ../locale/%/LC_MESSAGES, $<) msgfmt -o $@ $< -- 2.30.2