diff options
author | Brad King <brad.king@kitware.com> | 2013-07-26 20:08:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-31 12:19:13 (GMT) |
commit | 102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6 (patch) | |
tree | db05ed527f04506957049a7b087be6c038d98435 /Utilities/cmlibarchive/build/utils | |
parent | 87402c995ed2460deb2f39e02acf77a0bb57f263 (diff) | |
parent | 35df7c8ba8854e97bd6994c4d1143f57535ed6f2 (diff) | |
download | CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.zip CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.gz CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.bz2 |
Merge branch 'libarchive-upstream' into update-libarchive
Conflicts:
Utilities/cmlibarchive/CMakeLists.txt
Utilities/cmlibarchive/libarchive/archive.h
Utilities/cmlibarchive/libarchive/archive_entry.h
Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
Utilities/cmlibarchive/libarchive/archive_windows.h
Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
Diffstat (limited to 'Utilities/cmlibarchive/build/utils')
-rwxr-xr-x[-rw-r--r--] | Utilities/cmlibarchive/build/utils/gen_archive_string_composition_h.sh | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/Utilities/cmlibarchive/build/utils/gen_archive_string_composition_h.sh b/Utilities/cmlibarchive/build/utils/gen_archive_string_composition_h.sh index 95dbe16..925de5c 100644..100755 --- a/Utilities/cmlibarchive/build/utils/gen_archive_string_composition_h.sh +++ b/Utilities/cmlibarchive/build/utils/gen_archive_string_composition_h.sh @@ -1,10 +1,13 @@ #!/bin/sh # -# This needs http://unicode.org/Public/UNIDATA/UnicodeData.txt +# This needs http://unicode.org/Public/6.0.0/ucd/UnicodeData.txt # inputfile="$1" # Expect UnicodeData.txt outfile=archive_string_composition.h pickout=/tmp/mk_unicode_composition_tbl$$.awk +pickout2=/tmp/mk_unicode_composition_tbl2$$.awk +#nfdtmp=/tmp/mk_unicode_decomposition_tmp$$.txt +nfdtmp="nfdtmpx" ################################################################################# # # Append the file header of "archive_string_composition.h" @@ -14,7 +17,7 @@ append_copyright() { cat > ${outfile} <<CR_END /*- - * Copyright (c) 2011 libarchive Project + * Copyright (c) 2011-2012 libarchive Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,7 +47,7 @@ cat > ${outfile} <<CR_END /* * ATTENTION! * This file is generated by build/utils/gen_archive_string_composition_h.sh - * from http://unicode.org/Public/UNIDATA/UnicodeData.txt + * from http://unicode.org/Public/6.0.0/ucd/UnicodeData.txt * * See also http://unicode.org/report/tr15/ */ @@ -76,6 +79,7 @@ BEGIN { min = ""; max = ""; cmd="sort | awk -F ' ' '{printf \"\\\\t{ 0x%s , 0x%s , 0x%s },\\\\n\",\$1,\$2,\$3}'" + nfdtbl="${nfdtmp}" print "static const struct unicode_composition_table u_composition_table[] = {" } END { @@ -178,7 +182,6 @@ END { } print "};" print "" - print "#endif /* ARCHIVE_STRING_COMPOSITION_H_INCLUDED */" } # # @@ -241,7 +244,7 @@ function hextoi(hex) #} # # Exclusion code points specified by -# http://unicode.org/Public/UNIDATA/CompositionExclusions.txt +# http://unicode.org/Public/6.0.0/ucd/CompositionExclusions.txt ## # 1. Script Specifices ## @@ -404,6 +407,35 @@ function hextoi(hex) print "0"cp[1], "0"cp[2], "0"\$1 | cmd else print cp[1], cp[2], \$1 | cmd + # NFC ==> NFD table. + if (length(\$1) == 4) + print "0"\$1, "0"cp[1], "0"cp[2] >>nfdtbl + else + print \$1, cp[1], cp[2] >>nfdtbl +} +AWK_END +################################################################################# +# awk script +# +################################################################################# +cat > ${pickout2} <<AWK_END +# +BEGIN { + FS = " " + print "struct unicode_decomposition_table {" + print "\tuint32_t nfc;" + print "\tuint32_t cp1;" + print "\tuint32_t cp2;" + print "};" + print "" + print "static const struct unicode_decomposition_table u_decomposition_table[] = {" +} +END { + print "};" + print "" +} +{ +printf "\t{ 0x%s , 0x%s , 0x%s },\n", \$1, \$2, \$3; } AWK_END ################################################################################# @@ -413,6 +445,11 @@ AWK_END ################################################################################# append_copyright awk -f ${pickout} ${inputfile} >> ${outfile} +awk -f ${pickout2} ${nfdtmp} >> ${outfile} +echo "#endif /* ARCHIVE_STRING_COMPOSITION_H_INCLUDED */" >> ${outfile} +echo "" >> ${outfile} # # Remove awk the script. rm ${pickout} +rm ${pickout2} +rm ${nfdtmp} |