[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling MingW lynx under Cygwin (was Re: [Lynx-dev] text browsing)
From: |
patakuti |
Subject: |
Re: Compiling MingW lynx under Cygwin (was Re: [Lynx-dev] text browsing) |
Date: |
Sat, 12 Aug 2006 09:28:53 +0900 (JST) |
On Sun, 30 Jul 2006, address@hidden wrote:
> 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
Thanks a lot.
I tried it and finally successed to build with some efforts.
I wrote some comments and questions below.
> 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
I want to use precompiled libraries if it's OK.
If I should to use patched libraries, please tell me which libraries
sould be patched.
> 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 used precompiled library: pdcurses-2.6.0-2003.07.21-1.exe
I got from http://www.mingw.org/download.shtml.
> 2. Compile and install MingW OpenSSL 0.9.8 stable branch
>
> I applied this patch before compiling:
I tried GnuTLS instead of OpenSSL.
I used precompiled library: gnutls_1_0_17_win32_mingw_libs.zip
I got from ftp://ftp.gnutls.org/pub/gnutls/win32.
> 3. Compile and install MingW iconv
>
> I used libiconv 1.8.
> I applied this patch:
I used precompiled library: libiconv-1.9.1.bin.woe32.zip
I got from http://sourceforge.net/project/showfiles.php?group_id=25167
> 4. Compile and install MingW gettext
>
> I used gettext-0.11.5.
> I applied this patch:
I used precompiled library: gettext-0.11.5-2003.02.01-1.exe
I got from http://www.mingw.org/download.shtml.
# I found two different source archives of gettext-0.11.5 from
# http://www.gnu.org/software/gettext/
# http://www.mingw.org/download.shtml
#
# I failed to apply your patch to the former one.
# I successed to apply it the latter one but haven't successed to built.
> 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:
[snip]
> Then run "configure", then "make", then "make install".
No problem.
> 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.
No problem.
> 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.
[snip]
> Now run "autoconf" to genrate the "configure" file.
No problem.
> 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" \
I think "-L/mingw/lib" should be in LDFLAGS instead of in LIBS.
I changed these line as below to compile with GnuTLS.
LDFLAGS="-mno-cygwin -static -L/mingw/lib" \
LIBS="-lgdi32 -lmsvcrt -liconv -lgcrypt -lgpg-error -lwsock32" \
# I don't know why I have to add "-lgcrypt -lgpg-error".
> 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 \
I removed this line because I don't install 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.
Not tried yet.
> 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".
I tried only make and success to build binary. GREAT!
> 11. Optionally compress the lynx binary with upx
> If you want to make the lynx.exe file smaller, use "upx --best lynx.exe"
Not tried yet.
> 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
>
>
>
> _______________________________________________
> Lynx-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lynx-dev
--
Takeshi Hataguchi
E-mail: address@hidden
- Re: Compiling MingW lynx under Cygwin (was Re: [Lynx-dev] text browsing),
patakuti <=