This is the mail archive of the cygwin@cygwin.com 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.

Igor,

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")) {
	    _libname="libW11";
	    class = _register_window_class();
	    _set_atom(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
	bash$

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 librxvt.la  -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
	make
	unset DISPLAY
	env | grep DISPLAY	# To verify previous command.
	src/rxvt.exe

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
franl@world.std.com
http://world.std.com/~franl/
GPG and PGP public keys available on keyservers.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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