Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Cargo-based build system to eventually replace make #31123

Merged
merged 10 commits into from
Feb 12, 2016

Commits on Feb 11, 2016

  1. Add a Cargo-based build system

    This commit is the start of a series of commits which start to replace the
    makefiles with a Cargo-based build system. The aim is not to remove the
    makefiles entirely just yet but rather just replace the portions that invoke the
    compiler to do the bootstrap. This commit specifically adds enough support to
    perform the bootstrap (and all the cross compilation within) along with
    generating documentation.
    
    More commits will follow up in this series to actually wire up the makefiles to
    call this build system, so stay tuned!
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    046e687 View commit details
    Browse the repository at this point in the history
  2. bootstrap: Read configuration from config.mk

    During the transition period where we're still using ./configure and makefiles,
    read some extra configuration from `config.mk` if it's present. This means that
    the bootstrap build should be configured the same as the original ./configure
    invocation.
    
    Eventually this will all be removed in favor of only storing information in
    `config.toml` (e.g. the configure script will generate config.toml), but for now
    this should suffice.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    0a54e4d View commit details
    Browse the repository at this point in the history
  3. configure: Remove default NDK path value

    This likely isn't always valid, and subverts auto-detection.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    7cbd245 View commit details
    Browse the repository at this point in the history
  4. bootstrap: Add a bunch of Cargo.toml files

    These describe the structure of all our crate dependencies.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    2581b14 View commit details
    Browse the repository at this point in the history
  5. bootstrap: Add build scripts for crates

    This commits adds build scripts to the necessary Rust crates for all the native
    dependencies. This is currently a duplication of the support found in mk/rt.mk
    and is my best effort at representing the logic twice, but there may be some
    unfortunate-and-inevitable divergence.
    
    As a summary:
    
    * alloc_jemalloc - build script to compile jemallocal
    * flate - build script to compile miniz.c
    * rustc_llvm - build script to run llvm-config and learn about how to link it.
      Note that this crucially (and will not ever) compile LLVM as that would take
      far too long.
    * rustdoc - build script to compile hoedown
    * std - script to determine lots of libraries/linkages as well as compile
      libbacktrace
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    4da4970 View commit details
    Browse the repository at this point in the history
  6. bootstrap: Add directives to not double-link libs

    Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate
    `#[cfg]` definitions to all crates to avoid linking anything if this is passed.
    This should help allow libstd to compile with both the makefiles and with Cargo.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    eac0a8b View commit details
    Browse the repository at this point in the history
  7. rustbook: Make main a public function

    This will allow it to be used as a crate in a Cargo-based build
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    32c5613 View commit details
    Browse the repository at this point in the history
  8. rustc_llvm: Tweak how initialization is performed

    Refactor a bit to have less repetition and #[cfg] and try to bury it all inside
    of a macro.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    34f7364 View commit details
    Browse the repository at this point in the history
  9. configure: Add an option to use the cargo build system

    This commit adds a `--enable-rustbuild` option to the configure script which
    will copy a different `Makefile.in` into place to intercept all `make`
    invocations.
    
    Currently this makefile only has one target, but it's expected to be filled out
    quite a bit over time!
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    bb2e921 View commit details
    Browse the repository at this point in the history
  10. rustc_back: Fix disabling jemalloc

    When building with Cargo we need to detect `feature = "jemalloc"` to enable
    jemalloc, so propagate this same change to the build system to pass the right
    `--cfg` argument.
    alexcrichton committed Feb 11, 2016
    Configuration menu
    Copy the full SHA
    55dd595 View commit details
    Browse the repository at this point in the history