about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2006-09-19 00:44:51 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2006-09-19 00:44:51 -0400
commit29b077007f10f28f8e16ec608e490c0fc28e183a (patch)
treeae46c1681a7f87d70165531ae9e17978e56b50ea /src
parent24a47fee30cfc3e2da82571f9c13c896a601a8df (diff)
downloadlynx-snapshots-29b077007f10f28f8e16ec608e490c0fc28e183a.tar.gz
snapshot of project "lynx", label v2-8-6pre_4
Diffstat (limited to 'src')
-rw-r--r--src/AttrList.h1
-rw-r--r--src/LYCurses.c147
-rw-r--r--src/LYGlobalDefs.h4
-rw-r--r--src/LYMain.c4
-rw-r--r--src/LYReadCFG.c72
-rw-r--r--src/LYReadCFG.h4
-rw-r--r--src/LYStyle.c3
-rw-r--r--src/LYrcFile.h1
-rw-r--r--src/descrip.mms126
9 files changed, 194 insertions, 168 deletions
diff --git a/src/AttrList.h b/src/AttrList.h
index b73babc7..5d4015d6 100644
--- a/src/AttrList.h
+++ b/src/AttrList.h
@@ -23,7 +23,6 @@ extern "C" {
 	DSTYLE_NORMAL,		/* default attributes */
 	DSTYLE_OPTION,		/* option on the option screen */
 	DSTYLE_VALUE,		/* value on the option screen */
-	DSTYLE_HIGH,
 	DSTYLE_CANDY,		/* possibly going to vanish */
 	DSTYLE_WHEREIS,		/* whereis search target */
 	DSTYLE_ELEMENTS
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 7f1c371a..dd7ef979 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -548,34 +548,9 @@ void curses_style(int style,
 
 static BOOL lynx_called_initscr = FALSE;
 
-#if defined(HAVE_USE_DEFAULT_COLORS) && defined(USE_DEFAULT_COLORS)
-/*
- * If we find a "default" color while reading the config-file, set default
- * colors on the screen.
- */
-int lynx_default_colors(void)
-{
-    int code = 0;
-
-    if (!default_color_reset) {
-	if (lynx_called_initscr) {
-	    code = -1;
-	    if (use_default_colors() == OK) {
-		default_fg = DEFAULT_COLOR;
-		default_bg = DEFAULT_COLOR;
-		code = 1;
-	    } else {
-		default_fg = COLOR_WHITE;
-		default_bg = COLOR_BLACK;
-		default_color_reset = TRUE;
-	    }
-	}
-    }
-    return code;
-}
-#endif /* HAVE_USE_DEFAULT_COLORS && USE_DEFAULT_COLORS */
-
 #if defined(USE_COLOR_TABLE) && defined(COLOR_CURSES)
+#define COLOR_CFG_MAX 8
+
 /*
  * This block of code is designed to produce the same color effects using SVr4
  * curses as the slang library's implementation in this module.  That maps the
@@ -585,27 +560,30 @@ int lynx_default_colors(void)
  * 1997/1/19 - T.E.Dickey <dickey@clark.net>
  */
 /* *INDENT-OFF* */
+#define COLOR_CFG(c) c, (c) == DEFAULT_COLOR
 static struct {
-    int fg, bg;
+    int fg, dft_fg, bg, dft_bg;
 } lynx_color_cfg[] = {
-    /*0*/ { DEFAULT_FG,    DEFAULT_BG},
-    /*1*/ { COLOR_BLUE,    DEFAULT_BG},
-    /*2*/ { COLOR_YELLOW+8,COLOR_BLUE},
-    /*3*/ { COLOR_GREEN,   DEFAULT_BG},
-    /*4*/ { COLOR_MAGENTA, DEFAULT_BG},
-    /*5*/ { COLOR_BLUE,    DEFAULT_BG},
-    /*6*/ { COLOR_RED,	   DEFAULT_BG},
-    /*7*/ { COLOR_MAGENTA, COLOR_CYAN}
+    /*0*/ { COLOR_CFG(DEFAULT_FG),     COLOR_CFG(DEFAULT_BG)},
+    /*1*/ { COLOR_CFG(COLOR_BLUE),     COLOR_CFG(DEFAULT_BG)},
+    /*2*/ { COLOR_CFG(COLOR_YELLOW+8), COLOR_CFG(COLOR_BLUE)},
+    /*3*/ { COLOR_CFG(COLOR_GREEN),    COLOR_CFG(DEFAULT_BG)},
+    /*4*/ { COLOR_CFG(COLOR_MAGENTA),  COLOR_CFG(DEFAULT_BG)},
+    /*5*/ { COLOR_CFG(COLOR_BLUE),     COLOR_CFG(DEFAULT_BG)},
+    /*6*/ { COLOR_CFG(COLOR_RED),      COLOR_CFG(DEFAULT_BG)},
+    /*7*/ { COLOR_CFG(COLOR_MAGENTA),  COLOR_CFG(COLOR_CYAN)}
 };
 /* *INDENT-ON* */
 
+#define COLOR_PAIRS_MAX (COLOR_CFG_MAX * 3 + 1)
+
 /*
  * Hold the codes for color-pairs here until 'initscr()' is called.
  */
 static struct {
     int fg;
     int bg;
-} lynx_color_pairs[25];
+} lynx_color_pairs[COLOR_PAIRS_MAX];
 
 /*
  * If we find an exact match for the given default colors, force curses to use
@@ -642,7 +620,7 @@ static int lynx_color_cfg_attr(int code)
 {
     int result = A_NORMAL;
 
-    if (code >= 0 && code < 8) {
+    if (code >= 0 && code < COLOR_CFG_MAX) {
 	int fg = lynx_color_cfg[code].fg;
 
 	if (is_boldc(fg) && (fg & COLORS))
@@ -722,7 +700,8 @@ char *LYgetTableString(int code)
     if (fg == 0 && bg == 0) {
 	fg = COLOR_WHITE;
     }
-    CTRACE((tfp, "%#x -> %#x (mono %#x pair %d) fg=%d, bg=%d\n", mask, second, mono, pair, fg, bg));
+    CTRACE((tfp, "%#x -> %#x (mono %#x pair %d) fg=%d, bg=%d\n",
+	    mask, second, mono, pair, fg, bg));
     for (n = 0; n < TABLESIZE(Mono_Attrs); ++n) {
 	if ((Mono_Attrs[n].code & mono) != 0) {
 	    if (result != 0)
@@ -771,17 +750,18 @@ static void lynx_init_color_pair(int n)
 
 static void lynx_map_color(int n)
 {
+    int j;
+
     CTRACE((tfp, "lynx_map_color(%d)\n", n));
 
     if (n + 1 < (int) TABLESIZE(lynx_color_pairs)) {
-	lynx_color_pairs[n + 1].fg = lynx_color_cfg[n].fg;
-	lynx_color_pairs[n + 1].bg = lynx_color_cfg[n].bg;
-
-	lynx_color_pairs[n + 9].fg = lynx_color_cfg[n].fg;
-	lynx_color_pairs[n + 9].bg = lynx_color_cfg[0].bg;
+	for (j = n + 1; j < COLOR_PAIRS_MAX; j += COLOR_CFG_MAX) {
+	    lynx_color_pairs[j].fg = lynx_color_cfg[n].fg;
+	    lynx_color_pairs[j].bg = lynx_color_cfg[n].bg;
+	}
 
-	lynx_color_pairs[n + 17].fg = lynx_color_cfg[n].bg;
-	lynx_color_pairs[n + 17].bg = lynx_color_cfg[n].bg;
+	/* special case (does not apply to 3rd set) */
+	lynx_color_pairs[n + 1 + COLOR_CFG_MAX].bg = lynx_color_cfg[0].bg;
     }
 
     lynx_init_color_pair(n);
