[Libreoffice-commits] .: 2 commits - config_host.mk.in configure.in README.cross vcl/android vcl/headless vcl/inc vcl/Library_vcl.mk
Michael Meeks
michael at kemper.freedesktop.org
Wed Jan 18 09:07:53 PST 2012
README.cross | 18 --------
config_host.mk.in | 1
configure.in | 23 +++++++++++
vcl/Library_vcl.mk | 2
vcl/android/androidinst.cxx | 82 ++++++++++++++++++++++++++++++++++++++++
vcl/headless/svpdummies.cxx | 8 +--
vcl/inc/android/androidinst.hxx | 46 ++++++++++++++++++++++
vcl/inc/generic/gendata.hxx | 3 -
vcl/inc/headless/svpdummies.hxx | 15 +++----
9 files changed, 168 insertions(+), 30 deletions(-)
New commits:
commit 453339cc22da7b350804bd1911faa99b89815c5b
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Jan 18 17:07:07 2012 +0000
android: add --with-android-ndk= option to simplify configure.
diff --git a/README.cross b/README.cross
index d5ad353..4a74799 100644
--- a/README.cross
+++ b/README.cross
@@ -324,16 +324,9 @@ insane.)
Here is my autogen.lastrun for Android, when cross-compiling from Mac OS X:
-SYSBASE=/Users/tml/android-ndk-r7/platforms/android-9/arch-arm
-CC=ccache /Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc -march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8 --sysroot /Users/tml/android-ndk-r7/platforms/android-9/arch-arm -L/Users/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a
-CXX=ccache /Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-g++ -march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8 --sysroot /Users/tml/android-ndk-r7/platforms/android-9/arch-arm -I /Users/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/include -I/Users/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -L/Users/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a -fexceptions -frtti
-AR=/Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ar
-NM=/Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-nm
-OBJDUMP=/Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-objdump
-RANLIB=/Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
-STRIP=/Users/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-strip
CC_FOR_BUILD=ccache /Xcode3/usr/bin/gcc-4.0 -mmacosx-version-min=10.4
CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
+--with-android-ndk=/Users/tml/android-ndk-r7
--build=x86_64-apple-darwin11
--disable-zenity
--enable-werror
@@ -346,16 +339,9 @@ CXX_FOR_BUILD=ccache /Xcode3/usr/bin/g++-4.0 -mmacosx-version-min=10.4
And here is my autogen.lastrun for Android when cross-compiling from Linux:
-SYSBASE=/home/tml/android-ndk-r7/platforms/android-9/arch-arm
-CC=ccache /home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8 --sysroot /home/tml/android-ndk-r7/platforms/android-9/arch-arm -L/home/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a
-CXX=ccache /home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8 --sysroot /home/tml/android-ndk-r7/platforms/android-9/arch-arm -I /home/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/include -I/home/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -L/home/tml/android-ndk-r7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a -fexceptions -frtti
-AR=/home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
-NM=/home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-nm
-OBJDUMP=/home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-objdump
-RANLIB=/home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ranlib
-STRIP=/home/tml/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-strip
CC_FOR_BUILD=ccache gcc
CXX_FOR_BUILD=ccache g++
+--with-android-ndk=/home/tml/android-ndk-r7
--build=x86_64-unknown-linux-gnu
--disable-zenity
--with-distro=LibreOfficeAndroid
diff --git a/config_host.mk.in b/config_host.mk.in
index f8b0d81..9bd874d 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -11,6 +11,7 @@ export ALIGNOF_LONG="@ALIGNOF_LONG@"
export ALIGNOF_SHORT="@ALIGNOF_SHORT@"
export ALLOC="@ALLOC@"
export ANCIENT_BISON="@ANCIENT_BISON@"
+export ANDROID_NDK_HOME="@ANDROID_NDK_HOME@"
export AR="@AR@"
export AWTLIB='@AWTLIB@'
export BARCODE_EXTENSION_PACK="@BARCODE_EXTENSION_PACK@"
diff --git a/configure.in b/configure.in
index bb8abe6..638a0fd 100644
--- a/configure.in
+++ b/configure.in
@@ -90,6 +90,24 @@ if test -z "$SED"; then
fi
dnl ===================================================================
+dnl Building with an android-ndk implies a lot of pre-canned defaults
+dnl ===================================================================
+ANDROID_NDK_HOME=
+if test "z$with_android_ndk" != "z"; then
+ ANDROID_NDK_HOME=$with_android_ndk
+ ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/arm-linux*/prebuilt/*/bin`
+ test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-arm
+ test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ar
+ test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-nm
+ test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-objdump
+ test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-ranlib
+ test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-strip
+ test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-gcc --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a"
+ test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/arm-linux-androideabi-g++ --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-arm -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a -fexceptions -frtti"
+fi
+AC_SUBST(ANDROID_NDK_HOME)
+
+dnl ===================================================================
dnl The following is a list of supported systems.
dnl Sequential to keep the logic very simple
dnl These values may be checked and reset later.
@@ -833,6 +851,11 @@ AC_ARG_ENABLE(silent-msi,
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
+AC_ARG_WITH(android-ndk,
+ AS_HELP_STRING([--with-android-ndk],
+ [Specify location of the Android Native Development Kit to use for buildin.]),
+,)
+
AC_ARG_WITH(gnu-patch,
AS_HELP_STRING([--with-gnu-patch],
[Specify location of GNU patch on Solaris or FreeBSD.]),
commit 347bb132e0a3efc82211d4e53bf0aa25ad817cf4
Author: Michael Meeks <michael.meeks at suse.com>
Date: Mon Jan 16 21:26:25 2012 +0000
android: tweak headless, expand docs, and start custom android backend
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 8668a0e..647bb2e 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -458,7 +458,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/generic/fontmanager/fontmanager \
vcl/generic/fontmanager/helper \
vcl/generic/fontmanager/parseAFM \
- vcl/unx/generic/plugadapt/salplug \
+ vcl/android/androidinst \
vcl/unx/generic/printer/jobdata \
vcl/unx/generic/printer/ppdparser \
vcl/null/printerinfomanager \
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
new file mode 100644
index 0000000..3ce5d5b
--- /dev/null
+++ b/vcl/android/androidinst.cxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Novell, Inc.
+ * Michael Meeks <michael.meeks at suse.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include <android/androidinst.hxx>
+#include <headless/svpdummies.hxx>
+#include <generic/gendata.hxx>
+#include <android/log.h>
+
+AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex )
+ : SvpSalInstance( pMutex )
+{
+ fprintf (stderr, "created Android Sal Instance\n");
+}
+
+AndroidSalInstance::~AndroidSalInstance()
+{
+ fprintf (stderr, "destroyed Android Sal Instance\n");
+}
+
+class AndroidSalSystem : public SvpSalSystem {
+public:
+ AndroidSalSystem() : SvpSalSystem() {}
+ virtual ~AndroidSalSystem() {}
+ virtual int ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton )
+ {
+ (void)rButtons; (void)nDefButton;
+ __android_log_print(ANDROID_LOG_INFO, "LibreOffice - dialog '%s': '%s'",
+ rtl::OUStringToOString(rTitle, RTL_TEXTENCODING_ASCII_US).getStr(),
+ rtl::OUStringToOString(rMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ return 0;
+ }
+};
+
+SalSystem *AndroidSalInstance::CreateSalSystem()
+{
+ return new AndroidSalSystem();
+}
+
+class AndroidSalData : public SalGenericData
+{
+public:
+ AndroidSalData( SalInstance *pInstance ) : SalGenericData( SAL_DATA_ANDROID, pInstance ) {}
+ virtual void ErrorTrapPush() {}
+ virtual bool ErrorTrapPop( bool ) { return false; }
+};
+
+SalInstance *CreateSalInstance()
+{
+ SvpSalInstance* pInstance = new SvpSalInstance( new SalYieldMutex() );
+ new AndroidSalData( pInstance );
+ return pInstance;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx
index a4125f9..47f6875 100644
--- a/vcl/headless/svpdummies.cxx
+++ b/vcl/headless/svpdummies.cxx
@@ -91,10 +91,10 @@ rtl::OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
return aBuf.makeStringAndClear();
}
-int SvpSalSystem::ShowNativeMessageBox( const rtl::OUString&,
- const rtl::OUString&,
- int,
- int )
+int SvpSalSystem::ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton )
{
return 0;
}
diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx
new file mode 100644
index 0000000..fda916b
--- /dev/null
+++ b/vcl/inc/android/androidinst.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Novell, Inc.
+ * Michael Meeks <michael.meeks at suse.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef ANDROID_SALINST_H
+#define ANDROID_SALINST_H
+
+#include <headless/svpinst.hxx>
+
+class AndroidSalInstance : public SvpSalInstance
+{
+public:
+ AndroidSalInstance( SalYieldMutex *pMutex );
+ virtual ~AndroidSalInstance();
+
+ virtual SalSystem* CreateSalSystem();
+};
+
+#endif // ANDROID_SALINST_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx
index c52e891..eb45fd9 100644
--- a/vcl/inc/generic/gendata.hxx
+++ b/vcl/inc/generic/gendata.hxx
@@ -39,7 +39,8 @@ class SalDisplay;
class GtkSalDisplay;
enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE3, SAL_DATA_KDE4,
- SAL_DATA_UNX, SAL_DATA_SVP };
+ SAL_DATA_UNX, SAL_DATA_SVP,
+ SAL_DATA_ANDROID, SAL_DATA_IOS };
class VCL_DLLPUBLIC SalGenericData : public SalData
{
diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx
index e1fb22c..14f6e16 100644
--- a/vcl/inc/headless/svpdummies.hxx
+++ b/vcl/inc/headless/svpdummies.hxx
@@ -29,7 +29,7 @@
#ifndef _SVP_SVPDUMMIES_HXX
#include <vcl/sysdata.hxx>
-
+#include <generic/gensys.h>
#include <salobj.hxx>
#include <salimestatus.hxx>
#include <salsys.hxx>
@@ -74,9 +74,9 @@ class SvpImeStatus : public SalI18NImeStatus
virtual void toggle();
};
-class SvpSalSystem : public SalSystem
+class SvpSalSystem : public SalGenericSystem
{
- public:
+public:
SvpSalSystem() {}
virtual ~SvpSalSystem();
// get info about the display
@@ -85,11 +85,10 @@ class SvpSalSystem : public SalSystem
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen );
-
- virtual int ShowNativeMessageBox( const rtl::OUString& rTitle,
- const rtl::OUString& rMessage,
- int nButtonCombination,
- int nDefaultButton);
+ virtual int ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton );
};
More information about the Libreoffice-commits
mailing list