lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] How to compile Lynx 2.9.0dev5


From: Thomas Dickey
Subject: Re: [Lynx-dev] How to compile Lynx 2.9.0dev5
Date: Sun, 26 Apr 2020 10:00:49 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Sat, Apr 25, 2020 at 02:17:05PM +0200, Junaid Naseer wrote:
> Hello everyone,
> 
> I have been trying unsuccessfully for the last few days to build the
> lynx text web-browser on Windows 10.
> 
> 
>         Background (you can skip):
> 
> Reason for attempting to do so has been, that I downloaded various
> windows binary installers from https://invisible-island.net/lynx/, but I
> could get none of them to work with HTTPS. All the SSL-supporting

I'm puzzled because (since someone complained about the packages),
I did retest Windows 10 and Windows 8 with each of the installers.

> installers required the C++ 2012 (and/or C++2013) redistributables. (I
> tried with both VS C++ redistributables).

yes... I don't intend providing the dll's myself, since someone
else is willing to do this.  (The openssl developers have never
been much concerned with portability of their makefiles).
 
> Unfortunately, even though "msvcr120.dll" is installed on my system, the
> Lynx installer still throws an error /"could not copy msvcr120.dll"/. so
> I figured, I might try to compile myself the Lynx project.
> 
> 
>         Attempts:
> 
>  1.
> 
> 
>               Using the make-msc.bat
> 
>   * Since I had visual studio 2017 already installed and since I did NOT
>     want to install yet another Visual Studio on my system, I tried to
>     compile the Lynx browser with the VS 2017.
>       o I found out from here
>         
> <https://stackoverflow.com/questions/49184227/cannot-open-source-file-sys-types-h-sys-stat-h>,
>         here
>         
> <https://stackoverflow.com/questions/38290169/cannot-find-corecrt-h-universalcrt-includepath-is-wrong>,
>         here
>         
> <https://stackoverflow.com/questions/4051088/get-dos-path-instead-of-windows-path>
>         and here
>         <https://stackoverflow.com/questions/9509166/what-is-winapifamily-h>
>         that the location of some files had changed as we moved from
>         VS2012 to VS2017. Google and SO helped and after installing
>         *Windows Universal CRT SDK* and modifying my *makefile.msc* I
>         had added the following list of lines to my makefile.msc:

Generally I setup makefile.msc to allow environment variables to set the
interesting dependencies (I don't edit the makefile, since keeping that
in sync with source control would be a distraction).
 
>             SYS_DIR = "C:\PROGRA~2\WI3CF2~1\10\Include\100177~1.0\ucrt"
>             SDK_DIR =
>             
> "C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\include"
>             WIN_PATHS = "C:\PROGRA~2\WI3CF2~1\10\Include\100177~1.0\um"
>             WIN_PATH2 = "C:\PROGRA~2\WI3CF2~1\10\Include\100177~1.0\shared"
>             GNUWIN32 = "C:\no_space\GnuWin32\include"
>             CURSES_DIR = "C:\no_space\lynx-cur\PDCURS~1.9"
> 
>         And I had added those variables to the *INCLUDES*.
> 
>   * So far so good. I had to also install bzip2
>     <http://gnuwin32.sourceforge.net/packages/bzip2.htm>, zlib
>     <http://gnuwin32.sourceforge.net/packages/zlib.htm>.
>   * I wrote from here
>     
> <https://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c>my
>     unistd.h and from here <https://gist.github.com/ashelly/7776712>my
>     getopt.c and getopt.h. (Unfortunately the versions of unistd.h in
>     mys2 and mingw64 gave errors, that is why I copied the version from SO).

...and I don't modify the headers from the development system :-)