@@ -799,7 +779,7 @@ int lynx_chg_color(int color,
 
     if (fg == ERR_COLOR || bg == ERR_COLOR)
 	return -1;
-    if (color >= 0 && color < 8) {
+    if (color >= 0 && color < COLOR_CFG_MAX) {
 	lynx_color_cfg[color].fg = fg;
 	lynx_color_cfg[color].bg = bg;
 	lynx_map_color(color);
@@ -851,7 +831,17 @@ void lynx_setup_colors(void)
     int n;
 
     CTRACE((tfp, "lynx_setup_colors\n"));
-    for (n = 0; n < 8; n++)
+#ifdef USE_DEFAULT_COLORS
+    if (!LYuse_default_colors) {
+	for (n = 0; n < COLOR_CFG_MAX; n++) {
+	    if (lynx_color_cfg[n].dft_fg)
+		lynx_color_cfg[n].fg = COLOR_BLACK;
+	    if (lynx_color_cfg[n].dft_bg)
+		lynx_color_cfg[n].bg = COLOR_WHITE;
+	}
+    }
+#endif
+    for (n = 0; n < COLOR_CFG_MAX; n++)
 	lynx_map_color(n);
 }
 #endif /* USE_COLOR_TABLE */
@@ -1171,36 +1161,49 @@ void start_curses(void)
 #endif
 
 #ifdef USE_DEFAULT_COLORS
+	    if (LYuse_default_colors) {
 #if defined(EXP_ASSUMED_COLOR) && defined(USE_COLOR_TABLE)
-	    /*
-	     * Adjust the color mapping table to match the ASSUMED_COLOR
-	     * setting in lynx.cfg
-	     */
-	    if (assume_default_colors(default_fg, default_bg) != OK) {
-		default_fg = COLOR_WHITE;
-		default_bg = COLOR_BLACK;
-	    }
-	    CTRACE((tfp, "initializing default colors %d/%d\n",
-		    default_fg, default_bg));
-	    if (default_fg >= 0 || default_bg >= 0) {
-		unsigned n;
-
-		for (n = 0; n < TABLESIZE(lynx_color_cfg); n++) {
-		    if (default_fg >= 0 && lynx_color_cfg[n].fg < 0)
-			lynx_color_cfg[n].fg = default_fg;
-		    if (default_bg >= 0 && lynx_color_cfg[n].bg < 0)
-			lynx_color_cfg[n].bg = default_bg;
-		    CTRACE((tfp, "color_cfg[%u] = %d/%d\n", n,
-			    lynx_color_cfg[n].fg,
-			    lynx_color_cfg[n].bg));
+		/*
+		 * Adjust the color mapping table to match the ASSUMED_COLOR
+		 * setting in lynx.cfg
+		 */
+		if (assume_default_colors(default_fg, default_bg) != OK) {
+		    default_fg = COLOR_WHITE;
+		    default_bg = COLOR_BLACK;
+		}
+		CTRACE((tfp, "initializing default colors %d/%d\n",
+			default_fg, default_bg));
+		if (default_fg >= 0 || default_bg >= 0) {
+		    unsigned n;
+
+		    for (n = 0; n < TABLESIZE(lynx_color_cfg); n++) {
+			if (default_fg >= 0 && lynx_color_cfg[n].fg < 0)
+			    lynx_color_cfg[n].fg = default_fg;
+			if (default_bg >= 0 && lynx_color_cfg[n].bg < 0)
+			    lynx_color_cfg[n].bg = default_bg;
+			CTRACE((tfp, "color_cfg[%u] = %d/%d\n", n,
+				lynx_color_cfg[n].fg,
+				lynx_color_cfg[n].bg));
+		    }
+		    lynx_setup_colors();
 		}
-		lynx_setup_colors();
-	    }
 #else
 #if defined(HAVE_USE_DEFAULT_COLORS)
-	    lynx_default_colors();
+		if (!default_color_reset) {
+		    if (lynx_called_initscr) {
+			if (LYuse_default_colors && (use_default_colors() == OK)) {
+			    default_fg = DEFAULT_COLOR;
+			    default_bg = DEFAULT_COLOR;
+			} else {
+			    default_fg = COLOR_WHITE;
+			    default_bg = COLOR_BLACK;
+			    default_color_reset = TRUE;
+			}
+		    }
+		}
 #endif /* HAVE_USE_DEFAULT_COLORS */
 #endif /* EXP_ASSUMED_COLOR */
+	    }
 #endif /* USE_DEFAULT_COLORS */
 	}
 #endif /* USE_COLOR_STYLE || USE_COLOR_TABLE */
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index b1e19f66..a3ec2edf 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -577,6 +577,10 @@ extern "C" {
     extern char *lynx_lss_file;
 #endif
 
+#ifdef USE_DEFAULT_COLORS
+    extern BOOLEAN LYuse_default_colors;
+#endif
+
     extern int HTNoDataOK;	/* HT_NO_DATA-is-ok hack */
     extern BOOLEAN FileInitAlreadyDone;
 
diff --git a/src/LYMain.c b/src/LYMain.c
index 00c387e6..1f7699de 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -633,6 +633,10 @@ char *lynx_lss_file2 = NULL;	/* from command-line options */
 char *lynx_lss_file = NULL;	/* from config-file, etc. */
 #endif
 
+#ifdef USE_DEFAULT_COLORS
+BOOLEAN LYuse_default_colors = TRUE;
+#endif
+
 #ifdef __DJGPP__
 static void LY_set_ctrl_break(int setting)
 {
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 89fb9390..b34041e0 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -297,7 +297,7 @@ int check_color(char *color,
     CTRACE2(TRACE_STYLE, (tfp, "check_color(%s,%d)\n", color, the_default));
     if (!strcasecomp(color, "default")) {
 #ifdef USE_DEFAULT_COLORS
-	if (!default_color_reset)
+	if (LYuse_default_colors && !default_color_reset)
 	    the_default = DEFAULT_COLOR;
 #endif /* USE_DEFAULT_COLORS */
 	CTRACE2(TRACE_STYLE, (tfp, "=> default %d\n", the_default));
@@ -510,32 +510,37 @@ static int assumed_color_fun(char *buffer)
     char *fg = buffer, *bg;
     char *temp = 0;
 
-    StrAllocCopy(temp, buffer);	/* save a copy, for error messages */
+    if (LYuse_default_colors) {
+	StrAllocCopy(temp, buffer);	/* save a copy, for error messages */
 
-    /*
-     * We are expecting a line of the form:
-     *    FOREGROUND:BACKGROUND
-     */
-    if (NULL == (bg = find_colon(fg)))
-	exit_with_color_syntax(temp);
-    *bg++ = '\0';
+	/*
+	 * We are expecting a line of the form:
+	 *    FOREGROUND:BACKGROUND
+	 */
+	if (NULL == (bg = find_colon(fg)))
+	    exit_with_color_syntax(temp);
+	*bg++ = '\0';
 
-    default_fg = check_color(fg, default_fg);
-    default_bg = check_color(bg, default_bg);
+	default_fg = check_color(fg, default_fg);
+	default_bg = check_color(bg, default_bg);
 
-    if (default_fg == ERR_COLOR
-	|| default_bg == ERR_COLOR)
-	exit_with_color_syntax(temp);
+	if (default_fg == ERR_COLOR
+	    || default_bg == ERR_COLOR)
+	    exit_with_color_syntax(temp);
 #ifdef USE_SLANG
-    /*
-     * Sorry - the order of initialization of slang precludes setting the
-     * default colors from the lynx.cfg file, since slang is already
-     * initialized before the file is read, and there is no interface defined
-     * for setting it from the application (that's one of the problems with
-     * using environment variables rather than a programmable interface) -TD
-     */
+	/*
+	 * Sorry - the order of initialization of slang precludes setting the
+	 * default colors from the lynx.cfg file, since slang is already
+	 * initialized before the file is read, and there is no interface
+	 * defined for setting it from the application (that's one of the
+	 * problems with using environment variables rather than a programmable
+	 * interface) -TD
+	 */
 #endif
-    FREE(temp);
+	FREE(temp);
+    } else {
+	CTRACE((tfp, "...ignored since DEFAULT_COLORS:off\n"));
+    }
     return 0;
 }
 #endif /* EXP_ASSUMED_COLOR */
@@ -548,6 +553,26 @@ static int color_fun(char *value)
 }
 #endif
 
+#ifdef USE_DEFAULT_COLORS
+static int default_colors_fun(char *value)
+{
+    LYuse_default_colors = is_true(value);
+    if (LYuse_default_colors) {
+	default_fg = DEFAULT_COLOR;
+	default_bg = DEFAULT_COLOR;
+    } else {
+	default_color_reset = TRUE;
+	if (default_fg == DEFAULT_COLOR ||
+	    default_bg == DEFAULT_COLOR) {
+	    default_fg = COLOR_WHITE;
+	    default_bg = COLOR_BLACK;
+	    lynx_setup_colors();
+	}
+    }
+    return 0;
+}
+#endif
+
 static int default_bookmark_file_fun(char *value)
 {
     set_default_bookmark_page(value);
@@ -1282,6 +1307,9 @@ static Config_Type Config_Table [] =
      PARSE_TIM(RC_DELAYSECS,            DebugSecs),
      PARSE_FUN(RC_DEFAULT_BOOKMARK_FILE, default_bookmark_file_fun),
      PARSE_FUN(RC_DEFAULT_CACHE_SIZE,   default_cache_size_fun),
+#ifdef USE_DEFAULT_COLORS
+     PARSE_FUN(RC_DEFAULT_COLORS,       default_colors_fun),
+#endif
      PARSE_FUN(RC_DEFAULT_EDITOR,       default_editor_fun),
      PARSE_STR(RC_DEFAULT_INDEX_FILE,   indexfile),
      PARSE_ENU(RC_DEFAULT_KEYPAD_MODE,  keypad_mode, tbl_keypad_mode),
diff --git a/src/LYReadCFG.h b/src/LYReadCFG.h
index bbdcf5c3..cd02a107 100644
--- a/src/LYReadCFG.h
+++ b/src/LYReadCFG.h
@@ -41,10 +41,6 @@ extern "C" {
     extern int default_bg;
     extern BOOL default_color_reset;
 
-#if defined(HAVE_USE_DEFAULT_COLORS) && defined(USE_DEFAULT_COLORS)
-    extern int lynx_default_colors(void);
-#endif
-
     extern int check_color(char *color, int the_default);
     extern const char *lookup_color(int code);
 #endif
diff --git a/src/LYStyle.c b/src/LYStyle.c
index a8ac9379..838146e4 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,6 +1,6 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.61 Thu, 31 Aug 2006 16:37:53 -0700 dickey @
+ * @Id: LYStyle.c 1.62 Mon, 18 Sep 2006 17:28:28 -0700 dickey @
  */
 #include <HTUtils.h>
 #include <HTML.h>
@@ -251,7 +251,6 @@ static void parse_style(char *param)
 	{ "status",		DSTYLE_STATUS,		0 }, /* status bar */
 	{ "label",		DSTYLE_OPTION,		0 }, /* [INLINE]'s */
 	{ "value",		DSTYLE_VALUE,		0 }, /* [INLINE]'s */
-	{ "high",		DSTYLE_HIGH,		0 }, /* [INLINE]'s */
 	{ "normal",		DSTYLE_NORMAL,		0 },
 	{ "candy",		DSTYLE_CANDY,		0 }, /* [INLINE]'s */
 	{ "whereis",		DSTYLE_WHEREIS,		&s_whereis },
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index 43e29631..5da0e1bb 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -49,6 +49,7 @@
 #define RC_CSWING_PATH                  "cswing_path"
 #define RC_DEFAULT_BOOKMARK_FILE        "default_bookmark_file"
 #define RC_DEFAULT_CACHE_SIZE           "default_cache_size"
+#define RC_DEFAULT_COLORS               "default_colors"
 #define RC_DEFAULT_EDITOR               "default_editor"
 #define RC_DEFAULT_INDEX_FILE           "default_index_file"
 #define RC_DEFAULT_KEYPAD_MODE          "default_keypad_mode"
diff --git a/src/descrip.mms b/src/descrip.mms
index 2f8def50..3fc03ff2 100644
--- a/src/descrip.mms
+++ b/src/descrip.mms
@@ -25,6 +25,7 @@
 !  07/29/95 FM Added support for GNUC.
 !  02/29/96 FM Added LYMap.
 !  06/28/97 FM Added UCAuto, UCAux, and UCdomap.
+!  15 Sep 06 (TD)	Cleanup...
 !
 ! Instructions:
 !       Use the correct command line for your TCP/IP implementation:
@@ -65,97 +66,88 @@ OBJS =	DefaultStyle.obj, GridText.obj, HTAlert.obj, HTFWriter.obj, -
 	LYUpload.obj, LYUtils.obj, LYexit.obj, LYrcFile.obj, TRSTable.obj, -
 	UCAuto.obj, UCAux.obj, UCdomap.obj
 
-.ifdef WIN_TCP
-TCP = WIN_TCP
-TCPOPT = WIN_TCP
+.ifdef SLANG
+SCREEN_DEF = USE_SLANG
+SCREEN_INC = , SLANG_INC 
+SCREEN_LIB = , SLANG_LIB:slang.olb/lib
+.else
 .ifdef DEC_C
-CDEF = __VMS_CURSES
+SCREEN_DEF = __VMS_CURSES
 .endif
 .endif
 
-.ifdef CMU_TCP
-TCP = CMU_TCP
-TCPOPT = CMU_TCP
 .ifdef DEC_C
-CDEF = __VMS_CURSES
+COMPILER = DECC
+MODEL_DEF = _DECC_V4_SOURCE
+.else
+MODEL_DEF =
+.ifdef GNU_C
+COMPILER = GNUC
+CC = gcc
+.else
+COMPILER = VAXC
 .endif
 .endif
 
+.ifdef WIN_TCP
+NETWORK_DEF = WIN_TCP
+NETWORK_OPT = WIN_TCP
+.else
+.ifdef CMU_TCP
+NETWORK_DEF = CMU_TCP
+NETWORK_OPT = CMU_TCP
+.else
 .ifdef SOCKETSHR_TCP
-TCP = SOCKETSHR_TCP
-TCPOPT = SOCKETSHR_TCP
-.ifdef DEC_C
-CDEF = _DECC_V4_SOURCE,__VMS_CURSES
-.endif
-.endif
-
+NETWORK_DEF = SOCKETSHR_TCP
+NETWORK_OPT = SOCKETSHR_TCP
+.else
 .ifdef UCX
-TCP = UCX
+NETWORK_DEF = UCX
 .ifdef DEC_C
-TCPOPT = UCXSHR
-CDEF = __VMS_CURSES
+NETWORK_OPT = UCXSHR
 .else
-TCPOPT = UCXOLB
-.endif
+NETWORK_OPT = UCXOLB
 .endif
-
+.else
 .ifdef TCPWARE
-TCP = TCPWARE
+NETWORK_DEF = TCPWARE,UCX
 .ifdef DEC_C
-TCTOPT= TCPWARESHR
-CDEF = __VMS_CURSES
+NETWORK_OPT = TCPWARESHR
 .else
-TCTOPT= TCPWAREOLB
-.endif
+NETWORK_OPT = TCPWAREOLB
 .endif
-
-.ifdef MULTINET
-TCP = MULTINET
-TCPOPT = MULTINET
-.ifdef DEC_C
-CDEF = _DECC_V4_SOURCE,__SOCKET_TYPEDEFS,__VMS_CURSES
-.endif
-.endif
-
-.ifdef DECnet
-TCP = DECNET
-TCPOPT = DECNET
-.endif
-
-.ifdef TCP
 .else
-TCP = MULTINET
-TCPOPT = MULTINET
-.ifdef DEC_C
-CDEF = _DECC_V4_SOURCE,__SOCKET_TYPEDEFS,__VMS_CURSES
-.endif
-.endif
+.ifdef DECnet
+NETWORK_DEF = DECNET
+NETWORK_OPT = DECNET
+.else !  Default to MultiNet
+NETWORK_DEF = MULTINET,__SOCKET_TYPEDEFS
+NETWORK_OPT = MULTINET
+.endif !  DECnet
+.endif !  TCPWARE
+.endif !  UCX
+.endif !  SOCKETSHR_TCP
+.endif !  CMU_TCP
+.endif !  WIN_TCP
+
+COMPILER_DEF = $(MODEL_DEF),$(NETWORK_DEF),$(SCREEN_DEF)
 
 .ifdef DEC_C
-COMPILER = DECC
-.ifdef TCPWARE
-TCPFLAGS = /decc/Prefix=All/NoMember/Define=(ACCESS_AUTH,$(TCP),UCX,$(CDEF))
+MY_CFLAGS = /decc/Prefix=All/NoMember/Define=(ACCESS_AUTH,$(COMPILER_DEF))
 .else
-TCPFLAGS = /decc/Prefix=All/NoMember/Define=(ACCESS_AUTH,$(TCP),$(CDEF))
+MY_CFLAGS = /Define = (ACCESS_AUTH, $(COMPILER_DEF))
 .endif
+
+.if "$(MMS_ARCHNAME)" .eq "IA64"
+TOPT = 
+COPT = 
 .else
-.ifdef GNU_C
-COMPILER = GNUC
-CC = gcc
-.else
-COMPILER = VAXC
-.endif
-.ifdef TCPWARE
-TCPFLAGS = /Define = (ACCESS_AUTH, $(TCP), UCX)
-.else
-TCPFLAGS = /Define = (ACCESS_AUTH, $(TCP))
-.endif
+TOPT = ,sys$disk:[]$(NETWORK_OPT).opt/opt
+COPT = ,sys$disk:[]$(COMPILER).opt/opt
 .endif
 
-TOPT = sys$disk:[]$(TCPOPT).opt
-COPT = sys$disk:[]$(COMPILER).opt
-WWWLIB = [-.WWW.Library.Implementation]WWWLib_$(TCP).olb
-CFLAGS = $(TCPFLAGS) $(CFLAGS)/Include=([], [-], [.chrtrans], [-.WWW.Library.Implementation])
+WWWLIB = [-.WWW.Library.Implementation]WWWLib.olb
+CFLAGS = $(MY_CFLAGS) $(CFLAGS)/Include=([], [-], [.chrtrans], [-.WWW.Library.Implementation]$(SCREEN_INC))
 
 
 lynx :	lynx.exe
@@ -164,7 +156,7 @@ lynx :	lynx.exe
 HDRS = [.chrtrans]iso01_uni.h
 
 lynx.exe :   $(HDRS) $(OBJS) $(WWWLIB)
-	$(LINK) /Executable = Lynx.exe $(OBJS), $(WWWLIB)/lib, $(TOPT)/opt, $(COPT)/opt
+	$(LINK) /Executable = Lynx.exe $(OBJS), $(WWWLIB)/lib $(SCREEN_LIB) $(TOPT) $(COPT)
 
 $(HDRS) :
 	set default [.chrtrans]