Commit Graph

82 Commits

Author SHA1 Message Date
Alex Crichton
d830fcc6eb make: Add all the make support for lib{native,green}
This should now begin distribution of lib{green,native} in rlib/dylib format as
well as building them as part of the normal build process.
2013-12-24 19:59:52 -08:00
Alex Crichton
e91ffb0710 Link rustllvm statically, and distribute a static snapshot
In order to keep up to date with changes to the libraries that `llvm-config`
spits out, the dependencies to the LLVM are a dynamically generated rust file.
This file is now automatically updated whenever LLVM is updated to get kept
up-to-date.

At the same time, this cleans out some old cruft which isn't necessary in the
makefiles in terms of dependencies.

Closes #10745
Closes #10744
2013-12-06 20:51:17 -08:00
Alex Crichton
c6e934f447 *Actually* fix make install with rlibs
Turns out that we only want to install the target rlibs, not the host rlibs.
I had it backwards the first time, then mixed up the second time, but this time
should get it right.

There's no need for host rlib files because none of them are needed at runtime.
2013-12-01 06:58:46 -08:00
Alex Crichton
8b964bf349 Fix make install to install rlib files
It was only copying the host files, not the target rlib files.
2013-11-30 18:58:09 -08:00
Alex Crichton
9fbba7b2ee Statically link librustrt to libstd
This commit alters the build process of the compiler to build a static
librustrt.a instead of a dynamic version. This means that we can stop
distributing librustrt as well as default linking against it in the compiler.

This also means that if you attempt to build rust code without libstd, it will
no longer work if there are any landing pads in play. The reason for this is
that LLVM and rustc will emit calls to the various upcalls in librustrt used to
manage exception handling. In theory we could split librustrt into librustrt and
librustupcall. We would then distribute librustupcall and link to it for all
programs using landing pads, but I would rather see just one librustrt artifact
and simplify the build process.

The major benefit of doing this is that building a static rust library for use
in embedded situations all of a sudden just became a whole lot more feasible.

Closes #3361
2013-11-29 18:36:14 -08:00
Alex Crichton
e338a4154b Add generation of static libraries to rustc
This commit implements the support necessary for generating both intermediate
and result static rust libraries. This is an implementation of my thoughts in
https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html.

When compiling a library, we still retain the "lib" option, although now there
are "rlib", "staticlib", and "dylib" as options for crate_type (and these are
stackable). The idea of "lib" is to generate the "compiler default" instead of
having too choose (although all are interchangeable). For now I have left the
"complier default" to be a dynamic library for size reasons.

Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an
rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a
dynamic object. I chose this for size reasons, but also because you're probably
not going to be embedding the rustc compiler anywhere any time soon.

Other than the options outlined above, there are a few defaults/preferences that
are now opinionated in the compiler:

* If both a .dylib and .rlib are found for a rust library, the compiler will
  prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option
* If generating a "lib", the compiler will generate a dynamic library. This is
  overridable by explicitly saying what flavor you'd like (rlib, staticlib,
  dylib).
* If no options are passed to the command line, and no crate_type is found in
  the destination crate, then an executable is generated

With this change, you can successfully build a rust program with 0 dynamic
dependencies on rust libraries. There is still a dynamic dependency on
librustrt, but I plan on removing that in a subsequent commit.

This change includes no tests just yet. Our current testing
infrastructure/harnesses aren't very amenable to doing flavorful things with
linking, so I'm planning on adding a new mode of testing which I believe belongs
as a separate commit.

Closes #552
2013-11-29 18:36:13 -08:00
bors
9ec4c1851a auto merge of #10229 : brson/rust/warnings, r=thestinger
In Rust we don't like capital letters.
2013-11-02 00:51:12 -07:00
Brian Anderson
758af60334 Fix installation with DESTDIR 2013-11-01 20:23:22 -07:00
Brian Anderson
e9605dc0c9 Use consistent capitalization in makefile errors
In Rust we don't like capital letters.
2013-11-01 15:28:12 -07:00
Olivier Saut
a6cd20bff9 Fix missing parenthesis in a previous substitution '$(PREFIX_ROOT)' to '$(CFG_MANDIR' on 1c4a348b07 2013-10-31 11:33:02 +01:00
Heather
1c4a348b07 Correct prefix / CFG_PREFIX work in configure / install.mk 2013-10-29 16:22:57 -07:00
Heather
8a593a8bdb support for GNU configure syntax 2013-10-29 16:22:08 -07:00
Alex Crichton
201cab84e8 Move rust's uv implementation to its own crate
There are a few reasons that this is a desirable move to take:

