summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RepositoryExternal.mk4
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.in50
-rw-r--r--i18npool/Library_i18nisolang1.mk5
-rw-r--r--i18npool/source/languagetag/languagetag.cxx2
-rw-r--r--liblangtag/makefile.mk4
-rw-r--r--scp2/InstallModule_ooo.mk1
-rw-r--r--scp2/source/ooo/directory_ooo.scp2
-rw-r--r--scp2/source/ooo/file_extra_ooo.scp2
-rw-r--r--scp2/source/ooo/file_library_ooo.scp4
10 files changed, 41 insertions, 34 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 2fd6e5e733f7..4216bf240350 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -462,6 +462,8 @@ endef
endif # SYSTEM_GLIB
+ifeq ($(ENABLE_LIBLANGTAG),YES)
+
ifeq ($(SYSTEM_LIBLANGTAG),YES)
define gb_LinkTarget__use_liblangtag
@@ -495,6 +497,8 @@ endef
endif # SYSTEM_LIBLANGTAG
+endif # ENABLE_LIBLANGTAG
+
ifeq ($(SYSTEM_NEON),YES)
diff --git a/config_host.mk.in b/config_host.mk.in
index a3501f198997..717383b8c72e 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -125,6 +125,7 @@ export ENABLE_TDE=@ENABLE_TDE@
export ENABLE_KAB=@ENABLE_KAB@
export ENABLE_KDE4=@ENABLE_KDE4@
export ENABLE_KDE=@ENABLE_KDE@
+export ENABLE_LIBLANGTAG=@ENABLE_LIBLANGTAG@
export ENABLE_LIBRSVG=@ENABLE_LIBRSVG@
export ENABLE_LOCKDOWN=@ENABLE_LOCKDOWN@
export ENABLE_LOMENUBAR=@ENABLE_LOMENUBAR@
diff --git a/configure.in b/configure.in
index 7860aa292624..e0604571e36b 100644
--- a/configure.in
+++ b/configure.in
@@ -1066,6 +1066,12 @@ AC_ARG_ENABLE(winegcc,
needed for MinGW cross-compilation.]),
)
+AC_ARG_ENABLE(liblangtag,
+ AS_HELP_STRING([--disable-liblangtag],
+ [Disable use of liblangtag, and insted use an own simple
+ implementation.]),
+)
+
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -11084,37 +11090,33 @@ else
fi
AC_SUBST(SYSTEM_GLIB)
-dnl Get system's glib flags and libs.
-dnl The i18npool LanguageTag wrapper uses it for liblangtag.
+dnl ===================================================================
+dnl Test whether to use liblangtag
+dnl ===================================================================
+ENABLE_LIBLANGTAG=
+SYSTEM_LIBLANGTAG=
GLIB_CFLAGS=''
GLIB_LIBS=''
-if test "$SYSTEM_GLIB" = YES; then
- PKG_CHECK_MODULES( GLIB, glib-2.0 )
-else
- case "$_os" in
- iOS|Android)
- ;;
- *)
- BUILD_TYPE="$BUILD_TYPE GLIB"
- ;;
- esac
-fi
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
+if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a "$CROSS_COMPILING" != "YES" \); then
+ ENABLE_LIBLANGTAG=YES
+ dnl Get system's glib flags and libs.
+ dnl The i18npool LanguageTag wrapper uses it for liblangtag.
-dnl So far AFAIK no system has liblangtag, set this unconditionally for now.
-dnl Except for Android and iOS where we don't want liblangtag.
+ if test "$SYSTEM_GLIB" = YES; then
+ PKG_CHECK_MODULES( GLIB, glib-2.0 )
+ else
+ BUILD_TYPE="$BUILD_TYPE GLIB"
+ fi
-SYSTEM_LIBLANGTAG=NO
-case "$_os" in
-iOS|Android)
- ;;
-*)
+ dnl So far AFAIK no system has liblangtag, set this unconditionally for now.
+ dnl TODO Allow system liblangtag
BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
- ;;
-esac
+fi
+AC_SUBST(ENABLE_LIBLANGTAG)
AC_SUBST(SYSTEM_LIBLANGTAG)
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
dnl ===================================================================
diff --git a/i18npool/Library_i18nisolang1.mk b/i18npool/Library_i18nisolang1.mk
index e022680790db..d0825034dd89 100644
--- a/i18npool/Library_i18nisolang1.mk
+++ b/i18npool/Library_i18nisolang1.mk
@@ -54,12 +54,11 @@ $(eval $(call gb_Library_add_exception_objects,i18nisolang1,\
))
-ifneq ($(OS),ANDROID)
-ifneq ($(OS),IOS)
+ifeq ($(ENABLE_LIBLANGTAG),YES)
+$(eval $(call gb_Library_add_defs,i18nisolang1,-DENABLE_LIBLANGTAG))
$(eval $(call gb_Library_use_external,i18nisolang1,glib))
$(eval $(call gb_Library_use_external,i18nisolang1,liblangtag))
endif
-endif
$(eval $(call gb_Library_use_external,i18nisolang1,libxml2))
diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 8a60d196b220..41923742a2b1 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -15,7 +15,7 @@
//#define erDEBUG
-#if !defined(ANDROID) && !defined(IOS)
+#ifdef ENABLE_LIBLANGTAG
#include <liblangtag/langtag.h>
#else
/* Replacement code for LGPL phobic and Android systems.
diff --git a/liblangtag/makefile.mk b/liblangtag/makefile.mk
index f244039f5d6f..6acd16067f32 100644
--- a/liblangtag/makefile.mk
+++ b/liblangtag/makefile.mk
@@ -26,9 +26,9 @@ LIBLANGTAG_MICRO=0
# --- Files --------------------------------------------------------
-.IF "$(SYSTEM_LIBLANGTAG)" == "YES"
+.IF "$(ENABLE_LIBLANGTAG)" != "YES" || "$(SYSTEM_LIBLANGTAG)" == "YES"
@all:
- @echo "Using system liblangtag."
+ @echo "Not building liblangtag."
.ENDIF
TARFILE_NAME=liblangtag-$(LIBLANGTAG_MAJOR).$(LIBLANGTAG_MINOR)
diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk
index 685b70ea86d1..4dff0df7bca5 100644
--- a/scp2/InstallModule_ooo.mk
+++ b/scp2/InstallModule_ooo.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
ENABLE_KAB \
ENABLE_KDE \
ENABLE_KDE4 \
+ ENABLE_LIBLANGTAG \
ENABLE_LOMENUBAR \
ENABLE_NSPLUGIN \
ENABLE_ONLINE_UPDATE \
diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp
index e001c38564e7..063d1fe92680 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -671,7 +671,7 @@ Directory gid_Dir_Share_Autocorr
Styles = (WORKSTATION, CREATE);
End
-#ifndef SYSTEM_LIBLANGTAG
+#if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
Directory gid_Dir_Share_Liblangtag
ParentID = gid_Brand_Dir_Share;
DosName = "liblangtag";
diff --git a/scp2/source/ooo/file_extra_ooo.scp b/scp2/source/ooo/file_extra_ooo.scp
index 903d23f7af78..843d43b37a0f 100644
--- a/scp2/source/ooo/file_extra_ooo.scp
+++ b/scp2/source/ooo/file_extra_ooo.scp
@@ -144,7 +144,7 @@ File gid_File_Extra_Glas_Red_Zip
Name = "glas-red.zip";
End
-#ifndef SYSTEM_LIBLANGTAG
+#if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
File gid_File_Extra_Liblangtag
Dir = gid_Dir_Share_Liblangtag;
USER_FILE_BODY;
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index eaeb58f29969..71979861dbc8 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -758,7 +758,7 @@ End
#endif
-#ifndef SYSTEM_LIBLANGTAG
+#if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
File gid_File_Lib_Langtag
LIB_FILE_BODY;
@@ -774,7 +774,7 @@ File gid_File_Lib_Langtag
#endif
End
-#endif // SYSTEM_LIBLANGTAG
+#endif // ENABLE_LIBLANGTAG
#ifdef SOLAR_JAVA