delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/03/14:41:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Francis Litterio <franl AT world DOT std DOT com>
Subject: Re: How do I build the non-X version of rxvt.exe?
Date: Sat, 03 May 2003 12:32:02 -0400
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0305031020530 DOT 25128-100000 AT slinky DOT cs DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.44.0305031020530.25128-100000@slinky.cs.nyu.edu> (Igor
Pechtchanski's message of "Sat, 3 May 2003 10:22:34 -0400 (EDT)")
Message-ID: <u1xzf98kr.fsf@world.std.com>
Lines: 69
User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2
(i386-msvc-nt5.0.2195)
MIME-Version: 1.0

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 AT world DOT std DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019