Implement --disable-liblangtag, to be able to build without that.

Change-Id: Ic38d0282dba99efe2ecc45142a927ba3d8fa167d
This commit is contained in:
Jan Holesovsky
2012-08-10 10:27:54 +02:00
parent 26310504c3
commit 6a7b32b09e
10 changed files with 41 additions and 34 deletions

View File

@@ -462,6 +462,8 @@ endef
endif # SYSTEM_GLIB endif # SYSTEM_GLIB
ifeq ($(ENABLE_LIBLANGTAG),YES)
ifeq ($(SYSTEM_LIBLANGTAG),YES) ifeq ($(SYSTEM_LIBLANGTAG),YES)
define gb_LinkTarget__use_liblangtag define gb_LinkTarget__use_liblangtag
@@ -495,6 +497,8 @@ endef
endif # SYSTEM_LIBLANGTAG endif # SYSTEM_LIBLANGTAG
endif # ENABLE_LIBLANGTAG
ifeq ($(SYSTEM_NEON),YES) ifeq ($(SYSTEM_NEON),YES)

View File

@@ -125,6 +125,7 @@ export ENABLE_TDE=@ENABLE_TDE@
export ENABLE_KAB=@ENABLE_KAB@ export ENABLE_KAB=@ENABLE_KAB@
export ENABLE_KDE4=@ENABLE_KDE4@ export ENABLE_KDE4=@ENABLE_KDE4@
export ENABLE_KDE=@ENABLE_KDE@ export ENABLE_KDE=@ENABLE_KDE@
export ENABLE_LIBLANGTAG=@ENABLE_LIBLANGTAG@
export ENABLE_LIBRSVG=@ENABLE_LIBRSVG@ export ENABLE_LIBRSVG=@ENABLE_LIBRSVG@
export ENABLE_LOCKDOWN=@ENABLE_LOCKDOWN@ export ENABLE_LOCKDOWN=@ENABLE_LOCKDOWN@
export ENABLE_LOMENUBAR=@ENABLE_LOMENUBAR@ export ENABLE_LOMENUBAR=@ENABLE_LOMENUBAR@

View File

@@ -1066,6 +1066,12 @@ AC_ARG_ENABLE(winegcc,
needed for MinGW cross-compilation.]), 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 ===================================================================
dnl Optional Packages (--with/without-) dnl Optional Packages (--with/without-)
dnl =================================================================== dnl ===================================================================
@@ -11084,38 +11090,34 @@ else
fi fi
AC_SUBST(SYSTEM_GLIB) 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_CFLAGS=''
GLIB_LIBS='' GLIB_LIBS=''
if test "$SYSTEM_GLIB" = YES; then if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a "$CROSS_COMPILING" != "YES" \); then
PKG_CHECK_MODULES( GLIB, glib-2.0 ) ENABLE_LIBLANGTAG=YES
else dnl Get system's glib flags and libs.
case "$_os" in dnl The i18npool LanguageTag wrapper uses it for liblangtag.
iOS|Android)
;; if test "$SYSTEM_GLIB" = YES; then
*) PKG_CHECK_MODULES( GLIB, glib-2.0 )
else
BUILD_TYPE="$BUILD_TYPE GLIB" BUILD_TYPE="$BUILD_TYPE GLIB"
;; fi
esac
dnl So far AFAIK no system has liblangtag, set this unconditionally for now.
dnl TODO Allow system liblangtag
BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
fi fi
AC_SUBST(ENABLE_LIBLANGTAG)
AC_SUBST(SYSTEM_LIBLANGTAG)
AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_LIBS)
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.
SYSTEM_LIBLANGTAG=NO
case "$_os" in
iOS|Android)
;;
*)
BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
;;
esac
AC_SUBST(SYSTEM_LIBLANGTAG)
dnl =================================================================== dnl ===================================================================
dnl Test whether to build gettext runtime (libintl) or rely on the dnl Test whether to build gettext runtime (libintl) or rely on the

View File

