1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 01_js_binary.dpatch by <Mike Hommey <glandium@debian.org>>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: - JS binary. bz#331776
6
## DP: - Add readline support to xpcshell.
10
=== config/autoconf.mk.in
11
==================================================================
12
--- xulrunner/config/autoconf.mk.in (revision 7)
13
+++ xulrunner/config/autoconf.mk.in (local)
17
MOZ_JS_LIBS = @MOZ_JS_LIBS@
18
+ENABLE_JS_BINARY = @ENABLE_JS_BINARY@
19
+HAVE_READLINE = @HAVE_READLINE@
20
+READLINE_LIBS = @READLINE_LIBS@
22
MOZ_GFX_TOOLKIT_LDFLAGS = @MOZ_GFX_TOOLKIT_LDFLAGS@
23
MOZ_WIDGET_TOOLKIT_LDFLAGS = @MOZ_WIDGET_TOOLKIT_LDFLAGS@
25
==================================================================
26
--- xulrunner/config/rules.mk (revision 7)
27
+++ xulrunner/config/rules.mk (local)
29
ifeq ($(CPP_PROG_LINK),1)
30
$(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS)
32
- $(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS)
33
+ $(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS) $(PROG_LIBS)
35
endif # WINNT && !GNU_CC
38
==================================================================
39
--- xulrunner/configure.in (revision 7)
40
+++ xulrunner/configure.in (local)
41
@@ -5116,6 +5116,40 @@
42
AC_SUBST(JS_ULTRASPARC_OPTS)
44
dnl ========================================================
45
+dnl = Enable building of the js standalone binary
46
+dnl ========================================================
47
+MOZ_ARG_ENABLE_BOOL(js-binary,
48
+[ --enable-js-binary Build the standalone JS program],
51
+AC_SUBST(ENABLE_JS_BINARY)
53
+if test -n "$ENABLE_JS_BINARY"; then
54
+ dnl readline Support
55
+ dnl ========================================================
57
+ MOZ_ARG_WITH_STRING(readline,
58
+ [ --with-readline[=PFX]
59
+ Use libreadline [installed at prefix PFX]],
60
+ READLINE_DIR=$withval)
62
+ if test -n "${READLINE_DIR}" -a "${READLINE_DIR}" != "no"; then
63
+ _SAVE_LDFLAGS=$LDFLAGS
64
+ LDFLAGS="-L${READLINE_DIR}/lib $LDFLAGS"
65
+ AC_CHECK_LIB(readline, readline, [HAVE_READLINE=1 READLINE_LIBS="-lreadline"],
66
+ [HAVE_READLINE= READLINE_LIBS=])
67
+ LDFLAGS=$_SAVE_LDFLAGS
70
+ if test "${READLINE_DIR}" -a -d "${READLINE_DIR}" -a "$HAVE_READLINE" = 1; then
71
+ READLINE_LIBS="-L${READLINE_DIR}/lib ${READLINE_LIBS}"
75
+AC_SUBST(HAVE_READLINE)
76
+AC_SUBST(READLINE_LIBS)
78
+dnl ========================================================
80
dnl = Feature options that require extra sources to be pulled
82
=== js/src/Makefile.in
83
==================================================================
84
--- xulrunner/js/src/Makefile.in (revision 7)
85
+++ xulrunner/js/src/Makefile.in (local)
87
RESFILE = js$(MOZ_BITS)40.res
90
+ifdef ENABLE_JS_BINARY
92
+PROG_LIBS = -L. $(MOZ_JS_LIBS) $(NSPR_LIBS)
93
+$(SIMPLE_PROGRAMS): $(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX)
95
+PROG_LIBS += $(READLINE_LIBS)
100
PACKAGE_FILE = js.pkg
102
# JavaScript must be built shared, even for static builds, as it is used by
103
=== js/src/xpconnect/shell/Makefile.in
104
==================================================================
105
--- xulrunner/js/src/xpconnect/shell/Makefile.in (revision 69)
106
+++ xulrunner/js/src/xpconnect/shell/Makefile.in (local)
108
# look at mozilla/js/src/editline, which is license-free (but not part
109
# of the mozilla build.)
113
DEFINES += -DEDITLINE
114
-LIBS += -lreadline $(JS_READLINE_EXTRA_LIBS)
115
+LIBS += $(READLINE_LIBS)