Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Sat, 3 May 2003 16:06:37 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin@cygwin.com To: Francis Litterio cc: cygwin@cygwin.com Subject: Re: How do I build the non-X version of rxvt.exe? In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 3 May 2003, Francis Litterio wrote: > 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 Francis, IIRC, the W11 library is built as a DLL (libW11.dll), so you won't find the string W11_LIBRARY in rxvt.exe. For rxvt to find the DLL, it has to either be in your path, or in the same directory as rxvt.exe. It's quite possible that if rxvt doesn't find this DLL it reverts to X11 code. Try copying libW11.dll from wherever it's built to src/ and running rxvt.exe again with DISPLAY unset. After "make install" both rxvt.exe and libW11.dll go into $prefix/bin, so this is not a problem. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Knowledge is an unending adventure at the edge of uncertainty. -- Leto II -- 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/