1. Proof of concept that a third party event loop is possible
2. Clear separation of responsibility between rt::io and the uv-backend
3. Enforce in the future that the event loop is "pluggable" and replacable

Here's a quick summary of the points of this pull request which make this
possible:

* Two new lang items were introduced: event_loop, and event_loop_factory.
  The idea of a "factory" is to define a function which can be called with no
  arguments and will return the new event loop as a trait object. This factory
  is emitted to the crate map when building an executable. The factory doesn't
  have to exist, and when it doesn't then an empty slot is in the crate map and
  a basic event loop with no I/O support is provided to the runtime.

* When building an executable, then the rustuv crate will be linked by default
  (providing a default implementation of the event loop) via a similar method to
  injecting a dependency on libstd. This is currently the only location where
  the rustuv crate is ever linked.

* There is a new #[no_uv] attribute (implied by #[no_std]) which denies
  implicitly linking to rustuv by default

Closes #5019
2013-10-29 08:39:22 -07:00
Igor Bukanov
47fff53597 rust / build: make install should use explicit permissions when creating directories
Closes #10046
2013-10-24 10:23:12 +02:00
Daniel Micay
7c92435f8f remove the rusti command
Closes #9818
Closes #9567
Closes #8924
Closes #8910
Closes #8392
Closes #7692
Closes #7499
Closes #7220
2013-10-16 22:54:38 -04:00
Tim Chevalier
a9dddbacde rust / build: Remove the rust tool
Sadly, there's a lack of resources for maintaining the `rust` tool,
and we decided in the 2013-10-08 Rust team meeting that it's better
to remove it altogether than to leave it in a broken state.

This deletion is without prejudice. If a person or people appear who
would like to maintain the tool, we will probably be happy to
resurrect it!

Closes #9775
2013-10-10 14:36:06 -07:00
Alex Crichton
7b24efd6f3 rustdoc: Out with the old, in with the new
Removes old rustdoc, moves rustdoc_ng into its place instead (plus drops the _ng
suffix). Also shreds all reference to rustdoc_ng from the Makefile rules.
2013-09-22 09:51:15 -07:00
Alex Crichton
876cb76f1b Add the rustdoc_ng binary to the makefile rules
Now rustdoc_ng will be built as both a binary and a library (using the same
rules as all the other binaries that rust has). Furthermore, this will also
start building rustdoc_ng unit tests (and running them).
2013-09-16 18:10:46 -07:00
Corey Richardson
268f3f0ff5 Add rustdoc_ng 2013-09-16 07:26:48 -04:00
Young-il Choi
492cbcee6d mk: install.mk fix to specify ADB variables not adb 2013-08-07 20:42:44 +09:00
bors
60d5bb9413 auto merge of #7796 : thomaslee/rust/issue-6247, r=z0w0
This closes #6247 by simply ensuring librustllvm.so gets installed to the target lib directory in addition to the host lib directory.
2013-07-14 23:40:19 -07:00
Tom Lee
27435c081f Install librustllvm.so to target lib directory 2013-07-14 21:53:47 -07:00
Ted Horst
f2ecf18a8e remove new man pages on make uninstall 2013-07-13 13:56:08 -05:00
bors
e95fcfafc7 auto merge of #7632 : gavinb/rust/7484_manpages, r=cmr
This patch updates the existing manpage and creates new pages for all of the rust command line tools. Closes #7484.
2013-07-11 07:37:36 -07:00
Felix S. Klock II
ace49442a6 Fix #3225: Incorporate feedback from Graydon.
This is a small follow-up fix to the previous commit: I needed
to quote the right-hand side of the definition for the variable
MATCHES, to handle the case where there are more than one previously
installed libraries in the target directory.
2013-07-09 15:31:43 +02:00
Felix S. Klock II
25f51eeda0 Fix #3225: Incorporate feedback from Graydon.
Namely, switched in many places to using GNU make provided functions
for directory listing and text processing, rather than spawning a
shell process to do that work.

In the process of the revision, learned about Target-specific
variables, which were very applicable to INSTALL_LIB (which, on a
per-recipe basis, was always receiving the same actual arguments for
its first two formal parameters in every invocation).

  http://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html

(We might be able to make use of those in future refactorings.)

----

