Tested most of my compilation in the previous patch on NodeJS
and extracted the patches from there. This patch ensures libuv
will be capable of building standalone as well, both with gyp
and Makefiles.
Build documentation was added to the README.md file.
Some tests are failing, and I have not heavily investigated
the reasons. The failures are generally on errors, and are
likely related to differences between fully POSIX-compatible
systems and android.
Commit 3eb6eb3 links the .so with -Wl,-soname which breaks the
`make test` target: run-tests is linked against (for example)
libuv.so.0.11 while the actual file name is libuv.so.
That's relatively easy to fix by getting creative with rpaths but it's
even easier to fix by simply linking statically.
It also means I no longer have to remember to set LD_BIND_NOW when
profiling the benchmarks.
Rename it to darwin-getproctitle.c, it doesn't need an Objective-C
compiler. Fix up -Wpedantic warnings about void to function pointer
casts and include <ApplicationServices/ApplicationServices.h> to get
the GetCurrentProcess() function prototype.
Add a compiler check because turning on the option unconditionally
breaks the build when CC=gcc.
This should also fix the build on versions of OS X that predate Apple's
switch to clang (10.6 and older.)
Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.
Fixes#737.
Make changes to the process title visible to tools like `ps`.
The argv clobber technique is reasonably portable across Unices;
the common code has been moved into src/unix/proctitle.c and is used
on Linux and OS X. Other platforms will probably follow in the future.
Executing `make libuv.so` after `make libuv.a` failed because the
libuv.a target compiled the files in src/ without -fPIC.
Make the libuv.so target depend on files with a different suffix to
keep them separated.
Running a make target that builds the shared object while overriding the CFLAGS
variable from the command line, would fail with a relocation error:
relocation R_X86_64_32 against `.text' can not be used when making a shared
object; recompile with -fPIC
Fix that by adding -fPIC unconditionally.