@@ -54,12 +54,11 @@ $(eval $(call gb_Library_add_exception_objects,i18nisolang1,\
)) ))
ifneq ($(OS),ANDROID) ifeq ($(ENABLE_LIBLANGTAG),YES)
ifneq ($(OS),IOS) $(eval $(call gb_Library_add_defs,i18nisolang1,-DENABLE_LIBLANGTAG))
$(eval $(call gb_Library_use_external,i18nisolang1,glib)) $(eval $(call gb_Library_use_external,i18nisolang1,glib))
$(eval $(call gb_Library_use_external,i18nisolang1,liblangtag)) $(eval $(call gb_Library_use_external,i18nisolang1,liblangtag))
endif endif
endif
$(eval $(call gb_Library_use_external,i18nisolang1,libxml2)) $(eval $(call gb_Library_use_external,i18nisolang1,libxml2))

View File

@@ -15,7 +15,7 @@
//#define erDEBUG //#define erDEBUG
#if !defined(ANDROID) && !defined(IOS) #ifdef ENABLE_LIBLANGTAG
#include <liblangtag/langtag.h> #include <liblangtag/langtag.h>
#else #else
/* Replacement code for LGPL phobic and Android systems. /* Replacement code for LGPL phobic and Android systems.

View File

@@ -26,9 +26,9 @@ LIBLANGTAG_MICRO=0
# --- Files -------------------------------------------------------- # --- Files --------------------------------------------------------
.IF "$(SYSTEM_LIBLANGTAG)" == "YES" .IF "$(ENABLE_LIBLANGTAG)" != "YES" || "$(SYSTEM_LIBLANGTAG)" == "YES"
@all: @all:
@echo "Using system liblangtag." @echo "Not building liblangtag."
.ENDIF .ENDIF
TARFILE_NAME=liblangtag-$(LIBLANGTAG_MAJOR).$(LIBLANGTAG_MINOR) TARFILE_NAME=liblangtag-$(LIBLANGTAG_MAJOR).$(LIBLANGTAG_MINOR)

View File

@@ -42,6 +42,7 @@ $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
ENABLE_KAB \ ENABLE_KAB \
ENABLE_KDE \ ENABLE_KDE \
ENABLE_KDE4 \ ENABLE_KDE4 \
ENABLE_LIBLANGTAG \
ENABLE_LOMENUBAR \ ENABLE_LOMENUBAR \
ENABLE_NSPLUGIN \ ENABLE_NSPLUGIN \
ENABLE_ONLINE_UPDATE \ ENABLE_ONLINE_UPDATE \

View File

@@ -671,7 +671,7 @@ Directory gid_Dir_Share_Autocorr
Styles = (WORKSTATION, CREATE); Styles = (WORKSTATION, CREATE);
End End
#ifndef SYSTEM_LIBLANGTAG #if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
Directory gid_Dir_Share_Liblangtag Directory gid_Dir_Share_Liblangtag
ParentID = gid_Brand_Dir_Share; ParentID = gid_Brand_Dir_Share;
DosName = "liblangtag"; DosName = "liblangtag";

View File

@@ -144,7 +144,7 @@ File gid_File_Extra_Glas_Red_Zip
Name = "glas-red.zip"; Name = "glas-red.zip";
End End
#ifndef SYSTEM_LIBLANGTAG #if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
File gid_File_Extra_Liblangtag File gid_File_Extra_Liblangtag
Dir = gid_Dir_Share_Liblangtag; Dir = gid_Dir_Share_Liblangtag;
USER_FILE_BODY; USER_FILE_BODY;

View File

@@ -758,7 +758,7 @@ End
#endif #endif
#ifndef SYSTEM_LIBLANGTAG #if defined( ENABLE_LIBLANGTAG ) && !defined( SYSTEM_LIBLANGTAG )
File gid_File_Lib_Langtag File gid_File_Lib_Langtag
LIB_FILE_BODY; LIB_FILE_BODY;
@@ -774,7 +774,7 @@ File gid_File_Lib_Langtag
#endif #endif
End End
#endif // SYSTEM_LIBLANGTAG #endif // ENABLE_LIBLANGTAG
#ifdef SOLAR_JAVA #ifdef SOLAR_JAVA