Showing posts with label bbe windows compile mingw gcc. Show all posts
Showing posts with label bbe windows compile mingw gcc. Show all posts

Friday, September 9, 2016

binary block editor (bbe) for windows



0. bbe's Win32 binary is here.

How to compile it for windows yourself:
1. get mingw-get-setup.exe from http://www.mingw.org/, install installer :) to c:\mingw. Then install neccessary packages:
  • c:\mingw\bin\mingw-get.exe install msys-bash
  • c:\mingw\bin\mingw-get.exe install mingw32-gcc
  • c:\mingw\bin\mingw-get.exe install msys-make
  • c:\mingw\bin\mingw-get.exe install msys-texinfo
2. get source from https://sourceforge.net/projects/bbe-/files/, extract it to c:\bbe-0.2.2

3. fix src\bbe.h lines 52-54 (https://sourceforge.net/p/bbe-/discussion/497696/thread/c7ef2724/)
[pre class="brush:text"]
// #ifndef HAVE_OFF_T
// #define long int off_t
// #endif
#define off_t long int
[/pre]

Next changes enables binary mode for files, otherwise you'll have troubles with EOF 0x1A symbol.
4. fix src\buffer.c
[pre class="brush:text"]
line 56:
from out_stream.fd = open(file,O_WRONLY | O_CREAT | O_TRUNC,S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
  to out_stream.fd = open(file,O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,S_IRUSR | S_IWUSR);
line 100:
from new->fd = open(file,O_RDONLY);
  to new->fd = open(file,O_RDONLY | O_BINARY);
[/pre]
5. fix src\execute.c
[pre class="brush:text"]
line 420 from fseeko to fseeko64
line 550 from c->fd = fopen(file,"w"); to c->fd = fopen(file,"wb");
line 584 from c->fd = fopen(c->s1,"w"); to c->fd = fopen(c->s1,"wb");
line 602 from c->fd = fopen(c->s1,"r"); to c->fd = fopen(c->s1,"rb");
line 616 frim c->fd = fopen(c->s1,"r"); to c->fd = fopen(c->s1,"rb");
[/pre]
6. compile it:
run C:\MinGW\msys\1.0\msys.bat, it will start new unix-like console.
[pre class="brush:text"]
$ cd /c/bbe-0.2.2
./configure
make
[/pre]
7. grab your bbe.exe from src folder.
8. this solutuion works for me, but it might not work for you :)

References: