diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 32e4df29..60bc6469 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v2 with: persist-credentials: false - - run: make src/crustls.h + - run: make src/rustls.h - run: git diff --exit-code cargo-fmt: diff --git a/Cargo.toml b/Cargo.toml index 17b18f67..e90660c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "crustls" +name = "rustls-ffi" version = "0.7.1" authors = ["Jacob Hoffman-Andrews "] description = "C-to-rustls bindings" edition = "2018" -links = "crustls" +links = "rustls_ffi" [dependencies] # Keep in sync with RUSTLS_CRATE_VERSION in lib.rs @@ -19,5 +19,5 @@ log = "0.4.14" cbindgen = "*" [lib] -name = "crustls" +name = "rustls_ffi" crate-type = ["lib", "staticlib"] diff --git a/Makefile b/Makefile index 662ba4d2..4b4ce66b 100644 --- a/Makefile +++ b/Makefile @@ -29,27 +29,29 @@ test: all target: mkdir -p $@ -src/crustls.h: src/*.rs cbindgen.toml +src/rustls.h: src/*.rs cbindgen.toml cargo check cbindgen --lang C > $@ -target/$(PROFILE)/libcrustls.a: src/*.rs Cargo.toml +target/$(PROFILE)/librustls_ffi.a: src/*.rs Cargo.toml RUSTFLAGS="-C metadata=rustls-ffi" cargo build $(CARGOFLAGS) -target/%.o: tests/%.c src/crustls.h tests/common.h | target +target/%.o: tests/%.c src/rustls.h tests/common.h | target $(CC) -o $@ -c $< $(CFLAGS) -target/client: target/client.o target/common.o target/$(PROFILE)/libcrustls.a +target/client: target/client.o target/common.o target/$(PROFILE)/librustls_ffi.a $(CC) -o $@ $^ $(LDFLAGS) -target/server: target/server.o target/common.o target/$(PROFILE)/libcrustls.a +target/server: target/server.o target/common.o target/$(PROFILE)/librustls_ffi.a $(CC) -o $@ $^ $(LDFLAGS) -install: target/$(PROFILE)/libcrustls.a src/crustls.h +install: target/$(PROFILE)/librustls_ffi.a src/rustls.h mkdir -p $(DESTDIR)/lib - install target/$(PROFILE)/libcrustls.a $(DESTDIR)/lib/ + install target/$(PROFILE)/librustls_ffi.a $(DESTDIR)/lib/librustls.a mkdir -p $(DESTDIR)/include - install src/crustls.h $(DESTDIR)/include/crustls.h + install src/rustls.h $(DESTDIR)/include/ + ln -s librustls.a $(DESTDIR)/lib/libcrustls.a + ln -s rustls.h $(DESTDIR)/include/crustls.h clean: rm -rf target diff --git a/build.rs b/build.rs index 6ef3c876..b96a144c 100644 --- a/build.rs +++ b/build.rs @@ -5,7 +5,7 @@ fn main() { let include_dir = out_dir.join("include"); fs::create_dir_all(&include_dir).unwrap(); - fs::copy("src/crustls.h", include_dir.join("crustls.h")).unwrap(); + fs::copy("src/rustls.h", include_dir.join("rustls.h")).unwrap(); println!("cargo:include={}", include_dir.to_str().unwrap()); } diff --git a/src/crustls.h b/src/rustls.h similarity index 100% rename from src/crustls.h rename to src/rustls.h diff --git a/tests/client.c b/tests/client.c index c02b65ff..e6ab3375 100644 --- a/tests/client.c +++ b/tests/client.c @@ -43,7 +43,7 @@ #endif /* crustls.h is autogenerated in the Makefile using cbindgen. */ -#include "crustls.h" +#include "rustls.h" #include "common.h" /* diff --git a/tests/common.c b/tests/common.c index a0eb1d6b..56497a5c 100644 --- a/tests/common.c +++ b/tests/common.c @@ -21,7 +21,7 @@ #include #include -#include "crustls.h" +#include "rustls.h" #include "common.h" void diff --git a/tests/server.c b/tests/server.c index c20c992b..27e51a18 100644 --- a/tests/server.c +++ b/tests/server.c @@ -45,7 +45,7 @@ #endif /* _WIN32 */ /* crustls.h is autogenerated in the Makefile using cbindgen. */ -#include "crustls.h" +#include "rustls.h" #include "common.h" enum crustls_demo_result