Rename the C library to "ring-core", rename Rust crate to "ring".
The Rust crate can't be named "ring" if it links to a C library called "ring".
This commit is contained in:
parent
1f7f6de150
commit
0b23f8cf9e
40
BUILDING.md
40
BUILDING.md
@ -1,22 +1,11 @@
|
||||
Differences from BoringSSL and OpenSSL
|
||||
======================================
|
||||
|
||||
Here are the major differences between *ring* and BoringSSL & OpenSSL that
|
||||
affect building:
|
||||
|
||||
* BoringSSL uses CMake and OpenSSL uses make(1). *ring* uses Visual Studio's
|
||||
native build system (msbuild) on Windows, and GNU Make otherwise.
|
||||
* BoringSSL and OpenSSL both support building static or shared libraries.
|
||||
*ring* is only supported in static library form.
|
||||
* *ring*'s static library is named ring.lib on Windows and libring.a on
|
||||
other platforms. BoringSSL and OpenSSL use different names.
|
||||
Ring can be built as a Rust library or as a C library.
|
||||
|
||||
|
||||
|
||||
Building the Rust Library
|
||||
=========================
|
||||
|
||||
*ring*'s Rust crate is named ```rust_ring```. You can build it
|
||||
*ring*'s Rust crate is named ```ring```. You can build it
|
||||
using ```cargo build --release``` and you can run the tests
|
||||
with ```cargo test --release```. When you use ```cargo build```, you don't need
|
||||
to follow the instructions below to build the C code separately, because
|
||||
@ -31,6 +20,16 @@ any problems building (or using) *ring*'s Rust crate.
|
||||
Building the C Library on Linux and Similar Platforms
|
||||
=====================================================
|
||||
|
||||
Here are the major differences between *ring* and BoringSSL & OpenSSL that
|
||||
affect building:
|
||||
|
||||
* BoringSSL uses CMake and OpenSSL uses make(1). *ring* uses Visual Studio's
|
||||
native build system (msbuild) on Windows, and GNU Make otherwise.
|
||||
* BoringSSL and OpenSSL both support building static or shared libraries.
|
||||
*ring* is only supported in static library form.
|
||||
* *ring*'s static library is named ring-core.lib on Windows and libring-core.a
|
||||
on other platforms. BoringSSL and OpenSSL use different names.
|
||||
|
||||
There is no ./configure step.
|
||||
|
||||
GNU Make 3.81 or later is required. Perl 5.6.1 or later is also required
|
||||
@ -66,7 +65,7 @@ version of clang on Mac OS X:
|
||||
Then compile your applications with ```-Iring/include``` (assuming you put *ring*
|
||||
into the ```ring``` subdirectory of your project) and add ```$(RING_LDFLAGS)```
|
||||
to LDFLAGS in your linking step. ```RING_LDFLAGS``` expands by default
|
||||
to ```-pthread -Lbuild/$TARGET-$CC/lib -lring```. (It should also be
|
||||
to ```-pthread -Lbuild/$TARGET-$CC/lib -lring-core```. (It should also be
|
||||
easy to build *ring* so that it doesn't depend on pthreads, but the build system
|
||||
hasn't been enhanced to fully support that yet.)
|
||||
|
||||
@ -90,12 +89,13 @@ Alternatively, from a Visual Studio Native Tools Command Prompt:
|
||||
|
||||
msbuild ring.sln
|
||||
|
||||
The built ```ring.lib``` will be put into a subdirectory of ```build/``` depending
|
||||
on which configuration and which platform you choose to build for. For example,
|
||||
in a 32-bit release build, the result is ```build\Win32-Release\lib\ring.lib```.
|
||||
In your application's project, add *ring*'s ```include/``` subdirectory to the
|
||||
"Additional Include Directories," add the directory containing ```ring.lib```
|
||||
to the "Additional Library Directories", and add ```ring.lib``` to the
|
||||
The built ```ring-core.lib``` will be put into a subdirectory of ```build/```
|
||||
depending on which configuration and which platform you choose to build for.
|
||||
For example, in a 32-bit release build, the result
|
||||
is ```build\Win32-Release\lib\ring.lib```. In your application's project, add
|
||||
*ring*'s ```include/``` subdirectory to the "Additional Include Directories,"
|
||||
add the directory containing ```ring-core.lib``` to the
|
||||
"Additional Library Directories", and add ```ring-core.lib``` to the
|
||||
"Additional Dependencies."
|
||||
|
||||
On Windows, *ring* can be build in Debug or Release configurations for
|
||||
|
@ -3,14 +3,13 @@ authors = ["Brian Smith <brian@briansmith.org>"]
|
||||
build = "build.rs"
|
||||
description = "A Rust interface for a simplification of BoringSSL's libcrypto."
|
||||
license-file = "LICENSE"
|
||||
name = "rust-ring"
|
||||
name = "ring"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/briansmith/ring"
|
||||
version = "0.1.0"
|
||||
|
||||
[lib]
|
||||
name = "rust_ring"
|
||||
crate-type = ["rlib"]
|
||||
name = "ring"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.1"
|
||||
|
@ -33,7 +33,7 @@ were developed for *ring* have already been integrated upstream in BoringSSL.
|
||||
|
||||
The Rust API
|
||||
============
|
||||
The first part of the ```rust_ring``` Rust crate is now available.
|
||||
The first part of the ```ring``` Rust crate is now available.
|
||||
|
||||
Currently these features are supported through the Rust API:
|
||||
|
||||
@ -42,7 +42,7 @@ Currently these features are supported through the Rust API:
|
||||
* ECDSA Signature Verification for curves P-256, P-384, and P-521.
|
||||
|
||||
See the documentation at
|
||||
https://briansmith.github.io/ring/rust_ring/. Also take a look at the example
|
||||
https://briansmith.github.io/ring/ring/. Also take a look at the example
|
||||
program [checkdigest.rs](examples/checkdigest.rs).
|
||||
|
||||
See [Building the Rust Library](BUILDING.md#building-the-rust-library) for
|
||||
|
4
build.rs
4
build.rs
@ -53,7 +53,7 @@ fn main() {
|
||||
lib_path = Path::new(&out_dir).join("lib");
|
||||
args = vec![
|
||||
format!("-j{}", env::var("NUM_JOBS").unwrap()),
|
||||
format!("{}/lib{}.a", lib_path.to_str().unwrap(), LIB_NAME),
|
||||
format!("{}/lib{}-core.a", lib_path.to_str().unwrap(), LIB_NAME),
|
||||
format!("TARGET={}", target_str),
|
||||
format!("CMAKE_BUILD_TYPE={}", cmake_build_type),
|
||||
format!("BUILD_PREFIX={}/", out_dir),
|
||||
@ -91,5 +91,5 @@ fn main() {
|
||||
}
|
||||
|
||||
println!("cargo:rustc-link-search=native={}", lib_path.to_str().unwrap());
|
||||
println!("cargo:rustc-link-lib=static={}", LIB_NAME);
|
||||
println!("cargo:rustc-link-lib=static={}-core", LIB_NAME);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F4C0A1B6-5E09-41C8-8242-3E1F6762FB18}</ProjectGuid>
|
||||
<ProjectName>libring.Windows</ProjectName>
|
||||
<TargetName>ring</TargetName>
|
||||
<TargetName>ring-core</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
|
@ -12,10 +12,10 @@
|
||||
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
extern crate rust_ring;
|
||||
extern crate ring;
|
||||
extern crate rustc_serialize;
|
||||
|
||||
use rust_ring::{Digest, SHA256, SHA384, SHA512};
|
||||
use ring::{Digest, SHA256, SHA384, SHA512};
|
||||
use rustc_serialize::hex::FromHex;
|
||||
use std::error::Error;
|
||||
use std::io::{Read, Write};
|
||||
|
@ -11,7 +11,7 @@
|
||||
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ring.lib;ring-test.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>ring-core.lib;ring-test.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutRootDir)lib;$(IntRootDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
@ -16,7 +16,7 @@ RING_PREFIX ?= ring/
|
||||
|
||||
RING_CPPFLAGS = $(RING_THREAD_FLAGS) -I$(RING_PREFIX)include -D_XOPEN_SOURCE=700
|
||||
|
||||
RING_LDLIBS = $(RING_THREAD_FLAGS) -L$(dir $(RING_LIB)) -lring
|
||||
RING_LDLIBS = $(RING_THREAD_FLAGS) -L$(dir $(RING_LIB)) -lring-core
|
||||
|
||||
RING_SRCS = $(addprefix $(RING_PREFIX), \
|
||||
crypto/aes/aes.c \
|
||||
@ -200,7 +200,7 @@ else
|
||||
RING_CPPFLAGS += -DOPENSSL_NO_ASM=1
|
||||
endif
|
||||
|
||||
RING_LIB = $(LIB_PREFIX)libring.a
|
||||
RING_LIB = $(LIB_PREFIX)libring-core.a
|
||||
|
||||
# Recent versions of Linux have the D flag for deterministic builds, but Darwin
|
||||
# (at least) doesn't. Accroding to Debian's documentation, binutils is built
|
||||
|
Loading…
x
Reference in New Issue
Block a user