@@ -8,39 +8,51 @@ copy_dependent_dlls(){
88 do
99 echo " Searching $dll_name " in $dll_source_dir
1010 find " $dll_source_dir " -name " $dll_name " -exec cp " {}" ./dist \;
11- if [[ $? -eq 0 ]]
11+ dist_dll_path=" ./dist/$dll_name "
12+ if [[ -f " $dist_dll_path " ]]
1213 then
13- dist_dll_path=" ./dist/$dll_name "
14- if [[ -f " $dist_dll_path " ]]
15- then
16- copy_dependent_dlls " $dist_dll_path "
17- fi
18- else
19- echo " WARNING: Could not find $dll_name "
14+ copy_dependent_dlls " $dist_dll_path "
2015 fi
2116 done
2217}
2318
24- make_version=" $( cat build_version.txt) "
19+
20+
21+ # Verify tarball integrity first
22+ echo " ##############################"
23+ echo " Verifying integrity of tarball"
24+ echo " ##############################"
25+ sha256sum -c build_version.sha256sum
26+
27+ tarball=$( cat build_version.sha256sum | cut -d " " -f3)
28+ make_version=${tarball% .tar.gz}
2529host_triplet=" x86_64-w64-mingw32"
26- rm -rf " make- $make_version " || echo " No existing make directory"
30+ rm -rf " $make_version " || echo " No existing make directory"
2731
28- tar -xzvf " make- $make_version .tar.gz "
29- cd " make- $make_version "
32+ tar -xzf " $tarball "
33+ cd " $make_version "
3034
3135# Cleanup target directory
3236rm -rf ./dist
3337mkdir -p ./dist
3438mkdir -p install_target
3539
40+ echo " ##########################################"
41+ echo " Building $make_version for $host_triplet "
42+ echo " ##########################################"
3643# By default, --export-dynamic is used which is not supported for PE binaries.
3744# Therefore override the LDFLAGS accordingly
3845LDFLAGS=' -Wl,--export-all-symbols -fstack-protector -lssp' mingw64-configure --without-guile
3946mingw64-make && mv make.exe ./dist
4047if [[ $? -eq 0 ]]
4148then
49+ echo " #######################################"
50+ echo " Copying needed shared libraries to dist"
51+ echo " #######################################"
52+
4253 copy_dependent_dlls ./dist/make.exe
43- zip -r " make-$make_version -w64.zip" dist/*
54+
55+ echo " ################################"
4456 echo " Build complete. Result in ./dist"
57+ echo " ################################"
4558fi
46-
0 commit comments