mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
8b33d764a7
* Fix #3929 - Enable LTO in sys/static.sh * Update Ubuntu to 20.04 for static build * Use `gcc-ar` when needed * Do not use "c" option for ${AR} * Use `$$AR` instead of `$AR` * Aim to fix `-dynamiclib` issue outside darwin * Run tests for static LTO build Co-authored-by: pancake <pancake@nopcode.org> Co-authored-by: Anton Kochkov <xvilka@gmail.com>
38 lines
707 B
Bash
Executable File
38 lines
707 B
Bash
Executable File
#!/bin/sh
|
|
# sys/meson.py || exit 1
|
|
sys/meson.py --options use_libuv=false use_sys_magic=false || exit 1
|
|
(
|
|
cd build || exit 1
|
|
rm -rf a
|
|
mkdir a
|
|
for a in `find *| grep '\.a$' | grep -v 'libr\.a'` ; do
|
|
echo $a
|
|
b=`basename $a`
|
|
mkdir a/$b
|
|
(cd a/$b ; ${AR} xv ../../$a) > /dev/null
|
|
done
|
|
(
|
|
rm -f libr.a
|
|
cd a
|
|
${AR} rs ../libr.a */*.o
|
|
)
|
|
)
|
|
D=r2sdk
|
|
rm -rf $D
|
|
mkdir -p $D/lib || exit 1
|
|
cp -rf libr/include $D
|
|
cp -f build/r_userconf.h $D/include
|
|
cp -f build/r_version.h $D/include
|
|
cp -f build/libr.a $D/lib
|
|
rm -f $D.zip
|
|
zip -r $D.zip $D > /dev/null
|
|
|
|
cat > .test.c <<EOF
|
|
#include <r_core.h>
|
|
int main() {
|
|
RCore *core = r_core_new ();
|
|
r_core_free (core);
|
|
}
|
|
EOF
|
|
gcc .test.c -I $D/include $D/lib/libr.a
|