-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
4297 lines (3945 loc) · 142 KB
/
index.html
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>MXE (M cross environment)</title>
<link rel="stylesheet" href="assets/common.css">
</head>
<body>
<div id="navigation">
<h1>MXE (M cross environment)</h1>
<ul>
<li><a href="#introduction" >Introduction</a></li>
<li><a href="#screenshots" >Screenshots</a></li>
<li><a href="#tutorial" >Tutorial</a></li>
<li><a href="#download" >Download</a></li>
<li><a href="https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list">Mailing List</a></li>
<li><a href="https://github.com/mxe/mxe/issues">Issue Tracker</a></li>
</ul>
<ul>
<li><a href="#requirements" >Requirements</a></li>
<li><a href="#usage" >Usage</a></li>
<li><a href="#packages" >List of Packages</a></li>
<li><a href="#creating-packages">Creating Packages</a></li>
<li><a href="#copyright" >Copyright</a></li>
<li><a href="#legal" >Legal</a></li>
<li><a href="#history" >History</a></li>
</ul>
<ul>
<li><a href="#see-also" >See also</a></li>
<li><a href="#used-by" >Used by</a></li>
</ul>
</div>
<div class="section">
<h2 id="introduction">Introduction</h2>
<p>
MXE (M cross environment) is a Makefile that
compiles a cross compiler and cross compiles
many free libraries such as SDL and Qt. Thus,
it provides a nice cross compiling environment
for various target platforms, which
</p>
<ul>
<li>
is designed to
<a href="#requirements">run on any Unix system</a>
</li>
<li>
is easy to adapt and to extend
</li>
<li>
builds
<a href="#packages">many free libraries</a>
in addition to the cross compiler
</li>
<li>
can also
<a href="#usage">build just a subset</a>
of the packages,
and automatically builds their dependencies
</li>
<li>
downloads all needed packages
and verifies them by their checksums
</li>
<li>
is able to update the version numbers of all packages automatically
</li>
<li>
directly uses source packages,
thus ensuring the whole build mechanism is transparent
</li>
<li>
allows inter-package and intra-package
<a href="#usage">parallel builds</a>
whenever possible
</li>
<li>
integrates well with <a href="#tutorial-5a">autotools</a>,
<a href="#tutorial-5b">cmake</a>, <a href="#tutorial-5c">qmake</a>,
and <a href="#tutorial-5d">hand-written makefiles</a>.
</li>
<li>
has been in continuous development <a href="#history">since 2007</a>
and is <a href="#used-by">used by several projects</a>
</li>
</ul>
<h3>Supported Toolchains</h3>
<table id="supported-toolchains">
<tr>
<th rowspan="2">Runtime</th>
<th rowspan="2">Host Triplet</th>
<th colspan="2">Packages</th>
</tr>
<tr>
<th>Static</th>
<th>Shared*</th>
</tr>
<tr>
<td rowspan="2">MinGW-w64</td>
<td>i686-w64-mingw32</td>
<td style='text-align:center'>99% (339/341)</td>
<td style='text-align:center'>62% (211/341)</td>
</tr>
<tr>
<td>x86_64-w64-mingw32</td>
<td style='text-align:center'>91% (311/341)</td>
<td style='text-align:center'>61% (209/341)</td>
</tr>
</table>
<p>
These numbers were last updated on October 13, 2014. You can see the
current status by executing <code>make build-matrix.html</code> in the
MXE directory.
</p>
<p><small>
* Shared support in MXE was just added in early February, 2014. These
numbers are expected to rise significantly.
</small></p>
</div>
<div class="section">
<h2 id="screenshots">Screenshots</h2>
<p>
Cross compiling
<a href="http://thebeez.home.xs4all.nl/4tH/">4tH</a>:
</p>
<a href="assets/screenshot-4th-compile.png">
<img src="assets/screenshot-4th-compile-small.png" alt="4th-compile">
</a>
<p>
and running it:
</p>
<a href="assets/screenshot-4th-run.png">
<img src="assets/screenshot-4th-run-small.png" alt="4th-run">
</a>
</div>
<div class="section">
<h2 id="tutorial">Tutorial</h2>
<h3 id="tutorial-1">Step 1: Requirements and Download</h3>
<p>
First, you should ensure that your system meets
MXE's
<a href="#requirements">requirements</a>.
You will almost certainly have to install some stuff.
</p>
<p>
When everything is fine, download the
<a href="#download">current version</a>:
</p>
<pre>git clone https://github.com/mxe/mxe.git</pre>
<p>
If you don't mind installing it in your home directory,
just skip the following step and go straight to step 3.
</p>
<p>
MXE builds and installs everything under the same
top-level directory and is not relocatable after
the first packages are built.
</p>
<p>
Due to limitations of GNU Make, the path of MXE is not allowed
to contain any whitespace characters.
</p>
<h3 id="tutorial-2">Step 2: System-wide Installation (optional)</h3>
<p>
Now you should save any previous installation
of the MXE.
Assuming you've installed it under
/opt/mxe (any other directory will do as well),
you should execute the following commands:
</p>
<pre>su
mv /opt/mxe /opt/mxe.old
exit</pre>
<p>
Then you need to transfer the entire directory to its definitive location.
We will assume again you use /opt/mxe,
but feel free to use any other directory if you like.
</p>
<pre>su
mv mxe /opt/mxe
exit</pre>
<p>
We're almost done.
Just change to your newly created directory and get going:
</p>
<pre>cd /opt/mxe</pre>
<h3 id="tutorial-3">Step 3: Build MXE</h3>
<p>
Enter the directory where you've downloaded MXE.
Now it depends on what you actually want – or need.
</p>
<p>
If you choose to enter:
</p>
<pre>make</pre>
<p>
you're in for a long wait,
because it compiles
<a href="#packages">a lot of packages</a>.
On the other hand it doesn't require any intervention,
so you're free to do whatever you like
– like watch a movie or go for a night on the town.
When it's done you'll find that you've installed
a very capable Win32 cross compiler onto your system.
</p>
<p>
If you only need the most basic tools you can also use:
</p>
<pre>make gcc</pre>
<p>
and add any additional packages you need later on.
You can also supply a host of packages on the
<a href="#usage">command line</a>,
e.g.:
</p>
<pre>make gtk lua libidn</pre>
<p>
Targets can also be specified on the command line.
By default, only i686-w64-mingw32.static is built, but you can
build your toolchain(s) of choice with:
</p>
<pre>make MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static'</pre>
<p>
or by adjusting the <code>MXE_TARGETS</code> variable
in <code>settings.mk</code>.
</p>
<p>
You'll always end up with a consistent cross compiling environment.
</p>
<p>
If you have trouble here, please feel free to
contact the mxe team through the
<a href="https://github.com/mxe/mxe/issues">issue tracker</a> or
<a href="https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list">mailing list</a>.
</p>
<p>
After you're done it just needs a little post-installation.
</p>
<h3 id="tutorial-4">Step 4: Environment Variables</h3>
<p>
Edit your .bashrc script in order to change $PATH:
</p>
<pre>export PATH=/<em>where MXE is installed</em>/usr/bin:$PATH</pre>
<p>
You may be tempted to also add <code>$(TARGET)/bin</code>
to your path. You <strong>never</strong> want to do this,
the executables and scripts in there will cause conflicts
with your native toolchain.
</p>
<p>
In case you are using custom $PKG_CONFIG_PATH entries,
you can add separate entries for cross builds:
</p>
<pre>export PKG_CONFIG_PATH="<em>entries for native builds</em>"</pre>
<pre>export PKG_CONFIG_PATH_i686_w64_mingw32_static="<em>entries for MXE builds</em>"</pre>
<p>
Remember to use i686-w64-mingw32.static-pkg-config
instead of pkg-config for cross builds.
The Autotools do that automatically for you.
</p>
<p>
Note that any other compiler related environment variables
(like $CC, $LDFLAGS, etc.)
may spoil your compiling pleasure,
so be sure to delete or disable those.
</p>
<p>
For the most isolated and repeatable environment,
use a white-list approach:
</p>
<pre>unset `env | \
grep -vi '^EDITOR=\|^HOME=\|^LANG=\|MXE\|^PATH=' | \
grep -vi 'PKG_CONFIG\|PROXY\|^PS1=\|^TERM=' | \
cut -d '=' -f1 | tr '\n' ' '`</pre>
<!-- update mxe-activate also -->
<p>
Congratulations!
You're ready to cross compile anything you like.
</p>
<h3 id="tutorial-5a">Step 5a: Cross compile your Project (Autotools)</h3>
<p>
If you use the
<a href="https://www.lrde.epita.fr/~adl/autotools.html">Autotools</a>,
all you have to do is:
</p>
<pre>./configure --host=i686-w64-mingw32.static
make</pre>
<p>
If you build a library, you might also want to enforce a static build:
</p>
<pre>./configure --host=i686-w64-mingw32.static --enable-static --disable-shared
make</pre>
<p>
Don't worry about a warning like this:
</p>
<pre>configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.</pre>
<p>
Everything will be just fine.
</p>
<h3 id="tutorial-5b">Step 5b: Cross compile your Project (CMake)</h3>
<p>
If you have a
<a href="http://www.cmake.org/">CMake</a> project,
you can use the provided cmake wrapper:
</p>
<pre>i686-w64-mingw32.static-cmake ...</pre>
<p>
This will automatically use the MXE version of cmake
and locate the toolchain file.
</p>
<h3 id="tutorial-5c">Step 5c: Cross compile your Project (Qt)</h3>
<p>
If you have a
<a href="https://qt-project.org/">Qt</a> application,
all you have to do is:
</p>
<pre>/where MXE is installed/usr/i686-w64-mingw32.static/qt/bin/qmake
make</pre>
<p>
Note that Qt 4 is in the "qt" subdirectory. Qt 5 is in the "qt5" subdirectory
and its qmake can be invoked similarly.
</p>
<p>
If you are using Qt plugins
such as the svg or ico image handlers,
you should also have a look at the
<a href="https://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins">Qt documentation about static plugins</a>.
</p>
<p>
Note the sql drivers (-qt-sql-*)
and the image handlers for jpeg, tiff, gif and mng
are built-in, <em>not</em> plugins.
</p>
<h3 id="tutorial-5d">Step 5d: Cross compile your Project (Makefile)</h3>
<p>
If you have a handwritten Makefile,
you probably will have to make a few adjustments to it:
</p>
<pre>CC=$(CROSS)gcc
LD=$(CROSS)ld
AR=$(CROSS)ar
PKG_CONFIG=$(CROSS)pkg-config</pre>
<p>
You may have to add a few others, depending on your project.
</p>
<p>
Then, all you have to do is:
</p>
<pre>make CROSS=i686-w64-mingw32.static-</pre>
<p>
That's it!
</p>
<h3 id="tutorial-5e">Step 5e: Cross compile your Project (OSG)</h3>
<p>
Using static OpenSceneGraph libraries requires a few changes to your source.
The graphics subsystem and all plugins required by your application must be
referenced explicitly. Use a code block like the following:
</p>
<pre>#ifdef OSG_LIBRARY_STATIC
USE_GRAPHICSWINDOW()
USE_OSGPLUGIN(<plugin1>)
USE_OSGPLUGIN(<plugin2>)
...
#endif</pre>
<p>
Look at <code>examples/osgstaticviewer/osgstaticviewer.cpp</code> in the
OpenSceneGraph source distribution for an example. This example can be
compiled with the following command:
</p>
<pre>i686-w64-mingw32.static-g++ \
-o osgstaticviewer.exe examples/osgstaticviewer/osgstaticviewer.cpp \
`i686-w64-mingw32.static-pkg-config --cflags openscenegraph-osgViewer openscenegraph-osgPlugins` \
`i686-w64-mingw32.static-pkg-config --libs openscenegraph-osgViewer openscenegraph-osgPlugins`</pre>
<p>
The <code>i686-w64-mingw32.static-pkg-config</code> command from MXE will
automatically add <code>-DOSG_LIBRARY_STATIC</code> to your compiler flags.
</p>
<h3>Further Steps</h3>
<p>
If you need further assistance,
feel free to join the
<a href="https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list">mailing list</a>
where you'll get in touch with
the MXE developers
and other users.
</p>
</div>
<div class="section">
<div id="latest-release"></div>
<div id="latest-version"></div>
<div id="development"></div>
<h2 id="download">Download</h2>
<p>
To obtain the current version, run:
</p>
<pre>git clone https://github.com/mxe/mxe.git</pre>
<p>
To retrieve updates, run:
</p>
<pre>git pull</pre>
<p>
You can also browse the
<a href="https://github.com/mxe/mxe">web repository</a>.
</p>
<p>
In addition,
feel free to join the
<a href="https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list">mailing list</a>
and to <a href="#creating-packages">propose new packages</a>.
</p>
</div>
<div class="section">
<h2 id="requirements">Requirements</h2>
<p>
MXE requires a recent Unix system where
all components as stated in the table below
are installed. It also needs roughly 2 GiB of
RAM to link gcc and at least 700 MB of disk
space per target (counted with only gcc
built).
</p>
<p>
Detailed instructions are available for:
</p>
<ul class="compact-list">
<li><a href="#requirements-debian">Debian</a></li>
<li><a href="#requirements-fedora">Fedora</a></li>
<li><a href="#requirements-freebsd">FreeBSD</a></li>
<li><a href="#requirements-frugalware">Frugalware</a></li>
<li><a href="#requirements-gentoo">Gentoo</a></li>
<li><a href="#requirements-macos">Mac OS X</a></li>
<li><a href="#requirements-opensuse">openSUSE</a></li>
</ul>
<table class="requirements">
<tr>
<td><a href="https://www.gnu.org/software/autoconf/">Autoconf</a></td>
<td>≥ 2.68</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/automake/">Automake</a></td>
<td>≥ 1.11.3</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/bash/">Bash</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/bison/">Bison</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://www.bzip.org/">Bzip2</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://flex.sourceforge.net/">Flex</a></td>
<td>≥ 2.5.31</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/gcc/">GCC</a> (gcc, g++)</td>
<td></td>
</tr>
<tr>
<td><a href="http://www.gdk-pixbuf.org/">gdk-pixbuf</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://git-scm.com/">Git</a></td>
<td>≥ 1.7</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/coreutils/">GNU Coreutils</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/gettext/">GNU Gettext</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/gperf/">GNU gperf</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/make/">GNU Make</a></td>
<td>≥ 3.81</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/sed/">GNU Sed</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://freedesktop.org/wiki/Software/intltool/">Intltool</a></td>
<td>≥ 0.40</td>
</tr>
<tr>
<td><a href="https://en.wikipedia.org/wiki/C_standard_library">LibC</a> for 32-bit</td>
<td></td>
</tr>
<tr>
<td><a href="https://sourceware.org/libffi/">libffi</a></td>
<td>≥ 3.0.0</td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/libtool/">Libtool</a></td>
<td>≥ 2.2</td>
</tr>
<tr>
<td><a href="https://www.openssl.org/">OpenSSL</a>-dev</td>
<td>≥ 1.01</td>
</tr>
<tr>
<td><a href="http://p7zip.sourceforge.net/">p7zip (7-Zip)</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/patch/">Patch</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://www.perl.org/">Perl</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://search.cpan.org/dist/XML-Parser/Parser.pm">Perl XML::Parser</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://www.freedesktop.org/wiki/Software/pkg-config/">Pkg-config</a></td>
<td>≥ 0.16</td>
</tr>
<tr>
<td><a href="https://www.python.org/">Python</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.ruby-lang.org/">Ruby</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://www.scons.org/">SCons</a></td>
<td>≥ 0.98</td>
</tr>
<tr>
<td><a href="http://www.info-zip.org/UnZip.html">UnZip</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://www.gnu.org/software/wget/">Wget</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://tukaani.org/xz/">XZ Utils</a></td>
<td></td>
</tr>
<tr>
<td><a href="http://zlib.net/">zlib</a></td>
<td>≥ 1.20</td>
</tr>
</table>
<h3 id="requirements-debian">Debian and derivatives</h3>
<!-- http://www.debian.org/distrib/packages#search_packages -->
<pre>apt-get install \
autoconf automake autopoint bash bison bzip2 flex gettext\
git g++ gperf intltool libffi-dev libgdk-pixbuf2.0-dev \
libtool libltdl-dev libssl-dev libxml-parser-perl make \
openssl p7zip-full patch perl pkg-config python ruby scons \
sed unzip wget xz-utils</pre>
<p>
On 64-bit Debian, install also:
</p>
<pre>apt-get install g++-multilib libc6-dev-i386</pre>
<p>
On Debian Jessie (8) or Ubuntu Utopic (14.10) or later,
install also:
</p>
<pre>apt-get install libtool-bin</pre>
<p>
Only the <a href="https://www.debian.org/releases/stable/">latest Debian stable series</a> is supported.
</p>
<h3 id="requirements-fedora">Fedora</h3>
<!-- https://admin.fedoraproject.org/pkgdb/ -->
<pre>yum install \
autoconf automake bash bison bzip2 flex gcc-c++ \
gdk-pixbuf2-devel gettext git gperf intltool make \
sed libffi-devel libtool openssl-devel p7zip patch \
perl pkgconfig python ruby scons unzip wget xz</pre>
<p>
On 64-bit Fedora,
there are <a href="#issue-non-multilib">issues without a 32-bit compiler</a>.
</p>
<h3 id="requirements-freebsd">FreeBSD</h3>
<!-- http://www.freshports.org/ -->
<pre>pkg install \
automake autoconf bash bison coreutils flex \
gcc gdk-pixbuf2 gettext git glib gmake gperf gsed intltool libffi \
libtool openssl p5-XML-Parser p7zip patch perl5 \
pkgconf python ruby scons unzip wget</pre>
<p>
Use gmake instead of make.
</p>
<p>
Install file(1) from ports, because file(1) from base
<a href="https://forums.freebsd.org/threads/usr-bin-file-works-very-slow.52958/">works</a>
very-very-very slow with long text files.
</p>
<p>
Do not build as root. See
<a href="https://github.com/mxe/mxe/issues/902">#902</a>.
</p>
<p>
Ensure that /usr/local/bin precedes /usr/bin in your $PATH:
</p>
<p>
For C style shells, edit .cshrc
</p>
<pre>setenv PATH /usr/local/bin:$PATH</pre>
<p>
For Bourne shells, edit .profile
</p>
<pre>export PATH=/usr/local/bin:$PATH</pre>
<p>
On 64-bit FreeBSD,
there are <a href="#issue-non-multilib">issues without a 32-bit compiler</a>.
</p>
<p>
<strong>N.B. FreeBSD is no longer fully supported</strong>
</p>
<p>
to build the remainder of MXE, run:
</p>
<pre>gmake EXCLUDE_PKGS='gtksourceviewmm2 ocaml% openexr pcl qtbase'</pre>
<p>
to see a list of all dependent downstream packages that
will be excluded, run:
</p>
<pre>gmake show-downstream-deps-'gtksourceviewmm2 ocaml% openexr \
pcl qtbase'</pre>
<h3 id="requirements-frugalware">Frugalware</h3>
<!-- http://www.frugalware.org/packages -->
<pre>pacman-g2 -S \
autoconf automake bash bzip2 bison flex gcc gdk-pixbuf2\
gettext git gperf intltool make sed libffi libtool \
openssl patch perl perl-xml-parser pkgconfig python \
ruby scons unzip wget xz xz-lzma</pre>
<p>
On 64-bit Frugalware,
there are <a href="#issue-non-multilib">issues without a 32-bit compiler</a>.
</p>
<h3 id="requirements-gentoo">Gentoo</h3>
<!-- http://packages.gentoo.org/ -->
<pre>emerge \
sys-devel/autoconf sys-devel/automake app-shells/bash \
sys-devel/bison app-arch/bzip2 \
sys-devel/flex sys-devel/gcc sys-devel/gettext \
dev-vcs/git dev-util/gperf dev-util/intltool \
sys-devel/make sys-apps/sed dev-libs/libffi \
sys-devel/libtool dev-libs/openssl app-arch/p7zip \
sys-devel/patch dev-lang/perl dev-perl/XML-Parser \
dev-util/pkgconfig dev-lang/python dev-lang/ruby \
dev-util/scons app-arch/unzip net-misc/wget \
app-arch/xz-utils x11-libs/gdk-pixbuf</pre>
<h3 id="requirements-macos">Mac OS X</h3>
<p>
Install
<a href="http://developer.apple.com/xcode/">the latest Xcode</a>
</p>
<h5 id="requirements-macos-method-1">Method 1 - MacPorts</h5>
<p>
Install <a href="http://www.macports.org/">MacPorts</a>,
then run:
</p>
<!-- http://www.macports.org/ports.php -->
<pre>sudo port install \
autoconf automake bison coreutils flex gettext \
gdk-pixbuf2 glib2 gsed intltool libffi libtool \
openssl p5-xml-parser p7zip scons wget xz</pre>
<h5 id="requirements-macos-method-2">Method 2 - Rudix</h5>
<p>
Install <a href="http://rudix.org/">Rudix</a>,
then run:
</p>
<!-- http://rudix.org/packages/index.html -->
<pre>sudo rudix install \
autoconf automake coreutils gettext glib intltool \
libtool p7zip scons sed wget xz</pre>
<p>
Note: <b>gdk-pixbuf2</b> is not installed in method 2,
so you can not build <b>gtk3</b>. Other packages may be
missing on Rudix - please open an issue if you find any.
</p>
<h5 id="requirements-macos-method-3">Method 3 - Homebrew</h5>
<p>
Install <a href="http://brew.sh/">Homebrew</a>,
then run:
</p>
<!-- http://braumeister.org/ -->
<pre>brew install \
autoconf automake coreutils gdk-pixbuf gettext \
gnu-sed intltool libtool p7zip wget xz</pre>
<p>
Some formulae are
<a href="https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#what-does-keg-only-mean"><code>keg-only</code></a>
and will need <code>brew link</code> to be found.
</p>
<h5 id="requirements-macos-genaral">Genral Notes</h5>
<p>
You may be prompted to install a java runtime
- this is not required.
</p>
<p>
Mac OS X versions ≤ 10.9 are no longer tested.
</p>
<p>
<h5>Certain packages have open issues on OS X</h5>
</p>
<p>
to build the remainder of MXE, run:
</p>
<pre>make EXCLUDE_PKGS='nsis ocaml%'</pre>
<p>
to see a list of all dependent downstream packages that
will be excluded, run:
</p>
<pre>make show-downstream-deps-'nsis ocaml%'</pre>
<h3 id="requirements-opensuse">openSUSE</h3>
<!-- http://software.opensuse.org/131/en -->
<pre>zypper install -R \
autoconf automake bash bison bzip2 flex gcc-c++ \
gdk-pixbuf-devel gettext-tools git gperf intltool \
libffi-devel libtool make openssl libopenssl-devel \
p7zip patch perl perl-XML-Parser pkg-config python \
ruby scons sed unzip wget xz</pre>
<p>
On 64-bit openSUSE, install also:
</p>
<pre>zypper install -R \
gcc-32bit glibc-devel-32bit libgcc46-32bit \
libgomp46-32bit libstdc++46-devel-32bit</pre>
<h3 id="issue-non-multilib">Issues without a 32-bit compiler</h3>
<p>
Certain packages contain native tools that are
currently 32-bit only. In order to build these on a
64-bit system, multi-lib support must be enabled in the
compiler toolchain. However, not all operating systems
support this.
</p>
<p>
To build the remainder of MXE, specify the affected
packages to exclude:
</p>
<pre>make EXCLUDE_PKGS='ocaml%'</pre>
</div>
<div class="section">
<h2 id="usage">Usage</h2>
<p>
All build commands also download the packages if necessary.
</p>
<p>
In a BSD userland, substitute "make" with "gmake"
as all commands are based on
<a href="https://www.gnu.org/software/make/manual/make.html">GNU Make</a>.
</p>
<dl class="usage">
<dt>make</dt>
<dd>
build all packages,
non-parallel
</dd>
<dt>make gcc</dt>
<dd>
build a minimal useful set of packages,
i.e. the cross compilers
and the most basic packages,
non-parallel
</dd>
<dt>make foo bar</dt>
<dd>
build packages "foo", "bar" and their dependencies,
non-parallel
</dd>
<dd>
the package list can also be set in
<code>settings.mk</code>
<pre>LOCAL_PKG_LIST := foo bar
.DEFAULT local-pkg-list:
local-pkg-list: $(LOCAL_PKG_LIST)</pre>
</dd>
<dd>
so a call to <code>make</code> will only build those packages (and their
dependencies, of course)
</dd>
<dt>make foo bar --touch</dt>
<dd>
mark packages "foo" and "bar" as up-to-date after
a trivial change in one of their dependencies
(short option "-t")
</dd>
<dt>make foo bar --jobs=4 JOBS=2</dt>
<dd>
build packages "foo", "bar" and their dependencies,
where up to 4 packages are built in parallel
(short option "-j 4"),
each with up to 2 compiler processes running in parallel
</dd>
<dd>
the JOBS variable can also be defined in
<code>settings.mk</code> and defaults to the number
of CPUs up to a max of 6 to prevent runaway system
load with diminishing returns - see the
<a href="https://www.gnu.org/software/make/manual/make.html#Parallel">GNU Make manual</a>
for more details on parallel execution
</dd>
<dt>make --jobs=4 --keep-going</dt>
<dd>
build all packages with 4 inter-package parallel
jobs and continue as much as possible after an error
(short option "-j 4 -k")
</dd>
<dt>make EXCLUDE_PKGS='foo bar'</dt>
<dd>
build all packages excluding foo, bar, and all downstream
packages that depend on them - mostly used when there are
<a href="#issue-non-multilib">known issues</a>
</dd>
<dt>make check-requirements</dt>
<dd>
check most of the
<a href="#requirements">requirements</a>
if necessary
– executed automatically
before building packages
</dd>
<dt>make download</dt>
<dd>
download all packages,
non-parallel,
such that subsequent builds work without internet access
</dd>
<dt>make download-foo download-bar</dt>
<dd>
download packages "foo", "bar" and their dependencies,
non-parallel
</dd>
<dt>make download-foo download-bar -j 4</dt>
<dd>
download packages "foo", "bar" and their dependencies,
where up to 4 packages are downloaded in parallel
</dd>
<dt>make download-only-foo download-only-bar</dt>
<dd>
download packages "foo", "bar", without their dependencies,
non-parallel
</dd>
<dt>make clean</dt>
<dd>
remove all package builds
– use with caution!
</dd>
<dt>make clean-junk</dt>
<dd>
remove all unused files, including unused package
files, temporary folders, and logs
</dd>
<dt>make clean-pkg</dt>
<dd>
remove all unused package files,
handy after a successful update
</dd>
<dt>make show-deps-foo</dt>
<dd>
print a list of upstream dependencies
and downstream dependents
</dd>
<dt>make show-downstream-deps-foo</dt>