This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do I build the non-X version of rxvt.exe?

Igor Pechtchanski wrote:

> Short answer: unset your DISPLAY.
> Long answer: rxvt is compiled with support for both X11 and W11 (which is
> rxvt's emulation of X on native Windows).  At runtime, it checks whether X
> is running, and if it isn't (DISPLAY is unset), rxvt loads and uses the
> W11 library.


Thanks, but that did not solve the problem.  I found the code that makes
that decision in function XOpenDisplay() in rxvt/W11/wrap/wrap.c:

Display * XOpenDisplay(const char *name) {
    ATOM class;
    char *env_var=NULL;
    if (_libname==NULL)
	env_var = getenv("W11_LIBRARY");
	if (env_var!=NULL) _libname = strdup(env_var);
	else if (name==NULL || !strcmp(name,":0")) {
	    class = _register_window_class();
	    func_W11AddEventHandler=(proto_W11AddEventHandler *)_loadfunc("W11AddEventHandler");
	else _libname="libX11";

But that function does not seem to be linked into the executable:

	bash$ strings -a src/rxvt.exe | grep W11_LIBRARY

wrap.c is compiled and built into W11/lib/libX11.a, but for some reason
that library isn't linked into the executable, so the above
implementation of XOpenDisplay() isn't being used.  Here are some
relevant excerpts from the build:

	gcc -O -c wrap.c -I.. -mwin32
	windres -i rxvt.rc -o rxvt_res.o
	ar r ../lib/libX11.a wrap.o rxvt_res.o
	/bin/sh ../libtool --mode=link gcc -g -O2   rxvt.o  -L/usr/X11R6/lib -Wl,-rpath -Wl,/usr/X11R6/lib  -lX11   -o rxvt
	gcc -g -O2 rxvt.o -Wl,-rpath -Wl,/usr/X11R6/lib -o rxvt  ./.libs/librxvt.a -L/usr/X11R6/lib -lX11

Here's the exact sequence of commands I'm using:

	bzcat rxvt-2.7.10-3-src.tar.bz2 | tar xvf -
	cd rxvt
	./configure --prefix=/usr/local
	unset DISPLAY
	env | grep DISPLAY	# To verify previous command.

Then there's a pause for six or seven seconds, and I see:

	rxvt: can't open display :0

Am I configuring the source incorrectly?  Any help is appreciated.
Francis Litterio
GPG and PGP public keys available on keyservers.

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]