Also adds a cleanup pass to get-snapshot.py as well, since the same
problem arises when we unpack libraries from the snapshot archive into
a build directory with a prior snapshot's artifacts.  (I put this step
into the python script rather than the makefile because I wanted to
delay the cleanup pass until after we have at least successfully
downloaded the tarball.  That way, if the download fails, you should
not destroy the previous unarchived snapshot libraries and build
products.)

----

Also reverted whitespace changes to minimize diff.
I plan to put them back in in a dedicated commit elsewhere.
2013-07-09 13:08:50 +02:00
Felix S. Klock II
033ac5497e Fix #3225: Check for old Rust libraries when building and installing.
When building Rust libraries (e.g. librustc, libstd, etc), checks for
and verbosely removes previous build products before invoking rustc.
(Also, when Make variable VERBOSE is defined, it will list all of the
libraries matching the object library's glob after the rustc
invocation has completed.)

When installing Rust libraries, checks for previous libraries in
target install directory, but does not remove them.

The thinking behind these two different modes of operation is that the
installation target, unlike the build tree, is not under the control
of this infrastructure and it is not up to this Makefile to decide if
the previous libraries should be removed.
2013-07-07 15:23:40 +02:00
Gavin Baker
6143419ee1 Add new manpages to install script 2013-07-07 14:45:39 +10:00
Patrick Walton
0c820d4123 libstd: Rename libcore to libstd and libstd to libextra; update makefiles.
This only changes the directory names; it does not change the "real"
metadata names.
2013-05-22 21:57:05 -07:00
Daniel Micay
d800147abb minor automatic whitespace fixes 2013-05-06 23:57:35 -04:00
Young-il Choi
9ecb97ae58 mk: install.mk directory argument pass for install-runtime-target 2013-05-04 00:47:54 +09:00
Young-il Choi
17b368fd22 mk: configurable android test directory 2013-05-03 11:14:01 +09:00
Young-il Choi
dca88701a3 mk: install-runtime-target added to install.mk (pushing shared library to android target) 2013-05-01 18:49:19 +09:00
Daniel Micay
88e4b5de83 install the librust{doc,pkg} host libraries 2013-04-02 19:25:03 -04:00
Daniel Micay
431380f011 install.mk: use INSTALL_LIB for all libraries
There's no reason to make them executable, and this throws a warning
with the Arch Linux package lint tool (namcap) for .a files.
2013-03-31 19:14:02 -04:00
Daniel Micay
2cbfe6d19d stop installing empty .so files
Closes #4468
2013-03-21 20:32:57 -04:00
Young-il Choi
995a019dff mk: install/uninstall for multiple target 2013-03-04 19:14:24 +09:00
Young-il Choi
7714d52cd9 mk: cleanup - lib and executable suffix handling 2013-03-02 21:25:12 +09:00
Brian Anderson
49c3f9f166 mk: Cross-compile fixes 2013-03-02 10:44:56 +09:00
Brian Anderson
15c0c35352 mk: Split target triples into bulid triple + host triples + target triples
For cross compiling to targets that don't want to build a compiler
2013-02-21 17:51:55 -08:00
Marvin Löbel
726fc877d1 Added rust convenience tool similar to go's go tool 2013-02-18 23:11:08 +01:00
Zack Corr
621c791ded Rename cargo to rustpkg and start over fresh 2013-02-15 18:04:10 -08:00
Brian Anderson
6036add5eb Don't install the fuzzer
It's not an end-user tool
2012-12-16 19:06:47 -08:00
Graydon Hoare
d1affff623 Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
Brian Anderson
cf002e9d32 Tools should not be build prereqs of tests. Closes #3946 2012-11-13 18:35:02 -08:00
Brian Anderson
13c01dd48a Fix make install rules for new libraries 2012-11-07 14:05:45 -08:00
Brian Anderson
c2ffa3e916 Fix install target for new libraries 2012-11-07 14:05:45 -08:00
Daniel Patterson
0e5d0768df make: change to LIB prefixed for fuzzer, carge, rustdoc, rusti uninstall 2012-11-04 23:33:50 -05:00
Brian Anderson
84208b2d26 Librarify rusti, etc. 2012-11-04 17:14:52 -08:00
Brian Anderson
1b0c6665d9 Merge remote-tracking branch 'brson/repl'
Conflicts:
	mk/install.mk
	src/rt/rustrt.def.in
2012-11-04 13:42:39 -08:00