tuning update-libtom
Karel Miko
4 years ago
12 | 12 | warn "update libtommath from github (branch: $ltm_branch)..\n"; |
13 | 13 | system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltm/*"); |
14 | 14 | system "rm -rf $tmpdir; mkdir $tmpdir"; |
15 | system "git clone -b $ltm_branch https://github.com/libtom/libtommath.git $tmpdir && cp -R $tmpdir/bn*.c $tmpdir/tom*.h $FindBin::Bin/ltm/ && echo ok"; | |
15 | system "git clone -b $ltm_branch https://github.com/libtom/libtommath.git $tmpdir && cp $tmpdir/bn*.c $tmpdir/tom*.h $FindBin::Bin/ltm/ && echo ok"; | |
16 | system "(cd $tmpdir && git log --pretty='%h %ai %s') | head -1"; | |
17 | # avoid stdint.h hack | |
18 | system "find '$FindBin::Bin/ltm/' -name '*.c' -o -name '*.h' | xargs sed -i" | |
19 | . " -e 's/uint8_t/unsigned char/g'" | |
20 | . " -e 's/uint16_t/unsigned short/g'" | |
21 | . " -e 's/uint32_t/unsigned int/g'" | |
22 | . " -e 's/uint64_t/unsigned long long/g'" | |
23 | . " -e 's/int8_t/char/g'" | |
24 | . " -e 's/int16_t/short/g'" | |
25 | . " -e 's/int32_t/int/g'" | |
26 | . " -e 's/int64_t/long long/g'" | |
27 | . " -e 's/# *include *<stdint.h>//'"; | |
16 | 28 | |
17 | 29 | warn "update libtomcrypt from github (branch: $ltc_branch)..\n"; |
18 | 30 | system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltc/*"); |
19 | 31 | system "rm -rf $tmpdir; mkdir $tmpdir"; |
20 | 32 | system "git clone -b $ltc_branch https://github.com/libtom/libtomcrypt.git $tmpdir && cp -R $tmpdir/src/* $FindBin::Bin/ltc/ && echo ok"; |
33 | system "(cd $tmpdir && git log --pretty='%h %ai %s') | head -1"; | |
34 | ||
21 | 35 | system "rm -rf $tmpdir"; |
22 | 36 | |
23 | 37 | ### another style |
54 | 68 | #fix modes |
55 | 69 | warn "gonna chmod..\n"; |
56 | 70 | find({ wanted=>sub { system "chmod -x $_" if -f $_ && -x $_ && $_ =~ /\.(c|h)/ }, no_chdir=>1 }, "$FindBin::Bin/ltm", "$FindBin::Bin/ltc"); |
57 | ||
71 | ||
58 | 72 | my @objs = (); |
59 | 73 | find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ && $_ !~ /tab\.c$/}, no_chdir=>1 }, "$FindBin::Bin/ltc"); |
60 | 74 | find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "$FindBin::Bin/ltm"); |