Subject: Re: color
To: Tom T. Thai <tomthai@future.net>
From: Brian C. Grayson <bgrayson@ece.utexas.edu>
List: current-users
Date: 11/06/1997 13:08:16
Tom T. Thai wrote:
> 
> for some reason, I can't compile any program like lynx, dmsh, etc.. to
> correctly show bold, underline, reverse, etc on NetBSD1.2g. I've tested
> this on Suns and all the rendering are correct under SunOS but not NetBSD.

  Just a few hours ago, I installed lynx2-7-1, and it works on
-i386 for me with ``lynx -color.''  I'm not familiar with dmsh,
but with lynx I had to (from memory, so I may be missing a thing or two):

  1.  Download and install the slang library, which is what lynx
      needs to do colorization.  Did you do this already?  I
      threw it all into /usr/local (/usr/local/include,
      /usr/local/lib, etc.)

  2.  Edit the Makefile for lynx so that it defined -DUSE_SLANG
      and the various SLANG* variables.  Also, tweak it so that
      ``make netbsd'' doesn't link with -lcurses, and links
      with all the SLANG* stuff.  Notice that if the source
      tree for lynx is in foo/lynx2-7-1, and the slang source
      tree is in foo/slang, then the SLANG variables should
      have ../.. as documented, because they will be performed
      from foo/lynx2-7-1/src.

      (I really should have made a netbsd-slang target, but I
      was lazy.)

  3.  Now, a ``make netbsd'' in the lynx source tree should
      work.  Note that you need to use lynx -color to start up
      with coloring, and of course under X you need to have
      your xterm's color capabilities enabled.

  Neither of these is in /usr/pkgsrc yet, but both compiled relatively
easily for me.  For some reason, lynx/slang's idea of white is
really gray when used as a background, which is annoying to
me -- if I want a white background, I want a white background!  I
tried changing the colors in lynx.cfg, but with no success --
white is still being mapped to gray.

  Here's a diff of the top-level lynx Makefile:

--- Makefile.dist       Thu Nov  6 10:34:03 1997
+++ Makefile    Thu Nov  6 11:07:20 1997
@@ -77,6 +77,9 @@
 #SLANGINC = -I../../slang/src#              location of slang.h and slcurses.h
 #SLANGLIB = -L../../slang/src/$(ARCH)objs#  location of libslang.a
 #SLANGRRLIB = -R../../slang/src/$(ARCH)objs# for solaris
+SLANGINC = -I../../slang/src#              location of slang.h and slcurses.h
+SLANGLIB = -L../../slang/src/objs#  location of libslang.a
+SLANGRRLIB = -R../../slang/src/objs# for solaris
 
 # !!!!!!!!!!! Lynx Local Directory Listing Formats !!!!!!!!!!!!!!!!!!!!!!!!!!!
 # Lynx supports "ls -l" format for local directory listings on Unix if the
@@ -271,7 +274,7 @@
 SITE_LYDEFS = $(DIR_LYDEFS) # Your defines here
 
 # Set SITE_DEFS to one or more of the defines for lynx below:
-SITE_DEFS = $(DIR_DEFS) # Your defines here
+SITE_DEFS = -DUSE_SLANG $(DIR_DEFS) # Your defines here
 
 # if you are compiling on a previously unsupported system, modify
 # this generic entry!!
@@ -432,8 +435,10 @@
        cd WWW/Library/netbsd; $(MAKE) LYFLAGS="$(SITE_LYDEFS)"
        cd src; $(MAKE) all CC="cc" MCFLAGS="-O -DUNIX -DNO_KEYPAD -DNO_CUSERID \
                -I../$(WWWINC) $(SITE_DEFS)" \
-               LIBS="-lcurses -ltermcap \
+               LIBS="-ltermcap \
                $(WAISLIB) $(SOCKSLIB) $(SITE_LIBS)" \
+               SLANGLIB="$(SLANGLIB) -lslang -ltermcap -lm" \
+               SLANGINC="$(SLANGINC)" \
                WWWLIB="../WWW/Library/netbsd/libwww.a"
 
 # NetBSD doesn't have or need ranlib. (ignore the error message about that :)

-------  End of diff

  I hope this helps.  Have fun!
-- 
Brian Grayson (bgrayson@ece.utexas.edu)
Graduate Student, Electrical and Computer Engineering
The University of Texas at Austin
Office:  ENS 406       (512) 471-8011
Finger bgrayson@orac.ece.utexas.edu for PGP key.