bug 447619 - comm-central: add configure option to l10n repositories (port of bug 445328), r=l10n@mozilla.com
authorRobert Kaiser <kairo@kairo.at>
Fri, 25 Jul 2008 21:07:10 +0200
changeset 14 79d5655eff042c11cb85b4a637253e02fe5a1b22
parent 13 0b3d633a47f7986c14269d1e7c4747d187811a9f
child 16 fb26b673ca7ab6cc184a8b56485708f4174630a6
push idunknown
push userunknown
push dateunknown
reviewersl10n
bugs447619, 445328
bug 447619 - comm-central: add configure option to l10n repositories (port of bug 445328), r=l10n@mozilla.com
config/autoconf.mk.in
config/config.mk
configure.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -66,16 +66,18 @@ idldir		= $(datadir)/idl/$(MOZ_APP_NAME)
 
 installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
 
 MOZDEPTH	= $(DEPTH)/mozilla
 DIST		= $(MOZDEPTH)/dist
 LIBXUL_SDK      = @LIBXUL_SDK@
 
+L10NBASEDIR     = @L10NBASEDIR@
+
 ifdef LIBXUL_SDK
 LIBXUL_DIST = $(LIBXUL_SDK)
 else
 LIBXUL_DIST = $(DIST)
 endif
 
 XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
 
--- a/config/config.mk
+++ b/config/config.mk
@@ -858,18 +858,22 @@ endif
 # Localization build automation
 #
 
 # Because you might wish to "make locales AB_CD=ab-CD", we don't hardcode
 # MOZ_UI_LOCALE directly, but use an intermediate variable that can be
 # overridden by the command line. (Besides, AB_CD is prettier).
 AB_CD = $(MOZ_UI_LOCALE)
 
-EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
-EXPAND_MOZLOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(MOZILLA_SRCDIR)/$(1)/en-US,$(MOZILLA_SRCDIR)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
+ifndef L10NBASEDIR
+L10NBASEDIR = $(error L10NBASEDIR not defined by configure)
+endif
+
+EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(L10NBASEDIR)/$(AB_CD)/$(subst /locales,,$(1)))
+EXPAND_MOZLOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(MOZILLA_SRCDIR)/$(1)/en-US,$(L10NBASEDIR)/$(AB_CD)/$(subst /locales,,$(1)))
 
 ifdef relativesrcdir
 LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir))
 endif
 
 ifdef LOCALE_SRCDIR
 MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
 endif
--- a/configure.in
+++ b/configure.in
@@ -212,16 +212,30 @@ fi
 
 COMPILE_ENVIRONMENT=1
 MOZ_ARG_ENABLE_BOOL(compile-environment,
 [  --disable-compile-environment
                            Disable compiler/library checks.],
     COMPILE_ENVIRONMENT=1,
     COMPILE_ENVIRONMENT= )
 
+MOZ_ARG_WITH_STRING(l10n-base,
+[  --with-l10n-base=DIR     path to l10n repositories],
+    L10NBASEDIR=$withval)
+if test ! -z "$L10NBASEDIR"; then
+    if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
+        AC_MSG_ERROR([--with-l10n-base must specify a path])
+    elif test -d "$L10NBASEDIR"; then
+        L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
+    else
+        AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
+    fi
+fi
+AC_SUBST(L10NBASEDIR)
+
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 dnl Set CROSS_COMPILE in the environment when running configure
 dnl to use the cross-compile setup for now
 dnl ========================================================
 
 if test "$COMPILE_ENVIRONMENT"; then