[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling sed 4.7 under Windows 10 64 bit
From: |
Assaf Gordon |
Subject: |
Re: Compiling sed 4.7 under Windows 10 64 bit |
Date: |
Sat, 29 Dec 2018 20:06:37 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
Hello,
On 2018-12-29 5:08 p.m., John Smith wrote:
Does anyone know how to do this and what tools are required? It would be
great to have a clear set of instructions for reference somewhere.
1.
If you have cygwin installed ( https://www.cygwin.com/ ),
sed is available as a pre-built package which you can easily install.
They currently have sed-4.4 packaged, but I'm sure they will soon
have sed-4.7.
2.
Similarly, if you have cygwin installed, sed can be built from
sources. Installing the "xz","make","gcc" packages should suffice for
compiling sed from tar archive (compiling from git requires more
complicated setup and tools).
wget https://ftp.gnu.org/gnu/sed/sed-4.7.tar.xz
tar -xf sed-4.7.tar.xz
cd sed-4.7
./configure
make
The resulting binary will require the cygwin environment (or at least
the cygwin1.dll file to be available).
3.
With cygwin (and with most gnu/linuxes), the MingW cross-compiler can
be used to build sed binaries that can "just work" on any windows
machine without requiring cygwin1.dll.
There are two common "flavors" for MingW:
i686-w64-mingw32 = builds 32bit (PE32) executables
x86_64-w64-mingw32 = builds 64bit (PE32+) executables
On Cygwin the packages are: mingw64-i686-gcc-core mingw64-x86_64-gcc-core
On Debian the packages are: gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
Installing these packages should automatically pull all the required
dependencies (i.e. many more packages).
Then, to build sed using 32bit mingw, use the following commands:
wget https://ftp.gnu.org/gnu/sed/sed-4.7.tar.xz
tar -xf sed-4.7.tar.xz
cd sed-4.7
./configure --disable-nls --host=i686-w64-mingw32
make
Replace "--host=i686-w64-mingw32" with "--host=x86_64-w64-mingw32"
to build a "sed.exe" binary for 64bit.
NOTE:
The later stages of such builds might fail with errors mentioning
"lib/netinet/in.h". If you see this failure, it happens *after*
sed.exe was already successfully built, so the error can safely ignored.
4.
I do not know (and not familiar with) building sed using native windows
tools (e.g. Microsoft Visual Studio).
If anyone has experience with such builds, please do send information.
5.
In case you don't have cygwin/mingw and you just want a working sed
on native windows, I've compiled sed-4.7 for 32bit and 64bit
using the exact instructions in step 3.
They are available here:
https://download-mirror.savannah.gnu.org/releases/sed/sed-4.7-64bit.exe
https://download-mirror.savannah.gnu.org/releases/sed/sed-4.7-32bit.exe
The checksum for these binaries:
$ sha1sum sed-4.7-32bit.exe sed-4.7-64bit.exe
be5b6e0a4c025703431d49d3c156b07caaecb327 sed-4.7-32bit.exe
b4b4c888f3e2fd950ac41f779d4e5608081da32a sed-4.7-64bit.exe
$ sha256sum sed-4.7-32bit.exe sed-4.7-64bit.exe
89de8ab100b2b42fae1730db9b337ace77270b024958119a6d304abe7cc4b703
sed-4.7-32bit.exe
76547e833cf2e70b36de74c89be118dcd975a1d966b9322147a6e55e758f3751
sed-4.7-64bit.exe
regards,
- assaf