jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.29k stars 321 forks source link

Compilation with static linking #260

Open Nodraak opened 5 years ago

Nodraak commented 5 years ago

Hello!

I have an old OS and I need a new version of xdotool, so I am trying to statically compile xdotool. (Upgrading the OS or using Docker are beeing considered, but I would prefer a less intrusive method).

The Makefile has a xdotool.static target, but I dont understand what it is supposed to do.

To compile, I use:

make clean
export CFLAGS=-static
export LDFLAGS=-static
export CPPFLAGS=-static
make -j 8

Which gets me:

// compilation of all the srcs is fine

cc -static -shared -Wl,-soname=libxdo.so.3 xdo.o xdo_search.o -o libxdo.so -L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXtst -lXinerama -lxkbcommon
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:139: recipe for target 'libxdo.so' failed
make: *** [libxdo.so] Error 1

Do you have any idea how to solve this?

Many thanks

aldot commented 4 years ago

try 'make static' and 'make install-static'

chromer030 commented 1 year ago

Built successfully on archlinux , with make static