Sunday, July 28, 2013

compiling gvim statically

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define UNIX 1
#define STDC_HEADERS 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_SELINUX 1
#define FEAT_HUGE 1
#define USE_XSMP_INTERACT 1
#define HAVE_LIBNSL 1
#define FEAT_NETBEANS_INTG 1
/* end confdefs.h. */
#include <X11/Xlib.h>
int
main ()
{
XrmInitialize ()
;
return 0;
}
I am trying to compile a static version of gvim on a machine running a combination of Debian GNU/Linux Squeeze and Wheezy.

I installed all the dependencies using
root@hogwarts:~# apt-get build-dep vim-gnome

I downloaded the vim-7.3.tar.bz2 from ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 and untarred the file. I configured it with

rajulocal@hogwarts:~/compile_static_gvim_native/vim73$ LDFLAGS="-static" ./configure --with-features=huge --enable-gui=gnome2 2>&1 | tee ../configure_trial2_20130728.log

The log file (attached below) shows that the configure script does not pick up the GUI stuff.

checking for X... no
checking if X11 header files can be found... yes
checking --enable-gui argument... no GUI support

digging into the vim73/src/auto/config.log (attached) shows

configure:6547: checking for X
configure:6655: gcc -E  -I/usr/local/include conftest.c
configure:6655: $? = 0
configure:6686: gcc -o conftest -g -O2  -I/usr/local/include -static -L/usr/local/lib conftest.c -lX11 -lnsl  -lselinux >&5
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xim_trans.o): In function `_XimXTransSocketUNIXConnect':
(.text+0xe12): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `require_socket':
(.text+0x652): undefined reference to `xcb_take_socket'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `poll_for_event':
(.text+0x7d4): undefined reference to `xcb_poll_for_event'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `poll_for_response':
(.text+0x8c2): undefined reference to `xcb_poll_for_reply'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XSend':
(.text+0xada): undefined reference to `xcb_writev'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XReadEvents':
(.text+0xc38): undefined reference to `xcb_connection_has_error'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XReadEvents':
(.text+0xcd4): undefined reference to `xcb_wait_for_event'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XEventsQueued':
(.text+0xdfd): undefined reference to `xcb_connection_has_error'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XAllocIDs':
(.text+0xedb): undefined reference to `xcb_generate_id'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_io.o): In function `_XReply':
(.text+0x1045): undefined reference to `xcb_wait_for_reply'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(ClDisplay.o): In function `XCloseDisplay':
(.text+0xd3): undefined reference to `xcb_disconnect'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(OpenDis.o): In function `OutOfMemory':
(.text+0x4d4): undefined reference to `xcb_disconnect'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0x8fd): undefined reference to `xcb_get_setup'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0xb41): undefined reference to `xcb_get_maximum_request_length'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x1ac): undefined reference to `xcb_parse_display'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x206): undefined reference to `xcb_connect_to_display_with_auth_info'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x226): undefined reference to `xcb_get_file_descriptor'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x243): undefined reference to `xcb_generate_id'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x29c): undefined reference to `pthread_cond_init'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x2ae): undefined reference to `pthread_cond_init'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x2b6): undefined reference to `xcb_connection_has_error'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x2d6): undefined reference to `xcb_connect'
collect2: error: ld returned 1 exit status
configure:6686: $? = 1


However, the above gcc command succeeds if "-static" is removed from the command line. But then I would not be able to build a statically linked binary.

So for example, the following succeeds
gcc -o conftest -g -O2  -I/usr/local/include -L/usr/local/lib conftest.c -lX11 -lnsl  -lselinux

while
gcc -o conftest -g -O2  -I/usr/local/include -static -L/usr/local/lib conftest.c -lX11 -lnsl  -lselinux
fails.

So my question is how does one build a statically linked  gvim?

raju

--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
 
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: