[Pkg-mozext-commits] [adblock-plus] 27/464: Clean up the build system. Note that automagical m-c download does not yet work.

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:43:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit e654d459bff09148b7569c86a9b94e8feb7dd09b
Author: Joshua Cranmer <Pidgeot18 at gmail.com>
Date:   Wed May 6 17:50:20 2009 -0400

    Clean up the build system. Note that automagical m-c download does not yet work.
---
 .hgignore       |  6 ++++++
 Makefile        | 38 ++++++++++++++++++++++----------------
 README          | 14 +++++++++-----
 configure       | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 jshydra.cpp     |  1 +
 jshydra_funcs.h |  2 +-
 6 files changed, 91 insertions(+), 22 deletions(-)

diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..1749416
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,6 @@
+^config\.mk$
+^jshydra$
+\.o$
+^\.deps/
+
+^mozilla/
diff --git a/Makefile b/Makefile
index 317bc96..b8f336d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,27 @@
-# You'll need to change the below to match your setup
-# If you're doing a raw spidermonkey build, the two paths should be the same,
-# pointing to the directory that contains js/ from mozilla-central.
-MOZ_OBJDIR := /src/build/trunk/browser
-MOZ_SRCDIR := /src/trunk/mozilla
-
-INCLUDE := -I$(MOZ_OBJDIR)/dist/include/js/ \
-		   -I$(MOZ_OBJDIR)/dist/include/nspr/ -DXP_UNIX \
-		   -I$(MOZ_SRCDIR)/js/src/
+include config.mk
+
+# Defines for the mozilla build system
+DEPTH := $(MOZ_OBJDIR)/js/src
+topsrcdir := $(MOZ_SRCDIR)/js/src
+srcdir := $(MOZ_SRCDIR)/js/src
+MODULE := js
+
+include $(MOZ_OBJDIR)/js/src/config/autoconf.mk
+include $(MOZ_SRCDIR)/js/src/config/config.mk
+
 LINK := -L$(MOZ_OBJDIR)/dist/lib -lnspr4 -lm
 
 jshydra: jshydra.o jshydra_funcs.o jshydra_bridge.o
-	g++ -o jshydra jshydra.o jshydra_funcs.o jshydra_bridge.o $(MOZ_OBJDIR)/js/src/libjs_static.a $(LINK)
+	g++ -o $@ $^ $(MOZ_OBJDIR)/js/src/libjs_static.a $(LINK)
 
-jshydra.o: jshydra.cpp
-	g++ -o jshydra.o -g $(INCLUDE) -c jshydra.cpp
+.deps:
+	@if [ ! -e .deps ]; then mkdir .deps; fi
 
-jshydra_funcs.o: jshydra_funcs.cpp
-	g++ -o jshydra_funcs.o -g $(INCLUDE) -c jshydra_funcs.cpp
-jshydra_bridge.o: jshydra_bridge.cpp
-	g++ -o jshydra_bridge.o -g $(INCLUDE) -c jshydra_bridge.cpp -DDEBUG
+%.o: %.cpp .deps $(MOZ_OBJDIR)/js/src/libjs_static.a
+	$(CXX) -o $@ -c $(COMPILE_CXXFLAGS) $<
+
+clean:
+	@rm -rf jshydra *.o .deps
 
 TESTS := $(notdir $(wildcard autotest/test_*.js))
 check: jshydra
@@ -35,3 +38,6 @@ check: jshydra
 	done && rm .*.out
 
 .PHONY: check
+
+echo-variable-%:
+	@echo "$($*)"
diff --git a/README b/README
index c02536d..f72c0a0 100644
--- a/README
+++ b/README
@@ -19,12 +19,16 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 
-To build the code, set the assignment to MOZ_SRCDIR and MOZ_OBJDIR to point to
-the source and build directories for a mozilla-central checkout. The source code
-for SpiderMonkey is required, since this uses internal APIs. A revision newer
-than 2cf0bbe3772a is required, since that revision changed the parse APIs.
+Like most Linux/Unix programs, ./configure && make should work to build the
+system. You can also pass configure options to change which repository to
+download from, or even use an existing mozilla-central checkout and build. The
+source code for SpiderMonkey is required, since this uses internal APIs. If you
+have your own repository, a revision newer than 2cf0bbe3772a is required, since
+that revision changed the parse APIs. However, a newer revision could
+potentially break the code.
 
 The code is not known to work with all JS features; the only code that
 probably does not work is E4X code. If you find a bug in the program, feel free
 to contact me on irc.mozilla.org (nick: jcranmer) or email me at
-<Pidgeot18 at gmail.com>.
+<Pidgeot18 at gmail.com>. Since this program uses bleeding-edge versions of
+SpiderMonkey, some bugs may be due to broken code there.
diff --git a/configure b/configure
new file mode 100755
index 0000000..84fa21e
--- /dev/null
+++ b/configure
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+usage() {
+echo "Usage: $0 ...
+The following options control the setup for the SpiderMonkey build. Only set these if you wish to reuse source; otherwise, it will be downloaded for you:
+--moz-src 	Location of the mozilla source directory
+--moz-obj	Location of the object directory for the above tree.
+
+Other arguments:
+--moz-repo	Repository to clone the source from"
+}
+
+VAL=
+arg() {
+	VAL=${1#*=}
+}
+
+srcdir=mozilla
+objdir=
+repo='http://hg.mozilla.org/mozilla-central'
+
+until [ -z "$1" ]
+do
+	case "$1" in
+	--moz-src=*)
+		arg $1
+		srcdir="$VAL"
+		if [ -z "$objdir"]; then objdir=$srcdir; fi
+	;;
+	--moz-obj=*)
+		arg $1
+		objdir="$VAL"
+	;;
+	--moz-repo=*)
+		arg $1
+		repo="$VAL"
+	;;
+	-h|--help)
+		usage
+		exit 1
+	esac
+	shift
+done
+
+echo "Source directory: $srcdir"
+echo "Object directory: $objdir"
+echo "Source repository: $repo"
+
+cat >config.mk <<EOF
+MOZ_OBJDIR := $objdir
+MOZ_SRCDIR := $srcdir
+EOF
diff --git a/jshydra.cpp b/jshydra.cpp
index b17bd10..4ff328a 100644
--- a/jshydra.cpp
+++ b/jshydra.cpp
@@ -2,6 +2,7 @@
 #include "jsapi.h"
 #include "jsbit.h" // jsparse.h
 #include "jsscript.h" // jsparse.h
+#include "jsinterp.h" // jsparse.h
 #include "jsparse.h"
 #include "jscntxt.h"
 #include <stdio.h>
diff --git a/jshydra_funcs.h b/jshydra_funcs.h
index 942bbe9..deccf0b 100644
--- a/jshydra_funcs.h
+++ b/jshydra_funcs.h
@@ -4,7 +4,7 @@
 
 /* JS Natives */
 
-#define DH_JSNATIVE(fname) JSBool fname(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
+#define DH_JSNATIVE(fname) JSBool fname(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
  
 DH_JSNATIVE(Require);
 DH_JSNATIVE(Include);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list