summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-06-15 18:49:43 +0200
committerJan Holesovsky <kendy@collabora.com>2014-06-15 19:02:27 +0200
commit39c94b2e14f52a3d0ce39559716804150de3712e (patch)
tree9e2e4dc03e549bc522795bb74093950f65c5d6f9
parent43088b086e7b96fcc6d7def0d53cbc452d379471 (diff)
libffi: Add it as an external library.
Change-Id: I823d81a8dd88ddb0631808b7bdc125154a27b482
-rw-r--r--download.lst2
-rw-r--r--external/libffi/ExternalProject_libffi.mk32
-rw-r--r--external/libffi/Makefile7
-rw-r--r--external/libffi/Module_libffi.mk17
-rw-r--r--external/libffi/README2
-rw-r--r--external/libffi/UnpackedTarball_libffi.mk20
-rw-r--r--external/libffi/libffi-ifndef.patch11
7 files changed, 91 insertions, 0 deletions
diff --git a/download.lst b/download.lst
index 1ac844c868e8..e1e483378b44 100644
--- a/download.lst
+++ b/download.lst
@@ -87,6 +87,8 @@ export LIBATOMIC_OPS_TARBALL := libatomic_ops-7_2d.zip
export LIBEOT_MD5SUM := aa24f5dd2a2992f4a116aa72af817548
export LIBEOT_TARBALL := libeot-0.01.tar.bz2
export LIBEXTTEXTCAT_TARBALL := ae330b9493bd4503ac390106ff6060d7-libexttextcat-3.4.3.tar.bz2
+export LIBFFI_TARBALL := libffi-3.1.tar.gz
+export LIBFFI_MD5SUM := f5898b29bbfd70502831a212d9249d10
export LIBGLTF_TARBALL := 3c62598ccbecb65998bf7602bb09a791-libgltf.tar.bz2
export LIBLANGTAG_TARBALL := 36271d3fa0d9dec1632029b6d7aac925-liblangtag-0.5.1.tar.bz2
export LIBXMLSEC_TARBALL := 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
diff --git a/external/libffi/ExternalProject_libffi.mk b/external/libffi/ExternalProject_libffi.mk
new file mode 100644
index 000000000000..db54476d5f7a
--- /dev/null
+++ b/external/libffi/ExternalProject_libffi.mk
@@ -0,0 +1,32 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libffi))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libffi,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libffi,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,libffi,build) :
+ $(call gb_ExternalProject_run,build,\
+ $(if $(ENABLE_DEBUG),CFLAGS="$$CFLAGS -g") \
+ ./configure \
+ --with-pic \
+ --enable-static \
+ --disable-shared \
+ --without-docs \
+ $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
+ $(if $(VERBOSE)$(verbose),--disable-silent-rules,--enable-silent-rules) \
+ $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
+ && $(MAKE) \
+ )
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libffi/Makefile b/external/libffi/Makefile
new file mode 100644
index 000000000000..e4968cf85fb6
--- /dev/null
+++ b/external/libffi/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libffi/Module_libffi.mk b/external/libffi/Module_libffi.mk
new file mode 100644
index 000000000000..4522f408b0d8
--- /dev/null
+++ b/external/libffi/Module_libffi.mk
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,libffi))
+
+$(eval $(call gb_Module_add_targets,libffi,\
+ ExternalProject_libffi \
+ UnpackedTarball_libffi \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libffi/README b/external/libffi/README
new file mode 100644
index 000000000000..40d8e089b55b
--- /dev/null
+++ b/external/libffi/README
@@ -0,0 +1,2 @@
+Forigner Function Interface library - to bridge calls between C / C++ and
+other languages.
diff --git a/external/libffi/UnpackedTarball_libffi.mk b/external/libffi/UnpackedTarball_libffi.mk
new file mode 100644
index 000000000000..9edd7ba4d3d7
--- /dev/null
+++ b/external/libffi/UnpackedTarball_libffi.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,libffi))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,libffi,$(LIBFFI_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libffi,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,libffi,\
+ external/libffi/libffi-ifndef.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libffi/libffi-ifndef.patch b/external/libffi/libffi-ifndef.patch
new file mode 100644
index 000000000000..908b45fbde6e
--- /dev/null
+++ b/external/libffi/libffi-ifndef.patch
@@ -0,0 +1,11 @@
+--- libffi/include/ffi.h.in.orig 2014-06-15 18:34:58.144906593 +0200
++++ libffi/include/ffi.h.in 2014-06-15 18:35:11.287848950 +0200
+@@ -221,7 +221,7 @@ typedef struct {
+ #endif
+ } ffi_cif;
+
+-#if HAVE_LONG_DOUBLE_VARIANT
++#ifdef HAVE_LONG_DOUBLE_VARIANT
+ /* Used to adjust size/alignment of ffi types. */
+ void ffi_prep_types (ffi_abi abi);
+ # endif