Skip to content

Commit

Permalink
Bug 1294803 - Move MOZ_SYSTEM_FFI to moz.configure in preparation for…
Browse files Browse the repository at this point in the history
… moving libffi to our build system. r=glandium

This patch introduces a small change in behavior: we now unconditionally
require libffi > 3.0.9 when using system ffi, rather than accepting 3.0.9
when using GCC, as 3.0.10 was released 5 years ago, and should be widely
available.


MozReview-Commit-ID: DtSDPoZSPcx
  • Loading branch information
chmanchester committed Aug 22, 2016
1 parent 470a2af commit 942b77d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 31 deletions.
20 changes: 0 additions & 20 deletions build/autoconf/ffi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@ dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.

AC_DEFUN([MOZ_CONFIG_FFI], [
MOZ_ARG_ENABLE_BOOL(system-ffi,
[ --enable-system-ffi Use system libffi (located with pkgconfig)],
MOZ_SYSTEM_FFI=1 )
if test -n "$MOZ_SYSTEM_FFI"; then
# Vanilla libffi 3.0.9 needs a few patches from upcoming version 3.0.10
# for non-GCC compilers.
if test -z "$GNU_CC"; then
PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
else
PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
fi
fi
AC_SUBST(MOZ_SYSTEM_FFI)
])

AC_DEFUN([MOZ_SUBCONFIGURE_FFI], [
if test "$MOZ_BUILD_APP" != js -o -n "$JS_STANDALONE"; then
Expand Down
16 changes: 16 additions & 0 deletions build/moz.configure/ffi.configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.

js_option('--with-system-ffi',
help='Use system libffi (located with pkgconfig)')

use_system_ffi = depends_if('--with-system-ffi')(lambda _: True)

system_ffi = pkg_check_modules('MOZ_FFI', 'libffi > 3.0.9',
when=use_system_ffi)

set_config('MOZ_SYSTEM_FFI', system_ffi)
add_old_configure_assignment('MOZ_SYSTEM_FFI', system_ffi)
1 change: 0 additions & 1 deletion build/moz.configure/old.configure
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ def old_configure_options(*options):
'--enable-synth-pico',
'--enable-system-cairo',
'--enable-system-extension-dirs',
'--enable-system-ffi',
'--enable-system-pixman',
'--enable-system-sqlite',
'--enable-tasktracer',
Expand Down
5 changes: 0 additions & 5 deletions js/src/old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1538,11 +1538,6 @@ if test -n "$ZLIB_IN_MOZGLUE"; then
fi
AC_SUBST(ZLIB_IN_MOZGLUE)

dnl ========================================================
dnl system libffi Support
dnl ========================================================
MOZ_CONFIG_FFI()

dnl ========================================================
dnl =
dnl = Application
Expand Down
6 changes: 6 additions & 0 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ set_config('JS_HAS_CTYPES', js_has_ctypes)
set_define('JS_HAS_CTYPES', js_has_ctypes)
add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)

@depends('--enable-ctypes', '--enable-compile-environment', '--help')
def ctypes_and_compile_environment(ctypes, compile_environment, _):
return ctypes and compile_environment

include_when('build/moz.configure/ffi.configure',
when=ctypes_and_compile_environment)

@dependable
@imports(_from='mozbuild.backend', _import='backends')
Expand Down
5 changes: 0 additions & 5 deletions old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2310,11 +2310,6 @@ fi # SKIP_LIBRARY_CHECKS

AC_SUBST(MOZ_PNG_ARM_NEON)

dnl ========================================================
dnl system libffi Support
dnl ========================================================
MOZ_CONFIG_FFI()

dnl ========================================================
dnl =
dnl = Application
Expand Down

0 comments on commit 942b77d

Please sign in to comment.