diff --git a/src/update-libtom.pl b/src/update-libtom.pl index c8e7144..3e38d3b 100755 --- a/src/update-libtom.pl +++ b/src/update-libtom.pl @@ -13,12 +13,26 @@ warn "update libtommath from github (branch: $ltm_branch)..\n"; system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltm/*"); system "rm -rf $tmpdir; mkdir $tmpdir"; -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"; +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"; +system "(cd $tmpdir && git log --pretty='%h %ai %s') | head -1"; +# avoid stdint.h hack +system "find '$FindBin::Bin/ltm/' -name '*.c' -o -name '*.h' | xargs sed -i" + . " -e 's/uint8_t/unsigned char/g'" + . " -e 's/uint16_t/unsigned short/g'" + . " -e 's/uint32_t/unsigned int/g'" + . " -e 's/uint64_t/unsigned long long/g'" + . " -e 's/int8_t/char/g'" + . " -e 's/int16_t/short/g'" + . " -e 's/int32_t/int/g'" + . " -e 's/int64_t/long long/g'" + . " -e 's/# *include *//'"; warn "update libtomcrypt from github (branch: $ltc_branch)..\n"; system 'rm', '-rf', bsd_glob("$FindBin::Bin/ltc/*"); system "rm -rf $tmpdir; mkdir $tmpdir"; system "git clone -b $ltc_branch https://github.com/libtom/libtomcrypt.git $tmpdir && cp -R $tmpdir/src/* $FindBin::Bin/ltc/ && echo ok"; +system "(cd $tmpdir && git log --pretty='%h %ai %s') | head -1"; + system "rm -rf $tmpdir"; ### another style @@ -55,7 +69,7 @@ #fix modes warn "gonna chmod..\n"; find({ wanted=>sub { system "chmod -x $_" if -f $_ && -x $_ && $_ =~ /\.(c|h)/ }, no_chdir=>1 }, "$FindBin::Bin/ltm", "$FindBin::Bin/ltc"); - + my @objs = (); find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ && $_ !~ /tab\.c$/}, no_chdir=>1 }, "$FindBin::Bin/ltc"); find({ wanted=>sub { push @objs, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "$FindBin::Bin/ltm");