This exposes some implicit static linking of libs, and also shows that librz.a
can be removed or generalized into using the partial-ld appraoch.
Still issues with pkg-config because libr_shlr is only available as a static
library and can be used in libr_util.pc, creating an empty libr_shlr.${EXT_SO}
may simplify the problem but still a workaround.
It is dangerous to link against it results in much bigger builds
(also faster), which requires LTO to get adjusted sizes.
libr.a is a static library that combines every library r2 builds
and/or depends on, which means that they should be repackaged.
Before this commit, the situation was quite sorry:
* Makefile-ar.mk was parameterized by ARTYPE;
* there were three ARTYPEs, default, gnu and ios;
* the ios ARTYPE was not used and instead its logic was folded
into default;
* the gnu ARTYPE was obviously broken (typo in "rm -f libr.",
typo in "$(C_AR)") preventing it from ever running correctly;
* the default ARTYPE created libraries that did not link
on e.g. a Linux desktop, since the libr.a it created consisted
only of another .a files, and this just results in an error
trying to link:
libr.a: error adding symbols: Archive has no index; run ranlib to add one
* the default ARTYPE, when targeting iOS, performed a bunch of
useless work combining the archives as above, and then just
delegated to libtool, which overwrites the result.
After this commit:
* there is no ARTYPE (nothing in the r2 tree sets it anyway);
* there are no platform-specific assumptions about ar, such
as support for the -M option;
* there is only one code path;
* every archive is partially linked into a single object file
and then added to libr.a.
* Upstream patches from pkgsrc/devel/radare2
Switch to using egrep instead of non-portable "grep -e".
Add support for SunOS.
* Add support for SunOS.
* FIONREAD is defined in sys/filio.h on SunOS.
* Ask find(1) to look for files with desired extension rather than searching for
all files & fishing out the desired extension in the pipeline, with grep.
On MacOS X the library version goes before the library extension (dylib). This
patch adds two helper functions that are used by the install rule to get the
correct library file name.