rev |
line source |
al@20443
|
1 From: Mike Hommey <mh@glandium.org>
|
al@20443
|
2 Date: Tue, 9 Mar 2010 09:44:37 +0100
|
al@20443
|
3 Subject: Allow to build against system libffi
|
al@20443
|
4
|
al@20443
|
5 https://bugzilla.mozilla.org/show_bug.cgi?id=551138
|
al@20443
|
6 ---
|
al@20443
|
7 js/src/Makefile.in | 16 ++++++++++++++--
|
al@20443
|
8 js/src/config/autoconf.mk.in | 4 ++++
|
al@20443
|
9 js/src/configure.in | 14 +++++++++++++-
|
al@20443
|
10 js/src/shell/Makefile.in | 3 +++
|
al@20443
|
11 4 files changed, 34 insertions(+), 3 deletions(-)
|
al@20443
|
12
|
al@20443
|
13 --- a/js/src/Makefile.in
|
al@20443
|
14 +++ b/js/src/Makefile.in
|
al@20443
|
15 @@ -453,11 +453,20 @@ CPPSRCS += \
|
al@20443
|
16 Library.cpp \
|
al@20443
|
17 $(NULL)
|
al@20443
|
18
|
al@20443
|
19 -LOCAL_INCLUDES = \
|
al@20443
|
20 - -Ictypes/libffi/include \
|
al@20443
|
21 +ifdef MOZ_NATIVE_FFI
|
al@20443
|
22 +LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
|
al@20443
|
23 +else
|
al@20443
|
24 +LOCAL_INCLUDES = -Ictypes/libffi/include
|
al@20443
|
25 +endif
|
al@20443
|
26 +
|
al@20443
|
27 +LOCAL_INCLUDES += \
|
al@20443
|
28 -I. \
|
al@20443
|
29 $(NULL)
|
al@20443
|
30
|
al@20443
|
31 +
|
al@20443
|
32 +ifdef MOZ_NATIVE_FFI
|
al@20443
|
33 +EXTRA_DSO_LDOPTS += $(MOZ_FFI_LIBS)
|
al@20443
|
34 +else
|
al@20443
|
35 ifeq ($(OS_ARCH),OS2)
|
al@20443
|
36 SHARED_LIBRARY_LIBS += \
|
al@20443
|
37 ctypes/libffi/.libs/ffi.a \
|
al@20443
|
38 @@ -467,6 +476,7 @@ SHARED_LIBRARY_LIBS += \
|
al@20443
|
39 ctypes/libffi/.libs/libffi.$(LIB_SUFFIX) \
|
al@20443
|
40 $(NULL)
|
al@20443
|
41 endif
|
al@20443
|
42 +endif
|
al@20443
|
43
|
al@20443
|
44 endif # JS_HAS_CTYPES
|
al@20443
|
45
|
al@20443
|
46 @@ -546,6 +556,7 @@ endif
|
al@20443
|
47 include $(topsrcdir)/config/rules.mk
|
al@20443
|
48
|
al@20443
|
49 ifdef JS_HAS_CTYPES
|
al@20443
|
50 +ifndef MOZ_NATIVE_FFI
|
al@20443
|
51 # Build libffi proper as part of the 'exports' target, so things get built
|
al@20443
|
52 # in the right order.
|
al@20443
|
53 export::
|
al@20443
|
54 @@ -554,6 +565,7 @@ export::
|
al@20443
|
55 distclean clean::
|
al@20443
|
56 $(call SUBMAKE,$@,ctypes/libffi)
|
al@20443
|
57 endif
|
al@20443
|
58 +endif
|
al@20443
|
59
|
al@20443
|
60 ifdef MOZ_SYNC_BUILD_FILES
|
al@20443
|
61 # Because the SpiderMonkey can be distributed and built independently
|
al@20443
|
62 --- a/js/src/config/autoconf.mk.in
|
al@20443
|
63 +++ b/js/src/config/autoconf.mk.in
|
al@20443
|
64 @@ -250,6 +250,10 @@ NSPR_CONFIG = @NSPR_CONFIG@
|
al@20443
|
65 NSPR_CFLAGS = @NSPR_CFLAGS@
|
al@20443
|
66 NSPR_LIBS = @NSPR_LIBS@
|
al@20443
|
67
|
al@20443
|
68 +MOZ_NATIVE_FFI = @MOZ_NATIVE_FFI@
|
al@20443
|
69 +MOZ_FFI_LIBS = @MOZ_FFI_LIBS@
|
al@20443
|
70 +MOZ_FFI_CFLAGS = @MOZ_FFI_CFLAGS@
|
al@20443
|
71 +
|
al@20443
|
72 USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
|
al@20443
|
73
|
al@20443
|
74 JS_NATIVE_EDITLINE = @JS_NATIVE_EDITLINE@
|
al@20443
|
75 --- a/js/src/configure.in
|
al@20443
|
76 +++ b/js/src/configure.in
|
al@20443
|
77 @@ -4591,6 +4591,18 @@ if test -n "$MOZ_NATIVE_NSPR"; then
|
al@20443
|
78 CFLAGS=$_SAVE_CFLAGS
|
al@20443
|
79 fi
|
al@20443
|
80
|
al@20443
|
81 +dnl system libffi Support
|
al@20443
|
82 +dnl ========================================================
|
al@20443
|
83 +MOZ_ARG_ENABLE_BOOL(system-ffi,
|
al@20443
|
84 +[ --enable-system-ffi Use system libffi (located with pkgconfig)],
|
al@20443
|
85 + MOZ_NATIVE_FFI=1 )
|
al@20443
|
86 +
|
al@20443
|
87 +if test -n "$MOZ_NATIVE_FFI"; then
|
al@20443
|
88 + PKG_CHECK_MODULES(MOZ_FFI, libffi)
|
al@20443
|
89 +fi
|
al@20443
|
90 +
|
al@20443
|
91 +AC_SUBST(MOZ_NATIVE_FFI)
|
al@20443
|
92 +
|
al@20443
|
93 dnl ========================================================
|
al@20443
|
94 dnl =
|
al@20443
|
95 dnl = Application
|
al@20443
|
96 @@ -6074,7 +6086,7 @@ AC_MSG_RESULT(invoking make to create js
|
al@20443
|
97 $GMAKE js-config
|
al@20443
|
98
|
al@20443
|
99 # Build jsctypes if it's enabled.
|
al@20443
|
100 -if test "$JS_HAS_CTYPES"; then
|
al@20443
|
101 +if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
|
al@20443
|
102 # Run the libffi 'configure' script.
|
al@20443
|
103 ac_configure_args="--disable-shared --enable-static --disable-raw-api"
|
al@20443
|
104 if test "$MOZ_DEBUG"; then
|
al@20443
|
105 --- a/js/src/shell/Makefile.in
|
al@20443
|
106 +++ b/js/src/shell/Makefile.in
|
al@20443
|
107 @@ -53,6 +53,9 @@ CPPSRCS = \
|
al@20443
|
108 DEFINES += -DEXPORT_JS_API
|
al@20443
|
109
|
al@20443
|
110 LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX)
|
al@20443
|
111 +ifdef MOZ_NATIVE_FFI
|
al@20443
|
112 +EXTRA_LIBS += $(MOZ_FFI_LIBS)
|
al@20443
|
113 +endif
|
al@20443
|
114
|
al@20443
|
115 LOCAL_INCLUDES += -I$(topsrcdir) -I..
|
al@20443
|
116
|