>   * I also download PDCurses and included the path to it in the
>     makefile.msc also.
> 
>                             CURSES_DIR = "C:\no_space\lynx-cur\PDCURS~1.9"
> 
> So far so good. Unfortunately the rabbit hole did not end here.
> 
> 
>   * I get a bunch of redefinition errors. Unfortunately, I cannot remove
>     either of those paths as one is needed for "sys/type.h" and the
>     other one for "winapifamily.h".
> 
> C:\PROGRA~2\WI3CF2~1\10\Include\100177~1.0\shared\ws2def.h(103): warning
> C4005: 'AF_IPX': macro redefinition
> C:\PROGRA~2\WI3CF2~1\10\Include\100177~1.0\um\winsock.h(457): note: see
> previous definition of 'AF_IPX'
> 
> .......... (similar redefinition errors for more variables)
> 
> 
> 
>   * And also I get errors popping from within Lynx as well:
> 
>         src\GridText.c(9544): error C2065: 'URL_GET_METHOD': undeclared
...
 
> At which point I am thinking, are the devs of Lynx really using VS2012
> to build Lynx in 2020?

I did - I built using 2012, 2015, 2017, both 32-bit/64-bit,
and provide installers for the 2012 with 32-bits.
 
>       2. *Using configure on msys2*

msys2 won't give you a _native_ Windows executable.
Think of it as a cut-down Cygwin.

I do cross-compiles for mingw (32/64), but the state of packages for
supporting libraries has never been worth much (commenting on both
Debian and Redhat).
 
>   * Alternatively, I also tried using msys2 and configure a makefile.
>     The configure command look like this:

yes... but there's always the issue of compiling for the current
environment (which msys2 can do) and targeting something like native
Windows.  Cross-compiling from Debian or Fedora is simpler, but I've
gotten the most useful builds from Visual Studio :-)
 
>         ./configure --with-curses-dir=/c/no_space/lynx-cur/PDCurses-3.9/
>         --with-screen=pdcurses
> 
>     But here it fails with this error:
> 
>         configure: error: Unable to successfully link Athena library
>         (-lXaw) with test program

sure - the PDCurses X11 libraries are what it's looking for.
A check for cross-compiling into PDCurses on Windows is going to be
very different.
 
>   * Finally for good measure, I tried to use the solution files for the
>     VS2012X64 and VS2012X32 with my Visual studio 2017.
>   * I had to include the paths to the PDCurses folder and to the
>     GNUWin32/include directory.
>   * This seemed like it would work, until Visual Studio threw up an
>     error and said that it cannot find pdcurses.lib.
>   * Unfortunately, the PDCurses folder has no lib file. The makefiles in
>     the pdcurses/wincon directory only generate dll files or .a files.
>     No.lib files!
> 
> 
> The website invisible island clearly states that the developer has
> successfully built Lynx browser under windows using different VS
> versions. I am not sure, why I am failing at all methods.

I attempted to send an attachment with scripts, but don't see either try.

On my machines, I have a shortcut to a script which sets environment
variables, which then starts winvile.  From winvile, I run "all-lynx.bat",
which builds a half-dozen configurations of lynx.

Using winvile that way, I collect the logs for each compiler configuration:

-rw-r--r-- 1 tom users 620283 Feb 27 20:23 /usr/build/lynx/logs/vs2008x32.log
-rw-r--r-- 1 tom users 620356 Feb 27 20:29 /usr/build/lynx/logs/vs2010x32.log
-rw-r--r-- 1 tom users 620324 Feb 27 20:34 /usr/build/lynx/logs/vs2012x32.log
-rw-r--r-- 1 tom users 624050 Feb 27 20:44 /usr/build/lynx/logs/vs2012x64.log
-rw-r--r-- 1 tom users 617665 Feb 27 20:49 /usr/build/lynx/logs/vs2015x32.log
-rw-r--r-- 1 tom users 621248 Feb 27 20:53 /usr/build/lynx/logs/vs2015x64.log
-rw-r--r-- 1 tom users 617677 Feb 27 20:59 /usr/build/lynx/logs/vs2017x32.log
-rw-r--r-- 1 tom users 621499 Feb 27 21:04 /usr/build/lynx/logs/vs2017x64.log

(I had a VS 2013 on my preferred machine, but an upgrade broke it).

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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