Browse Source

libffi: Add patch to fix building with clang

android-5
Fredrik Fornwall 9 years ago
parent
commit
80eb12d68d
  1. 11
      packages/libffi/build.sh
  2. 87
      packages/libffi/configure.ac.patch

11
packages/libffi/build.sh

@ -2,14 +2,5 @@ TERMUX_PKG_HOMEPAGE=https://sourceware.org/libffi/
TERMUX_PKG_DESCRIPTION="Library providing a portable, high level programming interface to various calling conventions"
TERMUX_PKG_VERSION=3.2.1
TERMUX_PKG_SRCURL=ftp://sourceware.org/pub/libffi/libffi-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-multi-os-directory"
TERMUX_PKG_RM_AFTER_INSTALL="lib/libffi-${TERMUX_PKG_VERSION}/include"
termux_step_post_make_install () {
if [ $TERMUX_ARCH_BITS = "64" ]; then
# Avoid libffi being placed in lib64 for 64-bit builds:
mv $TERMUX_PREFIX/lib64/libffi* $TERMUX_PREFIX/lib/
perl -p -i -e 's|lib/../lib64|lib|' $TERMUX_PREFIX/lib/pkgconfig/libffi.pc
perl -p -i -e 's|lib/../lib64|lib|' $TERMUX_PREFIX/lib/libffi.la
fi
}

87
packages/libffi/configure.ac.patch

@ -0,0 +1,87 @@
From
https://github.com/chef/omnibus-software/blob/master/config/patches/libffi/libffi-3.2.1-disable-multi-os-directory.patch
, this change will be included in the next libffi release.
--- libffi-3.2.1-orig/configure.ac 2014-11-12 05:56:51.000000000 -0600
+++ libffi-3.2.1/configure.ac 2015-10-29 15:53:41.695055040 -0500
@@ -590,6 +590,10 @@
AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
fi)
+AC_ARG_ENABLE(multi-os-directory,
+[ --disable-multi-os-directory
+ disable use of gcc --print-multi-os-directory to change the library installation directory])
+
# These variables are only ever used when we cross-build to X86_WIN32.
# And we only support this with GCC, so...
if test "x$GCC" = "xyes"; then
@@ -601,11 +605,13 @@
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
+ if test x"$enable_multi_os_directory" != x"no"; then
+ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ fi
AC_SUBST(toolexecdir)
else
toolexeclibdir="${libdir}"
--- libffi-3.2.1-orig/configure 2014-11-12 11:59:57.000000000 +0000
+++ libffi-3.2.1/configure 2015-10-30 19:50:51.082221000 +0000
@@ -886,6 +886,7 @@
enable_structs
enable_raw_api
enable_purify_safety
+enable_multi_os_directory
'
ac_precious_vars='build_alias
host_alias
@@ -1538,6 +1539,8 @@
--disable-structs omit code for struct support
--disable-raw-api make the raw api unavailable
--enable-purify-safety purify-safe mode
+ --disable-multi-os-directory
+ disable use of gcc --print-multi-os-directory to change the library installation directory
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -18714,6 +18717,12 @@
fi
+# Check whether --enable-multi-os-directory was given.
+if test "${enable_multi_os_directory+set}" = set; then :
+ enableval=$enable_multi_os_directory;
+fi
+
+
# These variables are only ever used when we cross-build to X86_WIN32.
# And we only support this with GCC, so...
if test "x$GCC" = "xyes"; then
@@ -18725,11 +18734,13 @@
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
+ if test x"$enable_multi_os_directory" != x"no"; then
+ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
+ case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ esac
+ fi
else
toolexeclibdir="${libdir}"
Loading…
Cancel
Save