lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling MingW lynx under Cygwin (was Re: [Lynx-dev] text browsing) (LO


From: Doug Kaufman
Subject: Compiling MingW lynx under Cygwin (was Re: [Lynx-dev] text browsing) (LONG)
Date: Sun, 30 Jul 2006 00:24:20 -0700 (PDT)

On Sat, 29 Jul 2006 address@hidden wrote:

> May I ask you the concrete steps to compile Lynx under Cygwin with 
> -mno-cygwin?  Do you mean running configure & make on Cygwin bash?

OK. I went back through my notes and patches and did some more testing.
Here is a step-by-step guide to building a statically compiled lynx
under Cygwin which will not be dependent on the cygwin dll (i.e. a MingW
binary). There were a lot of patches, so this is long, but with all the
details it should avoid the need for multiple followup questions. Let me
know if anything isn't clear or if it doesn't work as claimed on your
machine. 
                       Doug



                 Compiling lynx for MingW under Cygwin

This post will try to outline how I built Windows lynx for MingW,
using the -mno-cygwin directive under Cygwin. I haven't looked
carefully at each of the steps to see whether or not it is important
for a successful build. Please remember that I am not a programmer,
so not all of the changes that I made may be appropriate. Before
beginning to try this, I would suggest reading Mumit Khan's paper
on how to use -mno-cygwin. Unfortunately, his web page about
MingW appears to have disappeared from the net. A copy of the
HOWTO has been saved and is available from DJ Delorie's web site
at "http://www.delorie.com/howto/cygwin/mno-cygwin-howto.html";.
Note that using -mno-cygwin turns off scanning of /usr/include
and /usr/local/include in favor of /usr/include/mingw and
/usr/local/include/mingw.

This assumes that you have an install of Cygwin, including all the usual
utilities, and with installation of the mingw modules. When I built
my mingw programs, I frequently did so with $prefix=/mingw, so some
includes and libraries are installed in /mingw/include and /mingw/lib
rather than in /usr/include/mingw, /usr/local/include/mingw, etc., so
appropriate paths have to be specified when compiling to be sure that
the mingw files are found, rather than the cygwin files.

The general plan is as follows: 
1. Compile and install MingW PDCurses 2.8
2. Compile and install MingW OpenSSL 0.9.8 stable branch
3. Compile and install MingW iconv
4. Compile and install MingW gettext 
5. Patch Cygwin autoconf to comply with Tom Dickey's patches. Note that
   standard autoconf will fail with the lynx configure.in script.
6. Patch aclocal.m4 for DOS/Windows compatibility
7. Run autoconf to regenerate configure
8. Run configure with the appropriate options to generate the makefiles
9. If desired, compile a lynx icon into a coff file with windres and
   modify the src/makefile to include the icon file in the lynx binary
10. Run make to generate lynx and make install-full to install
11. Optionally compress the lynx binary with upx

The details:


1. Compile and install MingW PDCurses 2.8

I applied this patch before compiling:

--- pdcurses28/win32/mingwin32.mak.ori  2005-12-29 18:49:20.000000000 -0800
+++ pdcurses28/win32/mingwin32.mak      2006-01-27 11:49:44.000000000 -0800
@@ -34,11 +34,11 @@
 CC             = gcc
 
 ifeq ($(DEBUG),Y)
-       CFLAGS  = -c -g -Wall -DPDCDEBUG -D_NO_OLDNAMES
-       LDFLAGS = -g
+       CFLAGS  = -c -g -Wall -W -O3 -mno-cygwin -DPDCDEBUG -D_NO_OLDNAMES
+       LDFLAGS = -g -mno-cygwin
 else
-       CFLAGS  = -c -O -Wall -D_NO_OLDNAMES
-       LDFLAGS =
+       CFLAGS  = -c -Wall -W -O3 -mno-cygwin -D_NO_OLDNAMES
+       LDFLAGS = -mno-cygwin
 endif
 
 CPPFLAGS       = -I$(PDCURSES_HOME)
@@ -53,8 +53,8 @@
 LIBEXE         = ar
 LIBFLAGS               =rcv
 
-LIBCURSES      = pdcurses.a
-LIBPANEL       = panel.a
+LIBCURSES      = libcurses.a
+LIBPANEL       = libpanel.a
 
 PDCLIBS        = $(LIBCURSES) $(LIBPANEL)
 DEMOS  =testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe ptest.exe
@@ -63,9 +63,9 @@
 all:   $(PDCLIBS) $(DEMOS)
 
 clean:
-       -del *.o
-       -del *.a
-       -del *.exe
+       -rm -f *.o
+       -rm -f *.a
+       -rm -f *.exe
 
 demos: $(DEMOS)
 
@@ -126,11 +126,11 @@
 PANOBJS =     \
 panel.o
 
-pdcurses.a : $(LIBOBJS) $(PDCOBJS)
+$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
        $(LIBEXE) $(LIBFLAGS) $@ *.o
        $(LIBEXE) d $@ $(PANOBJS) firework.o newdemo.o ptest.o testcurs.o tui.o 
tuidemo.o xmas.o
 
-panel.a : $(PANOBJS)
+$(LIBPANEL) : $(PANOBJS)
        $(LIBEXE) $(LIBFLAGS) $@ $(PANOBJS)
 
 addch.o: $(srcdir)/addch.c $(PDCURSES_HEADERS)
@@ -338,4 +338,4 @@
        $(PDCURSES_HOME)\curses.h $(PDCURSES_HOME)\curspriv.h \
        $(PDCURSES_HOME)\panel.h $(PDCURSES_HOME)\term.h \
        $(LIBCURSES) $(LIBPANEL) file_id.diz
-       del file_id.diz
+       rm -f file_id.diz
--- pdcurses28/win32/pdcsetsc.c.ori     2001-01-09 23:30:54.000000000 -0800
+++ pdcurses28/win32/pdcsetsc.c 2003-09-13 23:34:52.000000000 -0700
@@ -220,11 +220,11 @@
                        break;
                case 2:                 /* highly visible */
                        cci.bVisible = TRUE;
-                       cci.dwSize = 95;
+                       cci.dwSize = 50;
                        break;
                default:                /* normal visibility */
                        cci.bVisible = TRUE;
-                       cci.dwSize = 25;
+                       cci.dwSize = 10;
                        break;
        }
 

After compiling, install by copying libpanel.a and libcurses.a to
/mingw/lib and by copying curses.h and curspriv.h to /mingw/include.


2. Compile and install MingW OpenSSL 0.9.8 stable branch

I applied this patch before compiling:

--- crypto/dso/dso_win32.c.ori  2005-06-27 14:21:12.000000000 -0800
+++ crypto/dso/dso_win32.c      2005-07-08 22:23:02.000000000 -0800
@@ -306,8 +306,8 @@
        memset(result, 0, sizeof(struct file_st));
        position = IN_DEVICE;
 
