Closed pedroalbanese closed 3 years ago
Hi!
What do you mean by building statically? If you mean linking wl-clipboard against libwayland-client and libc statically, then it's up to your system / pkg-config to provide a static version of them. wl-clipboard does not do anything special wrt static/dynamic linking: it just asks Meson to find wayland-client
(Meson then goes and asks pkg-config which flags and libraries one has to use to link with libwayland-client):
I need the standalone binaries for armel, if it is not static it will not run on Android. I urgently need an equivalent to the xclip for Android terminal.
I mean, I would like to know what the gcc command is, so I can add the -static flag
Several things here don't work that way :slightly_smiling_face:
-static
manually; instead you tell the buildsystem how you want the project to be built
That all being said, you can pass -v
to ninja
to see the actual command (gcc something something...
) it runs. And wl-clipboard is easy to build without Meson, too: just write a suitable config.h
, pass all the C files to a compiler (using whatever flags you want!), link to libwayland-client somehow, done.
Android supports shared libs but the structure of directories differs, I used to compile things for mi Android with arm-linux-gnueabi-gcc/g++ tool. It works just if I make it -static.
root@cce:/tmp/wl-clipboard-master/build# ninja -v [1/2] cc -o src/wl-paste src/wl-paste.p/wl-paste.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group src/libwl-clipboard.a src/libgtk-primary-selection.a src/libwlr-data-control.a /usr/lib/x86_64-linux-gnu/libwayland-client.so -Wl,--end-group [2/2] cc -o src/wl-copy src/wl-copy.p/wl-copy.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group src/libwl-clipboard.a src/libgtk-primary-selection.a src/libwlr-data-control.a /usr/lib/x86_64-linux-gnu/libwayland-client.so -Wl,--end-group
I need to know what's the command to compile the executable..
Oh sorry, now I saw that there are two outputs.
if I add the flag -static:
root@cce:/tmp/wl-clipboard-master/build# cc -o src/wl-paste src/wl-paste.p/wl-paste.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group src/libwl-clipboard.a src/libgtk-primary-selection.a src/libwlr-data-control.a /usr/lib/x86_64-linux-gnu/libwayland-client.so -Wl,--end-group -s -static /usr/bin/ld: attempted static link of dynamic object `/usr/lib/x86_64-linux-gnu/libwayland-client.so' collect2: error: ld returned 1 exit status
Yes, exactly, you'd need to get/build yourself a static version of libwayland-client.
Wow, forget it then haha. Thanks
Do you know the path of /dev/Clipborad on Android?
Hi, how do I build it statically?