-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-toolchain.sh
executable file
·991 lines (857 loc) · 33.3 KB
/
build-toolchain.sh
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
#! /usr/bin/env bash
# Copyright (c) 2011-2019, ARM Limited
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Arm nor the names of its contributors may be used
# to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
set -e
set -x
set -u
set -o pipefail
if [[ "$(uname)" != "Darwin" ]]; then
PS4='+$(date +%Y-%m-%d:%H:%M:%S) (${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
fi
umask 022
exec < /dev/null
script_path=$(cd $(dirname $0) && pwd -P)
. $script_path/build-common.sh
# This file contains the sequence of commands used to build the
# GNU Tools Arm Embedded toolchain.
usage ()
{
cat<<EOF
Usage: $0 [--build_type=...] [--skip_steps=...]
This script will build GNU Tools Arm Embedded toolchain.
OPTIONS:
--build_type=TYPE specify build type to either ppa or native.
If followed by keyword debug, the produced binaries
will be debuggable. The default case will be
non-debug native build.
Example usages are as:
--build_type=native
--build_type=ppa
--build_type=native,debug
--build_type=ppa,debug
--skip_steps=STEPS specify which build steps you want to skip. Concatenate
them with comma for skipping more than one steps.
Available steps are:
gdb-with-python
mingw32
mingw32-gdb-with-python
package_sources
md5_checksum
howto
manual
EOF
}
if [ $# -gt 3 ] ; then
usage
fi
skip_mingw32=yes
BUILD_OPTIONS="-g -O2"
is_ppa_release=no
is_native_build=yes
is_debug_build=no
skip_manual=yes
skip_howto=yes
skip_package_sources=no
skip_md5_checksum=no
skip_steps=
skip_gdb_with_python=yes
skip_mingw32_gdb_with_python=yes
build_type=
MULTILIB_LIST="--with-multilib-list=rmprofile"
for ac_arg; do
case $ac_arg in
--skip_steps=*)
skip_steps=$(echo $ac_arg | sed -e "s/--skip_steps=//g" -e "s/,/ /g")
;;
--build_type=*)
build_type=$(echo $ac_arg | sed -e "s/--build_type=//g" -e "s/,/ /g")
;;
*)
usage
exit 1
;;
esac
done
if [ "x$build_type" != "x" ]; then
for bt in $build_type; do
case $bt in
ppa)
is_ppa_release=yes
is_native_build=no
skip_gdb_with_python=yes
;;
native)
is_native_build=yes
is_ppa_release=no
;;
debug)
BUILD_OPTIONS="-g -O0"
is_debug_build=yes
;;
*)
echo "Unknown build type: $bt" 1>&2
usage
exit 1
;;
esac
done
else
is_ppa_release=no
is_native_build=yes
fi
if [ "x$skip_steps" != "x" ]; then
for ss in $skip_steps; do
case $ss in
manual)
skip_manual=yes
;;
howto)
skip_howto=yes
;;
package_sources)
skip_package_sources=yes
;;
md5_checksum)
skip_md5_checksum=yes
;;
gdb-with-python)
skip_gdb_with_python=yes
;;
mingw32)
skip_mingw32=yes
skip_mingw32_gdb_with_python=yes
;;
mingw32-gdb-with-python)
skip_mingw32_gdb_with_python=yes
;;
*)
echo "Unknown build steps: $ss" 1>&2
usage
exit 1
;;
esac
done
fi
if dpkg-query -W lbzip2 > /dev/null 2>&1; then
echo "Using multi-threaded bzip2 compression"
TAR_FLAGS="--use-compress-program=lbzip2"
fi
if [ "x$BUILD" == "xx86_64-apple-darwin10" ] || [ "x$is_ppa_release" == "xyes" ]; then
skip_mingw32=yes
skip_mingw32_gdb_with_python=yes
BUILD_OPTIONS="$BUILD_OPTIONS -fbracket-depth=512"
fi
#Building mingw gdb with python support requires python windows package and
#a special config file. If any of them is missing, we skip the build of
#mingw gdb with python support.
if [ ! -d $SRCDIR/$PYTHON_WIN ] \
|| [ ! -x $script_path/python-config.sh ]; then
skip_mingw32_gdb_with_python=yes
fi
if [ "x$is_ppa_release" != "xyes" ]; then
ENV_CFLAGS=" -I$BUILDDIR_NATIVE/host-libs/zlib/include $BUILD_OPTIONS "
ENV_CPPFLAGS=" -I$BUILDDIR_NATIVE/host-libs/zlib/include "
ENV_LDFLAGS=" -L$BUILDDIR_NATIVE/host-libs/zlib/lib
-L$BUILDDIR_NATIVE/host-libs/usr/lib "
if [ -d $SRCDIR/$PYTHON_WIN ]; then
ENV_LDFLAGS+=" -L$SRCDIR/$PYTHON_WIN/lib "
fi
GCC_CONFIG_OPTS=" --build=$BUILD --host=$HOST_NATIVE
--with-gmp=$BUILDDIR_NATIVE/host-libs/usr
--with-mpfr=$BUILDDIR_NATIVE/host-libs/usr
--with-mpc=$BUILDDIR_NATIVE/host-libs/usr
--with-isl=$BUILDDIR_NATIVE/host-libs/usr
--with-libelf=$BUILDDIR_NATIVE/host-libs/usr "
BINUTILS_CONFIG_OPTS=" --build=$BUILD --host=$HOST_NATIVE "
NEWLIB_CONFIG_OPTS=" --build=$BUILD --host=$HOST_NATIVE "
GDB_CONFIG_OPTS=" --build=$BUILD --host=$HOST_NATIVE
--with-libexpat-prefix=$BUILDDIR_NATIVE/host-libs/usr "
fi
mkdir -p $BUILDDIR_NATIVE
rm -rf $INSTALLDIR_NATIVE && mkdir -p $INSTALLDIR_NATIVE
if [ "x$skip_mingw32" != "xyes" ] ; then
mkdir -p $BUILDDIR_MINGW
rm -rf $INSTALLDIR_MINGW && mkdir -p $INSTALLDIR_MINGW
fi
rm -rf $PACKAGEDIR && mkdir -p $PACKAGEDIR
cd $SRCDIR
echo Task [III-0] /$HOST_NATIVE/binutils/
rm -rf $BUILDDIR_NATIVE/binutils && mkdir -p $BUILDDIR_NATIVE/binutils
pushd $BUILDDIR_NATIVE/binutils
saveenv
saveenvvar CFLAGS "$ENV_CFLAGS"
saveenvvar CPPFLAGS "$ENV_CPPFLAGS"
saveenvvar LDFLAGS "$ENV_LDFLAGS"
$SRCDIR/$BINUTILS/configure \
${BINUTILS_CONFIG_OPTS} \
--target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--disable-nls \
--disable-werror \
--disable-sim \
--disable-gdb \
--enable-interwork \
--enable-plugins \
--with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
"--with-pkgversion=$PKGVERSION"
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make install-html install-pdf
fi
copy_dir $INSTALLDIR_NATIVE $BUILDDIR_NATIVE/target-libs
restoreenv
popd
pushd $INSTALLDIR_NATIVE
rm -rf ./lib
popd
echo Task [III-1] /$HOST_NATIVE/gcc-first/
rm -rf $BUILDDIR_NATIVE/gcc-first && mkdir -p $BUILDDIR_NATIVE/gcc-first
pushd $BUILDDIR_NATIVE/gcc-first
$SRCDIR/$GCC/configure --target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--libexecdir=$INSTALLDIR_NATIVE/lib \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--enable-languages=c \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--with-newlib \
--without-headers \
--with-gnu-as \
--with-gnu-ld \
--with-python-dir=share/gcc-arm-none-eabi \
--with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
${GCC_CONFIG_OPTS} \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
${MULTILIB_LIST}
make -j$JOBS CXXFLAGS="$BUILD_OPTIONS" all-gcc
make install-gcc
popd
pushd $INSTALLDIR_NATIVE
rm -rf bin/arm-none-eabi-gccbug
rm -rf ./lib/libiberty.a
rm -rf include
popd
echo Task [III-2] /$HOST_NATIVE/newlib/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
saveenvvar CFLAGS_FOR_TARGET '-g -O2 -ffunction-sections -fdata-sections'
rm -rf $BUILDDIR_NATIVE/newlib && mkdir -p $BUILDDIR_NATIVE/newlib
pushd $BUILDDIR_NATIVE/newlib
$SRCDIR/$NEWLIB/configure \
$NEWLIB_CONFIG_OPTS \
--target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--enable-newlib-io-long-long \
--enable-newlib-io-c99-formats \
--enable-newlib-register-fini \
--enable-newlib-retargetable-locking \
--disable-newlib-supplied-syscalls \
--disable-nls
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make pdf
mkdir -p $INSTALLDIR_NATIVE_DOC/pdf
cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.pdf $INSTALLDIR_NATIVE_DOC/pdf/libc.pdf
cp $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.pdf $INSTALLDIR_NATIVE_DOC/pdf/libm.pdf
make html
mkdir -p $INSTALLDIR_NATIVE_DOC/html
copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libc/libc.html $INSTALLDIR_NATIVE_DOC/html/libc
copy_dir $BUILDDIR_NATIVE/newlib/arm-none-eabi/newlib/libm/libm.html $INSTALLDIR_NATIVE_DOC/html/libm
fi
popd
restoreenv
echo Task [III-3] /$HOST_NATIVE/newlib-nano/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
saveenvvar CFLAGS_FOR_TARGET '-g -Os -ffunction-sections -fdata-sections'
rm -rf $BUILDDIR_NATIVE/newlib-nano && mkdir -p $BUILDDIR_NATIVE/newlib-nano
pushd $BUILDDIR_NATIVE/newlib-nano
$SRCDIR/$NEWLIB_NANO/configure \
$NEWLIB_CONFIG_OPTS \
--target=$TARGET \
--prefix=$BUILDDIR_NATIVE/target-libs \
--disable-newlib-supplied-syscalls \
--enable-newlib-reent-small \
--enable-newlib-retargetable-locking \
--disable-newlib-fvwrite-in-streamio \
--disable-newlib-fseek-optimization \
--disable-newlib-wide-orient \
--enable-newlib-nano-malloc \
--disable-newlib-unbuf-stream-opt \
--enable-lite-exit \
--enable-newlib-global-atexit \
--enable-newlib-nano-formatted-io \
--disable-nls
make -j$JOBS
make install
popd
restoreenv
echo Task [III-4] /$HOST_NATIVE/gcc-final/
rm -f $INSTALLDIR_NATIVE/arm-none-eabi/usr
ln -s . $INSTALLDIR_NATIVE/arm-none-eabi/usr
rm -rf $BUILDDIR_NATIVE/gcc-final && mkdir -p $BUILDDIR_NATIVE/gcc-final
pushd $BUILDDIR_NATIVE/gcc-final
$SRCDIR/$GCC/configure --target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--libexecdir=$INSTALLDIR_NATIVE/lib \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--enable-languages=c,c++ \
--enable-plugins \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
--with-headers=yes \
--with-python-dir=share/gcc-arm-none-eabi \
--with-sysroot=$INSTALLDIR_NATIVE/arm-none-eabi \
$GCC_CONFIG_OPTS \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
${MULTILIB_LIST}
# Passing USE_TM_CLONE_REGISTRY=0 via INHIBIT_LIBC_CFLAGS to disable
# transactional memory related code in crtbegin.o.
# This is a workaround. Better approach is have a t-* to set this flag via
# CRTSTUFF_T_CFLAGS
make -j$JOBS CXXFLAGS="$BUILD_OPTIONS" \
INHIBIT_LIBC_CFLAGS="-DUSE_TM_CLONE_REGISTRY=0"
make install
if [ "x$skip_manual" != "xyes" ]; then
make install-html install-pdf
fi
pushd $INSTALLDIR_NATIVE
rm -rf bin/arm-none-eabi-gccbug
LIBIBERTY_LIBRARIES=$(find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name libiberty.a)
for libiberty_lib in $LIBIBERTY_LIBRARIES ; do
rm -rf $libiberty_lib
done
rm -rf ./lib/libiberty.a
rm -rf include
popd
rm -f $INSTALLDIR_NATIVE/arm-none-eabi/usr
popd
echo Task [III-5] /$HOST_NATIVE/gcc-size-libstdcxx/
rm -f $BUILDDIR_NATIVE/target-libs/arm-none-eabi/usr
ln -s . $BUILDDIR_NATIVE/target-libs/arm-none-eabi/usr
rm -rf $BUILDDIR_NATIVE/gcc-size-libstdcxx && mkdir -p $BUILDDIR_NATIVE/gcc-size-libstdcxx
pushd $BUILDDIR_NATIVE/gcc-size-libstdcxx
$SRCDIR/$GCC/configure --target=$TARGET \
--prefix=$BUILDDIR_NATIVE/target-libs \
--enable-languages=c,c++ \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-libstdcxx-verbose \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
--with-headers=yes \
--with-python-dir=share/gcc-arm-none-eabi \
--with-sysroot=$BUILDDIR_NATIVE/target-libs/arm-none-eabi \
$GCC_CONFIG_OPTS \
"${GCC_CONFIG_OPTS_LCPP}" \
"--with-pkgversion=$PKGVERSION" \
${MULTILIB_LIST}
make -j$JOBS CCXXFLAGS="$BUILD_OPTIONS" CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections -fno-exceptions"
make install
copy_multi_libs src_prefix="$BUILDDIR_NATIVE/target-libs/arm-none-eabi/lib" \
dst_prefix="$INSTALLDIR_NATIVE/arm-none-eabi/lib" \
target_gcc="$BUILDDIR_NATIVE/target-libs/bin/arm-none-eabi-gcc"
# Copy the nano configured newlib.h file into the location that nano.specs
# expects it to be.
mkdir -p $INSTALLDIR_NATIVE/arm-none-eabi/include/newlib-nano
cp -f $BUILDDIR_NATIVE/target-libs/arm-none-eabi/include/newlib.h \
$INSTALLDIR_NATIVE/arm-none-eabi/include/newlib-nano/newlib.h
popd
echo Task [III-6] /$HOST_NATIVE/gdb/
build_gdb()
{
GDB_EXTRA_CONFIG_OPTS=$1
rm -rf $BUILDDIR_NATIVE/gdb && mkdir -p $BUILDDIR_NATIVE/gdb
pushd $BUILDDIR_NATIVE/gdb
saveenv
saveenvvar CFLAGS "$ENV_CFLAGS"
saveenvvar CPPFLAGS "$ENV_CPPFLAGS"
saveenvvar LDFLAGS "$ENV_LDFLAGS"
$SRCDIR/$GDB/configure \
--target=$TARGET \
--prefix=$INSTALLDIR_NATIVE \
--infodir=$INSTALLDIR_NATIVE_DOC/info \
--mandir=$INSTALLDIR_NATIVE_DOC/man \
--htmldir=$INSTALLDIR_NATIVE_DOC/html \
--pdfdir=$INSTALLDIR_NATIVE_DOC/pdf \
--disable-nls \
--disable-sim \
--disable-gas \
--disable-binutils \
--disable-ld \
--disable-gprof \
--with-libexpat \
--with-lzma=no \
--with-system-gdbinit=$INSTALLDIR_NATIVE/$HOST_NATIVE/arm-none-eabi/lib/gdbinit \
$GDB_CONFIG_OPTS \
$GDB_EXTRA_CONFIG_OPTS \
'--with-gdb-datadir='\''${prefix}'\''/arm-none-eabi/share/gdb' \
"--with-pkgversion=$PKGVERSION"
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make install-html install-pdf
fi
restoreenv
popd
}
#Always enable python support in GDB for PPA build.
if [ "x$is_ppa_release" == "xyes" ]; then
build_gdb "--with-python=yes"
else
#First we build GDB without python support.
build_gdb "--with-python=no"
#Then build gdb with python support.
if [ "x$skip_gdb_with_python" == "xno" ]; then
build_gdb "--with-python=yes --program-prefix=$TARGET- --program-suffix=-py"
fi
fi
if [ "x$is_ppa_release" != "xyes" -a "x$skip_howto" != "xyes" ]; then
echo TASK [III-7] /$HOST_NATIVE/build-manual
rm -rf $BUILDDIR_NATIVE/build-manual && mkdir -p $BUILDDIR_NATIVE/build-manual
pushd $BUILDDIR_NATIVE/build-manual
cp -r $SRCDIR/$BUILD_MANUAL/* .
echo "@set VERSION_PACKAGE ($PKGVERSION)" > version.texi
echo "@set CURRENT_YEAR $release_year" >> version.texi
echo "@set CURRENT_MONTH $release_month" >> version.texi
echo "@set PKG_NAME $PACKAGE_NAME" >> version.texi
make clean
make
rm -rf $ROOT/How-to-build-toolchain.pdf
cp How-to-build-toolchain.pdf $ROOT
popd
fi
echo Task [III-8] /$HOST_NATIVE/pretidy/
rm -rf $INSTALLDIR_NATIVE/lib/libiberty.a
find $INSTALLDIR_NATIVE -name '*.la' -exec rm '{}' ';'
echo Task [III-9] /$HOST_NATIVE/strip_host_objects/
if [ "x$is_debug_build" == "xno" ] ; then
STRIP_BINARIES=$(find $INSTALLDIR_NATIVE/bin/ -name arm-none-eabi-\*)
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
STRIP_BINARIES=$(find $INSTALLDIR_NATIVE/arm-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*)
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
if [ "x$BUILD" == "xx86_64-apple-darwin10" ]; then
STRIP_BINARIES=$(find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER/ -maxdepth 1 -name \* -perm +111 -and ! -type d)
else
STRIP_BINARIES=$(find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER/ -maxdepth 1 -name \* -perm /111 -and ! -type d)
fi
for bin in $STRIP_BINARIES ; do
strip_binary strip $bin
done
fi
echo Task [III-10] /$HOST_NATIVE/strip_target_objects/
saveenv
prepend_path PATH $INSTALLDIR_NATIVE/bin
TARGET_LIBRARIES=$(find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name \*.a)
for target_lib in $TARGET_LIBRARIES ; do
arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
done
TARGET_OBJECTS=$(find $INSTALLDIR_NATIVE/arm-none-eabi/lib -name \*.o)
for target_obj in $TARGET_OBJECTS ; do
arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
done
TARGET_LIBRARIES=$(find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER -name \*.a)
for target_lib in $TARGET_LIBRARIES ; do
arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_lib || true
done
TARGET_OBJECTS=$(find $INSTALLDIR_NATIVE/lib/gcc/arm-none-eabi/$GCC_VER -name \*.o)
for target_obj in $TARGET_OBJECTS ; do
arm-none-eabi-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc $target_obj || true
done
restoreenv
# PPA release needn't following steps, so we exit here.
if [ "x$is_ppa_release" == "xyes" ] ; then
exit 0
fi
echo Task [III-11] /$HOST_NATIVE/package_tbz2/
# Copy release.txt, readme.txt and license.txt into share.
cp $ROOT/$RELEASE_FILE $INSTALLDIR_NATIVE_DOC/
cp $ROOT/$README_FILE $INSTALLDIR_NATIVE_DOC/
cp $ROOT/$LICENSE_FILE $INSTALLDIR_NATIVE_DOC/
# Copy the samples from src to make the final package.
copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_NATIVE/share/gcc-arm-none-eabi/$SAMPLES
# Cleanup any pre-existing state.
rm -f $PACKAGEDIR/$PACKAGE_NAME_NATIVE.tar.bz2
rm -f $BUILDDIR_NATIVE/$INSTALL_PACKAGE_NAME
# Start making the package.
pushd $BUILDDIR_NATIVE
ln -s $INSTALLDIR_NATIVE $INSTALL_PACKAGE_NAME
# Make the package tarball.
${TAR} cjf $PACKAGEDIR/$PACKAGE_NAME_NATIVE.tar.bz2 \
--owner=0 \
--group=0 \
--exclude=host-$HOST_NATIVE \
--exclude=host-$HOST_MINGW \
$INSTALL_PACKAGE_NAME/arm-none-eabi \
$INSTALL_PACKAGE_NAME/bin \
$INSTALL_PACKAGE_NAME/lib \
$INSTALL_PACKAGE_NAME/share
# Remove stale links.
rm -f $INSTALL_PACKAGE_NAME
popd
# Extra actions for MacOS build after native toolchain build is completed
if [ "$(uname)" = "Darwin" ]; then
echo "Task [III-12] /$PACKAGEDIR/pkgbuild_macos"
# Package MacOS toolchain to unsigned .pkg file
MACOS_PKG_TMP_DIR="$(mktemp -d)"
tar xf "$PACKAGEDIR/$PACKAGE_NAME_NATIVE.tar.bz2" -C "$MACOS_PKG_TMP_DIR"
pushd "$MACOS_PKG_TMP_DIR"
pkgbuild --root "$PACKAGE_NAME" --identifier "gcc.${TARGET}-${GCC_VER_NAME}" --version "$RELEASEVER" "$PACKAGEDIR/$PACKAGE_NAME_NATIVE.pkg"
popd
rm -rf "$MACOS_PKG_TMP_DIR"
fi
# skip building mingw32 toolchain if "--skip_mingw32" specified
# this huge if statement controls all $BUILDDIR_MINGW tasks till "task [IV-8]"
if [ "x$skip_mingw32" != "xyes" ] ; then
saveenv
saveenvvar CC_FOR_BUILD gcc
saveenvvar CC $HOST_MINGW_TOOL-gcc
saveenvvar CXX $HOST_MINGW_TOOL-g++
saveenvvar AR $HOST_MINGW_TOOL-ar
saveenvvar RANLIB $HOST_MINGW_TOOL-ranlib
saveenvvar STRIP $HOST_MINGW_TOOL-strip
saveenvvar NM $HOST_MINGW_TOOL-nm
echo Task [IV-0] /$HOST_MINGW/host_unpack/
rm -rf $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE && mkdir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE
pushd $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE
ln -s . $INSTALL_PACKAGE_NAME
tar xf $PACKAGEDIR/$PACKAGE_NAME_NATIVE.tar.bz2 ${TAR_FLAGS:-}
rm $INSTALL_PACKAGE_NAME
popd
echo Task [IV-1] /$HOST_MINGW/binutils/
prepend_path PATH $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/bin
rm -rf $BUILDDIR_MINGW/binutils && mkdir -p $BUILDDIR_MINGW/binutils
pushd $BUILDDIR_MINGW/binutils
saveenv
saveenvvar CFLAGS "-I$BUILDDIR_MINGW/host-libs/zlib/include $BUILD_OPTIONS"
saveenvvar CPPFLAGS "-I$BUILDDIR_MINGW/host-libs/zlib/include"
saveenvvar LDFLAGS "-L$BUILDDIR_MINGW/host-libs/zlib/lib -Wl,/usr/i686-w64-mingw32/lib/CRT_glob.o"
$SRCDIR/$BINUTILS/configure --build=$BUILD \
--host=$HOST_MINGW \
--target=$TARGET \
--prefix=$INSTALLDIR_MINGW \
--infodir=$INSTALLDIR_MINGW_DOC/info \
--mandir=$INSTALLDIR_MINGW_DOC/man \
--htmldir=$INSTALLDIR_MINGW_DOC/html \
--pdfdir=$INSTALLDIR_MINGW_DOC/pdf \
--disable-nls \
--disable-sim \
--disable-gdb \
--enable-plugins \
--with-sysroot=$INSTALLDIR_MINGW/arm-none-eabi \
"--with-pkgversion=$PKGVERSION"
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make install-html install-pdf
fi
restoreenv
popd
pushd $INSTALLDIR_MINGW
rm -rf ./lib
popd
echo Task [IV-2] /$HOST_MINGW/copy_libs/
if [ "x$skip_manual" != "xyes" ]; then
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-arm-none-eabi/html $INSTALLDIR_MINGW_DOC/html
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/share/doc/gcc-arm-none-eabi/pdf $INSTALLDIR_MINGW_DOC/pdf
fi
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/lib $INSTALLDIR_MINGW/arm-none-eabi/lib
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/include $INSTALLDIR_MINGW/arm-none-eabi/include
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/arm-none-eabi/include/c++ $INSTALLDIR_MINGW/arm-none-eabi/include/c++
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/arm-none-eabi $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi
echo Task [IV-3] /$HOST_MINGW/gcc-final/
saveenv
saveenvvar AR_FOR_TARGET $TARGET-ar
saveenvvar NM_FOR_TARGET $TARGET-nm
saveenvvar OBJDUMP_FOR_TARET $TARGET-objdump
saveenvvar STRIP_FOR_TARGET $TARGET-strip
saveenvvar CC_FOR_TARGET $TARGET-gcc
saveenvvar GCC_FOR_TARGET $TARGET-gcc
saveenvvar CXX_FOR_TARGET $TARGET-g++
pushd $INSTALLDIR_MINGW/arm-none-eabi/
rm -f usr
ln -s . usr
popd
rm -rf $BUILDDIR_MINGW/gcc && mkdir -p $BUILDDIR_MINGW/gcc
pushd $BUILDDIR_MINGW/gcc
$SRCDIR/$GCC/configure --build=$BUILD --host=$HOST_MINGW --target=$TARGET \
--prefix=$INSTALLDIR_MINGW \
--libexecdir=$INSTALLDIR_MINGW/lib \
--infodir=$INSTALLDIR_MINGW_DOC/info \
--mandir=$INSTALLDIR_MINGW_DOC/man \
--htmldir=$INSTALLDIR_MINGW_DOC/html \
--pdfdir=$INSTALLDIR_MINGW_DOC/pdf \
--enable-languages=c,c++ \
--enable-mingw-wildcard \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--with-gnu-as \
--with-gnu-ld \
--with-headers=yes \
--with-newlib \
--with-python-dir=share/gcc-arm-none-eabi \
--with-sysroot=$INSTALLDIR_MINGW/arm-none-eabi \
--with-libiconv-prefix=$BUILDDIR_MINGW/host-libs/usr \
--with-gmp=$BUILDDIR_MINGW/host-libs/usr \
--with-mpfr=$BUILDDIR_MINGW/host-libs/usr \
--with-mpc=$BUILDDIR_MINGW/host-libs/usr \
--with-isl=$BUILDDIR_MINGW/host-libs/usr \
--with-libelf=$BUILDDIR_MINGW/host-libs/usr \
"--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm" \
"--with-pkgversion=$PKGVERSION" \
${MULTILIB_LIST}
make -j$JOBS all-gcc
make install-gcc
if [ "x$skip_manual" != "xyes" ]; then
make install-html-gcc install-pdf-gcc
fi
popd
pushd $INSTALLDIR_MINGW
rm -rf bin/arm-none-eabi-gccbug
rm -rf include
popd
copy_dir $BUILDDIR_MINGW/tools-$OBJ_SUFFIX_NATIVE/lib/gcc/arm-none-eabi $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi
rm -rf $INSTALLDIR_MINGW/arm-none-eabi/usr
rm -rf $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi/*/plugin
find $INSTALLDIR_MINGW -executable -and -not -type d -and -not -name \*.exe \
-and -not -name liblto_plugin-0.dll -exec rm -f \{\} \;
restoreenv
echo Task [IV-4] /$HOST_MINGW/gdb/
build_mingw_gdb()
{
MINGW_GDB_CONF_OPTS=$1
rm -rf $BUILDDIR_MINGW/gdb && mkdir -p $BUILDDIR_MINGW/gdb
pushd $BUILDDIR_MINGW/gdb
saveenv
saveenvvar CFLAGS "-I$BUILDDIR_MINGW/host-libs/zlib/include $BUILD_OPTIONS"
saveenvvar CPPFLAGS "-I$BUILDDIR_MINGW/host-libs/zlib/include"
saveenvvar LDFLAGS "-L$BUILDDIR_MINGW/host-libs/zlib/lib -Wl,/usr/i686-w64-mingw32/lib/CRT_glob.o"
$SRCDIR/$GDB/configure --build=$BUILD \
--host=$HOST_MINGW \
--target=$TARGET \
--prefix=$INSTALLDIR_MINGW \
--infodir=$INSTALLDIR_MINGW_DOC/info \
--mandir=$INSTALLDIR_MINGW_DOC/man \
--htmldir=$INSTALLDIR_MINGW_DOC/html \
--pdfdir=$INSTALLDIR_MINGW_DOC/pdf \
--disable-nls \
--disable-sim \
--disable-gas \
--disable-binutils \
--disable-ld \
--disable-gprof \
--with-lzma=no \
$MINGW_GDB_CONF_OPTS \
--with-libexpat \
--with-libexpat-prefix=$BUILDDIR_MINGW/host-libs/usr \
--with-libiconv-prefix=$BUILDDIR_MINGW/host-libs/usr \
--with-system-gdbinit=$INSTALLDIR_MINGW/$HOST_MINGW/arm-none-eabi/lib/gdbinit \
'--with-gdb-datadir='\''${prefix}'\''/arm-none-eabi/share/gdb' \
"--with-pkgversion=$PKGVERSION"
make -j$JOBS
make install
if [ "x$skip_manual" != "xyes" ]; then
make install-html install-pdf
fi
restoreenv
popd
}
build_mingw_gdb "--with-python=no"
if [ "x$skip_mingw32_gdb_with_python" == "xno" ]; then
export GNURM_PYTHON_WIN_DIR=$SRCDIR/$PYTHON_WIN
build_mingw_gdb "--with-python=$script_path/python-config.sh --program-suffix=-py --program-prefix=$TARGET-"
fi
echo Task [IV-5] /$HOST_MINGW/pretidy/
pushd $INSTALLDIR_MINGW
rm -rf ./lib/libiberty.a
rm -rf $INSTALLDIR_MINGW_DOC/info
rm -rf $INSTALLDIR_MINGW_DOC/man
find $INSTALLDIR_MINGW -name '*.la' -exec rm '{}' ';'
echo Task [IV-6] /$HOST_MINGW/strip_host_objects/
STRIP_BINARIES=$(find $INSTALLDIR_MINGW/bin/ -name arm-none-eabi-\*.exe)
if [ "x$is_debug_build" == "xno" ] ; then
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
STRIP_BINARIES=$(find $INSTALLDIR_MINGW/arm-none-eabi/bin/ -maxdepth 1 -mindepth 1 -name \*.exe)
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
STRIP_BINARIES=$(find $INSTALLDIR_MINGW/lib/gcc/arm-none-eabi/$GCC_VER/ -name \*.exe)
for bin in $STRIP_BINARIES ; do
strip_binary $HOST_MINGW_TOOL-strip $bin
done
fi
echo Task [IV-7] /$HOST_MINGW/installation/
rm -f $PACKAGEDIR/$PACKAGE_NAME_MINGW.exe
pushd $BUILDDIR_MINGW
rm -f $INSTALL_PACKAGE_NAME
cp $ROOT/$RELEASE_FILE $INSTALLDIR_MINGW_DOC/
cp $ROOT/$README_FILE $INSTALLDIR_MINGW_DOC/
cp $ROOT/$LICENSE_FILE $INSTALLDIR_MINGW_DOC/
copy_dir_clean $SRCDIR/$SAMPLES $INSTALLDIR_MINGW/share/gcc-arm-none-eabi/$SAMPLES
flip -m $INSTALLDIR_MINGW_DOC/$RELEASE_FILE
flip -m $INSTALLDIR_MINGW_DOC/$README_FILE
flip -m -b $INSTALLDIR_MINGW_DOC/$LICENSE_FILE
flip -m $INSTALLDIR_MINGW/share/gcc-arm-none-eabi/$SAMPLES_DOS_FILES
rm -rf $INSTALLDIR_MINGW/include
ln -s $INSTALLDIR_MINGW $INSTALL_PACKAGE_NAME
cp $SRCDIR/$INSTALLATION/gccvar.bat $INSTALLDIR_MINGW/bin
mkdir -p $SRCDIR/$INSTALLATION/output
makensis -DBaseDir=$INSTALLDIR_MINGW \
-DIncDir=$SRCDIR \
-DAppName="$APPNAME" \
-DAppNameStr="$PKGVERSION" \
-DPackageName=$PACKAGE_NAME_MINGW \
-DInstallDirBase="$INSTALLBASE" \
-DInstallDirVer="$GCC_VER_SHORT $RELEASEVER" \
"-XOutFile $SRCDIR/$INSTALLATION/output/$PACKAGE_NAME_MINGW.exe" \
$SRCDIR/$INSTALLATION/arm-none-eabi-gnu-tools.nsi
cp -rf $SRCDIR/$INSTALLATION/output/$PACKAGE_NAME_MINGW.exe $PACKAGEDIR/
rm -f $INSTALL_PACKAGE_NAME
popd
restoreenv
echo Task [IV-8] /Package toolchain in zip format/
pushd $INSTALLDIR_MINGW
rm -f $PACKAGEDIR/$PACKAGE_NAME_MINGW.zip
zip -r9 $PACKAGEDIR/$PACKAGE_NAME_MINGW.zip .
popd
fi #end of if [ "x$skip_mingw32" != "xyes" ] ;
if [ "x$skip_package_sources" != "xyes" ]; then
echo Task [V-0] /package_sources/
pushd "$PACKAGEDIR"
rm -rf "$PACKAGE_NAME" && mkdir -p "$PACKAGE_NAME/src"
pack_dir_clean "$SRCDIR" "$BINUTILS" "$PACKAGE_NAME/src/$BINUTILS.tar.bz2" \
--exclude="gdb/testsuite/config/qemu.exp" --exclude="sim"
pack_dir_clean "$SRCDIR" "$GCC" "$PACKAGE_NAME/src/$GCC.tar.bz2"
pack_dir_clean "$SRCDIR" "$GDB" "$PACKAGE_NAME/src/$GDB.tar.bz2" \
--exclude="gdb/testsuite/config/qemu.exp" --exclude="sim"
pack_dir_clean "$SRCDIR" "$NEWLIB" "$PACKAGE_NAME/src/$NEWLIB.tar.bz2"
pack_dir_clean "$SRCDIR" "$SAMPLES" "$PACKAGE_NAME/src/$SAMPLES.tar.bz2"
if [ "x$is_ppa_release" != "xyes" ] && [ "x$skip_howto" != "xyes" ]; then
pack_dir_clean "$SRCDIR" "$BUILD_MANUAL" "$PACKAGE_NAME/src/$BUILD_MANUAL.tar.bz2"
fi
if [ "x$skip_mingw32" != "xyes" ] ; then
pack_dir_clean "$SRCDIR" "$INSTALLATION" \
"$PACKAGE_NAME/src/$INSTALLATION.tar.bz2" \
--exclude=build.log --exclude=output
fi
cp "$ROOT/$RELEASE_FILE" "$PACKAGE_NAME/"
cp "$ROOT/$README_FILE" "$PACKAGE_NAME/"
cp "$ROOT/$LICENSE_FILE" "$PACKAGE_NAME/"
if [ "x$is_ppa_release" != "xyes" ] && [ "x$skip_howto" != "xyes" ]; then
cp "$ROOT/$BUILD_MANUAL_FILE" "$PACKAGE_NAME/"
fi
cp "$script_path/install-sources.sh" "$PACKAGE_NAME/"
cp "$script_path/build-common.sh" "$PACKAGE_NAME/"
cp "$script_path/build-prerequisites.sh" "$PACKAGE_NAME/"
cp "$script_path/build-toolchain.sh" "$PACKAGE_NAME/"
cp "$script_path/python-config.sh" "$PACKAGE_NAME/"
tar cf "$PACKAGE_NAME-src.tar.bz2" "$PACKAGE_NAME" ${TAR_FLAGS:-}
rm -rf "$PACKAGE_NAME"
popd
fi
if [ "x$skip_md5_checksum" != "xyes" ]; then
echo Task [V-1] /md5_checksum/
pushd "$PACKAGEDIR"
MD5_CHECKSUM_FILE="md5-$(uname -m)-$(uname | tr '[:upper:]' '[:lower:]').txt"
rm -rf "$MD5_CHECKSUM_FILE"
$MD5 "$PACKAGE_NAME_NATIVE.tar.bz2" > "$MD5_CHECKSUM_FILE"
if [ "$(uname)" = "Darwin" ]; then
$MD5 "$PACKAGE_NAME_NATIVE.pkg" >> "$MD5_CHECKSUM_FILE"
fi
if [ "x$skip_mingw32" != "xyes" ] ; then
$MD5 "$PACKAGE_NAME_MINGW.exe" >> "$MD5_CHECKSUM_FILE"
$MD5 "$PACKAGE_NAME_MINGW.zip" >> "$MD5_CHECKSUM_FILE"
fi
if [ "x$skip_package_sources" != "xyes" ]; then
$MD5 "$PACKAGE_NAME-src.tar.bz2" >> "$MD5_CHECKSUM_FILE"
fi
popd
fi