-       if(filename[0] == '\\' && filename[1] == '\\'
-               || filename[0] == '/' && filename[1] == '/')
+       if((filename[0] == '\\' && filename[1] == '\\')
+               || (filename[0] == '/' && filename[1] == '/'))
                {
                position = IN_NODE;
                filename += 2;
--- crypto/engine/eng_padlock.c.ori     2005-05-31 10:56:18.000000000 -0800
+++ crypto/engine/eng_padlock.c 2005-07-07 23:30:28.000000000 -0800
@@ -127,6 +127,9 @@
 # define alloca _alloca
 #else
 # include <stdlib.h>
+#ifdef __MINGW32__
+# include <malloc.h>
+#endif
 #endif
 
 /* Function for ENGINE detection and control */
--- crypto/LPdir_win.c.ori      2004-09-23 15:11:40.000000000 -0800
+++ crypto/LPdir_win.c  2005-07-08 22:37:10.000000000 -0800
@@ -54,7 +54,6 @@
 
 const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
 {
-  struct dirent *direntry = NULL;
 
   if (ctx == NULL || directory == NULL)
     {
--- engines/e_aep.c.ori 2005-06-17 14:27:28.000000000 -0800
+++ engines/e_aep.c     2005-07-08 22:27:32.000000000 -0800
@@ -57,7 +57,7 @@
 #include <string.h>
 
 #include <openssl/e_os2.h>
-#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
+#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__) || defined(__MINGW32__)
 #include <sys/types.h>
 #include <unistd.h>
 #else


I compiled using this shell script:

#!/bin/sh
./Configure no-shared no-idea --prefix=d\:/cygwin/mingw mingw >err 2>&1 && \
make depend >err1 2>&1 && \
make >err2 2>&1 && \
make test >err3 2>&1 && \
make install >err4 2>&1



3. Compile and install MingW iconv

I used libiconv 1.8.
I applied this patch:

--- libiconv-1.8/libcharset/lib/config.charset.ori      2003-01-31 
12:08:02.000000000 -0800
+++ libiconv-1.8/libcharset/lib/config.charset  2006-07-29 11:56:52.000000000 
-0700
@@ -463,4 +463,164 @@
        echo "eo CP850"
        echo "eo_EO CP850"
        ;;
+    mingw*)
+       echo "#"
+       echo "# The encodings given here may not all be correct."
+       echo "# If you find that the encoding given for your language and"
+       echo "# country is not the one your DOS machine actually uses, just"
+       echo "# correct it in this file, and send a mail to"
+       echo "# Juan Manuel Guerrero <address@hidden>"
+       echo "# and Bruno Haible <address@hidden>."
+       echo "#"
+       echo "C ASCII"
+       # ISO-8859-1 languages
+       echo "ca CP850"
+       echo "ca_ES CP850"
+       echo "da CP865"    # not CP850 ??
+       echo "da_DK CP865" # not CP850 ??
+       echo "de CP850"
+       echo "de_AT CP850"
+       echo "de_CH CP850"
+       echo "de_DE CP850"
+       echo "en CP850"
+       echo "en_AU CP850" # not CP437 ??
+       echo "en_CA CP850"
+       echo "en_GB CP850"
+       echo "en_NZ CP437"
+       echo "en_US CP437"
+       echo "en_ZA CP850" # not CP437 ??
+       echo "es CP850"
+       echo "es_AR CP850"
+       echo "es_BO CP850"
+       echo "es_CL CP850"
+       echo "es_CO CP850"
+       echo "es_CR CP850"
+       echo "es_CU CP850"
+       echo "es_DO CP850"
+       echo "es_EC CP850"
+       echo "es_ES CP850"
+       echo "es_GT CP850"
+       echo "es_HN CP850"
+       echo "es_MX CP850"
+       echo "es_NI CP850"
+       echo "es_PA CP850"
+       echo "es_PY CP850"
+       echo "es_PE CP850"
+       echo "es_SV CP850"
+       echo "es_UY CP850"
+       echo "es_VE CP850"
+       echo "et CP850"
+       echo "et_EE CP850"
+       echo "eu CP850"
+       echo "eu_ES CP850"
+       echo "fi CP850"
+       echo "fi_FI CP850"
+       echo "fr CP850"
+       echo "fr_BE CP850"
+       echo "fr_CA CP850"
+       echo "fr_CH CP850"
+       echo "fr_FR CP850"
+       echo "ga CP850"
+       echo "ga_IE CP850"
+       echo "gd CP850"
+       echo "gd_GB CP850"
+       echo "gl CP850"
+       echo "gl_ES CP850"
+       echo "id CP850"    # not CP437 ??
+       echo "id_ID CP850" # not CP437 ??
+       echo "is CP861"    # not CP850 ??
+       echo "is_IS CP861" # not CP850 ??
+       echo "it CP850"
+       echo "it_CH CP850"
+       echo "it_IT CP850"
+       echo "lt CP775"
+       echo "lt_LT CP775"
+       echo "lv CP775"
+       echo "lv_LV CP775"
+       echo "nb CP865"    # not CP850 ??
+       echo "nb_NO CP865" # not CP850 ??
+       echo "nl CP850"
+       echo "nl_BE CP850"
+       echo "nl_NL CP850"
+       echo "nn CP865"    # not CP850 ??
+       echo "nn_NO CP865" # not CP850 ??
+       echo "no CP865"    # not CP850 ??
+       echo "no_NO CP865" # not CP850 ??
+       echo "pt CP850"
+       echo "pt_BR CP850"
+       echo "pt_PT CP850"
+       echo "sv CP850"
+       echo "sv_SE CP850"
+       # ISO-8859-2 languages
+       echo "cs CP852"
+       echo "cs_CZ CP852"
+       echo "hr CP852"
+       echo "hr_HR CP852"
+       echo "hu CP852"
+       echo "hu_HU CP852"
+       echo "pl CP852"
+       echo "pl_PL CP852"
+       echo "ro CP852"
+       echo "ro_RO CP852"
+       echo "sk CP852"
+       echo "sk_SK CP852"
+       echo "sl CP852"
+       echo "sl_SI CP852"
+       echo "sq CP852"
+       echo "sq_AL CP852"
+       echo "sr CP852"    # CP852 or CP866 or CP855 ??
+       echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+       # ISO-8859-3 languages
+       echo "mt CP850"
+       echo "mt_MT CP850"
+       # ISO-8859-5 languages
+       echo "be CP866"
+       echo "be_BE CP866"
+       echo "bg CP866"    # not CP855 ??
+       echo "bg_BG CP866" # not CP855 ??
+       echo "mk CP866"    # not CP855 ??
+       echo "mk_MK CP866" # not CP855 ??
+       echo "ru CP866"
+       echo "ru_RU CP866"
+       echo "uk CP1125"
+       echo "uk_UA CP1125"
+       # ISO-8859-6 languages
+       echo "ar CP864"
+       echo "ar_AE CP864"
+       echo "ar_DZ CP864"
+       echo "ar_EG CP864"
+       echo "ar_IQ CP864"
+       echo "ar_IR CP864"
+       echo "ar_JO CP864"
+       echo "ar_KW CP864"
+       echo "ar_MA CP864"
+       echo "ar_OM CP864"
+       echo "ar_QA CP864"
+       echo "ar_SA CP864"
+       echo "ar_SY CP864"
+       # ISO-8859-7 languages
+       echo "el CP869"
+       echo "el_GR CP869"
+       # ISO-8859-8 languages
+       echo "he CP862"
+       echo "he_IL CP862"
+       # ISO-8859-9 languages
+       echo "tr CP857"
+       echo "tr_TR CP857"
+       # Japanese
+       echo "ja CP932"
+       echo "ja_JP CP932"
+       # Chinese
+       echo "zh_CN GBK"
+       echo "zh_TW CP950" # not CP938 ??
+       # Korean
+       echo "kr CP949"    # not CP934 ??
+       echo "kr_KR CP949" # not CP934 ??
+       # Thai
+       echo "th CP874"
+       echo "th_TH CP874"
+       # Other
+       echo "eo CP850"
+       echo "eo_EO CP850"
+       ;;
 esac
--- ./libcharset/lib/localcharset.c.ori 2003-01-31 11:08:02.000000000 -0800
+++ ./libcharset/lib/localcharset.c     2006-07-29 11:30:02.000000000 -0700
@@ -47,7 +47,7 @@
 # define OS2
 #endif
 
-#if !defined WIN32
+#if (!defined(WIN32) || defined(__MINGW32__))
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
@@ -110,7 +110,7 @@
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !defined WIN32
+#if (!defined(WIN32) || defined(__MINGW32__))
       FILE *fp;
       const char *dir = LIBDIR;
       const char *base = "charset.alias";
@@ -244,7 +244,7 @@
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32 || defined OS2)
+#if (!(defined WIN32 || defined OS2) || defined(__MINGW32__))
 
 # if HAVE_LANGINFO_CODESET
 
--- ./libcharset/m4/codeset.m4.ori      2003-01-31 11:08:02.000000000 -0800
+++ ./libcharset/m4/codeset.m4  2006-07-29 08:38:10.000000000 -0700
@@ -2,7 +2,7 @@
 
 dnl From Bruno Haible.
 
-AC_DEFUN(jm_LANGINFO_CODESET,
+AC_DEFUN([jm_LANGINFO_CODESET],
 [
   AC_CHECK_HEADERS(langinfo.h)
   AC_CHECK_FUNCS(nl_langinfo)
--- ./libcharset/m4/glibc21.m4.ori      2003-01-31 11:08:02.000000000 -0800
+++ ./libcharset/m4/glibc21.m4  2006-07-29 08:38:46.000000000 -0700
@@ -3,7 +3,7 @@
 # Test for the GNU C Library, version 2.1 or newer.
 # From Bruno Haible.
 
-AC_DEFUN(jm_GLIBC21,
+AC_DEFUN([jm_GLIBC21],
   [
     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
       ac_cv_gnu_library_2_1,
--- ./src/iconv.c.ori   2003-01-31 11:08:08.000000000 -0800
+++ ./src/iconv.c       2006-07-29 11:32:06.000000000 -0700
@@ -48,7 +48,7 @@
 # undef O_TEXT
 #endif
 #if O_BINARY
-# if !(defined(__EMX__) || defined(__DJGPP__))
+# if !(defined(__EMX__) || defined(__DJGPP__) || defined(__MINGW32__))
 #  define setmode _setmode
 #  define fileno _fileno
 # endif
@@ -330,7 +330,7 @@
       status = 0;
       for (; i < argc; i++) {
         const char* infilename = argv[i];
-        FILE* infile = fopen(infilename,"r");
+        FILE* infile = fopen(infilename,"rb");
         if (infile == NULL) {
           int saved_errno = errno;
           fprintf(stderr,_("iconv: %s: "),infilename);
--- ./tests/uniq-u.c.ori        2003-01-31 11:08:26.000000000 -0800
+++ ./tests/uniq-u.c    2006-07-29 11:32:06.000000000 -0700
@@ -179,7 +179,7 @@
   if (!strcmp (infile, "-"))
     istream = stdin;
   else
-    istream = fopen (infile, "r");
+    istream = fopen (infile, "rb");
   if (istream == NULL)
     {
       fprintf (stderr, "%s: error opening %s\n", program_name, infile);
@@ -189,7 +189,7 @@
   if (!strcmp (outfile, "-"))
     ostream = stdout;
   else
-    ostream = fopen (outfile, "w");
+    ostream = fopen (outfile, "wb");
   if (ostream == NULL)
     {
       fprintf (stderr, "%s: error opening %s\n", program_name, outfile);
--- ./tools/8bit_tab_to_h.c.ori 2003-01-31 11:08:28.000000000 -0800
+++ ./tools/8bit_tab_to_h.c     2006-07-29 11:32:06.000000000 -0700
@@ -138,7 +138,7 @@
     {
       char* fname = malloc(strlen(directory)+strlen(filename)+1);
       strcpy(fname,directory); strcat(fname,filename);
-      f = fopen(fname,"w");
+      f = fopen(fname,"wb");
       if (f == NULL)
         exit(1);
     }

Regenerate aclocal.m4 in the libiconv root directory by running "aclocal -I m4".
Regenerate configure in the libiconv root directory by running "autoconf".
Then change to the libcharset directory and run "aclocal -I m4" followed by
"autoconf".
Go back to the libiconv root directory and run configure. I used the following
shell script:


#!/bin/sh
LIBS="-L/mingw/lib" \
CFLAGS="-mno-cygwin -I/mingw/include -W -Wall -O3" \
CPPFLAGS="-mno-cygwin -I/mingw/include" \
LDFLAGS="-mno-cygwin -static" \
./configure \
--enable-static \
--disable-shared \
--host=mingw32 \
--prefix=d:/cygwin/mingw


4. Compile and install MingW gettext 

I used gettext-0.11.5.
I applied this patch:


--- gettext-0.11.5/intl/config.charset.ori      2003-02-01 09:13:14.000000000 
-0800
+++ gettext-0.11.5/intl/config.charset  2003-11-06 22:07:42.000000000 -0800
@@ -463,4 +463,164 @@
        echo "eo CP850"
        echo "eo_EO CP850"
        ;;
+    mingw*)
+       echo "#"
+       echo "# The encodings given here may not all be correct."
+       echo "# If you find that the encoding given for your language and"
+       echo "# country is not the one your DOS machine actually uses, just"
+       echo "# correct it in this file, and send a mail to"
+       echo "# Juan Manuel Guerrero <address@hidden>"
+       echo "# and Bruno Haible <address@hidden>."
+       echo "#"
+       echo "C ASCII"
+       # ISO-8859-1 languages
+       echo "ca CP850"
+       echo "ca_ES CP850"
+       echo "da CP865"    # not CP850 ??
+       echo "da_DK CP865" # not CP850 ??
+       echo "de CP850"
+       echo "de_AT CP850"
+       echo "de_CH CP850"
+       echo "de_DE CP850"
+       echo "en CP850"
+       echo "en_AU CP850" # not CP437 ??
+       echo "en_CA CP850"
+       echo "en_GB CP850"
+       echo "en_NZ CP437"
+       echo "en_US CP437"
+       echo "en_ZA CP850" # not CP437 ??
+       echo "es CP850"
+       echo "es_AR CP850"
+       echo "es_BO CP850"
+       echo "es_CL CP850"
+       echo "es_CO CP850"
+       echo "es_CR CP850"
+       echo "es_CU CP850"
+       echo "es_DO CP850"
+       echo "es_EC CP850"
+       echo "es_ES CP850"
+       echo "es_GT CP850"
+       echo "es_HN CP850"
+       echo "es_MX CP850"
+       echo "es_NI CP850"
+       echo "es_PA CP850"
+       echo "es_PY CP850"
+       echo "es_PE CP850"
+       echo "es_SV CP850"
+       echo "es_UY CP850"
+       echo "es_VE CP850"
+       echo "et CP850"
+       echo "et_EE CP850"
+       echo "eu CP850"
+       echo "eu_ES CP850"
+       echo "fi CP850"
+       echo "fi_FI CP850"
+       echo "fr CP850"
+       echo "fr_BE CP850"
+       echo "fr_CA CP850"
+       echo "fr_CH CP850"
+       echo "fr_FR CP850"
+       echo "ga CP850"
+       echo "ga_IE CP850"
+       echo "gd CP850"
+       echo "gd_GB CP850"
+       echo "gl CP850"
+       echo "gl_ES CP850"
+       echo "id CP850"    # not CP437 ??
+       echo "id_ID CP850" # not CP437 ??
+       echo "is CP861"    # not CP850 ??
+       echo "is_IS CP861" # not CP850 ??
+       echo "it CP850"
+       echo "it_CH CP850"
+       echo "it_IT CP850"
+       echo "lt CP775"
+       echo "lt_LT CP775"
+       echo "lv CP775"
+       echo "lv_LV CP775"
+       echo "nb CP865"    # not CP850 ??
+       echo "nb_NO CP865" # not CP850 ??
+       echo "nl CP850"
+       echo "nl_BE CP850"
+       echo "nl_NL CP850"
+       echo "nn CP865"    # not CP850 ??
+       echo "nn_NO CP865" # not CP850 ??
+       echo "no CP865"    # not CP850 ??
+       echo "no_NO CP865" # not CP850 ??
+       echo "pt CP850"
+       echo "pt_BR CP850"
+       echo "pt_PT CP850"
+       echo "sv CP850"
+       echo "sv_SE CP850"
+       # ISO-8859-2 languages
+       echo "cs CP852"
+       echo "cs_CZ CP852"
+       echo "hr CP852"
+       echo "hr_HR CP852"
+       echo "hu CP852"
+       echo "hu_HU CP852"
+       echo "pl CP852"
+       echo "pl_PL CP852"
+       echo "ro CP852"
+       echo "ro_RO CP852"
+       echo "sk CP852"
+       echo "sk_SK CP852"
+       echo "sl CP852"
+       echo "sl_SI CP852"
+       echo "sq CP852"
+       echo "sq_AL CP852"
+       echo "sr CP852"    # CP852 or CP866 or CP855 ??
+       echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+       # ISO-8859-3 languages
+       echo "mt CP850"
+       echo "mt_MT CP850"
+       # ISO-8859-5 languages
+       echo "be CP866"
+       echo "be_BE CP866"
+       echo "bg CP866"    # not CP855 ??
+       echo "bg_BG CP866" # not CP855 ??
+       echo "mk CP866"    # not CP855 ??
+       echo "mk_MK CP866" # not CP855 ??
+       echo "ru CP866"
+       echo "ru_RU CP866"
+       echo "uk CP1125"
+       echo "uk_UA CP1125"
+       # ISO-8859-6 languages
+       echo "ar CP864"
+       echo "ar_AE CP864"
+       echo "ar_DZ CP864"
+       echo "ar_EG CP864"
+       echo "ar_IQ CP864"
+       echo "ar_IR CP864"
+       echo "ar_JO CP864"
+       echo "ar_KW CP864"
+       echo "ar_MA CP864"
+       echo "ar_OM CP864"
+       echo "ar_QA CP864"
+       echo "ar_SA CP864"
+       echo "ar_SY CP864"
+       # ISO-8859-7 languages
+       echo "el CP869"
+       echo "el_GR CP869"
+       # ISO-8859-8 languages
+       echo "he CP862"
+       echo "he_IL CP862"
+       # ISO-8859-9 languages
+       echo "tr CP857"
+       echo "tr_TR CP857"
+       # Japanese
+       echo "ja CP932"
+       echo "ja_JP CP932"
+       # Chinese
+       echo "zh_CN GBK"
+       echo "zh_TW CP950" # not CP938 ??
+       # Korean
+       echo "kr CP949"    # not CP934 ??
+       echo "kr_KR CP949" # not CP934 ??
+       # Thai
+       echo "th CP874"
+       echo "th_TH CP874"
+       # Other
+       echo "eo CP850"
+       echo "eo_EO CP850"
+       ;;
 esac
--- gettext-0.11.5/intl/localcharset.c.ori      2003-11-08 21:48:40.000000000 
-0800
+++ gettext-0.11.5/intl/localcharset.c  2003-11-08 21:51:38.000000000 -0800
@@ -47,7 +47,7 @@
 # define OS2
 #endif
 
-#if !defined WIN32
+#if (!defined(WIN32) || defined(__MINGW32__))
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
@@ -110,7 +110,7 @@
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !defined WIN32
+#if (!defined(WIN32) || defined(__MINGW32__))
       FILE *fp;
       const char *dir = LIBDIR;
       const char *base = "charset.alias";
@@ -244,7 +244,7 @@
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32 || defined OS2)
+#if (!(defined WIN32 || defined OS2) || defined(__MINGW32__))
 
 # if HAVE_LANGINFO_CODESET
 
--- gettext-0.11.5/lib/binary-io.h.ori  2003-02-01 10:13:16.000000000 -0800
+++ gettext-0.11.5/lib/binary-io.h      2006-07-29 18:26:00.000000000 -0700
@@ -32,7 +32,7 @@
 # undef O_TEXT
 #endif
 #if O_BINARY
-# if !(defined(__EMX__) || defined(__DJGPP__))
+# if !(defined(__EMX__) || defined(__DJGPP__) || defined(__MINGW32__))
 #  define setmode _setmode
 #  define fileno _fileno
 # endif
--- gettext-0.11.5/lib/config.charset.ori       2003-02-01 09:13:16.000000000 
-0800
+++ gettext-0.11.5/lib/config.charset   2003-11-06 22:07:42.000000000 -0800
@@ -463,4 +463,164 @@
        echo "eo CP850"
        echo "eo_EO CP850"
        ;;
+    mingw*)
+       echo "#"
+       echo "# The encodings given here may not all be correct."
+       echo "# If you find that the encoding given for your language and"
+       echo "# country is not the one your DOS machine actually uses, just"
+       echo "# correct it in this file, and send a mail to"
+       echo "# Juan Manuel Guerrero <address@hidden>"
+       echo "# and Bruno Haible <address@hidden>."
+       echo "#"
+       echo "C ASCII"
+       # ISO-8859-1 languages
+       echo "ca CP850"
+       echo "ca_ES CP850"
+       echo "da CP865"    # not CP850 ??
+       echo "da_DK CP865" # not CP850 ??
+       echo "de CP850"
+       echo "de_AT CP850"
+       echo "de_CH CP850"
+       echo "de_DE CP850"
+       echo "en CP850"
+       echo "en_AU CP850" # not CP437 ??
+       echo "en_CA CP850"
+       echo "en_GB CP850"
+       echo "en_NZ CP437"
+       echo "en_US CP437"
+       echo "en_ZA CP850" # not CP437 ??
+       echo "es CP850"
+       echo "es_AR CP850"
+       echo "es_BO CP850"
+       echo "es_CL CP850"
+       echo "es_CO CP850"
+       echo "es_CR CP850"
+       echo "es_CU CP850"
+       echo "es_DO CP850"
+       echo "es_EC CP850"
+       echo "es_ES CP850"
+       echo "es_GT CP850"
+       echo "es_HN CP850"
+       echo "es_MX CP850"
+       echo "es_NI CP850"
+       echo "es_PA CP850"
+       echo "es_PY CP850"
+       echo "es_PE CP850"
+       echo "es_SV CP850"
+       echo "es_UY CP850"
+       echo "es_VE CP850"
+       echo "et CP850"
+       echo "et_EE CP850"
+       echo "eu CP850"
+       echo "eu_ES CP850"
+       echo "fi CP850"
+       echo "fi_FI CP850"
+       echo "fr CP850"
+       echo "fr_BE CP850"
+       echo "fr_CA CP850"
+       echo "fr_CH CP850"
+       echo "fr_FR CP850"
+       echo "ga CP850"
+       echo "ga_IE CP850"
+       echo "gd CP850"
+       echo "gd_GB CP850"
+       echo "gl CP850"
+       echo "gl_ES CP850"
+       echo "id CP850"    # not CP437 ??
+       echo "id_ID CP850" # not CP437 ??
+       echo "is CP861"    # not CP850 ??
+       echo "is_IS CP861" # not CP850 ??
+       echo "it CP850"
+       echo "it_CH CP850"
+       echo "it_IT CP850"
+       echo "lt CP775"
+       echo "lt_LT CP775"
+       echo "lv CP775"
+       echo "lv_LV CP775"
+       echo "nb CP865"    # not CP850 ??
+       echo "nb_NO CP865" # not CP850 ??
+       echo "nl CP850"
+       echo "nl_BE CP850"
+       echo "nl_NL CP850"
+       echo "nn CP865"    # not CP850 ??
+       echo "nn_NO CP865" # not CP850 ??
+       echo "no CP865"    # not CP850 ??
+       echo "no_NO CP865" # not CP850 ??
+       echo "pt CP850"
+       echo "pt_BR CP850"
+       echo "pt_PT CP850"
+       echo "sv CP850"
+       echo "sv_SE CP850"
+       # ISO-8859-2 languages
+       echo "cs CP852"
+       echo "cs_CZ CP852"
+       echo "hr CP852"
+       echo "hr_HR CP852"
+       echo "hu CP852"
+       echo "hu_HU CP852"
+       echo "pl CP852"
+       echo "pl_PL CP852"
+       echo "ro CP852"
+       echo "ro_RO CP852"
+       echo "sk CP852"
+       echo "sk_SK CP852"
+       echo "sl CP852"
+       echo "sl_SI CP852"
+       echo "sq CP852"
+       echo "sq_AL CP852"
+       echo "sr CP852"    # CP852 or CP866 or CP855 ??
+       echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+       # ISO-8859-3 languages
+       echo "mt CP850"
+       echo "mt_MT CP850"
+       # ISO-8859-5 languages
+       echo "be CP866"
+       echo "be_BE CP866"
+       echo "bg CP866"    # not CP855 ??
+       echo "bg_BG CP866" # not CP855 ??
+       echo "mk CP866"    # not CP855 ??
+       echo "mk_MK CP866" # not CP855 ??
+       echo "ru CP866"
+       echo "ru_RU CP866"
+       echo "uk CP1125"
+       echo "uk_UA CP1125"
+       # ISO-8859-6 languages
+       echo "ar CP864"
+       echo "ar_AE CP864"
+       echo "ar_DZ CP864"
+       echo "ar_EG CP864"
+       echo "ar_IQ CP864"
+       echo "ar_IR CP864"
+       echo "ar_JO CP864"
+       echo "ar_KW CP864"
+       echo "ar_MA CP864"
+       echo "ar_OM CP864"
+       echo "ar_QA CP864"
+       echo "ar_SA CP864"
+       echo "ar_SY CP864"
+       # ISO-8859-7 languages
+       echo "el CP869"
+       echo "el_GR CP869"
+       # ISO-8859-8 languages
+       echo "he CP862"
+       echo "he_IL CP862"
+       # ISO-8859-9 languages
+       echo "tr CP857"
+       echo "tr_TR CP857"
+       # Japanese
+       echo "ja CP932"
+       echo "ja_JP CP932"
+       # Chinese
+       echo "zh_CN GBK"
+       echo "zh_TW CP950" # not CP938 ??
+       # Korean
+       echo "kr CP949"    # not CP934 ??
+       echo "kr_KR CP949" # not CP934 ??
+       # Thai
+       echo "th CP874"
+       echo "th_TH CP874"
+       # Other
+       echo "eo CP850"
+       echo "eo_EO CP850"
+       ;;
 esac
--- gettext-0.11.5/lib/copy-file.c.ori  2003-02-01 09:23:38.000000000 -0800
+++ gettext-0.11.5/lib/copy-file.c      2003-10-30 21:26:18.000000000 -0800
@@ -33,7 +33,11 @@
 #endif
 
 #if HAVE_UTIME || HAVE_UTIMES
+#ifdef __MINGW32__
+# include <sys/utime.h>
+#else
 # include <utime.h>
+#endif /* __MINGW32__ */
 #endif
 
 #include "error.h"
--- gettext-0.11.5/lib/error.h.ori      2003-02-01 09:23:38.000000000 -0800
+++ gettext-0.11.5/lib/error.h  2003-10-30 22:46:00.000000000 -0800
@@ -65,7 +65,7 @@
 #endif
 
 /* This variable is incremented each time `error' is called.  */
-extern IMPORT unsigned int error_message_count;
+extern EXPORT unsigned int error_message_count;
 
 /* Sometimes we want to have at most one error per line.  This
    variable controls whether this mode is selected or not.  */
--- gettext-0.11.5/lib/execute.c.ori    2003-02-01 10:23:38.000000000 -0800
+++ gettext-0.11.5/lib/execute.c        2006-07-29 18:19:30.000000000 -0700
@@ -157,7 +157,7 @@
              && ((null_stdout && nulloutfd == STDOUT_FILENO)
                  || (null_stderr && nulloutfd == STDERR_FILENO)
                  || close (nulloutfd) >= 0))))
-  child = spawnvp(_P_NOWAIT, prog_path, prog_argv);
+  child = spawnvp(_P_NOWAIT, prog_path, (const char* const*)prog_argv);
   if (child < 1)
     {
       if (exit_on_error)
--- gettext-0.11.5/lib/gen-lbrkprop.c.ori       2003-02-01 09:13:16.000000000 
-0800
+++ gettext-0.11.5/lib/gen-lbrkprop.c   2003-11-02 15:30:26.000000000 -0800
@@ -155,7 +155,7 @@
   for (i = 0; i < 0x110000; i++)
     unicode_attributes[i].name = NULL;
 
-  stream = fopen (unicodedata_filename, "r");
+  stream = fopen (unicodedata_filename, "rb");
   if (stream == NULL)
     {
       fprintf (stderr, "error during fopen of '%s'\n", unicodedata_filename);
@@ -263,7 +263,7 @@
   for (i = 0; i < 0x110000; i++)
     unicode_combining[i] = 0;
 
-  stream = fopen (proplist_filename, "r");
+  stream = fopen (proplist_filename, "rb");
   if (stream == NULL)
     {
       fprintf (stderr, "error during fopen of '%s'\n", proplist_filename);
@@ -348,7 +348,7 @@
   for (i = 0; i < 0x110000; i++)
     unicode_width[i] = (unicode_attributes[i].name != NULL ? "N" : NULL);
 
-  stream = fopen (width_filename, "r");
+  stream = fopen (width_filename, "rb");
   if (stream == NULL)
     {
       fprintf (stderr, "error during fopen of '%s'\n", width_filename);
@@ -1002,7 +1002,7 @@
 {
   FILE *stream;
 
-  stream = fopen (filename, "w");
+  stream = fopen (filename, "wb");
   if (stream == NULL)
     {
       fprintf (stderr, "cannot open '%s' for writing\n", filename);
@@ -1036,7 +1036,7 @@
   for (i = 0; i < 0x110000; i++)
     unicode_org_lbp[i] = LBP_XX;
 
-  stream = fopen (linebreak_filename, "r");
+  stream = fopen (linebreak_filename, "rb");
   if (stream == NULL)
     {
       fprintf (stderr, "error during fopen of '%s'\n", linebreak_filename);
@@ -1180,7 +1180,7 @@
 {
   FILE *stream;
 
-  stream = fopen (filename, "w");
+  stream = fopen (filename, "wb");
   if (stream == NULL)
     {
       fprintf (stderr, "cannot open '%s' for writing\n", filename);
@@ -1340,7 +1340,7 @@
 {
   FILE *stream;
 
-  stream = fopen (filename, "w");
+  stream = fopen (filename, "wb");
   if (stream == NULL)
     {
       fprintf (stderr, "cannot open '%s' for writing\n", filename);
--- gettext-0.11.5/lib/localcharset.c.ori       2003-02-01 09:13:18.000000000 
-0800
+++ gettext-0.11.5/lib/localcharset.c   2003-11-08 12:13:34.000000000 -0800
@@ -47,7 +47,7 @@
 # define OS2
 #endif
 
-#if !defined WIN32
+#if !defined WIN32 || defined __MINGW32__
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
@@ -110,7 +110,7 @@
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !defined WIN32
+#if (!defined(WIN32) || defined(__MINGW32__))
       FILE *fp;
       const char *dir = LIBDIR;
       const char *base = "charset.alias";
@@ -204,7 +204,7 @@
         directory as the DLL and of retrieving the DLL's directory at
         runtime, simply inline the aliases here.  */
 
-# if defined WIN32
+# if defined WIN32 && !defined __MINGW32__
       cp = "CP936" "\0" "GBK" "\0"
           "CP1361" "\0" "JOHAB" "\0"
           "CP20127" "\0" "ASCII" "\0"
@@ -244,7 +244,7 @@
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32 || defined OS2)
+#if !(defined WIN32 || defined OS2) || defined __MINGW32__
 
 # if HAVE_LANGINFO_CODESET
 
--- gettext-0.11.5/lib/pipe-bidi.c.ori  2003-02-01 10:23:38.000000000 -0800
+++ gettext-0.11.5/lib/pipe-bidi.c      2006-07-29 18:19:00.000000000 -0700
@@ -50,6 +50,9 @@
 #ifndef STDOUT_FILENO
 # define STDOUT_FILENO 1
 #endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
 
 #define _(str) gettext (str)
 
@@ -155,7 +158,7 @@
            error (EXIT_FAILURE, errno, _("%s subprocess failed"), progname);
       }
 
-    child = _spawnvpe(_P_NOWAIT, prog_path, prog_argv, environ);
+    child = _spawnvpe(_P_NOWAIT, prog_path, (const char* const*)prog_argv, 
(const char* const*)environ);
 
     if (child < 1)
       {
--- gettext-0.11.5/lib/pipe-in.c.ori    2003-02-01 10:23:38.000000000 -0800
+++ gettext-0.11.5/lib/pipe-in.c        2006-07-29 18:32:08.000000000 -0700
@@ -181,7 +181,7 @@
       }
            
 
-    child = _spawnvpe(_P_NOWAIT, prog_path, prog_argv, environ);
+    child = _spawnvpe(_P_NOWAIT, prog_path, (const char* const*)prog_argv, 
(const char* const*)environ);
 
     if (child < 1)
       {
--- gettext-0.11.5/lib/pipe-out.c.ori   2003-02-01 10:23:38.000000000 -0800
+++ gettext-0.11.5/lib/pipe-out.c       2006-07-29 18:32:10.000000000 -0700
@@ -180,7 +180,7 @@
        close (stdoutfd);
       }
 
-    child = spawnvpe(_P_NOWAIT, prog_path, prog_argv, environ);
+    child = spawnvpe(_P_NOWAIT, prog_path, (const char* const*)prog_argv, 
(const char* const*)environ);
 
     if (child < 1)
       {
--- gettext-0.11.5/libuniname/test-names.c.ori  2003-02-01 09:13:18.000000000 
-0800
+++ gettext-0.11.5/libuniname/test-names.c      2003-11-02 15:32:08.000000000 
-0800
@@ -79,7 +79,7 @@
   for (i = 0; i < 0x110000; i++)
     unicode_names[i] = NULL;
 
-  stream = fopen (unicodedata_filename, "r");
+  stream = fopen (unicodedata_filename, "rb");
   if (stream == NULL)
     {
       fprintf (stderr, "error during fopen of '%s'\n", unicodedata_filename);
--- gettext-0.11.5/src/file-list.c.ori  2003-02-01 09:23:40.000000000 -0800
+++ gettext-0.11.5/src/file-list.c      2003-11-02 15:34:02.000000000 -0800
@@ -52,7 +52,7 @@
     fp = stdin;
   else
     {
-      fp = fopen (file_name, "r");
+      fp = fopen (file_name, "rb");
       if (fp == NULL)
        error (EXIT_FAILURE, errno,
               _("error while opening \"%s\" for reading"), file_name);
--- gettext-0.11.5/src/message.c.ori    2003-02-01 10:23:42.000000000 -0800
+++ gettext-0.11.5/src/message.c        2006-07-29 19:09:36.000000000 -0700
@@ -364,7 +364,7 @@
     {
       message_ty *mp;
 
-      if (find_entry (&mlp->htable, msgid, strlen (msgid) + 1, (void **) &mp))
+      if (find_entry (&mlp->htable, msgid, strlen (msgid) + 1, (void **)(void 
*) &mp))
        return NULL;
       else
        return mp;
--- gettext-0.11.5/src/open-po.c.ori    2003-02-01 09:13:32.000000000 -0800
+++ gettext-0.11.5/src/open-po.c        2003-11-02 15:34:30.000000000 -0800
@@ -69,7 +69,7 @@
        {
          file_name = concatenated_pathname ("", input_name, extension[k]);
 
-         ret_val = fopen (file_name, "r");
+         ret_val = fopen (file_name, "rb");
          if (ret_val != NULL || errno != ENOENT)
            {
              /* We found the file.  */
@@ -90,7 +90,7 @@
          {
            file_name = concatenated_pathname (dir, input_name, extension[k]);
 
-           ret_val = fopen (file_name, "r");
+           ret_val = fopen (file_name, "rb");
            if (ret_val != NULL || errno != ENOENT)
              {
                *real_file_name_p = file_name;
--- gettext-0.11.5/src/plural-table.h.ori       2003-02-01 09:23:42.000000000 
-0800
+++ gettext-0.11.5/src/plural-table.h   2003-10-30 22:57:32.000000000 -0800
@@ -28,7 +28,7 @@
   const char *value;
 };
 
-extern IMPORT struct plural_table_entry plural_table[];
-extern IMPORT const size_t plural_table_size;
+extern EXPORT struct plural_table_entry plural_table[];
+extern EXPORT const size_t plural_table_size;
 
 #endif /* _PLURAL_TABLE_H */
--- gettext-0.11.5/src/write-java.c.ori 2003-02-01 09:23:42.000000000 -0800
+++ gettext-0.11.5/src/write-java.c     2003-11-02 15:36:36.000000000 -0800
@@ -1201,7 +1201,7 @@
 
   /* Create the Java file.  */
   cleanup_list.file_name = java_file_name;
-  java_file = fopen (java_file_name, "w");
+  java_file = fopen (java_file_name, "wb");
   if (java_file == NULL)
     {
       error (0, errno, _("failed to create \"%s\""), java_file_name);
--- gettext-0.11.5/src/write-po.c.ori   2003-02-01 09:23:42.000000000 -0800
+++ gettext-0.11.5/src/write-po.c       2003-11-02 15:36:56.000000000 -0800
@@ -945,7 +945,7 @@
   if (filename != NULL && strcmp (filename, "-") != 0
       && strcmp (filename, "/dev/stdout") != 0)
     {
-      fp = fopen (filename, "w");
+      fp = fopen (filename, "wb");
       if (fp == NULL)
        error (EXIT_FAILURE, errno, _("cannot create output file \"%s\""),
               filename);
--- gettext-0.11.5/src/write-tcl.c.ori  2003-02-01 09:13:34.000000000 -0800
+++ gettext-0.11.5/src/write-tcl.c      2003-11-02 15:37:56.000000000 -0800
@@ -199,7 +199,7 @@
 
     file_name = concatenated_pathname (directory, frobbed_locale_name, ".msg");
       
-    output_file = fopen (file_name, "w");
+    output_file = fopen (file_name, "wb");
     if (output_file == NULL)
       {
        error (0, errno, _("error while opening \"%s\" for writing"),
--- gettext-0.11.5/src/xgettext.c.ori   2003-02-01 10:23:42.000000000 -0800
+++ gettext-0.11.5/src/xgettext.c       2006-07-29 21:13:06.000000000 -0700
@@ -646,7 +646,7 @@
      po_ty *pop;
      char *name;
 {
-  IMPORT extern lex_pos_ty gram_pos;
+  EXPORT extern lex_pos_ty gram_pos;
   po_gram_error_at_line (&gram_pos,
                         _("this file may not contain domain directives"));
 }
--- gettext-0.11.5/src/x-po.c.ori       2003-02-01 09:23:42.000000000 -0800
+++ gettext-0.11.5/src/x-po.c   2003-10-30 23:22:44.000000000 -0800
@@ -102,7 +102,7 @@
      po_ty *that;
      char *name;
 {
-  IMPORT extern lex_pos_ty gram_pos;
+  EXPORT extern lex_pos_ty gram_pos;
   po_gram_error_at_line (&gram_pos,
                         _("this file may not contain domain directives"));
 }


I then run configure from this shell script:

#!/bin/sh
LIBS="-L/mingw/lib" \
CFLAGS="-mno-cygwin -I/mingw/include -W -Wall -O3" \
CPPFLAGS="-mno-cygwin -I/mingw/include" \
LDFLAGS="-mno-cygwin -static" \
./configure \
--host=mingw32 \
--disable-shared \
--prefix=d:/cygwin/mingw

Then run "make" and "make install".


5. Patch Cygwin autoconf to comply with Tom Dickey's patches. 

I used cygwin autoconf 2.59-2. First I applied the cygwin
patch that comes with the source code. I then applied a patch
combining the DOS pathname patches from the DJGPP port and a
modification of the patch on Tom Dickey's web page for autoconf 2.57
("http://invisible-island.net/autoconf/autoconf.html";). This is the
patch:


--- AUTHORS.orig        2001-08-20 07:21:26.000000000 -0800
+++ AUTHORS     2005-01-30 00:28:36.000000000 -0800
@@ -5,7 +5,7 @@
 Ben Elliston next took over the maintenance, facing a huge Autoconf
 backlog that had been piling up since the departure of David.
 
-Today, there are no less than five maintainers: Akim Demaille, Paul
+Today, there are no fewer than five maintainers: Akim Demaille, Paul
 Eggert, Jim Meyering, Alexandre Oliva, and Tom Tromey, especially
 helped by Lars J. Aas, Mo DeJong, Steven G. Johnson, Matthew
 D. Langston, Pavel Roskin, and many others listed in the THANKS file.
--- THANKS.orig 2003-10-28 00:46:52.000000000 -0800
+++ THANKS      2005-01-30 00:28:36.000000000 -0800
@@ -186,7 +186,7 @@
 Steven G. Johnson           address@hidden
 Stu Grossman                address@hidden
 Syd Polk                    address@hidden
-T.E. Dickey                 address@hidden
+T.E. Dickey                 address@hidden
 Theodore Ts'o"              address@hidden
 Thien-Thi Nguyen            address@hidden
 Thomas Winder               address@hidden
--- configure.ac.orig   2003-11-06 01:30:34.000000000 -0800
+++ configure.ac        2005-01-30 00:28:36.000000000 -0800
@@ -22,7 +22,7 @@
 # We need AC_CONFIG_TESTDIR.
 AC_PREREQ([2.57])
 
-AC_INIT([GNU Autoconf], [2.59], address@hidden)
+AC_INIT([GNU Autoconf], [2.59.20050130], address@hidden)
 AC_SUBST([PACKAGE_NAME])dnl
 AC_CONFIG_SRCDIR([ChangeLog])
 
--- doc/autoconf.texi.orig      2003-11-05 02:38:28.000000000 -0800
+++ doc/autoconf.texi   2005-01-30 00:28:36.000000000 -0800
@@ -13556,9 +13556,25 @@
 AC_CONFIG_FILES(@address@hidden)
 AC_CONFIG_COMMANDS([default],
                    @var{extra-cmds}, @var{init-cmds})
+AC_SETUP_DEFS(@var{save-defs})
 AC_OUTPUT
 @end group
 @end example
+
+If you specify @var{save-defs}, autoconf will save the @samp{#define}s in a
+different form, for use in the files specified in @code{AC_CONFIG_HEADERS}.
+In this case, autoconf substitutes the C-style @samp{#define}s where it finds
address@hidden@@DEFS@@}.
+This runs faster, and is simpler to maintain
+than building a file of @samp{#undef}s,
+since autoconf will automatically generate a @samp{#define} for each
address@hidden that you execute in the @code{configure} script.
+The value for @var{save-defs} should be
+either @code{cat}, or @code{sort};
+this value is used to filter the list of @samp{#define}s before editing.
+Sorted lists are easier to read,
+but you may wish to see the definitions in the order that they were
+processed.
 @end defmac
 
 @defmac AC_OUTPUT_COMMANDS (@var{extra-cmds}, @ovar{init-cmds})
--- doc/stamp-vti.orig  2003-11-06 01:33:38.000000000 -0800
+++ doc/stamp-vti       2005-01-30 00:32:30.000000000 -0800
@@ -1,4 +1,4 @@
address@hidden UPDATED 5 November 2003
address@hidden UPDATED-MONTH November 2003
address@hidden EDITION 2.59
address@hidden VERSION 2.59
address@hidden UPDATED 30 January 2005
address@hidden UPDATED-MONTH January 2005
address@hidden EDITION 2.59.20050130
address@hidden VERSION 2.59.20050130
--- doc/version.texi.orig       2003-11-06 01:33:38.000000000 -0800
+++ doc/version.texi    2005-01-30 00:32:30.000000000 -0800
@@ -1,4 +1,4 @@
address@hidden UPDATED 5 November 2003
address@hidden UPDATED-MONTH November 2003
address@hidden EDITION 2.59
address@hidden VERSION 2.59
address@hidden UPDATED 30 January 2005
address@hidden UPDATED-MONTH January 2005
address@hidden EDITION 2.59.20050130
address@hidden VERSION 2.59.20050130
--- lib/Autom4te/General.pm.orig        2003-08-21 09:45:30.000000000 -0800
+++ lib/Autom4te/General.pm     2005-01-30 00:28:36.000000000 -0800
@@ -307,6 +307,10 @@
   my ($signature) = @_;
   my $TMPDIR = $ENV{'TMPDIR'} || '/tmp';
 
+  # <address@hidden>: Forward-slashify TMPDIR.
+  # TMPDIR may have backward slashes in it under DJGPP.
+  $TMPDIR =~ s,\\,/,g;
+
   # If mktemp supports dirs, use it.
   $tmp = `(umask 077 &&
           mktemp -d -q "$TMPDIR/${signature}XXXXXX") 2>/dev/null`;
--- lib/Autom4te/XFile.pm.orig  2003-10-23 06:32:56.000000000 -0800
+++ lib/Autom4te/XFile.pm       2005-01-30 00:28:36.000000000 -0800
@@ -226,6 +226,8 @@
   # so report it in that case, by inspecting MAKEFLAGS and looking for
   # any arguments indicating that the invoker used -j.
   # Admittedly this is a bit of a hack.
+  if ($^O ne "dos")
+  {
   if (!flock ($fh, $mode)
       && (!$!{ENOLCK}
          || " -$ENV{'MAKEFLAGS'}" =~ / (-[BdeikrRsSw]*j|---?jobs)/))
@@ -233,6 +235,7 @@
       my $file = $fh->name;
       fatal "cannot lock $file with mode $mode (perhaps you are running make 
-j on a lame NFS client?): $!";
     }
+    }
 }
 
 ################################################
--- lib/autoconf/c.m4.orig      2003-09-24 23:28:50.000000000 -0800
+++ lib/autoconf/c.m4   2005-01-30 00:28:36.000000000 -0800
@@ -535,12 +535,12 @@
       ac_cv_prog_gcc_traditional,
 [  ac_pattern="Autoconf.*'x'"
   AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
-Autoconf TIOCGETP],
+int Autoconf = TIOCGETP;],
   ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
 
   if test $ac_cv_prog_gcc_traditional = no; then
     AC_EGREP_CPP($ac_pattern, [#include <termio.h>
-Autoconf TCGETA],
+int Autoconf = TCGETA;],
     ac_cv_prog_gcc_traditional=yes)
   fi])
   if test $ac_cv_prog_gcc_traditional = yes; then
--- lib/autoconf/general.m4.orig        2003-10-27 03:10:56.000000000 -0800
+++ lib/autoconf/general.m4     2005-01-30 00:28:36.000000000 -0800
@@ -84,10 +84,10 @@
 #   Handling `configure --help'.
 # - HELP_CANON
 #   Help msg for AC_CANONICAL_*
-# - HELP_ENABLE
-#   Help msg from AC_ARG_ENABLE.
-# - HELP_WITH
-#   Help msg from AC_ARG_WITH.
+# - HELP_INTRO
+#   Overview help msg from AC_ARG_ENABLE, AC_ARG_WITH.
+# - HELP_DETAIL
+#   Detailed help msg from AC_ARG_ENABLE, AC_ARG_WITH.
 # - HELP_VAR
 #   Help msg from AC_ARG_VAR.
 # - HELP_VAR_END
@@ -135,8 +135,8 @@
 
 m4_define([_m4_divert(HELP_BEGIN)],     100)
 m4_define([_m4_divert(HELP_CANON)],     101)
-m4_define([_m4_divert(HELP_ENABLE)],    102)
-m4_define([_m4_divert(HELP_WITH)],      103)
+m4_define([_m4_divert(HELP_INTRO)],     102)
+m4_define([_m4_divert(HELP_DETAIL)],    103)
 m4_define([_m4_divert(HELP_VAR)],       104)
 m4_define([_m4_divert(HELP_VAR_END)],   105)
 m4_define([_m4_divert(HELP_END)],       106)
@@ -939,18 +939,18 @@
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data 
[PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --infodir=DIR           info documentation [PREFIX/info]
+  --mandir=DIR            man documentation [PREFIX/man]
 _ACEOF
 
   cat <<\_ACEOF]
@@ -964,11 +964,11 @@
 dnl   Support for cross compilation (--build, --host and --target).
 dnl   Display only in long --help.
 dnl
-dnl - HELP_ENABLE
+dnl - HELP_INTRO
 dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
 dnl   then implements the header of the non generic options.
 dnl
-dnl - HELP_WITH
+dnl - HELP_DETAIL
 dnl
 dnl - HELP_VAR
 dnl
@@ -977,7 +977,7 @@
 dnl - HELP_END
 dnl   initialized below, in which we dump the trailer (handling of the
 dnl   recursion for instance).
-m4_divert_push([HELP_ENABLE])dnl
+m4_divert_push([HELP_INTRO])dnl
 _ACEOF
 fi
 
@@ -987,7 +987,7 @@
      short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
    esac])
   cat <<\_ACEOF
-m4_divert_pop([HELP_ENABLE])dnl
+m4_divert_pop([HELP_INTRO])dnl
 m4_divert_push([HELP_END])dnl
 m4_ifset([AC_PACKAGE_BUGREPORT], [
 Report bugs to <AC_PACKAGE_BUGREPORT>.])
@@ -1278,6 +1278,22 @@
 ])
 
 
+# _AC_HELP_INTRO
+# --------------
+# Put the generic descriptions of AC_ARG_ENABLE and AC_ARG_WITH into a separate
+# paragraph to make it more readable.  The help-text for those macros falls
+# into the same list, making it simple to organize.
+m4_define([_AC_HELP_INTRO],
+[m4_divert_once([HELP_INTRO], [$1])
+m4_divert_once([HELP_DETAIL], [[
+Options recognized by this package (as ordered in configure.in)]])dnl
+])
+
+
+# Utility macro to add text to the enable/with options list.
+m4_define([AC_DIVERT_HELP],
+[m4_divert_once([HELP_DETAIL], [[$1]])
+])
 
 
 ## ----------------------------- ##
@@ -1288,11 +1304,12 @@
 # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
 # ------------------------------------------------------------------------
 AC_DEFUN([AC_ARG_ENABLE],
-[m4_divert_once([HELP_ENABLE], [[
+[m4_divert_once([HELP_INTRO], [[
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])dnl
-m4_divert_once([HELP_ENABLE], [$2])dnl
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]]
+)
+m4_divert_once([HELP_DETAIL], [$2])dnl
 # Check whether --enable-$1 or --disable-$1 was given.
 if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then
   enableval="[$enable_]m4_bpatsubst([$1], -, _)"
@@ -1316,11 +1333,12 @@
 # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
 # --------------------------------------------------------------------
 AC_DEFUN([AC_ARG_WITH],
-[m4_divert_once([HELP_WITH], [[
+[m4_divert_once([HELP_INTRO], [[
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
-m4_divert_once([HELP_WITH], [$2])dnl
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]]
+)
+m4_divert_once([HELP_DETAIL], [$2])dnl
 # Check whether --with-$1 or --without-$1 was given.
 if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then
   withval="[$with_]m4_bpatsubst([$1], -, _)"
@@ -1596,7 +1614,7 @@
 m4_divert_text([HELP_CANON],
 [[
 System types:
-  --build=BUILD     configure for building on BUILD [guessed]]])dnl
+  --build=BUILD           configure for building on BUILD [guessed]]])dnl
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
   AC_MSG_ERROR([cannot run $ac_config_sub])
--- lib/autoconf/programs.m4.orig       2003-05-22 04:05:12.000000000 -0800
+++ lib/autoconf/programs.m4    2005-01-30 00:28:36.000000000 -0800
@@ -405,12 +405,14 @@
 AC_TRY_EVAL(LEX conftest.l)
 if test -f lex.yy.c; then
   ac_cv_prog_lex_root=lex.yy
+  rm -f lex.yy.c
 elif test -f lexyy.c; then
   ac_cv_prog_lex_root=lexyy
+  rm -f lexyy.c
 else
   AC_MSG_ERROR([cannot find output from $LEX; giving up])
-fi])
-rm -f conftest.l
+fi
+rm -f conftest.l])
 AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])dnl
 
 AC_CACHE_CHECK(whether yytext is a pointer, ac_cv_prog_lex_yytext_pointer,
@@ -509,4 +511,27 @@
 AN_PROGRAM([byacc], [AC_PROG_YACC])
 AN_PROGRAM([bison], [AC_PROG_YACC])
 AC_DEFUN([AC_PROG_YACC],
-[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
+[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)
+AC_CACHE_CHECK($YACC output file suffix, ac_cv_prog_yacc_suffix,
+[cat >conf$$.y <<_ACEOF
+%%
+foo: /* dummy rule */;
+%%
+_ACEOF
+AC_TRY_EVAL(YACC conf$$.y)
+if test -f y.tab.c; then
+  ac_cv_prog_yacc_suffix=.tab
+  rm -f y.tab.c
+elif test -f y_tab.c; then
+  ac_cv_prog_yacc_suffix=_tab
+  rm -f y_tab.c
+else
+dnl For historical reasons, YACC is set to yacc even if no yacc was
+dnl found.  So we have to default to .tab if we can't find the output.
+  AC_MSG_WARN([cannot find output from $YACC])
+  ac_cv_prog_yacc_suffix=.tab
+fi
+rm -f conf$$.y])
+AC_SUBST([YACC_OUTPUT_SUFFIX], [$ac_cv_prog_yacc_suffix])dnl
+])
+
--- lib/autoconf/status.m4.ori  2003-11-06 00:46:24.000000000 -0800
+++ lib/autoconf/status.m4      2005-01-30 18:40:44.000000000 -0800
@@ -350,6 +350,16 @@
 m4_define([AC_OUTPUT_COMMANDS_POST])
 
 
+# AC_SETUP_DEFS([SAVE-DEFS])
+AC_DEFUN([AC_SETUP_DEFS],
+[
+m4_ifset([AC_LIST_HEADERS],
+[m4_if($1,,,[define(AC_SAVE_DEFS,$1)])dnl
+DEFS=-DHAVE_CONFIG_H],
+[m4_if($1,,,AC_MSG_WARN(ignored save-defs parameter))
+AC_OUTPUT_MAKE_DEFS()])
+])dnl
+
 
 # _AC_OUTPUT_COMMANDS
 # -------------------
@@ -497,6 +507,11 @@
 ac_dB='[        ].*$,\1#\2'
 ac_dC=' '
 ac_dD=',;t'
+# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_iA='s,^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_iB='\([     ]\),\1#\2define\3'
+ac_iC=' '
+ac_iD='\4,;t'
 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
 ac_uB='$,\1#\2define\3'
@@ -546,6 +561,42 @@
 
 _ACEOF
 
+ifdef([AC_SAVE_DEFS],
+[
+# Transform confdefs.h into a list of #define's.  We won't use it as a sed
+# script, but as data to insert where we see @address@hidden  We expect 
AC_SAVE_DEFS to
+# be either 'cat' or 'sort'.
+AC_SAVE_DEFS confdefs.h | uniq >conftest.vals
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+echo '  rm -f conftest.frag' >> $CONFIG_STATUS
+while grep . conftest.vals >/dev/null
+do
+  # Write chunks of a limited-size here document to conftest.frag.
+  echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  echo 'CEOF' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+# Run sed to substitute the contents of conftest.frag into $tmp/in at the
+# marker @address@hidden
+echo '  cat >> conftest.edit <<CEOF
+/@DEFS@/r conftest.frag
+/@DEFS@/d
+CEOF
+sed -f conftest.edit $tmp/in > $tmp/out
+rm -f $tmp/in
+mv $tmp/out $tmp/in
+rm -f conftest.edit conftest.frag
+' >> $CONFIG_STATUS
+],[
 # Transform confdefs.h into two sed scripts, `conftest.defines' and
 # `conftest.undefs', that substitutes the proper values into
 # config.h.in to produce config.h.  The first handles `#define'
@@ -576,6 +627,7 @@
 # sort them, since we want the *last* AC-DEFINE to be honored.
 uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
 sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+sed 's/ac_d/ac_i/g' conftest.defines >>conftest.undefs
 rm -f confdef2sed.sed
 
 # This sed command replaces #undef with comments.  This is necessary, for
@@ -639,6 +691,7 @@
   mv conftest.tail conftest.undefs
 done
 rm -f conftest.undefs
+])
 
 dnl Now back to your regularly scheduled config.status.
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -793,11 +846,21 @@
       *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
   esac
 
+  case $OSTYPE in
+   msdosdjgpp)
+  ln  $ac_rel_source $ac_dest 2>/dev/null ||
+    ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
+    cp -p $srcdir/$ac_source $ac_dest ||
+    AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest])
+   ;;
+   *)
   # Try a symlink, then a hard link, then a copy.
   ln -s $ac_rel_source $ac_dest 2>/dev/null ||
     ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
     cp -p $srcdir/$ac_source $ac_dest ||
     AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest])
+    ;;
+    esac
 m4_ifset([AC_LIST_LINKS_COMMANDS],
 [  # Run the commands associated with the file.
   case $ac_file in
@@ -1179,8 +1242,8 @@
 ## -------------------------- ##
 
 
-# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
-# -------------------------------------------------------------------
+# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS] [, 
SAVE-DEFS])
+# 
---------------------------------------------------------------------------------
 #
 # If there are arguments given to AC_OUTPUT, dispatch them to the
 # proper modern macros.
@@ -1189,6 +1252,8 @@
           [AC_CONFIG_FILES([$1])])dnl
 m4_ifvaln([$2$3],
          [AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])])dnl
+m4_ifvaln([$4],
+           [AC_SETUP_DEFS([$4])])dnl
 [AC_OUTPUT]])
 
 
@@ -1203,7 +1268,7 @@
 [dnl Dispatch the extra arguments to their native macros.
 m4_ifval([$1],
         [AC_CONFIG_FILES([$1])])dnl
-m4_ifval([$2$3],
+m4_ifval([$2$3$4],
         [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
 m4_ifval([$1$2$3],
         [AC_DIAGNOSE([obsolete],
@@ -1230,7 +1295,7 @@
 }']
 fi
 
-m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
+AC_SETUP_DEFS([$4])
 
 dnl Commands to run before creating config.status.
 AC_OUTPUT_COMMANDS_PRE()dnl
--- lib/m4sugar/m4sh.m4.orig    2003-11-06 00:46:24.000000000 -0800
+++ lib/m4sugar/m4sh.m4 2005-01-30 00:28:36.000000000 -0800
@@ -561,7 +561,7 @@
     _AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
       [for as_base in sh bash ksh sh5; do
         case $as_dir in
-        /*)
+        [\\/]* | ?:[\\/]*)
           if ("$as_dir/$as_base" -c '_AS_LINENO_WORKS') 2>/dev/null; then
             AS_UNSET(BASH_ENV)
             AS_UNSET(ENV)
@@ -637,7 +637,7 @@
 m4_defun([_AS_PATH_SEPARATOR_PREPARE],
 [# The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
+  echo "#! $SHELL" >conf$$.sh
   echo  "exit 0"   >>conf$$.sh
   chmod +x conf$$.sh
   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
--- tests/acstatus.at.orig      2003-11-06 01:36:28.000000000 -0800
+++ tests/acstatus.at   2005-01-30 00:34:26.000000000 -0800
@@ -9,6 +9,7 @@
 AT_BANNER([Testing autoconf/status macros.])
 
 # Modern macros.
+AT_CHECK_MACRO([AC_SETUP_DEFS])
 
 # Obsolete macros.
 AT_CHECK_AU_MACRO([AC_OUTPUT_COMMANDS])

Then run "configure", then "make", then "make install".


6. Patch aclocal.m4 for DOS/Windows compatibility

Finally to lynx, itself. 
Apply the patch I recently submitte to the lynx-dev list for DOS path
compatibility.


--- lynx2.8.6dev.18/aclocal.m4.ori      2006-07-12 21:28:58.000000000 -0800
+++ lynx2.8.6dev.18/aclocal.m4  2006-07-25 00:29:26.000000000 -0800
@@ -264,9 +264,9 @@
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
   for ac_dir in ifelse([$5], , $PATH, [$5]); do
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
+    if test -f $ac_dir/$ac_word$ac_exeext; then
       if [$3]; then
-       ac_cv_path_$1="$ac_dir/$ac_word"
+       ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext"
        break
       fi
     fi



7. Run autoconf to regenerate configure

Next, regenerate the configure file by running "autoconf". Unfortunately,
autoconf 2.59 is no longer backwards compatible with configure.in files
written for 2.13. So before you can run autoconf, you need to patch the
configure.in file to work with 2.59.


--- lynx2.8.6dev.18/lynx2-8-6/configure.in.ori  2006-07-16 12:16:28.000000000 
-0700
+++ lynx2.8.6dev.18/lynx2-8-6/configure.in      2006-07-26 01:35:52.000000000 
-0700
@@ -900,7 +900,7 @@
 AC_MSG_RESULT($use_externs)
 if test $use_externs != "no" ; then
        AC_DEFINE(USE_EXTERNALS)
-       LIBOBJS="$LIBOBJS LYExtern\$o"
+       AC_LIBOBJ([LYExtern])
 fi
 
 AC_MSG_CHECKING(if you want to use setfont support)
@@ -1074,7 +1074,7 @@
 AC_MSG_RESULT($use_dired)
 
 if test ".$use_dired" != ".no" ; then
-       LIBOBJS="$LIBOBJS LYLocal\$o"
+       AC_LIBOBJ([LYLocal])
        AC_DEFINE(DIRED_SUPPORT)
 
        AC_MSG_CHECKING(if you wish to allow extracting from archives via DirEd)

Now run "autoconf" to genrate the "configure" file. 


8. Run configure with the appropriate options to generate the makefiles

Run configure with the options that you want. I use:


#!/bin/bash.exe
LDFLAGS="-mno-cygwin -static" \
LIBS="-L/mingw/lib -lwsock32 -lgdi32 -lmsvcrt -liconv" \
CFLAGS="-mno-cygwin -I/mingw/include -I/mingw/include/openssl -W \
-Wall -O3 -D_WINDOWS -DSH_EX -DWIN_EX -DNOUSERS -DNOSIGHUP -DDOSPATH \
-DUSE_ALT_BLAT_MAILER -DBOXHORI=0 -DBOXVERT=0" \
CPPFLAGS="-mno-cygwin -I/mingw/include -I/mingw/include/openssl" \
./configure --prefix=d:/cygwin/mingw/lynx2.8.6dev.18/lynx-conf \
--host=mingw32 \
--disable-dired-override \
--disable-full-paths \
--enable-addrlist-page \
--enable-change-exec \
--enable-charset-choice \
--enable-default-colors \
--enable-exec-links \
--enable-externs \
--enable-file-upload \
--enable-gzip-help \
--enable-nested-tables \
--enable-nls \
--enable-vertrace \
--libdir=d:/cygwin/mingw/lynx2.8.6dev.18/lynx-conf \
--with-bzlib \
--with-screen=curses \
--with-ssl \
--with-zlib


9. If desired, compile a lynx icon into a coff file with windres and
   modify the src/makefile to include the icon file in the lynx binary

I use the lynx.ico file distributed by Wayne Buttles with his package. Just
put lynx.ico in src and create a "icon.rc" file in src consisting of the one 
line:

100     ICON    "./lynx.ico"

Then run "windres -i icon.rc -o icon.o -O coff".
You can then add "icon$o" to OBJS in src/Makefile.


10. Run make to generate lynx and make install-full to install
You must install into a separate directory if you want to compress the
helpfiles. That is why I use "lynx-conf".


11. Optionally compress the lynx binary with upx
If you want to make the lynx.exe file smaller, use "upx --best lynx.exe"



I run lynx from a batch file which sets up the appropriate variables:

@echo off
set TERM=pcterm
set HOME=d:/cygwin/mingw/lynx2.8.6dev.18/lynx-conf
set EDITOR=d:/progra~1/vim/vim61/gvim.exe
set SSL_CERT_FILE=d:/cygwin/usr/local/ssl/cert.pem
d:\cygwin\mingw\lynx2.8.6dev.18\lynx2-8-6\lynx.exe %1 %2 %3 %4 %5 %6 %7 %8 %9


The default lynx.cfg and lynx.lss files are in the directory specified by
"libdir" in the configure script. The lynx.rc (equivalent to .lynxrc) will be
created in the HOME directory as will the bookmark file.

I create a Windows shortcut file (.lnk) to the batch file and put it on
my desktop. 

You can specify the environment variable "LYNX_LOCALEDIR" to specify
the location of the directory under which the lynx.mo files reside.
The language used can be specified by the "LANG" environment variable.
The charset to be assumed by the NLS code is specified in the
"charset.alias" file, but can be overridden by setting the "LANG"
variable to the "codepage" and setting the "LANGUAGE" variable to the
language.
-- 
Doug Kaufman
Internet: address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]