astrand/xclip

build statically linked xclip failed.

leleliu008 opened this issue · 0 comments

https://github.com/astrand/xclip/archive/0.13.tar.gz

configure:4759: checking for XmuClientWindow in -lXmu
configure:4782: /opt/ppkg/core/bin/wrapper-cc -o conftest  -fPIC -fno-common -Os -DNDEBUG -I/opt/ppkg/installing/xclip/inc -I/opt/ppkg/installed/xorg-libxmu/include -I/opt/ppkg/installed/xorg-libxext/include -I/opt/ppkg/installed/xorg-libxt/include -I/opt/ppkg/installed/xorg-libx11/include -I/opt/ppkg/installed/xorg-libxcb/include -I/opt/ppkg/installed/python3/include -I/opt/ppkg/installed/expat/include -I/opt/ppkg/installed/libffi/include -I/opt/ppkg/installed/openssl/include -I/opt/ppkg/installed/sqlite/include -I/opt/ppkg/installed/readline/include -I/opt/ppkg/installed/ncurses/include -I/opt/ppkg/installed/zlib/include -I/opt/ppkg/installed/bzip2/include -I/opt/ppkg/installed/xz/include -I/opt/ppkg/installed/xorg-libxau/include -I/opt/ppkg/installed/xorg-libxdmcp/include -I/opt/ppkg/installed/xorg-libsm/include -I/opt/ppkg/installed/xorg-libice/include -I/opt/ppkg/installed/xorg-xtrans/include -I/opt/ppkg/installed/xorg-proto/include  -Wall -I/opt/ppkg/installing/xclip/inc -I/opt/ppkg/installed/xorg-libxmu/include -I/opt/ppkg/installed/xorg-libxext/include -I/opt/ppkg/installed/xorg-libxt/include -I/opt/ppkg/installed/xorg-libx11/include -I/opt/ppkg/installed/xorg-libxcb/include -I/opt/ppkg/installed/python3/include -I/opt/ppkg/installed/expat/include -I/opt/ppkg/installed/libffi/include -I/opt/ppkg/installed/openssl/include -I/opt/ppkg/installed/sqlite/include -I/opt/ppkg/installed/readline/include -I/opt/ppkg/installed/ncurses/include -I/opt/ppkg/installed/zlib/include -I/opt/ppkg/installed/bzip2/include -I/opt/ppkg/installed/xz/include -I/opt/ppkg/installed/xorg-libxau/include -I/opt/ppkg/installed/xorg-libxdmcp/include -I/opt/ppkg/installed/xorg-libsm/include -I/opt/ppkg/installed/xorg-libice/include -I/opt/ppkg/installed/xorg-xtrans/include -I/opt/ppkg/installed/xorg-proto/include  -L/opt/ppkg/installing/xclip/lib -Wl,-rpath,/opt/ppkg/installed/xclip/lib -L/opt/ppkg/installed/xorg-libxmu/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxmu/lib -L/opt/ppkg/installed/xorg-libxext/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxext/lib -L/opt/ppkg/installed/xorg-libxt/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxt/lib -L/opt/ppkg/installed/xorg-libx11/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libx11/lib -L/opt/ppkg/installed/xorg-libxcb/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxcb/lib -L/opt/ppkg/installed/xorg-xcb-proto/lib -Wl,-rpath,/opt/ppkg/installed/xorg-xcb-proto/lib -L/opt/ppkg/installed/python3/lib -Wl,-rpath,/opt/ppkg/installed/python3/lib -L/opt/ppkg/installed/expat/lib -Wl,-rpath,/opt/ppkg/installed/expat/lib -L/opt/ppkg/installed/libffi/lib -Wl,-rpath,/opt/ppkg/installed/libffi/lib -L/opt/ppkg/installed/openssl/lib -Wl,-rpath,/opt/ppkg/installed/openssl/lib -L/opt/ppkg/installed/sqlite/lib -Wl,-rpath,/opt/ppkg/installed/sqlite/lib -L/opt/ppkg/installed/readline/lib -Wl,-rpath,/opt/ppkg/installed/readline/lib -L/opt/ppkg/installed/ncurses/lib -Wl,-rpath,/opt/ppkg/installed/ncurses/lib -L/opt/ppkg/installed/zlib/lib -Wl,-rpath,/opt/ppkg/installed/zlib/lib -L/opt/ppkg/installed/bzip2/lib -Wl,-rpath,/opt/ppkg/installed/bzip2/lib -L/opt/ppkg/installed/xz/lib -Wl,-rpath,/opt/ppkg/installed/xz/lib -L/opt/ppkg/installed/xorg-libpthread-stubs/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libpthread-stubs/lib -L/opt/ppkg/installed/xorg-libxau/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxau/lib -L/opt/ppkg/installed/xorg-libxdmcp/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libxdmcp/lib -L/opt/ppkg/installed/xorg-libsm/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libsm/lib -L/opt/ppkg/installed/xorg-libice/lib -Wl,-rpath,/opt/ppkg/installed/xorg-libice/lib -L/opt/ppkg/installed/xorg-xtrans/lib -Wl,-rpath,/opt/ppkg/installed/xorg-xtrans/lib -L/opt/ppkg/installed/xorg-proto/lib -Wl,-rpath,/opt/ppkg/installed/xorg-proto/lib -L/opt/ppkg/installed/perl/lib -Wl,-rpath,/opt/ppkg/installed/perl/lib -static --static -Wl,--as-needed -Wl,-z,muldefs -Wl,--allow-multiple-definition -Wl,-S conftest.c -lXmu   >&5
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/ppkg/installing/xclip/lib/libXmu.a(ClientWin.o): in function `TryChildren':
ClientWin.c:(.text+0x43): undefined reference to `XQueryTree'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: ClientWin.c:(.text+0x9c): undefined reference to `XGetWindowProperty'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: ClientWin.c:(.text+0xaf): undefined reference to `XFree'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: ClientWin.c:(.text+0x105): undefined reference to `XFree'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/ppkg/installing/xclip/lib/libXmu.a(ClientWin.o): in function `XmuClientWindow':
ClientWin.c:(.text+0x16b): undefined reference to `XInternAtom'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: ClientWin.c:(.text+0x1ae): undefined reference to `XGetWindowProperty'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: ClientWin.c:(.text+0x1c1): undefined reference to `XFree'
collect2: error: ld returned 1 exit status
configure:4782: $? = 1

libXmu has many other dependencies. here I think should use pkg-config to find these libraries when build the statically linked executable.

follwing config works for me:

./configure LIBS="$(pkg-config --libs xmu)"