forked from chris-morgan/rust-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request chris-morgan#14 from larsbergstrom/update_origin_b…
…ranch Update the servo branch with changes from upstream and to build in Servo
- Loading branch information
Showing
39 changed files
with
402 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,9 @@ build/ | |
TAGS | ||
doc/http/ | ||
doc/src/http/ | ||
doc/.lock | ||
doc/*.js | ||
doc/*.css | ||
lib/ | ||
.rust/ | ||
Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
~$ | ||
\.dSYM/ | ||
\.swp$ | ||
^src/http/generated/ | ||
^bin/ | ||
^build/ | ||
^TAGS$ | ||
^doc/http/ | ||
^doc/src/http/ | ||
^doc/\.lock$ | ||
^doc/.*\.js$ | ||
^doc/.*\.css$ | ||
^lib/ | ||
^.rust/ | ||
^Makefile$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,91 @@ | ||
VPATH=%VPATH% | ||
|
||
RUST ?= rust | ||
SSL_LIB ?= %SSL_LIB% | ||
SSL_CFG ?= %SSL_CFG% | ||
ifdef SSL_LIB | ||
SSL_CFG += -L "$(SSL_LIB)" | ||
endif | ||
RUSTC ?= rustc | ||
RUSTFLAGS ?= -O | ||
HOST_RUSTFLAGS ?= -O | ||
RUSTDOC ?= rustdoc | ||
RUSTPKG ?= rustpkg | ||
RUSTFLAGS ?= -O $(SSL_CFG) | ||
RUST_REPOSITORY ?= ../rust | ||
RUST_CTAGS ?= $(RUST_REPOSITORY)/src/etc/ctags.rust | ||
VERSION=0.1-pre | ||
|
||
libhttp_files=$(shell find $(VPATH)/src/http/ -type f -name '*.rs') \ | ||
$(VPATH)/src/http/generated/read_method.rs \ | ||
$(VPATH)/src/http/generated/status.rs | ||
codegen_files=\ | ||
src/codegen/branchify.rs \ | ||
src/codegen/main.rs \ | ||
src/codegen/read_method.rs \ | ||
src/codegen/status.rs \ | ||
|
||
libhttp_so=build/.libhttp.timestamp | ||
http_files=\ | ||
$(wildcard src/http/*.rs) \ | ||
src/http/generated/read_method.rs \ | ||
src/http/generated/status.rs \ | ||
$(wildcard src/http/headers/*.rs) \ | ||
$(wildcard src/http/client/*.rs) \ | ||
$(wildcard src/http/server/*.rs) | ||
|
||
http: $(libhttp_so) | ||
|
||
Makefile: configure Makefile.in | ||
@echo "configure or Makefile.in changed, regenerating Makefile" | ||
@DOING_RECONFIGURE=1 SSL_LIB="$(SSL_LIB)" SSL_CFG="$(SSL_CFG)" ./configure | ||
@echo | ||
@echo ====================== | ||
@echo Please run make again! | ||
@echo ====================== | ||
@echo | ||
@exit 1 | ||
|
||
$(libhttp_so): Makefile $(http_files) | ||
mkdir -p build/ | ||
$(RUSTC) $(RUSTFLAGS) src/http/lib.rs --out-dir=build | ||
@touch build/.libhttp.timestamp | ||
|
||
all: http examples docs | ||
|
||
build/codegen: $(codegen_files) | ||
mkdir -p build/ | ||
$(RUSTC) src/codegen/main.rs --out-dir=build | ||
|
||
src/http/generated: | ||
mkdir -p src/http/generated | ||
|
||
src/http/generated/%.rs: build/codegen src/http/generated | ||
build/codegen $(patsubst src/http/generated/%,%,$@) src/http/generated/ | ||
|
||
build/%:: src/%/main.rs $(libhttp_so) | ||
mkdir -p "$(dir $@)" | ||
$(RUSTC) $(RUSTFLAGS) $< -o $@ -L build/ | ||
|
||
all: libhttp.dummy | ||
examples: $(patsubst src/examples/%/main.rs,build/examples/%,$(wildcard src/examples/*/main.rs)) \ | ||
$(patsubst src/examples/%/main.rs,build/examples/%,$(wildcard src/examples/*/*/main.rs)) | ||
|
||
codegen: $(wildcard $(VPATH)/src/codegen/*.rs) | ||
$(RUSTC) $(HOST_RUSTFLAGS) $(VPATH)/src/codegen/main.rs -o codegen | ||
docs: doc/http/index.html | ||
|
||
$(VPATH)/src/http/generated: | ||
mkdir -p $(VPATH)/src/http/generated | ||
doc/http/index.html: $(http_files) | ||
$(RUSTDOC) src/http/lib.rs | ||
|
||
$(VPATH)/src/http/generated/%.rs: codegen $(VPATH)/src/http/generated | ||
./codegen $(patsubst $(VPATH)/src/http/generated/%,%,$@) $(VPATH)/src/http/generated/ | ||
build/tests: $(http_files) | ||
$(RUSTC) $(RUSTFLAGS) --test -o build/tests src/http/lib.rs | ||
|
||
libhttp.dummy: $(libhttp_files) | ||
$(RUSTC) $(RUSTFLAGS) $(VPATH)/src/http/lib.rs --out-dir . | ||
touch $@ | ||
build/quicktests: $(http_files) | ||
$(RUSTC) --test -o build/quicktests src/http/lib.rs | ||
|
||
check: tests | ||
./tests --test | ||
# Can't wait for everything to build, optimised too? OK, you can save some time here. | ||
quickcheck: build/quicktests | ||
build/quicktests --test | ||
|
||
tests: $(libhttp_files) | ||
$(RUSTC) $(RUSTFLAGS) --test -o tests $(VPATH)/src/http/lib.rs | ||
check: all build/tests | ||
build/tests --test | ||
|
||
clean-tests: | ||
rm -f tests | ||
clean: | ||
rm -rf src/http/generated/ src/http/codegen/codegen | ||
rm -rf build/ | ||
rm -rf bin/ .rust/ | ||
|
||
clean: clean-tests | ||
rm -rf $(VPATH)src/http/generated/ codegen | ||
rm -rf libhttp.dummy | ||
rm -f *.so *.dylib *.rlib *.dll | ||
TAGS: | ||
ctags -f TAGS --options=$(RUST_CTAGS) -R src | ||
|
||
.PHONY: all examples clean clean-tests | ||
.PHONY: all http examples docs clean check quickcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
VPATH=%VPATH% | ||
|
||
RUST ?= rust | ||
RUSTC ?= rustc | ||
RUSTFLAGS ?= -O | ||
HOST_RUSTFLAGS ?= -O | ||
VERSION=0.1-pre | ||
|
||
libhttp_files=$(shell find $(VPATH)/src/http/ -type f -name '*.rs') \ | ||
$(VPATH)/src/http/generated/read_method.rs \ | ||
$(VPATH)/src/http/generated/status.rs | ||
|
||
all: libhttp.dummy | ||
|
||
codegen: $(wildcard $(VPATH)/src/codegen/*.rs) | ||
$(RUSTC) $(HOST_RUSTFLAGS) $(VPATH)/src/codegen/main.rs -o codegen | ||
|
||
$(VPATH)/src/http/generated: | ||
mkdir -p $(VPATH)/src/http/generated | ||
|
||
$(VPATH)/src/http/generated/%.rs: codegen $(VPATH)/src/http/generated/ | ||
./codegen $(patsubst $(VPATH)/src/http/generated/%,%,$@) $(VPATH)/src/http/generated/ | ||
|
||
libhttp.dummy: $(libhttp_files) | ||
$(RUSTC) $(RUSTFLAGS) $(VPATH)/src/http/lib.rs --out-dir . | ||
touch $@ | ||
|
||
build/%:: src/%.rs libhttp.dummy | ||
mkdir -p '$(dir $@)' | ||
$(RUSTC) $(RUSTFLAGS) $< -o $@ -L build/ | ||
|
||
examples: build/examples/apache_fake build/examples/hello_world build/examples/info build/examples/client/client | ||
|
||
.PHONY: check | ||
check: tests | ||
|
||
tests: $(libhttp_files) | ||
$(RUSTC) $(RUSTFLAGS) --test -o tests $(VPATH)/src/http/lib.rs | ||
./tests --test | ||
|
||
clean-tests: | ||
rm -f tests | ||
|
||
clean: clean-tests | ||
rm -rf $(VPATH)src/http/generated/ codegen | ||
rm -rf libhttp.dummy | ||
rm -f *.so *.dylib *.dll | ||
|
||
.PHONY: all examples clean tests clean-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
SRCDIR="$(cd $(dirname $0) && pwd)" | ||
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile | ||
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.servo.in > Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#[macro_escape]; | ||
#![macro_escape] | ||
|
||
use std::str::Chars; | ||
use std::io::IoResult; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.