-
Notifications
You must be signed in to change notification settings - Fork 122
/
COMPILE
145 lines (105 loc) · 5.69 KB
/
COMPILE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
You can compile wxHexEditor with Code::Blocks (C::B) easily.
All you need to install C::B for your OS, required compilation toolset (gcc) and wxHexEditor library for compilation.
But you can also build wxHexEditor from your shell.
For compiling wxHexEditor, without C::B you have to build internal udis and mhash libraries. They are automatically compiled when you run make command.
Please follow those directives under your OS to compile wxHexEditor.
-----------------------------------------------------
LINUX
-----------------------------------------------------
For Linux, make sure you have installed wxWidgets.
Use this command for ubuntu like distros:
apt-get install libwxgtk<version>-dev
or use your need to use this one for distros like OpenSuSE...
zypper in wxWidgets-devel
Then extract the wxHexEditor:
tar xvf wxHexEditor-v<version>-src.tar.bz2
cd wxHexEditor
make
you can also use OPTFLAGS and WXCONFIG flags if you have different wx-config name like
make WXCONFIG=wx-config CPPFLAGS="-fPIC" OPTFLAGS="-O3 -march-native -fopenmp"
Than you could use this command for installing wxHexEditor to your computer.
make install
-----------------------------------------------------
On Linux Cross-Compiling To WINDOWS
-----------------------------------------------------
If you have Linux installation and want to build Win32/Win64 build of wxHexEditor, follow this guide.
This is how I compile.
First, we need mingw-w64 toolchain. At AUR linux, I use;
yaourt -S mingw-w64-win-make mingw-w64-win-iconv
This will install all required dependencies mingw-w64-{make,iconv,crt,binutils,winpthreads,headers,cmake,gcc,pkg-config,environment}
I compile the wxWidgets library with a cross compiler:
tar xvf wxWidgets-<version>.tar.bz2
cd wxWidgets
mkdir release
cd release
../configure --enable-{monolithic,static,unicode} --disable-{debug,shared} --host=x86_64-w64-mingw32
make
Then I extract the wxHexEditor:
tar xvf wxHexEditor-v<version>-src.tar.bz2
cd wxHexEditor
x86_64-w64-mingw32-make win WXCONFIG=<wx-config path> HOST=x86_64-w64-mingw32 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++
PS: If you face with " _rpl_malloc " error, you can use
ac_cv_func_malloc_0_nonnull=yes make win WXCONFIG=<wx-congif path> HOST=x86_64-w64-mingw32 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++
PS2: for 32Bit build, you need to run with HOST=i686-w64-mingw32 instead of HOST=x86_64-w64-mingw32.
-----------------------------------------------------
WINDOWS
-----------------------------------------------------
For generating Windows executables, I use Linux to cross-compile a Windows executable via MinGW.
But you can use windows to compile it also.
*Download latest nightly of Code Blocks compiler from http://forums.codeblocks.org/index.php/board,20.0.html
With all support files, DLLs etc.
*Download MinGW Toolchains targets Win64 or Win32 from from https://sourceforge.net/projects/mingw-w64/files/
and extract to C:\mingw64
*You can download Headers and Release DLL files also but I prefer building from source code.
If you choose download just Headers and Release DLLs,
than please adjust
C::B->Project->Build options->Win32 Release->Search directories settings. (Also for Debug if needed.)
for build wxWidget from source code:
Download latest wxWidgets source code and extract it to root and remove versioning from en of the directory name.
PATH=%PATH%c:\mingw64\bin
cd C:\wxWidgets\build\msw
mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 SHARED=0 USE_XRC=1 -j1
You can increase -j1 for multi-thread building but you need to watch memory to have enough room.
Also C::B->Project->Build options->Win32 Release->Custom variables need wxWidgets path (if you use different version).
Also you need to generate udis86/libudis86/tab.c and tab.h files. I copy this files from linux.
Don't know how to build it via MSW.
-----------------------------------------------------
OS X
-----------------------------------------------------
You can easily install required dependencies and Xcode Commandline Tools with Homebrew installation:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After you could install required dependencies with this command:
brew install wxmac gettext autoconf automake libtool
Instead of wxmac library, you might need to compile wxWidgets from source.
Download wxWidgets source to your disk and with:
tar xvf wxWidgets-<version>.tar.bz2
cd wxWidgets
mkdir release
cd release
../configure --with-osx_cocoa \
--with-macosx-version-min=10.9 \
--with-macosx-sdk=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk \
--disable-shared --disable-mediactrl --with-{zlib,expat,libpng,libtiff}=builtin \
--with-opengl --enable-{unicode,monolithic}
PS: I use this configuration at Catalina using Clang compiler....
After you make ready the dependencies,
then extract the wxHexEditor and compile with:
tar xvf wxHexEditor-v<version>-src.tar.bz2
cd wxHexEditor
make mac WXCONFIG=<wx-config path>
Opps! I forgot to say that, you probably need to remove -lgomp flag from Makefile.
If everything is OK, you can also execute program with this command:
./wxHexEditor.app/Contents/MacOS/wxHexEditor
That's all.
-----------------------------------------------------
BSD
-----------------------------------------------------
First of all, you need to install all dependencies.
In FreeBSD 12.0, you can use pkg command
pkg install autotools wx31-gtk3 gmake openmp python
Then extract the wxHexEditor and compile with:
tar xvf wxHexEditor-v<version>-src.tar.bz2
cd wxHexEditor
gmake WXCONFIG=<wx-config path>
for example : gmake WXCONFIG=wxgtk3u-3.1-config
If you are lucky, this will compile the (dependencies mhash and udis86 than) program without any error.