cabextract-1.9/0000775000175000017500000000000013370076412010511 500000000000000cabextract-1.9/acinclude.m40000644000175000017500000000725513364627464012645 00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_func_mkdir.html # =========================================================================== # # SYNOPSIS # # AX_FUNC_MKDIR # # DESCRIPTION # # Check whether mkdir() is mkdir or _mkdir, and whether it takes one or # two arguments. # # This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG, # which are expected to be used as follows: # # #if HAVE_MKDIR # # if MKDIR_TAKES_ONE_ARG # /* MinGW32 */ # # define mkdir(a, b) mkdir(a) # # endif # #else # # if HAVE__MKDIR # /* plain Windows 32 */ # # define mkdir(a, b) _mkdir(a) # # else # # error "Don't know how to create a directory on this system." # # endif # #endif # # LICENSE # # Copyright (c) 2008 Alexandre Duret-Lutz # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 6 AU_ALIAS([AC_FUNC_MKDIR], [AX_FUNC_MKDIR]) AC_DEFUN([AX_FUNC_MKDIR], [AC_CHECK_FUNCS([mkdir _mkdir]) AC_CACHE_CHECK([whether mkdir takes one argument], [ac_cv_mkdir_takes_one_arg], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #if HAVE_UNISTD_H # include #endif ]], [[mkdir (".");]])], [ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])]) if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1, [Define if mkdir takes only one argument.]) fi ]) dnl Note: dnl ===== dnl I have not implemented the following suggestion because I don't have dnl access to such a broken environment to test the macro. So I'm just dnl appending the comments here in case you have, and want to fix dnl AX_FUNC_MKDIR that way. dnl dnl |Thomas E. Dickey (dickey@herndon4.his.com) said: dnl | it doesn't cover the problem areas (compilers that mistreat mkdir dnl | may prototype it in dir.h and dirent.h, for instance). dnl | dnl |Alexandre: dnl | Would it be sufficient to check for these headers and #include dnl | them in the AC_COMPILE_IFELSE block? (and is AC_HEADER_DIRENT dnl | suitable for this?) dnl | dnl |Thomas: dnl | I think that might be a good starting point (with the set of recommended dnl | ifdef's and includes for AC_HEADER_DIRENT, of course). cabextract-1.9/test/0000775000175000017500000000000013370076412011470 500000000000000cabextract-1.9/test/encoding.test0000775000175000017500000000430713370016754014111 00000000000000#!/bin/sh # test cabextract --encoding option . test/testcase # skip test if cabextract has no --encoding option if [ `$cabextract -h 2>&1 | grep -c encoding` -eq 0 ]; then exit 77 fi $cabextract -e koi8-ru -l cabs/encoding-koi8.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/encoding-koi8.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | Здравствуйте, это канал об аниме? 0 | 12.03.1997 11:13:52 | Да. 0 | 12.03.1997 11:13:52 | Как мне пропатчить KDE2 под FreeBSD? All done, no errors. EOF $cabextract -e iso-8859-1 -l cabs/encoding-latin1.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/encoding-latin1.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 |  ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ 0 | 12.03.1997 11:13:52 | ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß 0 | 12.03.1997 11:13:52 | àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ All done, no errors. EOF $cabextract -e sjis -l cabs/encoding-sjis.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/encoding-sjis.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | 猿も木から落ちる 0 | 12.03.1997 11:13:52 | 虎穴に入らずんば虎子を得ず 0 | 12.03.1997 11:13:52 | この父にしてこの子あり 0 | 12.03.1997 11:13:52 | 。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン 0 | 12.03.1997 11:13:52 | あいうえおかきくけこざしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん 0 | 12.03.1997 11:13:52 | アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/mixed.test0000775000175000017500000000200313367373245013427 00000000000000#!/bin/sh # test cabextract --filter and --pipe options . test/testcase $cabextract -p cabs/mixed.cab >$actual compare_with <<'EOF' If you can read this, the MSZIP decompressor is working! ----------------------------------------------------------------- If you can read this, the LZX decompressor is working! ----------------------------------------------------------------- If you can read this, the Quantum decompressor is working! EOF $cabextract -p -F 'mszip.*' cabs/mixed.cab >$actual compare_with <<'EOF' If you can read this, the MSZIP decompressor is working! EOF $cabextract -p -F '*zx*' cabs/mixed.cab >$actual compare_with <<'EOF' ----------------------------------------------------------------- If you can read this, the LZX decompressor is working! ----------------------------------------------------------------- EOF $cabextract -p -F '*m.txt' cabs/mixed.cab >$actual compare_with <<'EOF' If you can read this, the Quantum decompressor is working! EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/dirwalk-vulns.test0000775000175000017500000000423413367373566015141 00000000000000#!/bin/sh # test cabextract prevents directory path manipulation . test/testcase $cabextract -l cabs/dirwalk-vulns.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/dirwalk-vulns.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | absolute/path 0 | 12.03.1997 11:13:52 | absolute/xx/xx/and/relative/path 0 | 12.03.1997 11:13:52 | absolute\path\reverse\slashes 0 | 12.03.1997 11:13:52 | absolute\xx\xx\and\relative\path\reverse\slashes 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | xx/relative/path 0 | 12.03.1997 11:13:52 | xx/xx/relative/path 0 | 12.03.1997 11:13:52 | xx/xx/xx/relative/path 0 | 12.03.1997 11:13:52 | relative/xx/path 0 | 12.03.1997 11:13:52 | relative/xx/xx/path 0 | 12.03.1997 11:13:52 | relative/xx/xx/xx/path 0 | 12.03.1997 11:13:52 | ��absolute��path2b 0 | 12.03.1997 11:13:52 | absolute/path3b 0 | 12.03.1997 11:13:52 | absolute/path4b 0 | 12.03.1997 11:13:52 | �����absolute�����path5b 0 | 12.03.1997 11:13:52 | ������absolute������path6b 0 | 12.03.1997 11:13:52 | relative��..��..��path2b 0 | 12.03.1997 11:13:52 | relative/xx/xx/path3b 0 | 12.03.1997 11:13:52 | relative/xx/xx/path4b 0 | 12.03.1997 11:13:52 | relative�����..�����..�����path5b 0 | 12.03.1997 11:13:52 | relative������..������..������path6b 0 | 12.03.1997 11:13:52 | innocuous��/xx/xx/relative/path2b 0 | 12.03.1997 11:13:52 | innocuous�/xx/xx/relative/path3b 0 | 12.03.1997 11:13:52 | innocuous�/xx/xx/relative/path4b 0 | 12.03.1997 11:13:52 | innocuous�����/xx/xx/relative/path5b 0 | 12.03.1997 11:13:52 | innocuous������/xx/xx/relative/path6b All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/search.test0000775000175000017500000000662413367373251013600 00000000000000#!/bin/sh # test cabextract can find cabinets within files . test/testcase $cabextract -l cabs/search.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/search.cab File size | Date Time | Name -----------+---------------------+------------- 84 | 18.07.2018 15:30:04 | hello.cab 84 | 18.07.2018 15:30:04 | there.cab 88 | 18.07.2018 15:30:04 | general.cab 86 | 18.07.2018 15:30:04 | kenobi.cab 6 | 18.07.2018 15:30:04 | hello.txt 6 | 18.07.2018 15:30:04 | there.txt 8 | 18.07.2018 15:30:04 | general.txt 7 | 18.07.2018 15:30:04 | kenobi.txt 84 | 18.07.2018 15:30:04 | hello.cab 6 | 18.07.2018 15:30:04 | hello.txt 84 | 18.07.2018 15:30:04 | hello.cab 6 | 18.07.2018 15:30:04 | hello.txt 84 | 18.07.2018 15:30:04 | there.cab 6 | 18.07.2018 15:30:04 | there.txt 84 | 18.07.2018 15:30:04 | there.cab 6 | 18.07.2018 15:30:04 | there.txt 88 | 18.07.2018 15:30:04 | general.cab 8 | 18.07.2018 15:30:04 | general.txt 88 | 18.07.2018 15:30:04 | general.cab 8 | 18.07.2018 15:30:04 | general.txt 86 | 18.07.2018 15:30:04 | kenobi.cab 7 | 18.07.2018 15:30:04 | kenobi.txt 86 | 18.07.2018 15:30:04 | kenobi.cab 7 | 18.07.2018 15:30:04 | kenobi.txt All done, no errors. EOF $cabextract -t cabs/search.cab >$actual compare_with <<'EOF' Testing cabinet: cabs/search.cab hello.cab OK cabef68e0ded744846e41c05823a690c there.cab OK 82bfb679efc9d382ba315b3a2d459f0d general.cab OK 05d8826f088e942db74b03af56e6ffa9 kenobi.cab OK a83c633a08b9e6ef2343f4862ba2dabb hello.txt OK b1946ac92492d2347c6235b4d2611184 there.txt OK c4ff45bb1fab99f9164b7fec14b2292a general.txt OK 7ba5a8d2df7be8121b694c5c00d0919a kenobi.txt OK dd7f34d60a52ab6d8926eadc28b87042 hello.cab OK cabef68e0ded744846e41c05823a690c hello.txt OK b1946ac92492d2347c6235b4d2611184 hello.cab OK cabef68e0ded744846e41c05823a690c hello.txt OK b1946ac92492d2347c6235b4d2611184 there.cab OK 82bfb679efc9d382ba315b3a2d459f0d there.txt OK c4ff45bb1fab99f9164b7fec14b2292a there.cab OK 82bfb679efc9d382ba315b3a2d459f0d there.txt OK c4ff45bb1fab99f9164b7fec14b2292a general.cab OK 05d8826f088e942db74b03af56e6ffa9 general.txt OK 7ba5a8d2df7be8121b694c5c00d0919a general.cab OK 05d8826f088e942db74b03af56e6ffa9 general.txt OK 7ba5a8d2df7be8121b694c5c00d0919a kenobi.cab OK a83c633a08b9e6ef2343f4862ba2dabb kenobi.txt OK dd7f34d60a52ab6d8926eadc28b87042 kenobi.cab OK a83c633a08b9e6ef2343f4862ba2dabb kenobi.txt OK dd7f34d60a52ab6d8926eadc28b87042 All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/utf8-stresstest.test0000775000175000017500000001030713367373270015434 00000000000000#!/bin/sh # test cabextract handles bad UTF-8 filenames . test/testcase $cabextract -l cabs/utf8-stresstest.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/utf8-stresstest.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | κόσμε 0 | 12.03.1997 11:13:52 | € 0 | 12.03.1997 11:13:52 | ࠀ 0 | 12.03.1997 11:13:52 | 𐀀 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 |  0 | 12.03.1997 11:13:52 | ߿ 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | ���� 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 | ퟿ 0 | 12.03.1997 11:13:52 |  0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | 􏿿 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | ��� 0 | 12.03.1997 11:13:52 | ���� 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 | ������� 0 | 12.03.1997 11:13:52 | ������������������������������������������������ 0 | 12.03.1997 11:13:52 | � � � � � � � � � � � � � � � � 0 | 12.03.1997 11:13:52 | � � � � � � � � � � � � � � � � 0 | 12.03.1997 11:13:52 | � � � � � � � � 0 | 12.03.1997 11:13:52 | � � � � 0 | 12.03.1997 11:13:52 | � � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | ��� 0 | 12.03.1997 11:13:52 | ���� 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | ��� 0 | 12.03.1997 11:13:52 | ���� 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������������������������������ 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | ���� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | x 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | ߿ 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | ����� 0 | 12.03.1997 11:13:52 | ������ 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | �� 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | � 0 | 12.03.1997 11:13:52 | ﷐﷑﷒﷓﷔﷕﷖﷗﷘﷙﷚﷛﷜﷝﷞﷟﷠﷡﷢﷣﷤﷥﷦﷧﷨﷩﷪﷫﷬﷭﷮﷯"| 0 | 12.03.1997 11:13:52 | 🿾🿿𯿾𯿿𿿾𿿿񏿾񏿿񟿾񟿿񯿾񯿿񿿾񿿿򏿾򏿿 All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/testcase.in0000664000175000017500000000054513367374715013574 00000000000000cabextract=@abs_top_builddir@/cabextract@EXEEXT@ cd "@abs_srcdir@" status=`mktemp` expected=$status.expected actual=$status.actual echo success >$status trap cleanup 0 1 2 cleanup() { rm -f $expected $actual $failed } compare_with() { cat >$expected if diff -u $expected $actual; then : else echo failed >$status fi } cabextract-1.9/test/cabs/0000775000175000017500000000000013370030450012370 500000000000000cabextract-1.9/test/cabs/dirwalk-vulns.txt0000644000175000017500000000332013323707071015657 00000000000000# absolute paths - cabextract removes leading slashes and replaces "../" with "xx/" /absolute/path /absolute/../../and/relative/path \absolute\path\reverse\slashes \absolute\..\..\and\relative\path\reverse\slashes # nothing but slashes - cabextract turns this to just "x" / \ /////////// \\\\\\\\\\\ # relative paths - cabextract replaces "../" with "xx/" ../relative/path ../../relative/path ../../../relative/path relative/../path relative/../../path relative/../../../path # absolute and relative paths with overlong encodings of "/" # 0x2F = correct encoding # 0xC0 0xAF = overlong (cabextract converts this to 2 replacement chars) # 0xE0 0x80 0xAF = overlong (cabextract accepts this encoding so blocks the "../") # 0xF0 0x80 0x80 0xAF = overlong (cabextract accepts this encoding so blocks the "../") # 0xF8 0x80 0x80 0x80 0xAF = overlong (cabextract converts this to 5 replacement chars) # 0xFC 0x80 0x80 0x80 0x80 0xAF = overlong (cabextract converts this to 6 replacement chars) absolutepath2b absolutepath3b absolutepath4b absolutepath5b absolutepath6b relative....path2b relative....path3b relative....path4b relative....path5b relative....path6b # relative paths hiding after overlong encodings of null byte # cabextract sees the 2,5,6 byte versions as 2,5,6 invalid bytes # and converts to 2,5,6 replacement chars. cabextract sees the # 3,4 byte versions as valid bytes, but rejects the resulting # null so replaces with a single replacement char innocuous/../../relative/path2b innocuous/../../relative/path3b innocuous/../../relative/path4b innocuous/../../relative/path5b innocuous/../../relative/path6b cabextract-1.9/test/cabs/utf8-stresstest.cab0000664000175000017500000000371313370016607016102 00000000000000MSCF,Ol"Yκόσμεl"Y€l"Yࠀl"Y𐀀l"Yl"Yl"Yl"Y߿l"Y￿l"Yl"Yl"Yl"Y퟿l"Yl"Y�l"Y􏿿l"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Y l"Y l"Y l"Y l"Y l"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Yl"Y￾l"Y￿l"Y﷐﷑﷒﷓﷔﷕﷖﷗﷘﷙﷚﷛﷜﷝﷞﷟﷠﷡﷢﷣﷤﷥﷦﷧﷨﷩﷪﷫﷬﷭﷮﷯"|l"Y🿾🿿𯿾𯿿𿿾𿿿񏿾񏿿񟿾񟿿񯿾񯿿񿿾񿿿򏿾򏿿cabextract-1.9/test/cabs/large-cab.pl0000775000175000017500000000264213367355040014504 00000000000000#!/usr/bin/perl -w use strict; my ($blocks1, $blocks2) = map {int} @ARGV; die < This generates a CAB file with two files in it, where the first file is 32768*blocks1 bytes long and the second file is 32768*blocks2 bytes long. Neither file can be more than 65535*32768 bytes long. EOF my $header = pack('A4V5C2v5', 'MSCF', 0, 0, 0, 0, 0, 3, 1, 2, 2, 0, 0, 0); my $folders = pack('Vvv', 0, $blocks1, 0) . pack('Vvv', 0, $blocks2, 0); my $files = pack('V2v4Z*', $blocks1*32768, 0, 0, 0x226C, 0x59BA, 0x20, 'test1.bin') . pack('V2v4Z*', $blocks2*32768, 0, 1, 0x226C, 0x59BA, 0x20, 'test2.bin'); my $block = pack('VvvC*', 0, 32768, 32768, ((0..255) x 128)); # fixup offsets my $files_offset = length($header) + length($folders); my $blocks_offset = $files_offset + length($files); my $cab_length = $blocks_offset + length($block) * ($blocks1 + $blocks2); substr($header, 0x08, 4, pack 'V', $cab_length); substr($header, 0x10, 4, pack 'V', $files_offset); substr($folders, 0x00, 4, pack 'V', $blocks_offset); substr($folders, 0x08, 4, pack 'V', $blocks_offset + length($block) * $blocks1); die "Overall cabinet is too large ($cab_length > 4294967295)\n" if $cab_length > 4294967295; # print cab file to stdout print $header . $folders . $files; map {print $block} 1 .. ($blocks1 + $blocks2); cabextract-1.9/test/cabs/split-1.cab0000644000175000017500000007246013323707071014267 00000000000000MSCF0u#dd2 Split-2.CABSplit cabinet file 2/5u^ LF small1.bin@LF small2.bin@@LF medium1.binCK/ N. ;ֹe bXݵI{5"%R-z $ V5Æb`Rɯ܀ξv9h I}gDdvn$h:#x' b}ztbMJeFSߔSD:h\-Vq(ͤB#](ux(LS]˜ykP=:!t9.<9#㚹r#KtY]׮!U (=ش<>~ ~ <3 mn̉6:9wN&CemЛq EPy#Vf*7߫ħ^ո ]V`k^wJR'L,%D *A6lQ =LC*!O^)^B C]$'L/CoZ +e̔]rdMykA[Xp>+c°"c( whÆ6=of-{VK:f#Gqf(G##&sP؉*V:JsIU1(ϣ+V(EKU9z`SV;4LċX;E)u3F 5>`ixgbos%rz41 ^bT~T.q lZIjs]i[)`Ccf\P -Ն-B["o~h9x:O*x(,DCƐ#”J+O{@t͖y pq;G_?Dd4ˊIWT\1#^|&0"FR]ePR 4 N["%sWFPo*O?Oe[·)aWj!82by_pXMODIA*M8}8ڨ"K֫ q~w[X$6[(JdNCҎt4TR4yg;Hq{SE>TsqY/rD9^]&7ɬQզԢ>-^LR+ڣVL⶞ x{k(*h_{C[%ذ+(PxpP I~{E &# ?0Ȍa:[[B4D'e|kLGaõtH &͐!3VI&K(ŬB^7D-tmT3쟥>HyAc#eB**3q_2eW?]M}YNt9FHJ734ssv/WB='M#]wZA!iݩXD/f`o'^MaBN[[Tb?^ epvasUu;_ TGУCxSt)3FFl @g|惒}[E[%>t))E޻='¦|o0~5^hBc}Nb8`Bo:b\BdR06FHGpٟ  cB?hNZbR x5lq$t b!ݠE}kCK20f} ^M{WlVؗgcSUE'lv FsyB~G`wFMPm4 <槀ѐ>ů`[P:wy_o?7SkcQvYc 80♇R"&}[5dޘi~UJ<枛W343D'2[ .ad^Fz35JVY^pYTx ¯5fX Ii¼7JCU=6_w) >YSa`>\mEf秊AMB,_4gI7^8lkIGGAj i% 8[Ƃ023-lG[~s>XIUI_{5^yz `{bG Pwt>x0Pz"h.!j>aiVOgYl{ˌ객$0bAKyBZ_yͿ{1/K $NӗZЛU55Ɠ+/Wp)@}H5ow [R*3cHO,Uew񬑭J,.\P@X4w. mrk'SO-H^Q:E)qZy?{qxg#WZ̚ɑX0V2O{ qY!s&g&{aG9b(<5P2DkP|j'`{#^_XTJY`fhv/bYAtH H!>xeZO<C?aLi iB#wk}CP"gbzʘ}0QU Dbu2@B/]p]xm|3 "l΀Z@B$ۓ;"•?#)`z' mcw X/ۈ]5|>Jlvw]!66yN u-1pM.i '$r#s}q0>vo9)`]i!]]5!5R46)8/t (?/GN\WqaY/MWK?X|Yz[Ҝjp9% o*I;U`%i]TgyBtҜN'DPjx_+H2x'#O/*ۃ< $wXP{sӿ;Xu Ȝ:(I^g2} Fo 4/qxlVm7ڬWIȃ%Xtu f[Dy Jy+Ķrxem$U 40_]ֺn$ᩣ&4$ŸNZpdq2f~4[Nb۫&z M؊>e"ks~]3gIRA!R֘SCo- H16SL4$XFaf޻@uuk_m<ѯK=kX9>w3P-`UPi|}1o*T/kؿ]ΉH- ^|1F f⢓(3PT'& /pORR+h0!xgʿq2Sz'H<5g+` .O. 03,R&RX|c(F$p Hj<^yg5dł>l,NlKW(? Cе?RyIO,uc6XV^hAN-ƦIkx tzY}e ݌p~ـ,R7*"7v4j;||Ne%ݯR~-qD#&l~3 2bFs a@\ 2&0>p*Q_[3zt3 hۧ)=2wpZs_~)-O1LWFP@+ (P?ڼ~|ͽEqE&Kdu ?U-onMk$Iأ'"vl3jM[zDH]"uMTabh{f$t0MV5rA\K]Rdx1Cr2/iBYl!+Hy;`/F`3wi徜}t#C ?z32ar#Ѕv0 w$$I@iз6m)D/1IS6Wcs㯲[5l!i UuA21^frdkS ފIy^6y1kF|!ù](cu\4 jS/S9W)SLn.> F2!sM{n2{7 `b-mࢹm3IcczMomQ]HRe(YӯjN\KֽZk7yyrYҪ}u#^_1ѺhiqJN:oWF\KVt}i@<byO1zƳC`a(MɃTpt֩\ƽXxȹb%;'TNjOW#oKZ m\vԸVxmRUrh> 7}I\fg^OG孕"3>#ct MdTe-mEǬyBkkV 5H%=X.z@]}YK~,_"d%òc0v%p<+C >C:;vkHQ5Ǟga)}rw&=#=ش4wEy#r`@6GgC0Lp݈jV2 ѐCYg" ;S EQPx0Μ7@XHfȭ[TGrwHųHShWo_мt*+[K6歚#rnchL%EjR%Rwj,p5J*艰 HVO0=D(_9*{9Y)>Wd?w [A&Ar.ثY'sc"A,e|{x+KB9M,E<v&sdd&15B6$oh#ERD`۪rɯ?PV{x=g)^1GRLLjpp680}]DqXojԠe!@.)c3K%{BQ B2 7_ZEcvپDp؛T;IfX._նg:;R'h?4yd o"଱z?;t+ϝ4ǃaT5"InHEL)"\4DŖ,DΙ=?@/:kzID#Tg-1ǺY-yej;q<ۚ}o?Xw|ǻdEF-fS"aܽq^ő z0&[DQ`7CBj3BTN(OZG5סODd6P?ug1JKy9<3z%,MzO?8'hMY^|#;sԳUN;U ٲqO+zʑEy&.8 Q#teXyGC+!GH,)JGXV0u ߜ.wfC[,uomҗҷsDhEdvkNPwe| y,2izc:O~8jw}Tv è612U /Jd=>F71*aB.ے²o6Ӹ\sH4 oSSr平^ܫag_Xs:v_%1uߍl; - y-Py[2113@,>v%K #ݻҽeU!5aׄUkHK[+( |qzQL~ `k1wߦ;a!'vQ4fs1 Cws*]fb\LoT&Cݾ!u~kC¼gPTS =xuwrwτ:]ɰʙ>k|#}p{N 0$%,}6Z u CFެ!O Fpo3sMkzJ߁h>i'}AT\^lU,R.NA7~>V)t}QOF> Yh1<y0<+{󀲇;N&:>βH&T ?*D#,tu&* 5 K}g@Sr翽K%2svoTBBeH1^m3$ޑ9LҒ ]cϯ/:{9 6M}X7'xPVș)r^‰ wT9im{[hf(qy RaSœZ3AԻ.fm;.JH/!G$37e 66g~ȚSlCx a6LU =^CƔ\A.10c>Mơ̚Z@䇈't3:b ?KejW2c "+)p(nRn)"vi|MWԩTF!IV}p}.@Cq6Đ z ~gU2)H'\lÜaDIO#XL-T#)K5:+rrW^GDoj#Ҧ4xȎ7.K3@S) .fH^XX:^DZAr=R[՘3sDq ^;2L'hL:IR[ _]d h>=_F*HPz >[YʼWȆ~ jmF9RAUk"wi3uS@5HM<-web}cFL,Ruc:yL-Lji砶Cl:(G{E=8jf̞g%{ ?aMBE:<0Vɋ9rzO>{xYq , 5URe;(aHU%hF?3ך? `b]N DVbe\_dw(e+Fޱ0n|՝RYCBB3`d!.*o:r\G31QK=: MTڋ lcuHNˢ,!_~Doa*W~i~0N"/^@!|xN.$P/̈Գbh=\al2\.NZ21SWunGKO |[,??jS{^jEb_Á9.vA%ˉIJ%Cs^׆D $p~BeuO$ <YQ N^Cʡ nRx5/?g={,!A9Jϒ+"'2""`HT5ѝiE%d)8ۃ] 'T"C< [$oŽ0\MׅX0}Frol 3E7+yas~ik@ЄZ1Zk4L }P@@+{Q G 6ۥϾP N!96޽eɹ\ .wiBNƤAѯ:lnJ=lXw ( KBsEǹAYT_F*[?ϩkeslxrT|5)w_gxf(m.CgڠX+ omCMO]%1~qX-wƴIL_~x@8^OXpśHcqQdIד"ނ-Ž҅#Q\Ý3^2a6D,'˲ÀiB^h|q6kb[x"Btdd霧/d @cyR:ˉQQx3@2< 5X qw\W(+9wm)ɲnNHZ u4֭ [z?[MAAV[O2lMAI/ɛaJqKtd_3X*)gpL"Z Nɲ epxJdžZ񱰊it ՖqbT/dL|i܇ӪY?qD7CN8<컊a61&V z:f=uT Zòޏ)I5(qQn!B)|&?9$LFVuMoO'kf1VbT {wCMOVPN*8V8f,wҶbPYN!խT߸ESwк ƃmV)mPo4 <YTndJ1ŋ$ަ˝H\0TGߝ] ?X؉ 7,hB\#F@ T.0 MFF`EImH\I ^[hhnXnmukb0>lDK&lo@lwZ\I CMovQ٥uSF b [(!vd6:WlB jnϯ^luƘ6?7Qi6b1\<M { H,xp/猁ZGi^;zN60Sj#2HB:~,pA{h]y0ᥦeE` nR=̍2z{] V#٣mxIphL'ϧxJe5 }V'1sueDRƠ]BY݊HHMꂬ\Pfaߦ喃qӽzG 3 ٯaZ C,)8_k/FTT#%7K!7Rd0\ 5w \"忘 sDjVS:GUe{+@H˺! bb@ QYxVۅ`҈0ݦ$q7 sբkqE .5nXc?la0%p5J Q 3EF xqُ $ 0;? C+ޤlM9ޡߙ,GmU7 n9>PIWsCL[/~^mfPs?A/ nZoUlHe#1 DeOژ-q>˗2P0sF} K h*⧡p?XꃺO/s %$e=h  WٕJq@cP,hv/FNRǦO仪#(JzmZ uTekD=U3 Qq`=\{G`i$l\6.ЦOv-2CDR;6j4d b\{< Ƥ̙C cWf47\JExx7#~YĝXeȚ#M B#JAm hfҖ$kKXYP,c#=ZTV>4߿<>Kx"$RLUG ~fp^L8ę8y֪*==:]: WmU1a ߦ.0CY2?U|ouvP)M{_ (-GF G*h`bdT$]\{d8ji]ʚlOo0}bdv0Yd/")&BHrIðjDžNT;E^YT)z[&EnҒR L4b3r`}'"-ԨDQ(}`g511z9vX=7\-ol&4}HQMR7]8 qoK6_ioFy-2f,(fpqۨ/)IˌM]vW}gu0O6wҥ)JāOmRb3.e)]+}r Jsc%(zDžyD[ ?4iCH8R*p>z0OXxBbGF> m "rzO hKPd=h+\fe43i"x&#jfߔO$}3(~d|S:/_]l ПiUwE;- w6պq}#Me vA|3<9=C1ʒWNrkn&Gp_ep?Rbfp2*a[5UHR׾E)rNCPHÒKY)Jb ]N>AkPIqʿod `Upd `z 8VzJcR#F!!Ohg@t_oՁSu}HNv89XQ 1Ruđi0Xb!{vis &p5Nwڔf=vp.ߤ{xg-i\$ъ>`S!R;Gӂls>O㞋Wo!`[V1Gb#׵r@}9; ŕ O²˫5%_dER_ʃ6^DQ.ue~EvjmZJĥ xI}7HfhB&߰SCF%3t:8L`πwB26i:V1 oR!2۸,-&/$eCQ 4[+ $NUUa([keO|A\ :^kxd=2nc-!Oڷr>~IjNxȑ v*hLKIf( ,C41]o١(jxGƊpr[F*[@fKGo2+chLG%PFoU -$?M~#;Y ?.sxw\8==bh]t SLI%L*t icK?Vea 6F刻cs}f۔3/G ,ls &}2ַWD?Mld7a8V>b~}ûU%r Tl=.ق߷U~̈nn]L]#Y \pv(2olYl_3V V UzMAYlýe:q*7vef0 sIh̤Swڃbv#ƃ:Q-={*i!,rʱ P/vD}fDݫ; C'ť):۳M.8Gng7o8,DZLOϮ%פ}2{Ҕ 4N92P `R]0sB)mVٯqf\Cj ^z.b]DG~~Hu[-9FcB oK؋dqnޮ!"xn_\@5)\x_-+.JzuDA&WcVh3 AkjW2JMF5:tOhd)_ \54rsO01]}Kl_x8:dx!)٬-ӽB۟H0>HdUKy@1!aqbߢOFnmlRA PZ1b:uԈriZy[uc43;-U*EC"^g/G%ZcRaxޤ~m8ϩ'Sb_#ZIX}Ύ8*2+6?n#+TB^l: H{Ghq`lp;bLMGYjP̨0bvÛ+͂B3U~ait? o DOG4tF WÍWힼglFȵ LM$X _ݫ )m UjUyzЦ2ӝqg97/'[~D?I|kw%ױfzԻ^AUc:y9wv`*@K$!vX|XO-p7OX pw$\kh?*LӉiޠnirW>1LJ0LJױ!~T)D8~}&fͳ*CV_+s5ܳ->z=rwx!7kX4O ^̀軝b4Z #T(*<)ȅ`UoXB͚k&ᦱa1Mtv aIЯS!v4c)=FLR&"|:LF?n֡msl֡!t%p.9zU]nl(7x4H(2,Ra__-\#)7JsOgW8Xϫa5%z\%? 4T̩ b-Kg<52o"XM0jQ2 8<֟#w_be7U&1 Cq8+uטEBO!Dg"mDZȂA=7&&恲ƧuD}\5Dd^îHuL 5BD=9Y`{~U5Aj,lRՃlٕϭ '4mH؛ &B4$e1!.aC#5ؠ Ȁ-p',?n'mes@5$d-Lށo 3Y†$N]~TaF$@KC' zi)[jɏVfx+KFW)ʘN``)9X\kc,7˖eZFlZ_gńuTm0Y<,]8"ޝC޷ʇO h" H؁ ywFW"9okeT`Bm \4Gΐ~&w4o rHjl颢uL܂џhE'4I4!{MC 'ϯk (O'eāXP{W,"Pʺ)MͲX5?[jd)2s[=#gN7o$VEtdIҼ\ G>`raz!KxGwmS>h0v}-&tRW&603UkIϔԁ_C|)XUtgL6|sHY!?0aʼn$q,;59 )G@]/݆FB,vȃa!RTYޠ\:VzhD|bswN , 2zh*RI =fPKt'Mm.C3cñ TD$7Ľ>=JU (D;EܠbђKtidKu{qZG{Ov53,3]e^a,. wk:B5l˅$[^̰5ʼM Qܘ"r+lBm2(txeJVIpA5Vbf;VZi_ӳ Q>SXqO>QDv*jڛroc : +-pj dl3+uN KO|0ݷ43mX0|+-SA@r٫3pb(^ o9fFe_3nAj߃τ0mbzI}uVl$u %az#>kXAlܢZcϟ-ߧ#,fF;-xջ T>yx)cERri/uYДR\@j5@ Cb[$VtnBJEL+l^يx?5u!籷yԾLxR*:fMf҂7Ȇ*:ف}v7b'jKzoq=3e 逸ӉFuь~~+Ha$f1n:cm>'[*VNsy>lzoibV8FjJcλΣfY]ʻyi"6_hRkRjӡjR#GfOu_x=sDIZǛ|yusޞ6BÝN .nhff̸~:8 IO. kQh'֝ՒJPOǘUR|XJx^fyޭqIxy;9?Qwՙ'wch IGPBH:3g1ؐg r\8 "tMsɿbƘڹjR=2?`,BoR@Za30];$"Dn/H"=-Va^JIRǼG7:Tn:UCTWSܤțNmg7֡O4x{dퟞ|5Rjqa4U{yWxW3ζvyc_yaqF'R_H; 4a:[{r ^_ Z6[I^۬:SOQTx$s AY3zo+A `b=6.fKi$g;¢~Y51Ax˨Gmp+Sܑ j^G[py *>KKsDvi"Y^^t먑j/?H]ɖD,ehle>.MK2N %_Zo`gDR 6U r jN4tAO'ϲp7Y橤Rf:.#}iiWZï kr3^r% ֚?f tϭCChĚ.|(t()mOrÐL~cI'+̗N7!by]7SG:G=t )KO7>mx V3~my($H7fV<  lGjEppԠ[,=\I"/R8sݗU-a^/2WTaAi+^ j7B<d90ypnX7?պ ]Uv2+LSt1U1-2" lBKFz=Y,35Z ڕ:}_ʓ:>W"M/to1^(J3e8m%"O+- 5-", @TЀʤ\_lzrQ8ّÔx\$чGz]sK.Vx5M6e_p|"#`@`f5 n󍬛8KdmQ wiaxu_G4$9\*Ňp by=1~̳3}qK#k2c8H7c|##lźe$ʊ,lD_ \MeܳBI7^3$pq&Kx UvD0YoR[16b|-MQN35>Y>vAN Q!.6[c@{ 1AZkdʟ +JnX/V-Ҿ'iWfM͚I2<l-yK[!5Ʉp@S A >'>qZHfG7WR3ؿmM6.T~{|oN7O [CC`7qǺM אkqZ#@}9특8<.d~cAnB'v>kJ 8C8 KW&:f,=p& `D(g #ʥ :QEP6Djv>oόR/4ZIv<031KL(?|u37[t8>eU^cp{YC>)/$z$J*_PL4!uF atVtA>gkw!RٜQk2Fp3Xm  .UЯQI%PS LѝU_urGn϶FlQO%5ϘpOm^_xZHǬ c|kēW`RZaD\Ⱦv-Wlc׽BTsGC;WR52!CiQ8p}ћbz-O.U /IY1pCީqBZ4BL/#b4 ;hƉwyicUjI)^a)Kf">KXEblۂ (^!eB 54=`SyO-=[1hc[fۙ滫d> U^^`rVu|QJr.fJ&HB1/V]:TuA^Mbi omm~-UvV:{iV)z!̄I/^)G$ ցkYj9UVP%!ej譨IJ[vk98 }!gcKйnoIO:ǖDYAm4=Lj4d.3CHF_LJ VUWÎ ^Wxu [fib.[ǰSV돻%(bf~r"Bq^H0XHU~m."i1@{P~g|tIdbxU&#fJ8 #AL_%Ƌqz)u$ُwu.'iDJzz="Y/Kmb.AJ!0%n7#DE% \[5-Kpk7dΦq"e{9$Q+q,y;OYᢍ9nvJqXkV5r>(ch87/hMlj#ai%Ҕ]ɣc^sNJ0LN]!mt _Z|g+eKV9G:;0H[5GtW\i㵺1ilM7Jӱr*Twqɏ\Sp l8زcOΣ?eHGIo,zP-=E>(HQZk kieD^+|:懦HdYJZ@v{Hy~BpiS*O^ـėt1 QE{+9bE,i/¡ ]CDHz}ݝ)KokPި%KR gD [Y ¨+M5b3xأKB7c֎=_~J6W>E !xϥr~hK0yP $A|H8Vҙ ˨ev媩"O# ´;゜̴RXCt2 q_,8A[g3$^my.z͕mC)  G`š\YY87$D[/jDf <~ 2[q,wQg7 xC͝iM}8p4=̆^iO) يYpiF7l)5!B]% eV#mG9ޥ7K,/+фZIe FiA# S5ԚMcQc~=~? FeY(UFm5vRA,Gr/LW] Fx,ǐ#ԘVEC S:BĤ6Dt#å%6.dk]ht\I-I9 t-iw#f#G øyLQ-#գu7Py%dOG|5{⵴ɥ`[0Vkc*Ü6.Q!c\k`P-?|/v5ni0p+)1΅̮3'y#D )!WPYⰖ.8ΖᇶǷ0X[^!U}Fbǡ|+%:8v N.j%$n.[iC12^.0VTO #(w `2wJP;WGwça#98p] :j6ֿ(|R9WLGcabextract-1.9/test/cabs/split-2.cab0000644000175000017500000007246013323707071014270 00000000000000MSCF0uFdd2 Split-1.CABSplit cabinet file 1/5Split-3.CABSplit cabinet file 3/5Q@LF small2.bin@@LF medium1.binPLF medium2.binߺ.G_xΩ6l M 7l?7`VV4#tEXט֭^N/m'ljp,7rטFcsk_|CzY 7*E xgunlx rPQ*sȯL'G^F%;IAx]PԱa؋#mVQ}[zBI2N~L3g<~L={χ!]tZyiSoힿ͂u66eA_u"cc:O2HáDrgg>gy+B& w^.>LXoƃEO- ߿ %mqx0uk$h sBGSL[5ޜM^D@ qM"DQK1! p_D9ogeL|0Fo{%KD6 Ne]76)`l%s# YH` -|qXeJp2(R8nN?cbG1 aR y=p3)~1A!Y3a\^܏$4cBTaGˁRSUC]aSǁbDUk~{(gd1]n۸E'$*C;w~ Uqʆs>#9֝]J nk0cV4bH<^{4ī@=~ߛ"(9qG1b(# 6'oih7QcPApyDMva:h)/7eY"N4$S^UjU>[+u:@pbMv7a>K?{,o;gIw j{mޯ?`wB0LKulP)A6[.( N"Xڌw(`v*z"ʫN/I/&*#Wτ@_J) `EJr$vkϏ(< _OxG7 "5hRo/9q:}u!HِKd)`wGz\..wHJ*wd6Cy3ՑzNͦ$}q(tiRxVxn 2}8fTݠiz1L=^a1Gs3hixZ0q .WRCWEQ 9fe/.oT*Rl5HF<y :\fd13dC߾V؉n.~#n~G\%m:n˟uUÃB& wI!-ߌmE1C+veڣ5A$[騜V,Vs`&ސ`έW{A%qBZ_9Mjz.=:̟S)I s8ͮǬzn1@|(vV_UNådMV]θsk?<1"]F+tًٙd"q-/Jm/u4:{S|.kJ+#8_1@ ِIDR{0B>! Κ@zXd\f>ح39ȴ@EɤB==So;w!م6Y#½ALtG;_P2h&w6Y˔^eW-=A %!T_boSS]cŅ hZ[ !FASnA_LJސXS]=SИTP[%ZDp[0 wd"y3Km)"LKK* Tb(4b!^ nTfQ*%LobړBYU1ZMl%N?9bdř"PeL6̀Ui FUM{;2˽H`L6HοJ۪Fr-BNnE >G٬He 2x@T x`о93k8XuRWpmƺ$תϟh8`Mo ^ $E^3feXnjA"ޤ/itb0JBZ%ldvon{zI7S~{D忥RY=soڿ T:S`\ĤdFITY|;EǬBu+VWj XD Hbnxls),O}\X 5$;6QJL+aj@GuiӡNoVQn0o0bos2*[%Elߩ%6w*i|n`mrptGk8%ʨ;1-v,.6,9WW`M=jUB23'C-/~}k(] 52-yN0 qapsQZM\: c[_<^چkF`EFJFTADK.`!Ty;p\PN&?OSxdmẵ[3e:<ԑ0}P٧Ə*> )-E%7&QW׷ydCTTWJUo8ʪ4:9E@֩D3umKVZ(Ck'bqPlXeAtg [;zQr!J 5!}#ņ!%ћ% 'HG7EŰ>F Ϫb&@}h13' [V%e:ǝM uS;?k`ɅJ :v~ygW_v0~OJgxl2b>AB `}D@p4vVsVW>G&ـ0}/]ݑS~r"r+>.&v,$v\s ήi{]J;;CK;q P.Uh *R"[ ]{VWa"Lq]:IIc~_NCOZqy&O֛ኗhQCG=Jd nD Ny],)`TFwk!FZe=rxBCu"CHˍH2ɱx͹t(3Z @03`c2P%꾖\BZF(Qu2)Te")iܔUV F$Me/XTn,1UVP \L xeg~_XS9umUe:Ǥ@Q=tbOlzݵjri %8XPB0dƨ|Mn5YU |HL$Ɠ6o8%[ǀw1ƬA<]r|oGrmC.xWNYM,^R2LE]2YO ,Mtȴ'}y }kDSvN:J0Kv1|v[1Ѻ( ljȽEՒAmƅ)C=;1s5bZ(;o55|M5'Y4U n]|0FzLQmC !$am5|HUA&q5TLu&ļ즣JG,dE$(~pcUpwӰ,CGY< Gt+U8G' vdWq\xqLڣCxދjh+*]=3*V?1+ ؑp,S 4}f7A&'V*E&ahP iAu0i_s [/O 6l8q z{<"iqed8H"jIУ!I8c QJ%t oU0(٬BG*t182OfKaцKSSPK;ej=u粠sAzA:r`áQ_;á+"<dz 8$r&ad.2̀n_b*z3JgeKhQis!@0YΒp|$V=kܶxX.IЏj0| GsS\SM#EC@ #Y3Ofb(VqV?ʏʛle1`nͅ-0j+w }\~*Ji(d6P4q8ɇ jv9+ge$,EiQ\MLNhsitimD"Iܘ?s)N75]63ALA>TtĬ4,vAT hAf9Ä́E9id3G\nIݜ[ׇ <x'ܓ!~SHc7=nJ[M[eؔ+t X,S:i5Pm /*.Ġ. \!'>~ @5?W +٥ _`/99[byb$@؃ED(?njL᎚:'.; މ3W,]24RŃŧB)5z=jO{N邺CJ54cP;Aqy{=2`s}QHv$fŠ۪#yz0wrql1湪Udo'L̇[ށn& !\B?ʞ0( k'[IUF1\""*1`CM&3B#a$i ih}k{xTCXx~Q)SQނjFv}Wk[_b}Gḓϡw),,_ Ih`Xv蹶=h(6vl|  *h*h_V .|KoYdkj&ؚ2|ĖsI]c+%1-_[3P3SNw<|xoT2۠CaO*ceLa iu!dhҸ#:ٴm ܿN^J!Pc3cj >- J؜9@,M8dh3obe&z#.G"5kbQh GB XtQʈ*n^Ѷ  Fc`Djz63;8:"(IrqQ)4Mkw-BlsgW/bBASPݘFELh;b!m7zySy6Nbs;)) e'BV 3ȹ[0=NKXKϚ^$A_g`XhQ*>C%A3NƿlR첫S,<ZCYݨWN.>)ZN5 )RWi`שɸ;G.tw -PaWy1L@Q~~ :Y|/#b#pAHi9v[=g6}є5+tGBAw.S=t1}D`E.mQ*>8S_:еq&F~{esh֚d뗎v1hF|ѼqIIX/׍Y1 ر P6raz;_$ϳwx U YT%.aZ=h;{IH@:I]iWPpO&Y/dYZRpĥZ~ZoRq1 01[P\=*s߆J,=A[:`wԦ(ntP @(()k|Lk[zZTe8+͐4c^U}k~NLc+G&v0q.d'O>ҥ&[9?^Z=zecH'K^F 3)dz8 @@ aҞ:gqە9)mC(]w}~=ϭї 9s~,azxK4&RD[ѡ1FzM R704vW`dT+r|36ov(4g|{jZ9.)ڈ3٩I֣!5Q^7s#:$WZَXTj=/F\][?IMYPU>4Foy\z%iuӼE%2.TY 7 D?wrRI[Ã.ph/-&Ņ>ޞ/x%@nKd@l2LΘ5Ѵڀ/պ?VB(z~g23wgҾIg`4 I0T8u),|jxcO [wI9 4Q4\cfn?2Qpj1}d=H*`E Nz]ŵ{%sPr8C،NU[Zc>cWRضG"X>׵xX *W,d,)䠞 ;y:Ԯ#qhVn\Yf|J›miщhm-kjOq$9}B &\sv"zܰO&N>DKI[=1CkIj_佺8kC1M3Xu}aYUшzx$Ld7h}ZW Rb~nR}߳7UE{vr7!ڊ^xK:1z_*۠Y ^Wf_Bu\V6R+-a%D%2VO0E/ZM rc\Ul=QiC^tĿDpU+_Yڐ#8>|1d>܇Y04y?hKZW_3M3CUӱ%(斲%>㤍ƗUlv`XHvGxP"/[X5kedYG]&#f}cq.L]bF{}9ZRܫ:qhG?z:CZitx 7|qG*FʀBgJ-+ }rնחz k(>Q9I8Ngl= 4޹Pkv)/>. IKy{PްX[bɿ1z=Tt2HOn{xOП^gASdTUhM݊YÊ/vŋW~H==b>+K`MWFcE`G0}W63-GPEKCmt%&Sb[V2d#>bW~*=B"R%P.i^X:+;mv%A{y]k5]liߺ\};>3gFubnjl["d.kN2pJMϛtEmawk)޴*W"I97!6[%䟆PLRD9||rZ;J7wdh~_Pf;͘â)NEF >ڪ\ 7HՄ(B!1U%PV$1r&NN3+r5Z#ӤKk^"';Ty>  hzdKD997a=%mOEk(%mW\6YN;C0ǫ ^6 arBӈ/2lVyJ%0K$/SA֟Q0;ޢ@3. Sx{(KmXeՌvވwcYRpn ?(4Im ,R.¤e@M$~N Dp:U iIF,1V5oDrFD8Ș=_DSׄIbĔ)!\ Ñ8aUN}Ӯ.jaVJiL 8@sţr_jk-4}(]Ymkڶ^.ر3H1 eXkl_9x"< -Y\'o,> 1<&ד:L䔋{6ў:LaqLg[ne4h@\5jY !#cHk~F!si$ G6۲.s\Ssq_P}#wN=l}RC&Yz\$a Dcp q$9f>dnIHJ ^g!-g7"ڠy0%D66z&ɲ)}x&?BE2TN~AYoMߺlݘKJiE2 07{[;·*Uus$,=cPJR]/]> vYPo::J 2 QUS3Z Թ0'#Eʭ$a9I,LHt36vfR(}Z&^zΤÿmB.ݿBr#0%~|+o({l jGUN@W<"d/q"v &(sCݮsۄDiȷd(/yݷFk3[p"xVbB%M.m]Y\㟤U䐔VYAQU&p^mR Wc yB~/銧ֱq3pjk,iH5TQJH8Eȇlgc^yH@oq.ƒx_"2j>qIChcZԗŬq~'#@g#&OܭWfB`*dw.Qk<(Š񩐱Qcph&m^џF@n䷀+3}$K8nH)c?Sm[U|hrAI)IU6%]GA:!;~JCjx%=Oq=Uc)—Mk*$E'}u:D)+;ssB(0zJ|ȩd$T@E}NٹoZÞuLT'7#f*Ol5We*lۦdz( yfcaF ?_xQe{=+пRW2ly= +^$ނ +mh.썡Y;-1I:I3O1ýnEw7r{LXLS4 g |V]AOh, D6hbJz^vE9ū$gOUk>HgmS:WV ō[F.!?HO!s&f 4VF>-/4 姢 :r0yk\_8+7#]Oij<Y[1˼8k\ƒ(֫ߏ9GJ||Z$۴^* x CQxg`?!\/}5+%Hk^Tda?LG"^\CTt,z8s%Y&Ag1.ft'vMzG(T oFL!fY1Ao `ۋO?\Y@j r+4%?d& <Ӕ\ZO?+0ۆ@!1A=}:+±p"~Q8Dz90(ыiazPu,Vxh,H7%5=>pkx1 X,FYJ?zcyLyg¬%_\3e^]D!ԙ5%PDE҃ hdh{9ED.IƮcNԄj-X&SQΰ #AHic=}nfPvaSًC?VAHrc]x2@hMojjz(x5vT9E+TAP^Hwcꦴt Sb2cuǰlKjx@٬[J5{qA BXQ6ccX=]eUn5R:A\Eg$ɩ`G@Ǿ~h̛3S@Z;=%V@{C+)@= 2R5݂U?4,GR"4ٜN*eY3=譗5 / 78D^ Q4} #xLa~bl>} &z͢Qm3t*#X=%\nzXUcE0I?lAh.г TGixa w!j$лE)wLqۘc|ԥΦ ˖iY/JvB1nYeCփ /B4Lpre4qU _OV Y#h, \DtX_"ο/_bؗWՌ3PZ͹kSdU q)3qtU̍0'}g~LJ.¨nŸNr"cKo`PLJPj+ }>IB DwsڴD1ɏVRDwo Ba3Ӡ+m;Pj((,TqaY2Mk;Ob uU qӀMqU. GuM@O>|}Cװ,tKW̵"CoHp+Lhs`6/ibj~og:Ocv&vIҭїxTXW6^Gn$Y[={a&A&vvpF1.BO-'^|@zoa cOnaߝ?IkIP\gƁǹ}#1_wmwa5d2\ԵD2lNYp"VMcCz敏HI26^-]tI$\-k@.{mٶyG莤0%6`̘Gͮ@N5J[`GBR@^Qw8/&67I"TKnF9E8uIS= Xڸ:=xdbVD^,p0|῀vXU]L:ĸfwP8%_xGOðm0V;Kc2{ Zb>i('`qkl1IlM' N~kD"4Jd–H9( k@|>Pe~Oԩ u5ҪFt1h5B &#Mk}7H[Ѻ|$XFcVɑsiF^,yxp~X#{fCĄh(O?<ҳ{|2,} X IqJDB nzp;>}d9?N$#V*^"OuB5pZ.}$Kyzr >TPaI4}Ke -{POݓ HhGx =Acsk\Ȫx4A_sfRLQHΟHaVΌ)~zspD͗U2C ۀŠM/HchKlOz o+%$ѽ":֌卝=K-'hLHG)h@/Ls4O ֌}G)BH0O巔%R!Pܥc7qyb2x+ ° iQ !޸}1Z6e?^PWdy>Gc>m":ς,ApiBy8SFIcgX59!-MfH^Uxzimo"0cc8dݓ~0tT60H1O3WI5d ͢dĊ}it8-ELW[$t\ܭ΃sFj-cf>x fr_d<#|,CҒ W XQCݕV ԏƸRySX%Bҳ{|Oh goJ^k%q џ0T8KMAR %'0wU;ioǕ] fԾ( #G&iw|{q@{Qf):z[Z#'e{eܲ* hG;Fѝ_v>"KY <ivm)Jr~+A6Uןc2`G?-b$怌\AL]EwAk;}akdJ}щTX(~RfWH s/ɂ2gKr3"VG6d+SwhRP\.ۖDb0*eDmK1PUˑ)f4jCr))g-L\I`vU"! oƵ\wJ-QOn{ -iXi@pWM!p)Vh-W~ y6+lM|_6Ԥw9'{ÚV_zl 3P3֙،OOS_#9twa0Z2S)ěQulh8{h k+U͋_y)DTnj6l/GD?)vI dY%i@ކOy1j)Bڻ^kY"c8]FX'Wq}zBI؈z%t|q@*luݖr #VX&Iܳ6V'312_(?_k5+Ø%@n;;\.>MyVg\eP MhYLj( 0o.*uNϬqQOXF7E{}Wa/>T̒>0;}wsEtt9rBWu(O\@rW.q)V ,fΏ$Ny+ ^+׈Ee^s5Ɯ<&&fth.O.9߶ے1Kj'vѼ>Ku0 K:ԔXB%#.eϩ؂ ciW?G+T2-u0)*;~ 3kK!;I^<2"sNOԢ-M2C.02,Kz!!9528c6dIհAif^%M5dy.H2#EqKm>27 74A?pzH٧xW4KD&L`~aB#|l3=eP6@1%'nSq4־aPSh Nٯbedk$y[r-6bcy Xc@nUA xW+_X|aٔE,{cgտV><f6t"90yJ}ʷ`|Uf$59֢RYNyQQ|1;s7":}T8j !)$P<:˕.5Y Lʍ!r|2I!c-+/iK4n`yܚ (4A<#; v %Zb8!N$yuŻ fe&?m^vף1 ˳ai{mEg;]E&;FD Kp^W^$ptpPrKm/ Hg5ԔȀf[h ̈o5X/Ne)-2*ZrY-2CtWHWy^ONZO+&ƩD~vK3 z?T!|v8*Z |uOƌp/RB;D2Jc >sE/:$)E kּ>̵Nx~N$H4@c(Jay+5#4h sT ^7|E#xU1 xb2I*yN-A0/GmQJYa`hiKWNH`|h$K-C.haގ<9`9PSiWC+A9wuxp4da-ZsKfikJ :*`o;R-<^o +2b+oWR19+nP.o8ӊ ɡ&Go/ucfdCp6+/ 촳OWQsbr]*&IqjA*bA!!&Otm UG.NN'vEz }C<w;Z`1hvLN$Љ$m Xr֟o7[=m;>Qz#CKgRDǐ'2prC鐸ǦXCyRb%66- QӂSw!a'5骼0qRxP@:SN >ub;R'BJǡFZ!!ɿK13LuUCUP*m ̱w#,-hH#jstm1=70׼p |lmHG5!-8MXnԥegM/̵|n J)ٞ*Y-C`mQ' " 7n.8) |5J+yFCޅxdU&ިA7U6-^>l߀L]M.j0Cn#f>.E^C4?/U RIem>9]_Yq&@-9{fJ-`1CCONϼJӺ co"鯪π!c^)/E^ֹe_teuBG0?X\RDeb@Y視DoMBC$Sk`o̽VG=;'k_vEìq%+&dzJtq*0@C „%mՍLH\ I.*ȡR9 QX;nw|XE$p\NORKvӳKwKt=Vp*Id߮$rn=̡XwJvw@?@E%@LuzT# nv%υeWhR$X pW[X;(*N=.^iD$v,~8j B aJ)xGX+ vhq wCh8kg/`@@vn-əVA]Ns"y]Ogk;'c8QiJ<&@-On*Du?i$UIDFr/1)pNs'$ d]$/ma8/<A< [E!#nO-"SJBxjrhF~Z~;N|΃y=)~ҟ9~Pq=k+`"u{7f'UϮfarvpgsX}Q\̨JkUcax}6(,徎U薕k90=bnLj; 7VẺ1I{|ʖ&a 35 (r%JTq(p u=讥ECHu<^N7wڧA^,>v 8Ul-p$OO953^ z4` OKY{Nct)LS?AC W-GYKk MH,-2AY/hgi EG}\{wJXqF3ovߢW%\3A(?c~H%lfjn2pi)ן*ă5c&ϖrgÂ&P?]ZTIȮ}M q Zgs\ԭ,}ʼƐwKw:OZV{-֎eBeM cmvl!D+0R]Fk}Y<Ҡ]#8\xxzs}0Y/BI5[R$ q%۾r܅\z1Joios`O\!̔~_r əwInvk2zF< {ZwTi9*9ju\fT ,%ew0- o(4a_~Sj3,{cJ>VrMT4DA^Bj"] 9%ůl:7-xۡºB7*U_)G+F[@˱\'57τGM9@mڿ!獠hztҮNIÍVPi}éոPAHwJ|32 FwfS>Vrc.u 7ұ0@TcH"T4ܰLZ"ikG=Uhi}Dd<֛wPVj9.pS1m>H:{k~ T?rU]!!H8ha07:ED3䤌R's ɃV^pQ7lMfq9 M[ߎ S)iIHSm5VaZо$ѓ( 잣pj(( ~R{K͒=8c+rbƈF/#̢r?5xkEY&,(}")]>ʊ7K,2qW@ .Ԣ>O{ܳ0!ó+pWmL1Jt/LK6/O!د_vq  VcQi 5+Z\MYJU+YWcWakO>I/ #܆GGuϚihSK%.# 4KFhIyOWMTQV{az61ifh0Yg z>޲.=H-/~G'~/BoYRr"Xd!@f(gIے "[ja?ɦ?6Rx_ 3;xZF7LL9kjfY"A6ҪN yWT! +6%.UA/Tԝid قT3?2%YJԄ0 0:Y|Tѿ3y$h0KP0 "e`r|ć8_[ ܼ lgA@W~(I'ۺJ^wAL(U]!cTru=N4/\1LD&Vh3; vHCxCI8)\'++c*7q+"sUwۡ;eq.bDu)/? A (غ%6j-^&DEi+H .{!nPMN1tCT}qApl4fR+ Vޱ`Q1S(>p/[/ eCu[_CY)||͐ڪ.2K,onfMs~>m.Z& zTwI|X=U7],q( cEHPZnpxpG~ߩٶ8WtkM<v-g~4 B0N4X i͙Ú5F># f&`>k]Z&Vޖ=3q&u]O?T?e),U@+4C!s]cltķ)KsR*vE׳IT(A$#Ev/|ⅺ‚*"(Qag3AM>ku4~t1# ۩^H3{5#MYのD(¾ qJ2?s-K/ " c7f*!A.ydql7{ݖsRrܥl 6w eƂ ;-C1epIO].yQ^2ba5•)nܡ^uXv.5HQD8ums#g #Lş|8hbv 4-,KrݡafֻLZq5MSvZ sԨU6x,7:gKP2eނQ-ܿ x>Y'˽VGjӶ_d+v&´}y)ˎ+{j@{aΖ! 7E}mQ“ACa)v PBur! ZOOƃnQ4hMip`ZXk)m ͑j]=G)UVL3^p6m[43rub6ah;Չ?&>Y5]T~l9>ud:Pm =`5[-VhTd:;˴L=$VA7cSU([ć/$5/O-^vEv<Hy1b(c ?Э ٫5#D|h"QI0gNl.zѝAy]|Kg wdC) Bl808!Ji1a\X%%u5߼|x/>wX_/sk~:hxl ad>vS(ĥAσli9Q7f@?Vǫ-)Q/Lu/Cg=t} ֦z8#+3) W#[ K9SivRUX$a\x1^9OB[82\&}=k3UAU <]ihXfTujtTQq"םB1)M  S+aN Θ#QBt0j#6̜6޴b^,))ޕO64,nRs3x+bӁ4`$9_3GZTn=n 4v2:"*S#]Y1}#?V=!.&tyrF/Dz?TQuG5*5{MM'e{m=gZ?8th7pSƕ.XN_QoJMF7Yp:rߋ|>~5|7rc_aڵ^:ptGaC~qW9?s3gVi<>1Y#WB (Ʒ`҆n_'SȻPrqIPooSl$%VMۥH]-@EOۙ4[yWˀ.Ϗ#WEO#.GmMԂ+;Y߲8"er;DGKb!nr;'sܕO@hA^UwE'9^vA 7)u fh1EdIɻ}'Z>޷#Tgi^ ~жxE Θh98s68- e]l,3+wy61 4#:8vokgRv$e:26{9x[J{-4= `5"8 /Ř_yXtQrhMjR(HÓ\X?v LQ%E>?@!άntqt$.hB0QzO""]Zgvt_̮ؓE<)ٔfыnWCHzCpF!=?9*olXq "ni7NSȤɇoEI<Q_%*bhԔ|&rn 0;1~-X\ݑON/mEzdA'H vfN./b{gT<^[ +s%!ͤGƵ1w_f4<۲NDPmAzMhJ_.?RA<k | v0:jx;&>]PkZR7XkV%x9 Ay.Aq(O8o& !<ޡ>[;|r.OߋJBGտ('QJ(i(c1 ′,x4q oF} ŔzUt8Wwa"5 S>}>h|~g5 ?L קƟ" 'g*NنFA/(*XG%UH6zRҲԞ 7x`u7QNdМ0$VRDCpLӽҨw.Nf:vFr)3x`swFw)uS~\ Cd6|F,O#(XO2gU''?\e1Iy0_jf_0ܜdzi-v֣h%~AJpWWFCo^Viާ[Ff2=zoy]ph@]Vg ?jbIy[ ِ]d ]:eA.qr[5gk/mkMڕr"љKwiT5cA3>5׽BcՑ4CC$ewLhF2 /rx0H|K}uik9r'2؜[[o@$ hӐ|Y{]]_1Ss!\ɧOpE.ƍ5zRft|p)N(YLzO44<=vzm|3"{(AT< MH[œo;]ОA9a98Z!1>"F3aDv`, %). ac}EgeL2&jvlY`D6k]c0?'gE8ęynWȝc_J/R'$ʠc p(#9+@&#m;j o`Y!G9?7w)c4<4k6/B :dɱ"(qEFm4< 4Q9 ?tt6Zgѐ; ~XltfpWaM'XH#HT"Vcabextract-1.9/test/cabs/encoding-latin1.txt0000644000175000017500000000014313323707071016031 00000000000000 cabextract-1.9/test/cabs/filenames.pl0000744000175000017500000000377213323707071014630 00000000000000#!/usr/bin/perl -w use strict; # reads filenames, from stdin or from files provided on the command ilne, # writes a cabinet file with those filenames in it to stdout my @filenames; while (<>) { chomp; next if /^$/ or /^#/; push @filenames, $_; } die "no filenames" if @filenames == 0; die "too many filenames" if @filenames > 65535; my (@folders, @files, @datablocks); my $header = pack 'A4V5C2v5', 'MSCF', 0, 0, 0, # signature, 0, cabinet size (fixup), 0, 0, 0, 3, 1, # files offset (fixup), 0, format rev, format ver 1, # number of folders scalar @filenames, # number of files 0, 1234, 0; # flags, set id, set index push @folders, pack 'Vvv', 0, # data offset (fixup) 0, # number of data blocks 0; # compression method for my $filename (@filenames) { my $attribs = ($filename =~ /[\x80-\xFF]/) ? 0xA0 : 0x20; $attribs = 0xA0 if $ENV{FORCE_UTF8}; $attribs = 0x20 if $ENV{FORCE_CODEPAGE}; push @files, pack 'V2v4Z*', 0, # uncompressed size 0, # folder offset 0, # folder index 0x226C, # time 0x59BA, # date $attribs, # attribs $filename; # filename } push @datablocks, pack 'Vvv', 0, # checksum 0, # compressed size 0; # uncompressed size # fixup header's cabinet length and files offset my $files_offset = length($header) + length(join '', @folders); my $blocks_offset = $files_offset + length(join '', @files); my $cab_length = $blocks_offset + length(join '', @datablocks); substr($header, 0x08, 4, pack 'V', $cab_length); substr($header, 0x10, 4, pack 'V', $files_offset); # fixup folders' data block offsets my $b = 0; for (my $f = 0; $f < @folders; $f++) { substr($folders[$f], 0x00, 4, pack 'V', $blocks_offset); my $num_blocks = (unpack 'Vvv', $folders[$f])[1]; while ($num_blocks-- > 0) { $blocks_offset += length($datablocks[$b++]); } } # print cab file to stdout print $header, @folders, @files, @datablocks; cabextract-1.9/test/cabs/encoding-koi8.cab0000644000175000017500000000025713370016607015427 00000000000000MSCF,l"Y , ?l"Y .l"Y KDE2 FreeBSD?cabextract-1.9/test/cabs/encoding-sjis.cab0000644000175000017500000000071713370016607015526 00000000000000MSCF,l"Y ؂痎l"Y Ռɓ炸ΌՎq𓾂l"Y ̕ɂĂ̎ql"Y l"Y ‚ĂƂȂɂʂ˂̂͂Ђӂւق܂݂ނ߂l"Y ACEGIJLNPRTVXZ\^`cegijklmnqtwz}~cabextract-1.9/test/cabs/simple.cab0000644000175000017500000000037513323707071014263 00000000000000MSCF,"^Ml"Y hello.cJMl"Y welcome.cZ0#include void main(void) { printf("Hello, world!\n"); } #include void main(void) { printf("Welcome!\n"); } cabextract-1.9/test/cabs/mixed.cab0000644000175000017500000000057313323707071014100 00000000000000MSCF{<C"9l"Y mszip.txtl"Y lzx.txt;l"Y qtm.txt6y;9CKLS/UHNS(JMLQ(, Q )EE Eٙy\"r[ "UCR>sA^G ,0x 1`_~@!/sѾ9&YW?&a!v9S -K0;i G,*:,<3XK{omQn:gBK6CfVʞr0cabextract-1.9/test/cabs/encoding-sjis.txt0000644000175000017500000000047313323707071015617 00000000000000؂痎 Ռɓ炸ΌՎq𓾂 ̕ɂĂ̎q ‚ĂƂȂɂʂ˂̂͂Ђӂւق܂݂ނ߂ ACEGIJLNPRTVXZ\^`cegijklmnqtwz}~ cabextract-1.9/test/cabs/filename-cabs.sh0000775000175000017500000000061513367364501015354 00000000000000#!/bin/sh ./filenames.pl case.txt >case.cab ./filenames.pl dirwalk-vulns.txt >dirwalk-vulns.cab FORCE_CODEPAGE=1 ./filenames.pl encoding-koi8.txt >encoding-koi8.cab FORCE_CODEPAGE=1 ./filenames.pl encoding-latin1.txt >encoding-latin1.cab FORCE_CODEPAGE=1 ./filenames.pl encoding-sjis.txt >encoding-sjis.cab FORCE_UTF8=1 ./filenames.pl utf8-stresstest.txt >utf8-stresstest.cab cabextract-1.9/test/cabs/large-files-cab.cab0000644000175000017500000006367213323707071015720 00000000000000MSCFg,L#Lj large-files.cabw[&"AE#ph!:(ҳ"{AaBD!5dMYn}sV bEP`JF\~_$4nfx LBBco~pؑ0 TTDDGDj\1NV+u[ii/:uF+x{ml/N{pzMb=nw;t N:WѪڧ\p:Zw9p>=JwӪ} p(IQh q?З5w|?YJ57u 3{z%>aK읚6Fլ>m+> :Ch#˰a~2nxeOBJGѲyr*1GquG۩Fw=*=SÊ1+N֠~_w>=mֳlV[_s#Qtg߼ɺDXw4W?F?;bTHNv )98?80N$';R@n0'UcHNv )H&JJzIq1{sK/l_V4BJg~@Z&4}Q{244;}ż$F["l=D$hf$fK$o"x$9#$+$Yp$p~}([ $~x$4z$S4 $y@H(&b$f$fD$&8$DP7$tX$z*$y"V@$ @4$8DL$t(&tc@$yR4&34o(DH$ld$u5$y1($p|'J$@;1$@{${@Ӏ$b"$09NA&l$8m-&fk$p$ t$@zQ`$`0L$>+$}"'$ xHi$$4@$L{q[&`@0N$1J&,@f~&lxx $$ u5$15$d$D$|X{$ {" $"^}Q$}zj&̖{(.$(`8&u`3$ZD$eĢR$@M$\5$< $ ($;t$w84,$,DZ$D~%&cY$zU$ku~|RKke~Ū1+w$1*5t>P>|婟9Wp8Av VVuC!u*?.gk[=]WZڙ-5ͶIݬO/揸nVn<Ƭ+Չr#.zCtלn;'2Oڪu2Gp?ySEǵ;; h]fakZ)tC͏;g4~׀t=T=(2iF\Fo:N{RiF3)nOwF6o2˞ޥiF$22gI1tN ܭ9:'rdI1Βc$H}Klt!TfÓWOu۽54ѺCtofQt[ef&yE B$)&\[167$Ѱw$@quz@$`zA$>@$"w$wD"+&);pT&fpb$$ $D"$j{$`{qD$Ĭj&lyD$yĦ:&P|$D>$@4>@0$ $"a&zf;&cHL$X$@m|X#M$y{?(&)<%$"$~H6Z&Z16Q$$eh$hc$$D`$`wDj{${`$Į&klY@$p$ t&5$f18r$r$Dm&&SmbU$}q""Z &`7 @A$tzQ<r$l@t$}h$D$"$wDuV&6R$4$l|6?"s$8",b$$Hv$vDXUr&x $zS&S8=$yQ$t$pb&$|~$ y$jmP&km`U$q"AD$eZԫxt p⵼J0q_5x--`ked𴨖RvϸۡQql93oUuV\2~/m-~t3eU_mVqEڹruͺw`eϚo¿9IW{owקf?MܴlF?g^bL s׿)GOWw 5tsmma|<zQclًr-saa=ls׳+}wt?֤//֚^j^ k󜗫&ȻZӱX Ov6)dc}7Uu.MJV<巽YmUg,;?[{ͰMⴞ}o-157) w~[³Y1W]C9mULs:j=Kv*;[ݰk|־Vb9ص=sS3nd[7^~ooͥӳqu#l6oZ̙֓a嵛?OX7t ˴m'ܖmv=~Yq5}uEQ,ץ1g#r}AǠt՜N5͚0R_5|kbۊgW]6 ؤ۳w oʛ5v.qiԛ^>X\~7u޽^\ԽM9ݮ~InybY+sS֙Fab&g:0lg)Y'zz*yUԔN=e+9ә 0 R0j^pHr7@;6N^r=iľڭR5>!סw<1ΤL4Ymz8*cCAwǧ;V03Q>۳&k|/W-)}#*ە_M_wau_#|U}V+9{F*C5~:&ћ騼qGyjV5N\K<z̗_\VoE,Z;EǺ&x*R0Z f,;Ʊ{-C챼{Nu%̈́5w,/>Yh|zSSO-my>]Dֹ|UYz_ 7>#BG,F@I[l^/M(_{~8Wdt =FYBh0~cc q2nQ݀?y?O [(Y>AT 9e?'tj2)V~QiQ_1>~W/r۹|Tt~U>2ƆLr/6-c]oi佨:Cͦ} Zp r//Ę)M\5)۹o'7mՋ>[KV31zzy{Ue+[b%gb}6{34wվ2R {3V]UGwr;nͿraLf~t-s6=9u^H>s>ngJw^ɉǝMvϦphԹQ+j/yzk﷦Zw\ Y\qThGCc2z7J2Zc@ʷlZq=F F "bC~޴JNh @i8?O La>]8Py]=K}f!C#q|ÏZv):MA(-z@XVzs Wu\CaGm??;Vޔt݀pOkfzz?sCFaB}KPġSzccqlJ2j?7sɴQ=Vzwo߀KF TȌ0 ѝPFKS vJĎ[j:byLVCÞO!@ndkd(7 @i[OW(_)ljCZ  ?3]^Xj_GH?ѐF{x?7F2[j5g C:͹7J2/Q>>\ɽ~6yXJiOEnVYi!D7o޶n_[̿Jh @i4՟ijPRsG_oGRϷ  B8<7j?kew4`;(;XڗDF䧹mP!a2_11KCV1ߔ݀M~n@EL_`6n܏ϸ{(d>W3D=ގ?scGN2lJg[x+GHB`s87BX?n>҂q|o8wc`v{6i d^'͐@iw?_NQELv \(hjR~yM9?ϩf!֍[ӷo}9 @W%/|@Vg\7]gf՟Kcj?_SYh_?{~1mFCۖPGS vJyXv+8%ޒw=T%w4@М40~fI_ '&ht#dn|Fs?S-#4K5ЧB$4v(6˅>sx_o$o[@_I EJ~G̀7?+gs ESw Jnii@y$J'q/Qpki<&9~-]>pb6iKt-gW;t>ca&z;/I#鷤4ߓ V0b㊈'`&Ӷf[AyٝshPxkqW5IYr2~P;Dk+_w4! z~)hGJwSgfOof2.Lm% =nU>n hvlFKdVsi!5 7e2B%D>MnO85*\čE݈ o֝*e9FN Ґh`&at{hpƍ'v^ӡ]v6|x7?&\ gb V\M|8]$ IAeƣJ#{@W TqP%vYexʲn@8/` h/Oq{s ^# hf']AU2>wOѡ8|y `ţ!֑Lb[DΒOئ=c޷MҢtmm ;؉fLoh` ,GUb`X)&Xu $68Wlޕt4~萩*v$m'nϲհoTd^U ^Rձ{ra% gHIJ>ZH +vi[x41D QHkZ,+ }rKUAXytQ]B|Ԝ nm'J;N ĉg}O)sDɉMY6uJe,/"aƖgLi&K|o-UYQs&jkd$)hǞC߁dL[}LEH* h=)s"ojCxl(+yƋ$Y|,m7 njnvK=!z͎M-nuNTp82F N$'X4ڣUSz|6U?ygWa5ȣBCEiJw5;$ErڊN~K 6ٺ!a8h!{,*Jba;C݁=uvI-*&Ut]+?^ fl@D^يvmh4٣iH*>^ޘ- C6Dd"xKʹŇ nj11yfoL Sa 6.#>=1'0[cDR9oX0 Heexbu_e+Z%/r9ph]N8;zF,bzV?FI k]31'pN+9\ioXq *y u,S@dW u#$/;qdv.L؋йQsomO5b3.N]zx2U䡘doF^ywKV;P,G[9:n`3V8o§9{] 4#Lld|Tc_$1].D}AFbnsbY I{(Fͥ<y\-/NC dD<*_;q7gȐWۓ# rE45.`j@s쁻ԠSKu32_8e^x,n!"pE߂s>Hbz.V'!]_m¿?e5؁Z}"cV\eJ#R3?Ƒ5WGd!TI_-RhyNۥc )jb\Rb!|k3mRY/.Ƙ ^iw:1e0lmJ}Ȩ>$G\<4r6@JvZ+PS>a6?* U3'hy, q\}jFJ5P @l<uޝF.!W7w:N@S.+{B($&=ٸPa~^31n_/t15!.#!ǷDDh+`dL"5;o#Tn%-=D=ßb*j٥&_UfYssʘR=9BðburhBk\b)i.¢l&jSJS RM`hd!h^^+X/>xƂLv@G/!1cP YG[9Y;lW,GD=RWy_ƩSb<#2Vެ4Է?dc7<}K5RI(4ljiR,,ԦRW 8QŞȈsBLr$t_4CvzX KꏕFpIRo_~ND1I34y"\L0MR$i^ƕX_+ؒNu$ $SAš_P¨>j6>3ٞ1C'@7^}X/x_՝TUmsO5uD&b^<2!!C}A`*[wƺp2ƿb%[]WnE IEsb6ci9L{>\[rryHG͊Z$ჭ h*A6vVb0zX^a֑ĢI>֤ߖOV3V s pUs@Ҍ@aD.B뱁|"iܝ ̏R]'3`<^k.d>W C7-,EA ,r%P.A#[DH } ̗ݬ0Lw^1srQyr쟉n{EuFV:3~"A!p[}a [h}Hv␻9"\!blx 1 VeMp)w/^z 9Mۃg-Zl4ll sB摖͕yTAuk!$fS#a*8/kPv=S5dցWc;:)qRݴ& =_V0T~XrϮ{vNxwM`lQjb;ܙ-.>0)'ÒisAOIu8SU<%ۙ\l tv=;wȇ4~bee͔ ?Oϕ h@ ۼj$? 1m BU km,SpnGb CIJbe/ýE)pc!bw6Т4b9 &,Lig>:KޙϸI#4q*w0SNYB'wnEDޮ)upqW&'MXo(@cX76.w~'u^ vz'18x/ptSu;0tikc'cs–؄U\4fO Zb6Q܎_|~@PKYtt/D@U| U0?]免Sj:jW`Um}KͬgJЕ"^ P䃥GWl+hK@R]8ϴ + w e*+dP2bfE9ͺK?vp,˙/0VCmjm[cetR/6[cj:W'OZ?Jȕy+sBB(jF嚭n3Dž0Q_tٍ|V碍p^5p<\t-X +P91:W9-w@yWFF }^E/x7ETݗ\B1[3)f z%x!r>EjrW2섵TwHܥ|? ? cx/Ot^ @G$aG97c|FU5Ysd]/YVs-i!v%#HN{.m{gv05uH{\1 n9 =ՇbsiQgOVFyv5 sdV73S>R Z-6Ϊ<"irćSX1!w!`F9i&jHe TdU}9_Wm9=s=-Okjv P5{`3B5±d,_ĦHH髱#^L=8ԟ`>|oN>lɄ1ŨM̀OR8;q}$bEl<f!u i)εLfX]hc~f* 7>W+a^Sy+ADFQ:Oi6 w1ݗmo*yίF 'bxzPװ \]R'`H #nPOXSnxiIj&e!eȩ4e]b7X؛P1ꪺ0x彮"eްZyWwu{tX6ARV{+mVpw{vd\c]((mzf-<|&ϡ4YLSF߮۫H^+hUM,ԸZF F-q6yk#cAڱ+>\DI(!h@ 5j/Sπv7zʎNVGo_]:DGIKnAsQ?(̪]h:zQp`NX"PB*.SDPDzh #۳9A\@2\`u19P0ZX9O2+40(6_M,l}{eDsG_Ya ۋDiha>p4LBpJЊPp̮/ػGU1+( =/4c}8Ͽ IluorhCPJlNUuƌ%u"6b{#$>mRuUNv s28x+CAsP mg.shM瞃-ϝ/Q*iI2pexrY>-ьǘ*V .S5͌r_#lbE}. 2h7i9ȑW>) H"i;{x{cU?CM)UIjTy>U7Ef齼ƒ" vf %@i(lOG U{۵KO$/!Z` u-C!ZZiP6Z+ØTx=^A,|  5X@܁) .t$yIr8k ,Y Y/?#ln:cf[1m.(bHgbskUP\ѬTϙ[<Rӧ"G&Hǃ_;xK]> :%@P KZ)Bn_Sn|rCf a5&qø{G wk\`2\RԒ[XÍecf$}i+踃zGhQ4yK+f{.qH&uȧ:ždc-B=HK %lqs3q*rS3QDa͖[r!FhDAAt3ܓ8%Th>\%ꡀy&:/L#u pAF$= $]@f&q&aމjz r~>7XKkhFBOez(5VyZ<-A8 oT1a 5K] |=m]Sɉ.3zpYq)2c^eGV˞݊`DMG]>*H_MZ*.jQM c`V !kFFN`DW",#HQw@CP&D($ .{nM&29M0KɣF×,{-L Jʿ\x<0䔮CsE$M׷yz -V7ID 6FBD2Z+'ZQ̡-ͦd4ABLܬNzWVvȹ ͌[CHrV؃r@¾l8[lMPGc(n.&M?'TW(Jntb$TBؒEbSS>?T;6gGCH4S x\{zTXQfOR_.^R338ʅ7#W愔@FQR`#zLjBg! D 1V C<D H'')|ۥ ֒|}dH?9Y/}m{wҚpxGŖ3l)/qݍ<9(+H$BKNDB!6[H3P*M 3 bie~GL&H* Z,S>f"0{r=%ɗl S5||L2;f‚ilJטxØ/Nx1ǁQ "/зY˒3jٌJĢ9Ut -\x{z%-Y ~g6:ˆuې̯y盤yr-!p7ˍP1=Hm0-GhΊ7ڈc d_5]}ԺTI-xյ4-nlΒAaTbeu}ÃHLef`3Gd`ˊXvOA>GRGN4v"ڢx:L!S/\m/+ÈCXVԼ\Ҷ]`m.2V=ezcGݩl3ð#ϖ(J9x 'OLXGZ WP&ۻ㍕%"#Y=-Rގ$-`FnR%'*l4^sVݑN[*'nvkS<񢨏T)=}^sx đxc)ťXc$w\XM/*4^vOo>#&{) 5ޟa5O|\7 9Z k 'l;gڂv#QҾ;x@ӰO\ Ui抉 ph5_ȭ晇dyudY(ٟo^2؎07߄xxVO$16 zcڍ~!H}Q;q VMS[KߓsYh V0 ܇6 2LU)C}_QǠ]2<ֳm3|0tVs~'aPjWRΝ7)nB;?fQiQ4'-7-dqp[#9iP8jH_`㶜6S.< 5⢯b˖q@$N::aUxR;nBU`^$%g_`o]o=سe9U-+/6P|둶&f kݞ(vsB2`C4`ۙn0/^j 1Zu/&arcEd~i_dg;~9ˏTܯ|6SHWA"Ա6ϕ ?ts"N}mKNtCxƒ;^݅ǟu]\}B CwhJ{lմk u7 쨩(\Q+Ɂ&/~"Խⓙ) :9-l$KX)iߤ^6MZ4tɓ/`38)(u6QB΁Da2C&p Aa_+>OX3 0KՐqL.5V!NPs{z.O]-D*L7㵏6M hf:?kU-EҚB IV VuY[vD,~F=U9pΣ@* &P]@ ym8nJj Z7qϼvyuZ^6ZxFXga+T5p?ĖMJHUc2)'C+QSѵX^AӃKHQ,gih1m,zxVg{puewWm uMY,AAH)όmQ&j\'"烾8s|1fES[;U{8":PigqboR)cǨ iöD2ܗԝP}OhF_oU!7tQ/R7a2B%( 1 ZڧU~ brYj7n+Ft;"É*]-3B'}k~4;s7Nv1=;@Xxk4i݄QIa{RHwa&V[D+/quLIbG=f|ETny C# :qi|!RdkkS8cx]-=@ )u^)@_Nz,?Yw\-28s½v=0DL_[)~tD!jU'}qJ~,^_ ?&. z0z;%~%Ge5#LÓIԄ-r r8lٍ+S3BuKB2%^PwwP68eZ}5/bk#Hi9rIP:Řc:.UKH|(̡SB։Fo,CaGhˤ8L$JJ 'Q1SgSt';EY}U"P3{P u9Ǡd~., tJ곯PO|Qyk; CR@7wL勒fD?έqX*E`i&: #ףQsUM or_w"Cn.]ȁP\-/gjJ 7ij4q9zE3<`,,k#5_} oEnMN-'Fh|y?$N5SGc,,6XM'u,ʮ"~fL3̼}9n?ځMK]ᕚewPT4zS@HpCyI8f\`I%lFw$ϒN &an-Rij/7"ǣ zWbRkr@/;ERڵ $~OHY>}DI33jR!%O/g>6Ofs WG>"ޑMJWjUP=`,5!XSv}aqiE$Hr9GQe(I_ާѺgmŠ!9ӄ#&oUar0̮cqrچ+SFko2]2"6'M 7=}rZYI!(~|>qT8'{"N2)嗖;[<_I_ Z4>KH_^Gf@o<9 9"3DTtc/PhGQRt^b-DzuM).r LPcu6Jaw+50h:A+ ɫv8W`k\>r =x*.트%!g Qީ/7s nWEtT%'8!hSߝ?K`%D{tNZunŞbhNG v#l{՘?8 Z.*R=0#>ҍ Մh[&-ٽ{qִhP/I.yoUaʇmUjYCK?߂d0z;7zT>Q*WPaN@DD^gT1kevp{Y Upn< (2ȭU(q9Q[6wz\o!<;E޵Փ+ &98/%: =A^|Ao C Ulp{.CX\4t,Og$'f'_u%9 `A3㮏H/lug]aȋ ĉp٢kQԭ&[u\-?H nxO w5 R9>k|v|9_:T˚#? ? /Et]oJFXH;nKǣkQoIW1;/p7\ܖ(ühzBɂ՝+nBL-Ϳq)~2U.N@dLGB5)T A8Ae#%T/$R"K.%HK#>!']XgY`զd1-2ZlSSZPjV15L—C7UƵx|fIG,ڌgKW+ٴ9dEj<](cߐZI#>zbN7ta`S/Dp0 Qj o9=sOy:0I$M~w8_U[A3)zke/TF!@ 2ru~(ڧQ G) d%~y[:O9[Ow<9xhʩD[v]snC^ȧ4~~oρ9!V 9W 1^Dy0jup49 >%㉬C#=G1ؾi͇A :餠IPh%1@fW]o!ͳ*:*沄 2$'z1  a5fp+ B5/)KEI4!F6trJPNdCGX!"HŌX蔚;#X 'C.5YHE͡14k n( üag3U[G)RՃ%B%`hܚ갺n{stB:6lG4!iؙű~i)"w *ͭHʤ7N5Z ono9 ?<Wrgvm3 5~8PTPb֧L3D3#@ST"HU  d+Ûcw/% 12:t8Xf5-Ok.5Tm>dP"irԼ%/-_3{] ;0u3uJ%t6@D(啢_ֵ& ? ?6RE>@ĔZ O%KU V&Ѻͦ eM" X^b+EfۂqF( ]CuJ^G]pc-Ok&\aemZdn['jz?sgR׈ct%(7߶(d~(XHΗoh7݈FA̕ǵ` 2ghF7A'S8pԭp֜K*FDJ e{W<.B2w;6ᔑLq!0>0Mԍ<2 ZƂj`G6~Z)4]X %&rE%< ߺF >9xovO&gW【QG05݈?8-׍9~eK_/Aǿ37;jXQܹ,pKkFUgW]Ŀ%,SI9Q;9 =6Nɰi`_}`V*EԹAsṵAh.,O[WC"HVoĴ̯fխt [޽俏 w׋,AqP TOߕ0fmVΩ v8/&iԦﻃL"ӌ5\Qgݼ9sD:X&iGHXvA9*t ?O˫|M X׸]FRY<9[>f6?cU'5wh#6n^ޱ,T07;t bHV(0m1 N~ށ{-->#AQk[mh&T_u>b=n-xh2M uZ2A^]6OFgPl]u_|TLA-Y~5ox% % xqxAVvA}?o)f d_0n"ZclȨҁ>? i{f5`:Բ-&VX(2w:@EiasWP+PD"^xڔU*B EݧQ9?lo_$_ GOS2V AJrD4ETuMѷ~L=rѝRZ)p0m%O0!i?Pͤ]UtkcOrOdMllVk6klO'x{0;nW-uOòK2#9!o(v@ GAO9A"aW7^wzl8IX2#ƫ(}$P/vPQ䄴n_S|L6!8 =@C&Dh)KTQX uhzTOeWfmAY $ 챿`-_&vc"Ɋ)yXџ=B]N^W QGq-.T_~S8oxTnS ?d`"+28Q2Mk 7 ˔ 0`Ь_! aD()\FQJtNEjVMZ5kbs(6Zhx x~;~+%My!S& %.I~eE,U\Iׅ:B.bNG k&FPyEPD[^eR3YW ,#{ۏMo ٕob̕µd ?`-pl`gc-+_RDZ?} ht`1.ZCc,NljyYZQl }%▊|[FnNRZ hs%wrTjI6"^^Kc&νT- ȍc `]SdؔJAI?I3%pP=cNW^ՃK T+x'8FL(SɢX >Δ畐ՑՆy,O%J3 e\/1jc={WOTW'[Ŵ&_JM nUz eq x 'K3l}՘̋VP!ka,DF)sA[ 2kf-y:{hgM>IH)􇴪A">gÆm,0!{q yG@ҾZ ~d/>`z O췙)br/{ ~tŜaN2l#6ŗLEpdl#Kݑ }+NȋIVXo=CDܕu`dhr՟3cabextract-1.9/test/cabs/split-4.cab0000644000175000017500000007246013323707071014272 00000000000000MSCF0uFdd2 Split-3.CABSplit cabinet file 3/5Split-5.CABSplit cabinet file 5/5-PLF medium2.binLF small3.bin@LF medium3.bin+PCzk .E+%+^p s`q Kc`b8Plk SW Ẍb.E;KD.*/{ZH[.fy ' Uz`vy%r%l:]`#VS,eۂq Dk_{󘇄b%@ 1?$^e ڠyKp"$/:9fPHpD]Ω΂ ]43mQ9(q_$hH/~Y4EȤ 5Rncgr ?Ez~ݕ$Z+.ή&y}.#QʘұeӾs"18X\8D=,tjO^CrV\'_o3&Har{s(;H'z.i/[AV#dBe7 D~6 tᱯ Ob:nraԝq\*H6JQ!aǼ5 8γЦ 0LjV*UB} ,J|u5~r_?D9`C< yiOFLb==%kɵGț *)QbXTAۺ`_ƻ*J<S–߬WUCC4uxǗpWyQM.;(zc"V؊!O*gPw\(p(d)sbsiv"p(~(h8T3"q`<5@xkf9^ǘ}KM"2 E*hH{nz/B;b<+ j%EDIorj7Z}_]d%]{8FC(9z){p~o z1ӭbA̮Z\ 7jQ+cfti7x{ѝ(H. rYxZ,X1 }=M7|pmnU=LǣU}$:}Ɉ?W\ 7@TumgDCj6dJ uwc6$: \cBnrsJFD-ak֭q3Rg[[NcH.*"ghg/<}T pPL>4 mkzB۹03خhm;*Pʃf?C<]m6v Lu쾽a\e;->KMҵpӌ ;u"cb{,|dTx̪P!F3PS7˓hC` (ሸHΘ >5 c6m+9:%_C/Ғ۲6 6ϖ^;bT^:.3]iT,6'W,I O*9q[u.|0ܢbr3DBGP͈ы[+$Dx|ݗ(^J6(+6( )<-Y1_')alhnÜPpEEĚw\ʠX3XKY[VݏL|­0S'Ե­r\Y"E1sxL$(Fqc-=e/a'Cl6dn) $!ꍐ<Zޒwp8'v?Ev>qa3-6MNa{ c[L}TKxa8)7ҚY,3cz2=ld0M9qޞIfA<֎IZZ,Os(ƟyArz(-Cywz)DR[jm EDpIDYYXy{`Nz:FgmD(kd^SͩiI#>lƪە8"bꃳ`c* O mOYqF.dID#c?F 8 J"/rx!$<ع9Hw.rh]ucB(RU+/Vy5/ňZ9B}''KJkqw n]vFU D#&jw5bN!pN2^ ЖPr5iyL-)\8N+0T Y`3KE^Sl !CZv$uXHUɔHwvpm5 $&` zO:i5]wY<ֺu.Ϥ@䠽j }!mZ*3P\ ۍulqFO{5 ݚ>9JWW:ad>ܞAt4E?Rq/l+0dUe^$ΔUe݉tt^M)!r%j^T$rxl(k7+yWcм͡LH1k?PIyQ<xѶП/\.3+En$U4,Ld;Oݏj5<{+u5fGUda{ f.c"GiU7G+@O`ڵJuϴSU^Զ Ӧn|T  ! Giuthʼ rUw="UǠ܃7" Χk&Q񡠟֙Z Yzwh')1eR Wa*¶ 7\ ;( g-BT{풠v9. Xw6O<v~)wŰHvT"!Ot9B^NyLsP"Ƹ{z _[v8B 6ƒ-5%?E>O>_mLetݟD3`^m@WV}>74K>n۳8NDk1$&E7F?v;E$T-YS҅_+EGd`q|oS w i!us:|f/]T_<`_&x5/IBiBA| |WqM%ogKaW /S=bR6cٓS"$͜ѥWqc\E⁶M_auY y?pёy]V{ٷ,w4;ͺ*~(GxԇDQX&["y^䲲&^lGg 扏l 4؅.D9ߺWrHОn f) Ϧ+T`ڹ5! ^'FV'>. %^ <͠xRa[3#oƙ:e6uB$*F2_O0.˘41{w!#Ƶ8^G2B$v:Kb*g;|Py5{qq[ݓ4N@uMr67R+ɴ6,R-4y7R0(٨D~㵏WY#L!6t#6ۅjq<{Y=R`4xer .b)-/- iƁŒqitRn盹=1@M֏U0*D5+_u?J *=rBeUR/`45,mX"llBwcɮY1?rU:aqANrd^յv1oz"pGq/>p@4.Sv4FRt U5Z}BYxv }Jo t!S9,EyQڭܘiF._Ȥa7>ecNWPRQ>lVa|Ar U(}FDC˓=VAF!Q8]DQ鳬H&Nf,y\q#,s ?i72錒Bj%ʁTȊS96{ Reȗs-aQBQFe/ E^Z,@F}02~Yې|= >`3R<.DUFI2D-x ٍ'` 6KkƏڶPKg9fņP;pI{ ].n,ioE rpm{tBb"R;בhû3Nb2a#{V1o-#!=?}= c%)+T3R!fƇEŞֶ'|^6Onywˋ G[7pU g(63UxqZ47Y9FsE yܱ7ϱ1t↌@#CW?koKQU%z6vNH~KG W, ń^5ԏ-M6t0mrьJW1/q[O,$x@wa0RnUJx0 5N64憳(kؕdM#l~n^jE𔙻SԴHb-K-IDKYF㞶Jߺhb-o=F _AqvKQwԥVdA@U*0v\$!}‹ =[#o"4ɬ / C57W1?`Q ]nM4뎵<I8FB["j5A{Ts8mϓ:)|QWD!_E|vNH%}K6GxQ4$ϸ('4`oQ&\㑗7ETbShKtzbn Zɞ8ϝu e e(8`s.)H~9IK/G.TK{pjv$ܒ%b]zs{6ʂ RxZ\G*Ήֆ@reo7#q*04󶝪foEZLm@~"'*L:B6uKBI.Nw(PJH*ͳA_8 f֣ۢb Lټ@pC{uXv4#>|X&3J3ś4H7kCu2;jٳy\Zv]-B)URW}ΡSB20^Wo nNVGYtWRl'¸}{Iٶҵ>FS T|y'W͸E|aWTW1b;gР]SNjMb@ 5ޅrҢ? 0fBb7W ҼyB}{5ڹxSbzy9+mȖv{UZq24x']sDrrv Ub)ї,r:LQ{NZ;N sIEqxfn߆ :ŧ7aE` :o [eo:9+0П37[qlw!G"0BD:ԸRlYW(ҕD1Xb~Z1"t:XX,Y~su(pT 2> OVAI3nwRMl`dJOU8)[y]e( Ƣuu\VFm7I`yV P@*z >ܽHqYDgиrkva#({3fA?Y5> e/o!la`bP(ļ.VHۭ2KE22B{QKɳ1%Fѿ{L}\19,]ۭIĩM5Qgɪ k^uʛ-gnHX@I`^ 8Clu)q/Ӂ;"1 %c`{i?E 2qPd8M@umSB"%W,E wn⾲BM_$j"[-P0`3&ǝ炪LCl)!V-v5 G݃X\rXrR?'%*H蕝J |0=WHnp*m/c 3 t> .y O<@R^3RQ$& ZstC"eQy;T[`8#3̨SC83< ޣ [^,dvHjwXvFSNZw [F`cRD9ɒA/WGL+6f|CQ4vd ]YGwnWbV^wQj"^9~~8xй7f$Q}$)z{4r}ÁCZ tk(]Ay~$D7& DD!NӂSlfR4H֣%],?9z.qT8"j'!xnkE4獼1F.`Z|&Z9~c:ÎvmJsD1\Bª  J6qNKavw'!=ѭu hRt(4怹BIB"[Vl9v< L,dGCKb$epp^_?^}=~,;~}Q*I,T %7JVSi&{⽉}i/ \ Ydh)lNI pY ԟcr0OOtpW6Jǩ Ogi蓀Z?qtpZ^j(7(1] A=n3ܛ|z:)7,qEQ٩6 q4f5~I!졊j1 T~+ Vk }; :\cɿ7^so;)3;Ti7 ׋I8*SVm47&nׇ4f8G; zʹR&q!o. RK7&`K\0â{ch~G1T9iѪ*Ud2ϫ-2kImB)-SBڀ0 νE%Os6{D4˲߿.\]9ҿ$ <UiYOލ |ǸCl[+W)2a@8 MRJ#1(5_3pB j~b&O_o/}jot-*P:t6R$;cT1-8qxYv/{uor w0ȍ(%$ny+ uT9C, ɍBqE D1ZCx^x,֜İFJeăMo TBâebII*[ Jg+L FH`0AD* F&LqJJMHWzzx0'n.,{&_sgC5y'_Ud&:tYNiP'}0H2)][VƘܽ6uKYYwz/@}Jy sqZ~楟a}d 3n[]z8`7ftB Gd6;!3QMnjϑL"8tuh5V-}gAaCJ²A&o}6w/&lNJ/޲s%ozHn)Hioe ׃_U`UBڤ87qtAr]]g.p@ˉ+@ǫy)ny(3ϐ}m!z F9z+ 23d;s!+Ci@tbD)KA"D(FCWp @-uE?iǠJ yn՜*YIcxrL-AMCU{Y,2lݛ`rW : 3'>{<^48ѝ!KN`*8gX O%E:=-jYa۠bhDt󤹑UxLF3o|.jlZ,wΙ`7\KU owvNźnLaȟ+ w\\i\ 8}"@~f)v29+\ 1D8낍J[9vsf8dW"Lq4razh4dT#^Z*hϱ},\-'ۀ@L I?\Q= d~`$8/Yt&R sm]U;tVoH pN($#ثic\"+Ix/Z J(x8rKpN}f&9" (h?Ə$%7=IMcOVy& j(ZW#B?EQ78LmJh!WiX Չ˞x8F֕ +)岘KQ0//{pGS[R%rMjWδ} _}<.qW5>wg6Mte/h-y҈LWWaWvo;4T8BvI  KnrFy5/!i#A?aəhw:>̾s&gpy+y Y _/ncnI׫1۳հ/f ԙIT_+_feš˪$HF ?%i ;axf@cp^IQӰӬ=ގQ"G|"WIp*+:F5D¦,"GEIcUі 1ok&?1GRE Fz N<. ^4!u#(!m=ei<17w5]u+.#U#;ŚB 2G"6s[py NۂBHyMAY/dm(RRi% ť7T^' %p'Y] 3lANHL}"Xr7]WRuGՖ\RFUJ@MhWvkB'E,ˠr޶88< Wh׼˺m˫yIuԽq?jY Xܑrt( mF=vŸ"pmՊ"8})ۈHZ^}ޡO#+wyx5/z[8/3Z.w8؈wHd-w{僌_ƘH)}_l9!Nu&b[p0}Ի!%`q:qp-royЗy[vSkhػ>{4ʼ&6R~e_`^ˀrhD<q}6j59dKcejLQl8絨Bcg<*+irte1ԓkF4 pf,f&c ْ3;[,h-I+[>4`3.U6c-F仑0cE,f~Uf>+ ƅyT*I8ͼ$#~/F=ɑ};ehRM}0T4t0K#UQF#]fA'&fvˈ ªu*QeEP*p-3ͫdA\N(`+AC1I41b^uO38:(5<%UvY7.?:r*P] Id0ɑ@O;]T԰ $>B(-Yk@|F"HǴtJM&e`jet/P.1 |q.6j.;2A ]tYm 9KGaM@N<4/ icև1= wp]"3dAj: *Bb4}@ ^/Tr""U A@nOGz⓬Z<%CN 'PזACs:wl\։Dx bQfxr+]dlH"X:GmPD1,.úPJldF )UX1D+E%fYe`+6%p *:GcTig'3U>B<ƜI F;cUpŶ7Pc<;"kcr[t1,B ^vBVI4"rFaz!ɲs?X&u/ėXo4?Xr>ΓYbٔYm2h#Mpk%T7$, pt+ 7[igukۆK뿝ϹmI8Ȏ#~ -K3)o,QYJ;z?D;L!8^8(m=o]r/[Gc(<(:uWcaQ]7Di.8y ?])PVA!=]|X3'؊]I3*F*N+LE&L:>h5D$# I'e%9<6 2H c|}] |9C7 s^nԾDž0Io1 bPF-ja ]WvHݾo=qsKbZs{?̞**q}u2K;*2XW&zO!okmǭQ,ػ #R iL3ܶ,_גw LY'wޕ ,L8L榊iT|,$_Laul!tE0|: /1{ݿ Hy+iyH$MB,q=ՄrM*i8bHГLfgtM"KBBI _L(vV aptOn[E [WJ]]^-HE]չ#9葇7Ol+J"zvElڤӴG6g%3Z t0EfQV3EVKl+/͜WAhk/*yE"&/|&IW W=1h<ĵ8.UĻȋ%ȔNuyB0|k֎p;-SXh(tJ).s*Uc3c˺@5CHpCSXOLAE2E( "8cZ# CC P>C1x+=TdW [w%yh!>sh]hq [7q@4Jcz7?PLiA˼9)Ba`'"{/~#fiwQOcr$ym:ձ`͇Nu7[Ud*(Y)w7Ve2C(kX8o3w'C'7%ŝl6Nsz QdisnM%(ޞ9X[I &ZXIrw/ ;͜ tu!=>TVA@Qhڰ&xL߄N-DZM-# ;kYG ^K_`x!ܒ$qS};g@M NʹܮC!ٚ.+2y1:). 8G.[ N?Ұ$?a Հ mb́uٯ}ͧvFL5,_"t6c5=kzA%"S:{x _LsOM *b׏A3:LzWtT6'/kNŹAxNJM% wI+)# qZg ]iY G236 \)ϸn+43M2cRWY@:8>uxS2 Hў|Y wrG@Y! 0^tG֩+qX]1nZR.<3y1nェ?RJW8(n<|Z4i! 3FMP8惁YQg3+c݆9%gf/\dV3mIYfccTh^M&%,,Sk擐#UYBwtq -L6NlR_,"N=,ԔZg,F*dgwb-}Jb#?V!_iwGP}5~:tq{ڶۜg7p`R<ٝ2h6dD~d0b@̙V޽ʱ_d9t޵VAm/V4{rkVl}zyረxy\Lm[xKjb>Fa2ΔW,W(P/o!Z`mvo EB6 {k\IRS2O9[ooFDvo\=0c;f&-% +SAQ ye(%<)?a.Ê3b\WP æu1r:z8r5<> \l(\ U;T.RCe֢F'&*@qn7ZmIX\ f4>8X 'WZP)_3 7᫐$~n crl`=eK 8ʖG9Γp;y U4#$_5%mb1zK\1LǤKMӵ) 6AulJ.V(ɔN +; _7.{~J!.v]JӨw[A{PU [Nqzrs^SR%2-{0K$,%[Kﱙ Ш'FP\ cGYO@DoWl,Ij%zE,">  %q!"$m?XKAx6E{IX֜+'!\ ki0jlO)rm72ݿj( ò OcB9_s3ЭӁZo߉|IJDڏ?K7+ÝM T%X=5I_~3PŘߪnNElzіɑ đ3/NX2BnRSk$BD2oҦ(]ĮҌbChU I:$S Oj<5nm#`r!]h)AceWWH vQ1zyjY a+'=++1yXXR`!*:~ 略eM;P]"`ӼdCo82 Ft.;"\@°*z*c13(FcϐˁD?/@02oqw`)/>z[M&"P!fi/^^xk2pI/8M4|^OݼZera^Ub-Ӆ4ZpA_)lhA$LxLJ pk\nƿ%jۙy'(;f^,_yk]R~) .U^"zHY4k_>j.wh?<˗~qf2 5Ž5FIm $aU6%/1 ڇf SػndX =`-4I7p72ך/xn< #rxlpujzZgRV@j"_ XKQT# ΨThDI"~Q4M%z6v.jA֝ *D*K:#_}?ϞH9S<{R a@!z2#z:I`r|sS!6֝kq^M1j.@Z`YN4򗤻HSD}7x}yec˱̖L]uYa+a3M怉΅R z`SGL2յԖIx*8czlŐҌEU7kx7 >HJ  ɫs(OQ_+Jd_$|[$%w?*,Tי g씨'ח[ G =$:A)X1,X/=Fjt@hUjh$: Bc4<=W?Zm#of,6):pѣɂj,L߾eB^/B65p'6Z1Tn8ˁT{h%ʘfL?`(Vp&G @-|L4 VRfYOq#AXF\ 6mL-cʖ `3GcLm/ $]GfX*6Ʒ:zo& 䦚'y8+^2AN)F1^.l +zR*6nn때O+˭#1oy;O rgUCrؘLJπeTeϲotSc F WHl Loȋl/2kB%mx[Xܐ~ c|iU+}EТ)1~8RX@d:By8@8QGqD|g:z9¸+ʈI9.OŸʴ+ z~P~{<-_u%3>8L/գ-@[ݰ_y.d?h}r8?= nudiQْ_7oxv>-C@[KiKU9EVgy} gF(/,'K/<8ܝ4Isig!h: c;ChrOC ~7u:ٜa%~~h9A;?Zd3!! ap/cJ掺˷A !;D}o f%weZpYsNfvN,'eH37.QD[硫 :cdvr9@oUWIV8O$KFC+0 ~Fa*e[iwҢτ<T8߈G4[9uKlE/*-IAYv~~ğvz)Τ` ϛDkjCF 7t-bzؗJ%eFpAP$'/>ֈzZȩ6Uo՘e 4,H w d<ϼMBDT>$ x͒Tw_Q{OȬ>D1*/eA8):8^ڏXbǁNEp\uLG =i:xW@MX" xzz+KIGIx kʰ-WR* ?֣x𹮩wRK[\W`cD{ E:6p8q!qvjͨu25]OcKZ4I|6u0JR>!C9 […(r.{f A\;o*kWG_@ĶճO)x0ѭxd`>uΟH u(m:9`gJ(;4>oAZx{us0ƒVeۨ g|.6Fo2 jFp 7f߼}, p^tqL,4MXqSyKGt X gSIq8eg p ^{&~fL+g~]?M+.{^o|wؚ"ۮ 72 wj:k20MUT [@l8g[5JMxx{34=vio;_SkXj"\еƲn|W"e#TZn]%Y8ܜSY{/N ש|O97ủZCfgѐNzĤ5ik"Ԩ"8ҽ:^ ^8@Y ~8처`/7Fz'EVfy]`+y^G8T/U\wisR+"ͱʳ+E=b-Jւ*"e JR+`fi_ ڌ KU qQeUDS[|XYv7g-,M65& ox˜6^8c>DFoHuS]KhM.{U{jC; 26wl%R}(GAx@H"Ij:O.nE4gt2@.2OpX`P$KKBOwc>{cpk-B -2yv]>vw(9>,щ~S+zH]jEU&'i>Lɗ-$M9a $ [q;Z;/2ru>@ucn9{Ț!p_\{QF.^I1atnWJhSZ,9ok)Y}k.W-B } <͵(xjQ B63F"7Vkɢ9v&. \V Tm8籊ҍ?b*qӻ|R,Gu@ upxoڷK^ $C 8##ܘf[TɪR+2 Z#v. ʧ`h2 RRU 9R1"m!;0ujE4_ Ό<ČQ n-P* dP˔lfdM8_(f|[2?~\za @by  E|PכO~j2[Qm?pJAmQ2 23)zNQXRr#gs2"B7|lwaᅊCn%D"P8&t@SJ+is4<ԭ^,/rí㛈Jޕ ?aAi# s2;.B`F^[zSXt=V[DS׌Qp==M˦5(yC9HFئx5y Gh4\C6JjzT]japT)', h֋W5,7 mMG5W3 )<8Pr_dhklY_E PqY[0ԪЅ=X!"+({~^XKǤjrx!4VM#zcѲ~#blhpX%X6qtAMRFcn(6gB;vqFUUe"vL7Yzg4C<2= 5W)DL+ A?Cm%r1_]%QX pkv e1]K[U՚{PŇ#gι +yx8 ̛:e,t̘])Z+΍H+̽k!DUN ̇g4U."!fu> p27ݍol2E *oy6|2̾|M%3D29Xʪ?8yzqS_"˹n=~Žӝ~MuM\6}!9W[Mys~qĖם KȺ ,hFEt8)}Gxfp`&lIWsLk 8 p 7wz%2;`峠]@.@)e/ӳq{"ZOD֨SOJK֍ٶ{ܫ.Zw"}CUI#:dLT`#]()^*&¶ۊܕ4Pc< ċZr.נӊxHI D o[ [&ډur&K?O6i;*7 ^`DϯN _l%; IUYIώ5'ľi,9@放"&LtC -K"hS-2g)<Ӊ!%ÌBrBUM\4i+vXVJ蓲8±5El QV/"LuZ f.[8j'nVGm7w{G1ū e\1r񌅃Ds{?0M5 FDHj+R!0Q`%"/a9M:7 g#bA P>I 1c2% "ikk|YGАyb]Ursj#Dd3QqfP Ua8[1 ԐAݧg+eȈ]7@w*VgCwOȮkͷn:^,@#&E8@0A?c"ICdW`{@Ɂ'nDҬ#ߢUcXlU$L)G䱬s&yBک-Kxx-GuJ[XTz6J2a١b,l?l&GFweޅ]H 12^%(Ajho !Mڶ)@:G -_(FWey! >.q$\$[zOf))yd}4\R|ݻ:4 _uk$;jރSjƅ3EМ(EIZjuĐo9O<Wmq枪}_ɾADȤ |$!{PDvqJ#VxmP DK" ZR/h)>ʹ*L<#0̈7@wT*֡P uV߄]he7Ag΂ȯɁ)UľJѓ;yhv=tey+P\77ްēD.41 Z$" 恈@1# i{8* &(Lji*6v* g$bPl!´BoJC܌F~ bNLd֧4vamm1ua}LKgñ}:uZe*CTf~rZF[9 AЗŬ)'DW^[9fMVdHxu-y*e.%"՚ -LD)B}g,sk\2U>N(4ٿx[ْ ,([ȶ8"4*9,ZH5VkeȠnN>bxr6hްa]7-"3z"gp tRmΓhyQ*YdxtE?ӎ|QBk 0* 1䰶?$37b enJ'n@"VЅG*LۆmIM]5GV@b ЅMJ~w# BU+w߹껅^}<C.&C Kdu*ӝ f QX6C2 s\pd t Oӻ.(It{*#yVHf]谏d\OϤD)> $J7a9B ˠLNﷄf>_qqEm77g n5})Tuː,`6@|FԟwZ2d<[۸58m {w0w-$5oFe/E(JYcabextract-1.9/test/cabs/search.cab0000644000175000017500000000572713323707071014245 00000000000000hello MSCF,FTL{ hello.cabAf{TTMSCFT,FL{ hello.txtd jlhello there MSCF,FTL{ there.cabWkoTTMSCFT,FL{ there.txtx crthere general MSCF,HXL{ general.cabSQAXXMSCFX,HL{ general.txt ogeneral kenobi MSCF,GVL{ kenobi.cab ^yVVMSCFV,GL{ kenobi.txtf okenobi MSCFT,FL{ hello.txtd jlhello MSCFT,FL{ there.txtx crthere MSCFX,HL{ general.txt ogeneral MSCFV,GL{ kenobi.txtf okenobi kenobi MSCF,FTL{ hello.cabAf{TTMSCFT,FL{ hello.txtd jlhello MSCFT,FL{ hello.txtd jlhello MSCF,FTL{ hello.cabAf{TTMSCFT,FL{ hello.txtd jlhello MSCFT,FL{ hello.txtd jlhello MSCF,FTL{ there.cabWkoTTMSCFT,FL{ there.txtx crthere MSCFT,FL{ there.txtx crthere MSCF,FTL{ there.cabWkoTTMSCFT,FL{ there.txtx crthere MSCFT,FL{ there.txtx crthere MSCF,HXL{ general.cabSQAXXMSCFX,HL{ general.txt ogeneral MSCFX,HL{ general.txt ogeneral MSCF,HXL{ general.cabSQAXXMSCFX,HL{ general.txt ogeneral MSCFX,HL{ general.txt ogeneral MSCF,GVL{ kenobi.cab ^yVVMSCFV,GL{ kenobi.txtf okenobi MSCFV,GL{ kenobi.txtf okenobi MSCF,GVL{ kenobi.cab ^yVVMSCFV,GL{ kenobi.txtf okenobi MSCFV,GL{ kenobi.txtf okenobi cabextract-1.9/test/cabs/split-3.cab0000644000175000017500000007246013323707071014271 00000000000000MSCF0u dd2 Split-2.CABSplit cabinet file 2/5Split-4.CABSplit cabinet file 4/5(PLF medium2.binПt\Bu S0K`#1tG8^v@)^vp( .Ӏ @W9+'Z)FUT C:n0q6܅V\ P-00TDPm\Kb7j$/Gh2k)>?DrKx|\Ï%h"(ٞ+S60M Mؤ ʢśkM&Γ*9J:Ҁ!0H\+J!]X;] kIա䋤9 rW s߃j_w'zH5 {j}msd=hɱ:|g?diԞ0nu]cփM&ˍ$~3hy^WvWr8UD(4a3\T@[رe" yϡ-'^IV٫ak&ȦJ" 𥭓[ApVH x 5h|F]4Pd* 1^Uw{>#"1ˍ ZOntjH(ZX̭mB,@!% d=$ŀMyߥ*ܜԙt{i9Xe\~d; $v.r(8gGTZ D=?(ev~Me iϖ#fyI ĉ<}=e!@#ޭ}jM-+cXPPP9>mW MkAS'(ymH`-rll_Ɖ3f~=z4:.i4ccDeD'۷Ld6ɿT%+@iGuILU)7t gB a0l+ė׳րCش'1@7.抩(@,AhiqYDgFOZa^e bʔqO`Ϳ?A 7]i"/9V R8nJ:rQr-^O:i ~pRH݈z>5n֭I^rceHGӟZrQ A6Q'-8sTpR C딃D|@tx9)qnL@ŕp3hs x6 gF22f y,` ՜v`S-yd0O9ᛝZKB8#g3 _I;݁[}EP^`Wqffn@Ѯ-(.'}>i5 @= O,UV]bҢk_3\2gDqqd^˄cbOhbEB}Zjbb' )8Zqщ^, er7 65FՁ㋋dՖ0HyPPҽ-Z:7}WfEm3ʷw[+zEGiJxkͤO %%V.ʹYB4IcRޞ8ITg$%s!uZb@P'fTGx[&QA)2n"aQz #| wBGO%Y2{ `+Rqq ;TRhB}$^ `M 1b]5/gWӝ5WV"%RZz(Ir]y6CMw4Vś#PlŒS;K}BKL4P6g9QY^~JFM)EN6$3 (켸 $U1|S_;7^fw}4$QΪNuxb #q);"0&{@=* AĆT!0GI 8i]||}0 {.ڽ2X"xO>Su8ugG£sQa7\6G{z_mkz݀Ŭf w4JF%uRFɟ'|xwSaUR^ox 7CsK1I} zo(rK޸02_? RK/+f?te˾H-X> FvM8?7CƼ bqIU\G\U}nPb V3+=ޠՊ*C>G4(WX6ZC3iBAtY/%a󜎚P4@C >"ujt?kӺMt]4Rb`;ڻ_#d-B؉e%o)_KI /cC=2"PBf?h|Ql"f.!tD8F4"{A@G|XPVN3ˢ=t#3W*˒rP%vQ:VɰuTg7ǖ~&;N z7ڷomVL6󡾈Cl췜;0+z_/x_7٩LtAĆ."aCXj&/2vDyQ-(ș4Qң!LdX@4S턓 ,j3q6OxTwv7wctJQ$9Љx0jjaOtQrbL F7Al{g6W RR@lHס;:?ӂSA<⳰SO,[*'¤-Ƽ?lk8 c MsOfY.hԎ<8*.h^A:[g/8Vr Y6H&QaKe5^_Nl/`0M>>H=ޥ*1 DA-Eq:Yh„)vC{3H<<~!T-SH PFpV؝#P𸶅] r+j:]Gp㴷!  pBxXkT/G9-Oap@d`&kn1EYbg,mV(zڇ)wZ9Eыn~G筗c>PWLb7u&]'J ?|N°~=Dhh,dFWF 3U&wxY\f EQ% /r<1rdө$s Ht*߅ R^YFn\Dk.^bBhKٴ2HGTPiQ gЛz<,4EG5T\H(&KPSe$ E֕UO0GR&, HDR VQ:;Pȴ1C>pxxA8w+M ]c~5[YS՗oDt<5smC< j;1m6NsUGC{S+(+%| 5 :GjT'"ڗT{C8ڍpT`F g7#)2lgk:q4`цMY>sSljsas#(3j"0A) emE>ؑRYaCZmҙ2g)dR\(p;bJI tmw$3N=&zg4[&AH|ݎ?[,X8uBز\5MYQV.ak^;OGe!yVp*0Y!fJ'MO#LV" `E$V{&vqM}w -D\'<<1jhbْ+? Dƛ1D"-Q]4-@EXw;'t<Ux1y5=j(F}ԏ hQHu+ O6UBx0} :p>;:D=?\6+%<U&rRhS~ \2l5`;Td톢NNS r:Ɍ˸ȓ@U +}J yǍ=봤s7Mҙ`A?s٠.G^*Pƌ9sLhz<}PdidsVhvJ fo#냫{L1enC=@iSiH#6!XZF'h+8;qry)?+ s+f\w hYzQ1!س®0M`z<$[,ھ\/ЌFDu` {78-ʱۆd$ @؀m ',l^]}Ǹi3ZMXwiA4 =m2x`XhK zb^ ErLc)+<1-7Z[johNvO9\MhԱ.|Zrꎑ<-i/͚kTwi8$ =[*;Tm"m%q>8o$z+>̙]^dm\6~4;Z%I~ [்FvmSjQƉ7 Շo14u<_l͐Y,G'goLhX?(%W#mߗ?P +;ڑ34~^q*YPP3 jv$r+S9\1@x ֡לvP ITS@1 gOH,OoS ;ɀ CKT]lfxm(ճ?*j^JG&5c E rh|v۵ڲN 4q .&-c=RGv-7͚IfuQ4 Ϊ{'kxxbب; '+6q\V1=~ R7H2xqE QeA+I'Ž0%ߕ4p#QOqڪy36yiF4jjn(8x {.18_hXx~?>6Ny,A']7Arn# N?H6~8#o< 27I\տc*f7T0]窔Y-7z,#T/TEAۇX*A,a @F=拉~t5 _Pr 3l5'zx@H)*dǩ}Ҭ}D&j9kky'bng jQ>_- (\S6F*ѐN֦48}Z> ־,=qO`9:AQy\:..:g#9U2i'%NBHGճ-^_P#f"q ]8 )z 蔠62q M@1L:?0^ od2©J]FOC*Յ!%IlΫ0xs8lzQO%FliKM?SMJf!3o :D3>nB1+ oE 9pW?dRz]#7S5ÓV(Jh,HivX<* ]>3ÒE\C<˰\|x al0rK=G:˶nGu)ȱB Fq~k n - XAlq"LupǑ{-`nZAO*bcGga/kz:zUpPa a,K=tQi:*gº;Aa?6ņnvG8j^{L|z}~~7泃JH9X8gE4GV,_ra20$39g-^gH%|6ୗ}>'A7•j8#Z~Ir!}r,y|d0{E\=)S)Ѳp>ޓЉq7 mGsW>cuw8A+g>4hT{ԎI{xf0?ZU!gEO+xV77bG1hP?r` cqԓy?Tf Iٓӗ9jky WE.bWUAGvM2FYf-Q|*Ń9wxUCi;˿jeR]jS)iPXYu$ZWh\UǞ[Ԣ,}/TCK ~`1Tbw.Jt#b~02[7ebZ:)]B}ǚ sS4S--D.Րjz1G|('qBXVq#hRgυ4W -9p3PI\Qo5eeq)*TugӣƢazELħ*0(p(-'r".K˴QN@qdxj{%|~UWvI1= j\.h>c7aF1FkstӜYb/4X?c>FRX~NPʑ@?9<|}y]o=#aZ;3v_ӹjDƶ͂ =((v-J  %5h,db@"9t3j3ɺ1./޴vE[sruH4r L^Vu&lk(cx9V$e*ŖjQ:3 5nְYLPKxqeWeo7kN^Vn;E˅,ñ\1R/o2\{鳊1߃^݂ЮUl| 69#-i+?KbįzFY;P$άJĒ!26\3GU륾6|^u-̘A+]"MnU4'$ƶ8OlxZK f*|.* e.>; ƭh f+r7]S(52tUCmkD 'dcF/Qnz) #b{j>%~tA?x~ܔE_UM[6[im?3 Kpݦ$,Y~/`1iq'fI 0QT3znVɾDk 9\ݐŷD!ѭY[ gFM@Œ@fw!4kmöIi vv* ȹKuy7IҞZ{[Y܆&Wn`=gs'BI|b!I0X@l|a_{`>7<0_=Ր}gQLҢ,"AN_XP֏R IfICvZYGz aX70nܥC=LZgbohC$R\erK >̩;7lYȶ &Ugc_{=EàQSaOc](:rM'ÓC55wac_?t7Ŵ޸\b0>-ة!(Sx2̡*h#WWdA[jp( 8]x޴<)n${i #5*b]"_};^aeH j DӢG#pW4h:3!i&NT6Ÿ J*+vAlVE dKjY&:\XA)o$>}󠆱]復zaE%':]! ir `MM 1>f(f;fEΉbO 0P!P@mՑ,_ǩ#%6է҈:;*[5;dEtVhzU!k->pWTSci-m0,v5[aEt"5ϯ4`(| DQ ˦5U_jrۦfǗqG÷s6RV7=6"Wjq70xhXz)xDԈHIJT#ՠWNܻba m9nN ~ק+6">ۢ~pJfB,JH">EO@<~|o~tYۡRGNDd]ErnJں FH)xZ;q(#,RRq2Px=0L{˭M<;XŨhjvP<5HyYRLn2Ev\34ItFh NH&+4dk G]R[4—!|ۤ>VrLzavsUK@`c o}4$x=Bj^FϚtM(%u,cD|D\5 湭5ᙻC*#WQh++ˑxV=N*'ҝм*U+hlm0ƙc h7щ"jGzi& B6!?H{)sq8]05CsdLx`{64j|PT$<u.NxIץ"Ҥx~پt|cC`Yk b՝jr,b֕Nn9|Uf@4$ki/njiX *gM.8] 9=xL21({Kou "BW^qZ7=o$hm2`!\Olln8H,o| yۘӚ$w(:Y4^o>Jp\(#D=Xf%?nQ$ wƹ(*EF.o]Y|f$~;w {iw.:Luruf 1ԴOˡ`U7ϴ*u)[<Fj"d厓lBK}apImZYzoIn[xDP)XQm4"ұ)c{'Hػ{?ҍzlAsAPW_rؐM> ,)-LjޯÄ([|a7{Cd:1OpX: zp=]h"Soa$nwM@8aӫhl%C&i޹¸7LVhG5nyjg,??Y@0ry7Ov8m!JGw&+D7Y}ew&A'nz.7p (++),WRHM \D&Mȼ_rl[Ǒnp  0T3V6$_>κ{Q8[rѬׂw» rX;-^,y׏]3b&zRnةXԉin4k6+%t dۘ%V X4kf9nG=) :%(>:{-qΟԻ,@En1OK"yj|]##=2,TQ@ΔĖlB|Q.]q y-GJ7 Npu^ i77O$+&ByN Η0a\K'iEJ4i8aUe+>zNA*í|̈PvF 9=Qx>.Sn##r,%L{=2BxdEշ}Ti=?tïnKa&^' i_ Q4>r1ペ(sOc/I MvldR-C%uiV5GzvBY+:Y~ךUs@hlƐfV6RJʾh.8ys MY'˸;0x1ؕ(x"Df`]a|̒_ e' xɞsS!Sd(};6CMĈv>+B)ܨ=}Qڣٝ)(==X-T5S.Rl;!>Bx5%6fXۿEƮ<ٜr~gI&dZM)y1p !JHO$gXͱJJG:V"01YJo*ts̯#Z@껇VHV/{۬-K.^,guL<.0"u&T9F]8ee@KtkҽW`46_Mw=>b@[o+zb s(,+A*)_ŭHM ad| EFcgRyZ/9_ sBlliǫnDT_'(o Rh)#KY| +,m^Ry&S#2\5b 'm.f2xvGU=W3Ai퓊2WR9kNр^LrǀOM貰'ӦK*p *'ҁ&OMWPVECII(el P-Ԑ3.€^  dct[|>;vm<9ߍt@I0ȿ n;dN'[;\>4+͢%GO WYرQ dGisp!%CAR%H p@uJG{QH@}\n'tE"'UgK4 fb=*AC.bU2U{֜urĺ μ OL>sZƌ=_coˋ?}w8jTÇ1P6 C2KFnl!pP,鸹K"md@,dGw&W& ?+&JpYO,E4 - Szx@&s ĝ +qjHOr]w׫ c^ՒO\ Qݷ[v rƕ"{1G:䏯4yH .i8_=_xq̴9(S??6KK Uҿ[U2#ohǂr 0d^CZ'K0Φ`\ltE?̔_#r,Ocnz¾DctV~E ٧,n[FOeu;ϗMDEηl^׸:՘ٿrb|šىi:;37 w-*2._2Q ]X|J_`SI#H*8 gȯmAkT\:5VTXl.KVcbq8>% bGp eXvy& խ>q-l ~HS(+jyЅBq 1 zt bm4Vs D 5Im|`{d@gAM"r1pz1eTE=8#0}k͹47-?xw(_D휱0S[< bSLn$Jp)Mo+(\(/)V# AFqu(rĥ;,m*8: twϾ$E3U_q%ƴCk8 s%:qSJJS!tJ#l):QAW_>=.&;z|3͍;,`U*9M@' pi\Kqo_ g(iT׶!8NI.[RT$T7WƋ#>~l"ĀAic=GӾ#Fo llxg(JB:@Ʊ5q;k$`rbW6& Cy|0Ұͧ2"a֛.(3R m-@,2ji'=b$KO]-l=@8GеIS9$.ɺ yff(eB`EFr~tN5H{|;m*7~1=Y5YxlO(W/_9X}{y'z\QNTc2fDc~d6LٝՔTZ(]S4wB^o촫"RW`UKFFJ#hU D)v(쾏BS*xx oYt D,EG= ԂE50,bV,OV% G|N1&\cK?l^ڡitOκ.EZ@;zY"qUb~oّ! )2O.Z5 5ǡhLg{s(VdggzxaW q!j]L[02xR2+J\/R+ aL%#I(;B_brx]ޤkM'*tujs89=@j.mEW@oTIXItƒr>+^]AQ|H~B'Dx[kLf('CܩB^s;@/jo+Ql81C1l5W &q$<}Sc~܉һB-#Gcҟ]YgH *7qsϪv' u6\)MTRr$bd̸+kG8aqMEG,gmpX֕9Gm.bq&7j,̓OgzG1񆅍SRNj\"Lճ :YC X/yz)YSCD'#94edmKd*/haKiv"L1ja;? pq:?ATN ,#ty/7;g2Rz00C u<<yiH1>%ƂWq`U=È.iM+#>S9x䘐l&pD:5'E Bih`!U_nQ4dEp,śVL\&'t/I"#lQUoL]AYy']brSS_(_roDˤ0}@Wy GSi3fKSTʎ{ޞQL^Ѯs#Z%5|B9|ҘЎr;p̋zrGFk<7bi  Tg8. .DugVsH9GFLnfHXn[§ CdABbzt-=WyYx?x N mH RlxvAl(1w:7ɹ$u,/56lUV$|-EJB.g[?p"Hb,=WR6$Qn`-&O cr33Ҍe#~ nzSpo͑+S+lp#SF]N,{ x@AȢ)a -cl?DeډU?3)^hIЈ}0]J$ZS*Up0B C ;_ %`AӦe3[ 'p8gfE;ŭgϕt.nhR-NMφ>VeFD.{N4cAon~K(ymV!8`b@N? }qS-ѣ\E8Qg}xG چJ hY 7 72D4;+==V= USFU*׭.V8D;^UCW ڊѮvLMw_. JUV4* v`ϒ JxT r b׽dctj oz ]l k:$ŪZ ܘ I:>H D(H6JGYzP#Qz5MdGhv 6Թ<5C9뀝F븰+>UΔ?̤q8Hi=˟S'g # NAe}Xs_<)wQ<璌YjHp+)AjД|U SZWǺ  Gk"0e $o-z8w6q )EA9Yqtl˖ҕn2ak{ &2Rm׏KGk})G|CJdٹ lw<6ู. J!}CϟRXRs b8e\7KQǏFaC?]j.hۇ,dh]ؚ:+JVzos]F+rycap8m#CyVr1) nzL'I#&0wMs&^dz,kP)H߽|b+ޚr+u9qH^i[,3 A`GlR'7vTEYea5@X6B쏌QJzG/ɮ`[J(\-zSh;m͢Jj)I+p=zU|,("sj=Ɩs xFh5q68rsL>҄f5|/>32Af3uv@%bG0ˍ¶uk"Ml>’S|潊8AJW2 Ys-`Ϣυ RW/8(d5wQO3┯go uk֣=FG (<=4ҋ Ԋ0qZ-KDY(ftvUm.S+Y`(5qeXu6gD _(!t2^We C3JnAw֨sto)(y%"ܢ넄6{wa窐|"8rk:& ]o!STXQz<ώ~{VbI,[ڀ쐷tˊxs, 0`S6 w\M`J@/QJ?cN3- f }Y ޝxe3-]Bfƹ'~NZȓs@m %ձEB`-4Jnl8BȨ$`i GcW1aɆ`BJ 4:缓ܲ۳{+)/(˶L,iHr#݆=giYn҆`Fs8@Fi9*ЁB2 ~\EUomԬ>횡QCUZve&ͤFiWM)%+NIF>.?gFt P_)IF5U0d02'0_Z7A4‰//Т'ImqFj*Y$6!G#gA#oyړYF,7X 1'Fw轛b᠛LONqW/O7sڞ똁p5] ޮDEQ4M}8y:7bMhk~F"U'.X aE(Xn_.1K~ZDk ڷ)Uz5c yQRٚAp40&xP5b$Q\uY))Jȉ[VH94򘐴9iP1Kj|KϐSV3 ꭖBSթj۫e-& Q*0?ȣp3S럒g~ <̶䣢\\1)@@άv4& KvDNz{)h4uÛwpCKPCRM2XhcTkNK~Ʒh]s> ٵiS;x Э]״s K|" ^}!>: )?~"9lf2LLN?`XN3$E7S/u@42 o: Gx>C*ZؑVp[7K 5ingقs`I)ĔumPb#x% ሶL|AGj4.OqTx(vG[HU0?I 7\(M!LW }ܴ ~",+cI~xT+]ܾ8;6rz@*bQrv%#U~=A|F89}Rߖ*lDx3$be_ dB3SWI"퉰o`L~߳kRUgV>{T"E/rʪ/-W =tQ}tv~Q6?(8c->@-K's\@^ٚQHyQtȾ1& epG )cqW1ozcmzbJRw;+3!3VÅOڋ ^iNKMB|sgqPsWGʎ$'oS{YM̴D- ƜaH#l:sg=mw? v-932va8aިjN Q &E@/=c%:-l ~H€m2BspAGK+8+JY*)5N͒[qA$^3Դ& 62^!7GKVh_WuUTP>يs/.khmp$BrVsnf3L0aýX1c}k!Kp 2b6<U}ތ[ R* _Hb;:P^P$F#R%+ⓓgFL&| p#Ƚ̧!qa1<$Ph+$2΀>$pN U82 $[$%ћz!liGb^*w7EG0}$qQlrPRr;!e~gCt57Qو|T \[^A&(C xfzS%dZs0@Eu`𡬦1Ϯ -!'b0w{ɐLoW'6j ׼]tYqa8-mXަmfŮ@6MB|Q ko&zīwCǤJnX7""ilknZbsuE+۵a8qd`#V)rܕkQ>-vf7ДI)ZTn;8NyޜܪvFzQy[ǭOW{|nWc㼆qI3j ( C_&(24YV9ib,=:̻4w7N٤= JR0URNteIlu=s`:utX/ .)CSj4Ro#V8<*mUa?R3םPy〪Oa,s%1 k8˔gݛ~8^ZS{Ud7ia(Ac]em WR:xifN3R=E jݎqSKr+Xnvd7Us`dF#@Kem 6,Qzؠ!7{ܛ|\.s?pOO_up[78XS[[(uT}ٍtCquA]y׮"3&Љ+Ζ1 >ƱlX|\k*Kcn4f}p)e fShvdV3t0:gO:=mf&VJXCf8u!*v?C; mWuvQi-aBs>Ae|pZKoqp &.ݜAku!?+c <'M}K[Doh%zlw?{~)um[ Ä'"ąw4dLb<"l4jAU&V@a62 Sp5H﮲SBdN?K!60TK)KU,k^aQC9 EC tƒȦD(8Z#Pm}sT_qmh.>-tmYF2x P.QwiY`oQ>lZs#ҍB1+^5x[Vxe=3k|ZqmvF$qea-\0B kHxك;w"֠x1BkjWf <ӯKfZX b.+՞&Y/ ,#Ev$lx?$ʾG=3;TNF+8i.n>ޮ }lk4eu^ {'Du~1Rׂ:ORo?O2in)$SW]hoL_b^/Y8Kx#'N0jrI=䂳ˎn#Tj+4 <\ʘ4z>H4w44e35 `"ڼBV"O%.o͝6o Qwo] 4֢_ɖ4xSd*\ˮB%LVS=ce C=H˽cS#/23HgWǔ5n8t w߃Vc 8q׉3CRItqMWMq~ʹgBSK'1Ҵ$+`8'^+Ɠ1ѫ'CGދyJ׉em MƳ'DŽlT>9I.AP<|^&fCO""O_ ~)JEalgn$CK_?2Mi %f\İ2֕ia`GF4 kBvC ߄`*ƺ^JNmW~^Z߳'J0D௾RN=0'E}VbIgҟŻЗT9ٗhjqSx?tzi8Xh88D +T~f/4^f䱕utitm'8пQ+̢֪JS$] HT\bu3fg30|υGsA.Ԧ40Y$p*0(DxΚfS fᅙ_2kM-G_+Ŷ7]6NJW}}/BˢOt;k^m83/j}T廒'm1.;3v@*[j?Noy]ǂDSjß[1l\򮗒2A(k {c7%\.C CouuGM3ѡPf9+b@U(.|ȟ[ V >XA&ԉEmBI3gFJ?ax1Vdv}MJK FĄˀ` ,[~qj^wtE>0>`KqxrrM|m45,ߊ3S 2FR?R^ 2ҢfƮlȠQï gݕsm&yFjGY@e{T 0 43aǞV3v~~HrR!]xy%,m#W.q[|y`fS, RMDMFބe3^gvЩ'" icabextract-1.9/test/cabs/large-files-cab.sh0000744000175000017500000000160713367363364015607 00000000000000#!/bin/sh # creates 2GB of highly-repeated ASCII text, then compresses it with # MSZIP and LZX in the same cabinet # largest possible file is 65535 blocks of 32768 byte which is nearly 2GB perl -e '$b="Fabulous secret powers were revealed to me the day I held aloft\n" x 512; for (1..65535) {print $b;}' >2gb.txt cat >directives.txt < 20kB wine makecab.exe /D CompressionType=LZX /D CompressionMemory=21 large-files.cab mv large-files.ca_ large-files-cab.cab cabextract-1.9/test/cabs/case.txt0000644000175000017500000000107313323707071013773 00000000000000# test that cabextract can lowercase ASCII and UTF-8 filenames ascii\upper\ABCDEFGHIJKLMNOPQRSTUVWXYZ ascii\lower\abcdefghijklmnopqrstuvwxyz latin1\upper\ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ latin1\lower\àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ greek\upper\ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ greek\lower\αβγδεζηθικλμνξοπρςστυφχψ cyrillic\upper\АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ cyrillic\lower\абвгдежзийклмнопрстуфхцчшщъыьэюя cabextract-1.9/test/cabs/utf8-stresstest.txt0000644000175000017500000000411113323707071016163 00000000000000# from Markus Kuhn's UTF-8 decoder capability and stress test # https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt # 1. The Greek word 'kosme' κόσμε # 2 Boundary condition test cases # 2.1 First possible sequence of a certain length € ࠀ 𐀀 # 2.2 Last possible sequence of a certain length  ߿ ￿ # 2.3 Other boundary conditions ퟿  � 􏿿 # 3 Malformed sequences # 3.1 Unexpected continuation bytes # 3.1.9 Sequence of all 64 possible continuation bytes (0x80-0xbf): # 3.2 Lonely start characters # 3.2.1 All 32 first bytes of 2-byte sequences (0xc0-0xdf), each followed by a space character: # 3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), each followed by a space character: # 3.2.3 All 8 first bytes of 4-byte sequences (0xf0-0xf7), each followed by a space character: # 3.2.4 All 4 first bytes of 5-byte sequences (0xf8-0xfb), each followed by a space character: # 3.2.5 All 2 first bytes of 6-byte sequences (0xfc-0xfd), each followed by a space character: # 3.3 Sequences with last continuation byte missing # 3.4 Concatenation of incomplete sequences # 3.5 Impossible bytes # 4 Overlong sequences # 4.1 Examples of an overlong ASCII character # 4.2 Maximum overlong sequences # 4.3 Overlong representation of the NUL character # 5 Illegal code positions # 5.1 Single UTF-16 surrogates # 5.2 Paired UTF-16 surrogates # 5.3 Noncharacter code positions ￾ ￿ # Other noncharacters: ﷐﷑﷒﷓﷔﷕﷖﷗﷘﷙﷚﷛﷜﷝﷞﷟﷠﷡﷢﷣﷤﷥﷦﷧﷨﷩﷪﷫﷬﷭﷮﷯"| # 5.3.4 U+nFFFE U+nFFFF (for n = 1..10) 🿾🿿𯿾𯿿𿿾𿿿񏿾񏿿񟿾񟿿񯿾񯿿񿿾񿿿򏿾򏿿 cabextract-1.9/test/cabs/dirwalk-vulns.cab0000644000175000017500000000233413370016607015571 00000000000000MSCF,l"Y /absolute/pathl"Y /absolute/../../and/relative/pathl"Y \absolute\path\reverse\slashesl"Y \absolute\..\..\and\relative\path\reverse\slashesl"Y /l"Y \l"Y ///////////l"Y \\\\\\\\\\\l"Y ../relative/pathl"Y ../../relative/pathl"Y ../../../relative/pathl"Y relative/../pathl"Y relative/../../pathl"Y relative/../../../pathl"Yabsolutepath2bl"Yabsolutepath3bl"Yabsolutepath4bl"Yabsolutepath5bl"Yabsolutepath6bl"Yrelative....path2bl"Yrelative....path3bl"Yrelative....path4bl"Yrelative....path5bl"Yrelative....path6bl"Yinnocuous/../../relative/path2bl"Yinnocuous/../../relative/path3bl"Yinnocuous/../../relative/path4bl"Yinnocuous/../../relative/path5bl"Yinnocuous/../../relative/path6bcabextract-1.9/test/cabs/encoding-koi8.txt0000644000175000017500000000011313370016543015507 00000000000000, ? . KDE2 FreeBSD? cabextract-1.9/test/cabs/case.cab0000644000175000017500000000126013370016607013677 00000000000000MSCF,l"Y ascii\upper\ABCDEFGHIJKLMNOPQRSTUVWXYZl"Y ascii\lower\abcdefghijklmnopqrstuvwxyzl"Ylatin1\upper\ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞl"Ylatin1\lower\àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþl"Ygreek\upper\ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩl"Ygreek\lower\αβγδεζηθικλμνξοπρςστυφχψl"Ycyrillic\upper\АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯl"Ycyrillic\lower\абвгдежзийклмнопрстуфхцчшщъыьэюяcabextract-1.9/test/cabs/encoding-latin1.cab0000644000175000017500000000030713370016607015741 00000000000000MSCF,l"Y l"Y l"Y cabextract-1.9/test/cabs/split-cabs.sh0000775000175000017500000000321013367363373014727 00000000000000#!/bin/sh # creates a good mix of standalone folders, folders that # split backwards, split forwards, and split both ways, # with differing numbers of files in each dd if=/dev/urandom of=small1.bin bs=2000 count=1 2>/dev/null dd if=/dev/urandom of=small2.bin bs=8000 count=1 2>/dev/null dd if=/dev/urandom of=medium1.bin bs=40000 count=1 2>/dev/null dd if=/dev/urandom of=medium2.bin bs=50000 count=1 2>/dev/null dd if=/dev/urandom of=small3.bin bs=128 count=1 2>/dev/null dd if=/dev/urandom of=medium3.bin bs=40000 count=1 2>/dev/null # force differing case: wine will write the cab files as "split-1.cab" # but the cab file will have "Split-1.CAB" embedded in it touch split-1.cab split-2.cab split-3.cab split-4.cab split-5.cab cat >directives.txt <d< qPbqE/gڠn Hw@ ԦGv\vUTv (uV/fzn(`efy ,8j\L_cabextract-1.9/test/bugs/cve-2010-2800-mszip-infinite-loop.cab0000644000175000017500000000012513323707071020451 00000000000000MSCFU,El"Y file.txtCKcabextract-1.9/test/bugs/filename-read-violation-4.cab0000644000175000017500000000012413323707071017646 00000000000000MSCFP,Eello cabextract-1.9/test/bugs/filename-read-violation-3.cab0000644000175000017500000000012413323707071017645 00000000000000MSCFP,FpE hello.hello cabextract-1.9/test/bugs/filename-read-violation-1.cab0000644000175000017500000000012413323707071017643 00000000000000MSCFT,FpE ello.txtd jlhello cabextract-1.9/test/bugs/lzx-main-tree-no-lengths.cab0000644000175000017500000000013513323707071017564 00000000000000MSCF],El"Y file.txtcabextract-1.9/test/bugs/README0000644000175000017500000000040313323707071013223 00000000000000These cabinet files cause old versions of cabextract to crash, loop forever, or read outwith allocated memory. The current version of cabextract should no longer do that, however it will reject or fail to unpack most of these files because they are invalid. cabextract-1.9/test/bugs/cve-2014-9556-qtm-infinite-loop.cab0000644000175000017500000000041413323707071020134 00000000000000MSCF ,E gE2 limerickLThere was a young man from Japan Whose limericks never would scan. When asked why that was, He replied "It's because I always try to cram as many words into the last line as I possibly can." cabextract-1.9/test/bugs/cve-2015-4471-lzx-under-read.cab0000644000175000017500000000023013323707071017406 00000000000000MSCF (uVreserved header test 12345~l"Y test1.txtl"Y test2.txtT5ST test cabextract-1.9/test/bugs/cve-2010-2801-qtm-flush.cab0000644000175000017500000000043513323707071016462 00000000000000MSCF,C"Lt zeroes!sm4bҀ o5i3cbc`]TiTc(j(dkQFF00̋0vHH0`cabextract-1.9/test/bugs/qtm-max-size-block.cab0000644000175000017500000011411613362372512016446 00000000000000MSCFN,Frl"Y test1.bincabextract-1.9/test/simple.test0000775000175000017500000000134213367373256013621 00000000000000#!/bin/sh # test cabextract gets the basics right (correct dates, filenames, checksums...) . test/testcase $cabextract -l cabs/simple.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/simple.cab File size | Date Time | Name -----------+---------------------+------------- 77 | 12.03.1997 11:13:52 | hello.c 74 | 12.03.1997 11:15:14 | welcome.c All done, no errors. EOF $cabextract -t cabs/simple.cab >$actual compare_with <<'EOF' Testing cabinet: cabs/simple.cab hello.c OK c2535936b8908b1f8a28b7724a2c2045 welcome.c OK 67c981a019c21f3f4bb8f92efe4d95a1 All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/bugs.test0000775000175000017500000000027013367372662013267 00000000000000#!/bin/sh # test that known crash bugs remain fixed . test/testcase $cabextract -t $test_files/bugs/*.cab # fail if exit code indicates a crash (SIGBUS, SIGSEGV, etc.) test $? -le 1 cabextract-1.9/test/split.test0000775000175000017500000001075113367373264013466 00000000000000#!/bin/sh # test cabextract can join up split cabinets, whichever you start with . test/testcase $cabextract -t cabs/split-1.cab >$actual compare_with <<'EOF' cabs/split-1.cab: extends to Split-2.CAB (Split cabinet file 2/5) cabs/split-1.cab: extends to Split-3.CAB (Split cabinet file 3/5) cabs/split-1.cab: extends to Split-4.CAB (Split cabinet file 4/5) cabs/split-1.cab: extends to Split-5.CAB (Split cabinet file 5/5) Testing cabinet: cabs/split-1.cab small1.bin OK 2ad5ba0f497f1e597ab187a2dfaa2e29 small2.bin OK 1f862f9e36a32a74202c1120b9f06af7 medium1.bin OK 0a7bd124a4c03a30329bd9ff06f71df7 medium2.bin OK b4b0a02ad6a1170d4b3db18cec616fcc small3.bin OK bbaecacfeba976165e9d77bbecb0cbde medium3.bin OK b98fe17e8afbcf05aefc5b2c4badbc28 All done, no errors. EOF $cabextract -t cabs/split-2.cab >$actual compare_with <<'EOF' cabs/split-2.cab: extends backwards to Split-1.CAB (Split cabinet file 1/5) cabs/split-2.cab: extends to Split-3.CAB (Split cabinet file 3/5) cabs/split-2.cab: extends to Split-4.CAB (Split cabinet file 4/5) cabs/split-2.cab: extends to Split-5.CAB (Split cabinet file 5/5) Testing cabinet: cabs/split-2.cab small1.bin OK 2ad5ba0f497f1e597ab187a2dfaa2e29 small2.bin OK 1f862f9e36a32a74202c1120b9f06af7 medium1.bin OK 0a7bd124a4c03a30329bd9ff06f71df7 medium2.bin OK b4b0a02ad6a1170d4b3db18cec616fcc small3.bin OK bbaecacfeba976165e9d77bbecb0cbde medium3.bin OK b98fe17e8afbcf05aefc5b2c4badbc28 All done, no errors. EOF $cabextract -t cabs/split-3.cab >$actual compare_with <<'EOF' cabs/split-3.cab: extends backwards to Split-2.CAB (Split cabinet file 2/5) cabs/split-3.cab: extends backwards to Split-1.CAB (Split cabinet file 1/5) cabs/split-3.cab: extends to Split-4.CAB (Split cabinet file 4/5) cabs/split-3.cab: extends to Split-5.CAB (Split cabinet file 5/5) Testing cabinet: cabs/split-3.cab small1.bin OK 2ad5ba0f497f1e597ab187a2dfaa2e29 small2.bin OK 1f862f9e36a32a74202c1120b9f06af7 medium1.bin OK 0a7bd124a4c03a30329bd9ff06f71df7 medium2.bin OK b4b0a02ad6a1170d4b3db18cec616fcc small3.bin OK bbaecacfeba976165e9d77bbecb0cbde medium3.bin OK b98fe17e8afbcf05aefc5b2c4badbc28 All done, no errors. EOF $cabextract -t cabs/split-4.cab >$actual compare_with <<'EOF' cabs/split-4.cab: extends backwards to Split-3.CAB (Split cabinet file 3/5) cabs/split-4.cab: extends backwards to Split-2.CAB (Split cabinet file 2/5) cabs/split-4.cab: extends backwards to Split-1.CAB (Split cabinet file 1/5) cabs/split-4.cab: extends to Split-5.CAB (Split cabinet file 5/5) Testing cabinet: cabs/split-4.cab small1.bin OK 2ad5ba0f497f1e597ab187a2dfaa2e29 small2.bin OK 1f862f9e36a32a74202c1120b9f06af7 medium1.bin OK 0a7bd124a4c03a30329bd9ff06f71df7 medium2.bin OK b4b0a02ad6a1170d4b3db18cec616fcc small3.bin OK bbaecacfeba976165e9d77bbecb0cbde medium3.bin OK b98fe17e8afbcf05aefc5b2c4badbc28 All done, no errors. EOF $cabextract -t cabs/split-5.cab >$actual compare_with <<'EOF' cabs/split-5.cab: extends backwards to Split-4.CAB (Split cabinet file 4/5) cabs/split-5.cab: extends backwards to Split-3.CAB (Split cabinet file 3/5) cabs/split-5.cab: extends backwards to Split-2.CAB (Split cabinet file 2/5) cabs/split-5.cab: extends backwards to Split-1.CAB (Split cabinet file 1/5) Testing cabinet: cabs/split-5.cab small1.bin OK 2ad5ba0f497f1e597ab187a2dfaa2e29 small2.bin OK 1f862f9e36a32a74202c1120b9f06af7 medium1.bin OK 0a7bd124a4c03a30329bd9ff06f71df7 medium2.bin OK b4b0a02ad6a1170d4b3db18cec616fcc small3.bin OK bbaecacfeba976165e9d77bbecb0cbde medium3.bin OK b98fe17e8afbcf05aefc5b2c4badbc28 All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/test/case.test0000775000175000017500000001027013367373220013232 00000000000000#!/bin/sh # test cabextract --lowercase and --directory options . test/testcase $cabextract -l cabs/case.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/case.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | ascii/upper/ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 | 12.03.1997 11:13:52 | ascii/lower/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | latin1/upper/ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ 0 | 12.03.1997 11:13:52 | latin1/lower/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | greek/upper/ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ 0 | 12.03.1997 11:13:52 | greek/lower/αβγδεζηθικλμνξοπρςστυφχψ 0 | 12.03.1997 11:13:52 | cyrillic/upper/АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ 0 | 12.03.1997 11:13:52 | cyrillic/lower/абвгдежзийклмнопрстуфхцчшщъыьэюя All done, no errors. EOF $cabextract -L -l cabs/case.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/case.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | ascii/upper/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | ascii/lower/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | latin1/upper/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | latin1/lower/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | greek/upper/αβγδεζηθικλμνξοπρστυφχψω 0 | 12.03.1997 11:13:52 | greek/lower/αβγδεζηθικλμνξοπρςστυφχψ 0 | 12.03.1997 11:13:52 | cyrillic/upper/абвгдежзийклмнопрстуфхцчшщъыьэюя 0 | 12.03.1997 11:13:52 | cyrillic/lower/абвгдежзийклмнопрстуфхцчшщъыьэюя All done, no errors. EOF $cabextract -d DIR/PATH -l cabs/case.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/case.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | DIR/PATH/ascii/upper/ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 | 12.03.1997 11:13:52 | DIR/PATH/ascii/lower/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | DIR/PATH/latin1/upper/ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ 0 | 12.03.1997 11:13:52 | DIR/PATH/latin1/lower/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | DIR/PATH/greek/upper/ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ 0 | 12.03.1997 11:13:52 | DIR/PATH/greek/lower/αβγδεζηθικλμνξοπρςστυφχψ 0 | 12.03.1997 11:13:52 | DIR/PATH/cyrillic/upper/АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ 0 | 12.03.1997 11:13:52 | DIR/PATH/cyrillic/lower/абвгдежзийклмнопрстуфхцчшщъыьэюя All done, no errors. EOF $cabextract -d DIR/PATH -L -l cabs/case.cab >$actual compare_with <<'EOF' Viewing cabinet: cabs/case.cab File size | Date Time | Name -----------+---------------------+------------- 0 | 12.03.1997 11:13:52 | DIR/PATH/ascii/upper/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | DIR/PATH/ascii/lower/abcdefghijklmnopqrstuvwxyz 0 | 12.03.1997 11:13:52 | DIR/PATH/latin1/upper/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | DIR/PATH/latin1/lower/àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ 0 | 12.03.1997 11:13:52 | DIR/PATH/greek/upper/αβγδεζηθικλμνξοπρστυφχψω 0 | 12.03.1997 11:13:52 | DIR/PATH/greek/lower/αβγδεζηθικλμνξοπρςστυφχψ 0 | 12.03.1997 11:13:52 | DIR/PATH/cyrillic/upper/абвгдежзийклмнопрстуфхцчшщъыьэюя 0 | 12.03.1997 11:13:52 | DIR/PATH/cyrillic/lower/абвгдежзийклмнопрстуфхцчшщъыьэюя All done, no errors. EOF read status < $status && test "x$status" = xsuccess cabextract-1.9/mspack/0000775000175000017500000000000013370076412011767 500000000000000cabextract-1.9/mspack/mszip.h0000664000175000017500000001111213370027445013220 00000000000000/* This file is part of libmspack. * (C) 2003-2004 Stuart Caie. * * The deflate method was created by Phil Katz. MSZIP is equivalent to the * deflate method. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_MSZIP_H #define MSPACK_MSZIP_H 1 #ifdef __cplusplus extern "C" { #endif /* MSZIP (deflate) compression / (inflate) decompression definitions */ #define MSZIP_FRAME_SIZE (32768) /* size of LZ history window */ #define MSZIP_LITERAL_MAXSYMBOLS (288) /* literal/length huffman tree */ #define MSZIP_LITERAL_TABLEBITS (9) #define MSZIP_DISTANCE_MAXSYMBOLS (32) /* distance huffman tree */ #define MSZIP_DISTANCE_TABLEBITS (6) /* if there are less direct lookup entries than symbols, the longer * code pointers will be <= maxsymbols. This must not happen, or we * will decode entries badly */ #if (1 << MSZIP_LITERAL_TABLEBITS) < (MSZIP_LITERAL_MAXSYMBOLS * 2) # define MSZIP_LITERAL_TABLESIZE (MSZIP_LITERAL_MAXSYMBOLS * 4) #else # define MSZIP_LITERAL_TABLESIZE ((1 << MSZIP_LITERAL_TABLEBITS) + \ (MSZIP_LITERAL_MAXSYMBOLS * 2)) #endif #if (1 << MSZIP_DISTANCE_TABLEBITS) < (MSZIP_DISTANCE_MAXSYMBOLS * 2) # define MSZIP_DISTANCE_TABLESIZE (MSZIP_DISTANCE_MAXSYMBOLS * 4) #else # define MSZIP_DISTANCE_TABLESIZE ((1 << MSZIP_DISTANCE_TABLEBITS) + \ (MSZIP_DISTANCE_MAXSYMBOLS * 2)) #endif struct mszipd_stream { struct mspack_system *sys; /* I/O routines */ struct mspack_file *input; /* input file handle */ struct mspack_file *output; /* output file handle */ unsigned int window_posn; /* offset within window */ /* inflate() will call this whenever the window should be emptied. */ int (*flush_window)(struct mszipd_stream *, unsigned int); int error, repair_mode, bytes_output; /* I/O buffering */ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end, input_end; unsigned int bit_buffer, bits_left, inbuf_size; /* huffman code lengths */ unsigned char LITERAL_len[MSZIP_LITERAL_MAXSYMBOLS]; unsigned char DISTANCE_len[MSZIP_DISTANCE_MAXSYMBOLS]; /* huffman decoding tables */ unsigned short LITERAL_table [MSZIP_LITERAL_TABLESIZE]; unsigned short DISTANCE_table[MSZIP_DISTANCE_TABLESIZE]; /* 32kb history window */ unsigned char window[MSZIP_FRAME_SIZE]; }; /* allocates MS-ZIP decompression stream for decoding the given stream. * * - uses system->alloc() to allocate memory * * - returns NULL if not enough memory * * - input_buffer_size is how many bytes to use as an input bitstream buffer * * - if repair_mode is non-zero, errors in decompression will be skipped * and 'holes' left will be filled with zero bytes. This allows at least * a partial recovery of erroneous data. */ extern struct mszipd_stream *mszipd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int input_buffer_size, int repair_mode); /* decompresses, or decompresses more of, an MS-ZIP stream. * * - out_bytes of data will be decompressed and the function will return * with an MSPACK_ERR_OK return code. * * - decompressing will stop as soon as out_bytes is reached. if the true * amount of bytes decoded spills over that amount, they will be kept for * a later invocation of mszipd_decompress(). * * - the output bytes will be passed to the system->write() function given in * mszipd_init(), using the output file handle given in mszipd_init(). More * than one call may be made to system->write() * * - MS-ZIP will read input bytes as necessary using the system->read() * function given in mszipd_init(), using the input file handle given in * mszipd_init(). This will continue until system->read() returns 0 bytes, * or an error. */ extern int mszipd_decompress(struct mszipd_stream *zip, off_t out_bytes); /* decompresses an entire MS-ZIP stream in a KWAJ file. Acts very much * like mszipd_decompress(), but doesn't take an out_bytes parameter */ extern int mszipd_decompress_kwaj(struct mszipd_stream *zip); /* frees all stream associated with an MS-ZIP data stream * * - calls system->free() using the system pointer given in mszipd_init() */ void mszipd_free(struct mszipd_stream *zip); #ifdef __cplusplus } #endif #endif cabextract-1.9/mspack/qtmd.c0000664000175000017500000004253013370027445013026 00000000000000/* This file is part of libmspack. * (C) 2003-2004 Stuart Caie. * * The Quantum method was created by David Stafford, adapted by Microsoft * Corporation. * * This decompressor is based on an implementation by Matthew Russotto, used * with permission. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ /* Quantum decompression implementation */ /* This decompressor was researched and implemented by Matthew Russotto. It * has since been tidied up by Stuart Caie. More information can be found at * http://www.speakeasy.org/~russotto/quantumcomp.html */ #include #include /* import bit-reading macros and code */ #define BITS_TYPE struct qtmd_stream #define BITS_VAR qtm #define BITS_ORDER_MSB #define READ_BYTES do { \ unsigned char b0, b1; \ READ_IF_NEEDED; b0 = *i_ptr++; \ READ_IF_NEEDED; b1 = *i_ptr++; \ INJECT_BITS((b0 << 8) | b1, 16); \ } while (0) #include /* Quantum static data tables: * * Quantum uses 'position slots' to represent match offsets. For every * match, a small 'position slot' number and a small offset from that slot * are encoded instead of one large offset. * * position_base[] is an index to the position slot bases * * extra_bits[] states how many bits of offset-from-base data is needed. * * length_base[] and length_extra[] are equivalent in function, but are * used for encoding selector 6 (variable length match) match lengths, * instead of match offsets. * * They are generated with the following code: * unsigned int i, offset; * for (i = 0, offset = 0; i < 42; i++) { * position_base[i] = offset; * extra_bits[i] = ((i < 2) ? 0 : (i - 2)) >> 1; * offset += 1 << extra_bits[i]; * } * for (i = 0, offset = 0; i < 26; i++) { * length_base[i] = offset; * length_extra[i] = (i < 2 ? 0 : i - 2) >> 2; * offset += 1 << length_extra[i]; * } * length_base[26] = 254; length_extra[26] = 0; */ static const unsigned int position_base[42] = { 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864 }; static const unsigned char extra_bits[42] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19 }; static const unsigned char length_base[27] = { 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 18, 22, 26, 30, 38, 46, 54, 62, 78, 94, 110, 126, 158, 190, 222, 254 }; static const unsigned char length_extra[27] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; /* Arithmetic decoder: * * GET_SYMBOL(model, var) fetches the next symbol from the stated model * and puts it in var. * * If necessary, qtmd_update_model() is called. */ #define GET_SYMBOL(model, var) do { \ range = ((H - L) & 0xFFFF) + 1; \ symf = ((((C - L + 1) * model.syms[0].cumfreq)-1) / range) & 0xFFFF; \ \ for (i = 1; i < model.entries; i++) { \ if (model.syms[i].cumfreq <= symf) break; \ } \ (var) = model.syms[i-1].sym; \ \ range = (H - L) + 1; \ symf = model.syms[0].cumfreq; \ H = L + ((model.syms[i-1].cumfreq * range) / symf) - 1; \ L = L + ((model.syms[i].cumfreq * range) / symf); \ \ do { model.syms[--i].cumfreq += 8; } while (i > 0); \ if (model.syms[0].cumfreq > 3800) qtmd_update_model(&model); \ \ while (1) { \ if ((L & 0x8000) != (H & 0x8000)) { \ if ((L & 0x4000) && !(H & 0x4000)) { \ /* underflow case */ \ C ^= 0x4000; L &= 0x3FFF; H |= 0x4000; \ } \ else break; \ } \ L <<= 1; H = (H << 1) | 1; \ ENSURE_BITS(1); \ C = (C << 1) | PEEK_BITS(1); \ REMOVE_BITS(1); \ } \ } while (0) static void qtmd_update_model(struct qtmd_model *model) { struct qtmd_modelsym tmp; int i, j; if (--model->shiftsleft) { for (i = model->entries - 1; i >= 0; i--) { /* -1, not -2; the 0 entry saves this */ model->syms[i].cumfreq >>= 1; if (model->syms[i].cumfreq <= model->syms[i+1].cumfreq) { model->syms[i].cumfreq = model->syms[i+1].cumfreq + 1; } } } else { model->shiftsleft = 50; for (i = 0; i < model->entries; i++) { /* no -1, want to include the 0 entry */ /* this converts cumfreqs into frequencies, then shifts right */ model->syms[i].cumfreq -= model->syms[i+1].cumfreq; model->syms[i].cumfreq++; /* avoid losing things entirely */ model->syms[i].cumfreq >>= 1; } /* now sort by frequencies, decreasing order -- this must be an * inplace selection sort, or a sort with the same (in)stability * characteristics */ for (i = 0; i < model->entries - 1; i++) { for (j = i + 1; j < model->entries; j++) { if (model->syms[i].cumfreq < model->syms[j].cumfreq) { tmp = model->syms[i]; model->syms[i] = model->syms[j]; model->syms[j] = tmp; } } } /* then convert frequencies back to cumfreq */ for (i = model->entries - 1; i >= 0; i--) { model->syms[i].cumfreq += model->syms[i+1].cumfreq; } } } /* Initialises a model to decode symbols from [start] to [start]+[len]-1 */ static void qtmd_init_model(struct qtmd_model *model, struct qtmd_modelsym *syms, int start, int len) { int i; model->shiftsleft = 4; model->entries = len; model->syms = syms; for (i = 0; i <= len; i++) { syms[i].sym = start + i; /* actual symbol */ syms[i].cumfreq = len - i; /* current frequency of that symbol */ } } /*-------- main Quantum code --------*/ struct qtmd_stream *qtmd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int window_bits, int input_buffer_size) { unsigned int window_size = 1 << window_bits; struct qtmd_stream *qtm; int i; if (!system) return NULL; /* Quantum supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */ if (window_bits < 10 || window_bits > 21) return NULL; /* round up input buffer size to multiple of two */ input_buffer_size = (input_buffer_size + 1) & -2; if (input_buffer_size < 2) return NULL; /* allocate decompression state */ if (!(qtm = (struct qtmd_stream *) system->alloc(system, sizeof(struct qtmd_stream)))) { return NULL; } /* allocate decompression window and input buffer */ qtm->window = (unsigned char *) system->alloc(system, (size_t) window_size); qtm->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size); if (!qtm->window || !qtm->inbuf) { system->free(qtm->window); system->free(qtm->inbuf); system->free(qtm); return NULL; } /* initialise decompression state */ qtm->sys = system; qtm->input = input; qtm->output = output; qtm->inbuf_size = input_buffer_size; qtm->window_size = window_size; qtm->window_posn = 0; qtm->frame_todo = QTM_FRAME_SIZE; qtm->header_read = 0; qtm->error = MSPACK_ERR_OK; qtm->i_ptr = qtm->i_end = &qtm->inbuf[0]; qtm->o_ptr = qtm->o_end = &qtm->window[0]; qtm->input_end = 0; qtm->bits_left = 0; qtm->bit_buffer = 0; /* initialise arithmetic coding models * - model 4 depends on window size, ranges from 20 to 24 * - model 5 depends on window size, ranges from 20 to 36 * - model 6pos depends on window size, ranges from 20 to 42 */ i = window_bits * 2; qtmd_init_model(&qtm->model0, &qtm->m0sym[0], 0, 64); qtmd_init_model(&qtm->model1, &qtm->m1sym[0], 64, 64); qtmd_init_model(&qtm->model2, &qtm->m2sym[0], 128, 64); qtmd_init_model(&qtm->model3, &qtm->m3sym[0], 192, 64); qtmd_init_model(&qtm->model4, &qtm->m4sym[0], 0, (i > 24) ? 24 : i); qtmd_init_model(&qtm->model5, &qtm->m5sym[0], 0, (i > 36) ? 36 : i); qtmd_init_model(&qtm->model6, &qtm->m6sym[0], 0, i); qtmd_init_model(&qtm->model6len, &qtm->m6lsym[0], 0, 27); qtmd_init_model(&qtm->model7, &qtm->m7sym[0], 0, 7); /* all ok */ return qtm; } int qtmd_decompress(struct qtmd_stream *qtm, off_t out_bytes) { unsigned int frame_todo, frame_end, window_posn, match_offset, range; unsigned char *window, *i_ptr, *i_end, *runsrc, *rundest; int i, j, selector, extra, sym, match_length; unsigned short H, L, C, symf; register unsigned int bit_buffer; register unsigned char bits_left; /* easy answers */ if (!qtm || (out_bytes < 0)) return MSPACK_ERR_ARGS; if (qtm->error) return qtm->error; /* flush out any stored-up bytes before we begin */ i = qtm->o_end - qtm->o_ptr; if ((off_t) i > out_bytes) i = (int) out_bytes; if (i) { if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) { return qtm->error = MSPACK_ERR_WRITE; } qtm->o_ptr += i; out_bytes -= i; } if (out_bytes == 0) return MSPACK_ERR_OK; /* restore local state */ RESTORE_BITS; window = qtm->window; window_posn = qtm->window_posn; frame_todo = qtm->frame_todo; H = qtm->H; L = qtm->L; C = qtm->C; /* while we do not have enough decoded bytes in reserve: */ while ((qtm->o_end - qtm->o_ptr) < out_bytes) { /* read header if necessary. Initialises H, L and C */ if (!qtm->header_read) { H = 0xFFFF; L = 0; READ_BITS(C, 16); qtm->header_read = 1; } /* decode more, up to the number of bytes needed, the frame boundary, * or the window boundary, whichever comes first */ frame_end = window_posn + (out_bytes - (qtm->o_end - qtm->o_ptr)); if ((window_posn + frame_todo) < frame_end) { frame_end = window_posn + frame_todo; } if (frame_end > qtm->window_size) { frame_end = qtm->window_size; } while (window_posn < frame_end) { GET_SYMBOL(qtm->model7, selector); if (selector < 4) { /* literal byte */ struct qtmd_model *mdl = (selector == 0) ? &qtm->model0 : ((selector == 1) ? &qtm->model1 : ((selector == 2) ? &qtm->model2 : &qtm->model3)); GET_SYMBOL((*mdl), sym); window[window_posn++] = sym; frame_todo--; } else { /* match repeated string */ switch (selector) { case 4: /* selector 4 = fixed length match (3 bytes) */ GET_SYMBOL(qtm->model4, sym); READ_MANY_BITS(extra, extra_bits[sym]); match_offset = position_base[sym] + extra + 1; match_length = 3; break; case 5: /* selector 5 = fixed length match (4 bytes) */ GET_SYMBOL(qtm->model5, sym); READ_MANY_BITS(extra, extra_bits[sym]); match_offset = position_base[sym] + extra + 1; match_length = 4; break; case 6: /* selector 6 = variable length match */ GET_SYMBOL(qtm->model6len, sym); READ_MANY_BITS(extra, length_extra[sym]); match_length = length_base[sym] + extra + 5; GET_SYMBOL(qtm->model6, sym); READ_MANY_BITS(extra, extra_bits[sym]); match_offset = position_base[sym] + extra + 1; break; default: /* should be impossible, model7 can only return 0-6 */ D(("got %d from selector", selector)) return qtm->error = MSPACK_ERR_DECRUNCH; } rundest = &window[window_posn]; frame_todo -= match_length; /* does match destination wrap the window? This situation is possible * where the window size is less than the 32k frame size, but matches * must not go beyond a frame boundary */ if ((window_posn + match_length) > qtm->window_size) { /* copy first part of match, before window end */ i = qtm->window_size - window_posn; j = window_posn - match_offset; while (i--) *rundest++ = window[j++ & (qtm->window_size - 1)]; /* flush currently stored data */ i = (&window[qtm->window_size] - qtm->o_ptr); /* this should not happen, but if it does then this code * can't handle the situation (can't flush up to the end of * the window, but can't break out either because we haven't * finished writing the match). bail out in this case */ if (i > out_bytes) { D(("during window-wrap match; %d bytes to flush but only need %d", i, (int) out_bytes)) return qtm->error = MSPACK_ERR_DECRUNCH; } if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) { return qtm->error = MSPACK_ERR_WRITE; } out_bytes -= i; qtm->o_ptr = &window[0]; qtm->o_end = &window[0]; /* copy second part of match, after window wrap */ rundest = &window[0]; i = match_length - (qtm->window_size - window_posn); while (i--) *rundest++ = window[j++ & (qtm->window_size - 1)]; window_posn = window_posn + match_length - qtm->window_size; break; /* because "window_posn < frame_end" has now failed */ } else { /* normal match - output won't wrap window or frame end */ i = match_length; /* does match _offset_ wrap the window? */ if (match_offset > window_posn) { /* j = length from match offset to end of window */ j = match_offset - window_posn; if (j > (int) qtm->window_size) { D(("match offset beyond window boundaries")) return qtm->error = MSPACK_ERR_DECRUNCH; } runsrc = &window[qtm->window_size - j]; if (j < i) { /* if match goes over the window edge, do two copy runs */ i -= j; while (j-- > 0) *rundest++ = *runsrc++; runsrc = window; } while (i-- > 0) *rundest++ = *runsrc++; } else { runsrc = rundest - match_offset; while (i-- > 0) *rundest++ = *runsrc++; } window_posn += match_length; } } /* if (window_posn+match_length > frame_end) */ } /* while (window_posn < frame_end) */ qtm->o_end = &window[window_posn]; /* if we subtracted too much from frame_todo, it will * wrap around past zero and go above its max value */ if (frame_todo > QTM_FRAME_SIZE) { D(("overshot frame alignment")) return qtm->error = MSPACK_ERR_DECRUNCH; } /* another frame completed? */ if (frame_todo == 0) { /* re-align input */ if (bits_left & 7) REMOVE_BITS(bits_left & 7); /* special Quantum hack -- cabd.c injects a trailer byte to allow the * decompressor to realign itself. CAB Quantum blocks, unlike LZX * blocks, can have anything from 0 to 4 trailing null bytes. */ do { READ_BITS(i, 8); } while (i != 0xFF); qtm->header_read = 0; frame_todo = QTM_FRAME_SIZE; } /* window wrap? */ if (window_posn == qtm->window_size) { /* flush all currently stored data */ i = (qtm->o_end - qtm->o_ptr); /* break out if we have more than enough to finish this request */ if (i >= out_bytes) break; if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) { return qtm->error = MSPACK_ERR_WRITE; } out_bytes -= i; qtm->o_ptr = &window[0]; qtm->o_end = &window[0]; window_posn = 0; } } /* while (more bytes needed) */ if (out_bytes) { i = (int) out_bytes; if (qtm->sys->write(qtm->output, qtm->o_ptr, i) != i) { return qtm->error = MSPACK_ERR_WRITE; } qtm->o_ptr += i; } /* store local state */ STORE_BITS; qtm->window_posn = window_posn; qtm->frame_todo = frame_todo; qtm->H = H; qtm->L = L; qtm->C = C; return MSPACK_ERR_OK; } void qtmd_free(struct qtmd_stream *qtm) { struct mspack_system *sys; if (qtm) { sys = qtm->sys; sys->free(qtm->window); sys->free(qtm->inbuf); sys->free(qtm); } } cabextract-1.9/mspack/system.h0000664000175000017500000000642613370027445013416 00000000000000/* This file is part of libmspack. * (C) 2003-2018 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_SYSTEM_H #define MSPACK_SYSTEM_H 1 #ifdef __cplusplus extern "C" { #endif /* ensure config.h is read before mspack.h */ #ifdef HAVE_CONFIG_H # include #endif #include /* assume exists */ #include /* fix for problem with GCC 4 and glibc (thanks to Ville Skytta) * http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150429 */ #ifdef read # undef read #endif /* Old GCCs don't have __func__, but __FUNCTION__: * http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html */ #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "" # endif #endif #if DEBUG # include # define D(x) do { printf("%s:%d (%s) ",__FILE__, __LINE__, __func__); \ printf x ; fputc('\n', stdout); fflush(stdout);} while (0); #else # define D(x) #endif /* CAB supports searching through files over 4GB in size, and the CHM file * format actively uses 64-bit offsets. These can only be fully supported * if the system the code runs on supports large files. If not, the library * will work as normal using only 32-bit arithmetic, but if an offset * greater than 2GB is detected, an error message indicating the library * can't support the file should be printed. */ #if HAVE_INTTYPES_H # include #else # define PRId64 "lld" # define PRIu64 "llu" # define PRId32 "ld" # define PRIu32 "lu" #endif #include #if ((defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS >= 64) || \ (defined(FILESIZEBITS) && FILESIZEBITS >= 64) || \ defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE) || \ SIZEOF_OFF_T >= 8) # define LARGEFILE_SUPPORT 1 # define LD PRId64 # define LU PRIu64 #else extern const char *largefile_msg; # define LD PRId32 # define LU PRIu32 #endif /* endian-neutral reading of little-endian data */ #define __egi32(a,n) ( ((((unsigned char *) a)[n+3]) << 24) | \ ((((unsigned char *) a)[n+2]) << 16) | \ ((((unsigned char *) a)[n+1]) << 8) | \ ((((unsigned char *) a)[n+0]))) #define EndGetI64(a) ((((unsigned long long int) __egi32(a,4)) << 32) | \ ((unsigned int) __egi32(a,0))) #define EndGetI32(a) __egi32(a,0) #define EndGetI16(a) ((((a)[1])<<8)|((a)[0])) /* endian-neutral reading of big-endian data */ #define EndGetM32(a) (((((unsigned char *) a)[0]) << 24) | \ ((((unsigned char *) a)[1]) << 16) | \ ((((unsigned char *) a)[2]) << 8) | \ ((((unsigned char *) a)[3]))) #define EndGetM16(a) ((((a)[0])<<8)|((a)[1])) extern struct mspack_system *mspack_default_system; /* returns the length of a file opened for reading */ extern int mspack_sys_filelen(struct mspack_system *system, struct mspack_file *file, off_t *length); /* validates a system structure */ extern int mspack_valid_system(struct mspack_system *sys); #ifdef __cplusplus } #endif #endif cabextract-1.9/mspack/cab.h0000664000175000017500000001303413370027445012610 00000000000000/* This file is part of libmspack. * (C) 2003-2018 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_CAB_H #define MSPACK_CAB_H 1 /* generic CAB definitions */ /* structure offsets */ #define cfhead_Signature (0x00) #define cfhead_CabinetSize (0x08) #define cfhead_FileOffset (0x10) #define cfhead_MinorVersion (0x18) #define cfhead_MajorVersion (0x19) #define cfhead_NumFolders (0x1A) #define cfhead_NumFiles (0x1C) #define cfhead_Flags (0x1E) #define cfhead_SetID (0x20) #define cfhead_CabinetIndex (0x22) #define cfhead_SIZEOF (0x24) #define cfheadext_HeaderReserved (0x00) #define cfheadext_FolderReserved (0x02) #define cfheadext_DataReserved (0x03) #define cfheadext_SIZEOF (0x04) #define cffold_DataOffset (0x00) #define cffold_NumBlocks (0x04) #define cffold_CompType (0x06) #define cffold_SIZEOF (0x08) #define cffile_UncompressedSize (0x00) #define cffile_FolderOffset (0x04) #define cffile_FolderIndex (0x08) #define cffile_Date (0x0A) #define cffile_Time (0x0C) #define cffile_Attribs (0x0E) #define cffile_SIZEOF (0x10) #define cfdata_CheckSum (0x00) #define cfdata_CompressedSize (0x04) #define cfdata_UncompressedSize (0x06) #define cfdata_SIZEOF (0x08) /* flags */ #define cffoldCOMPTYPE_MASK (0x000f) #define cffoldCOMPTYPE_NONE (0x0000) #define cffoldCOMPTYPE_MSZIP (0x0001) #define cffoldCOMPTYPE_QUANTUM (0x0002) #define cffoldCOMPTYPE_LZX (0x0003) #define cfheadPREV_CABINET (0x0001) #define cfheadNEXT_CABINET (0x0002) #define cfheadRESERVE_PRESENT (0x0004) #define cffileCONTINUED_FROM_PREV (0xFFFD) #define cffileCONTINUED_TO_NEXT (0xFFFE) #define cffileCONTINUED_PREV_AND_NEXT (0xFFFF) /* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed * blocks have zero growth. MSZIP guarantees that it won't grow above * uncompressed size by more than 12 bytes. LZX guarantees it won't grow * more than 6144 bytes. Quantum has no documentation, but the largest * block seen in the wild is 337 bytes above uncompressed size. */ #define CAB_BLOCKMAX (32768) #define CAB_INPUTMAX (CAB_BLOCKMAX+6144) /* input buffer needs to be CAB_INPUTMAX + 1 byte to allow for max-sized block * plus 1 trailer byte added by cabd_sys_read_block() for Quantum alignment. * * When MSCABD_PARAM_SALVAGE is set, block size is not checked so can be * up to 65535 bytes, so max input buffer size needed is 65535 + 1 */ #define CAB_INPUTMAX_SALVAGE (65535) #define CAB_INPUTBUF (CAB_INPUTMAX_SALVAGE + 1) /* There are no more than 65535 data blocks per folder, so a folder cannot * be more than 32768*65535 bytes in length. As files cannot span more than * one folder, this is also their max offset, length and offset+length limit. */ #define CAB_FOLDERMAX (65535) #define CAB_LENGTHMAX (CAB_BLOCKMAX * CAB_FOLDERMAX) /* CAB compression definitions */ struct mscab_compressor_p { struct mscab_compressor base; struct mspack_system *system; /* todo */ }; /* CAB decompression definitions */ struct mscabd_decompress_state { struct mscabd_folder_p *folder; /* current folder we're extracting from */ struct mscabd_folder_data *data; /* current folder split we're in */ unsigned int offset; /* uncompressed offset within folder */ unsigned int block; /* which block are we decompressing? */ off_t outlen; /* cumulative sum of block output sizes */ struct mspack_system sys; /* special I/O code for decompressor */ int comp_type; /* type of compression used by folder */ int (*decompress)(void *, off_t); /* decompressor code */ void *state; /* decompressor state */ struct mscabd_cabinet_p *incab; /* cabinet where input data comes from */ struct mspack_file *infh; /* input file handle */ struct mspack_file *outfh; /* output file handle */ unsigned char *i_ptr, *i_end; /* input data consumed, end */ unsigned char input[CAB_INPUTBUF]; /* one input block of data */ }; struct mscab_decompressor_p { struct mscab_decompressor base; struct mscabd_decompress_state *d; struct mspack_system *system; int param[4]; /* !!! MATCH THIS TO NUM OF PARAMS IN MSPACK.H !!! */ int error, read_error; }; struct mscabd_cabinet_p { struct mscabd_cabinet base; off_t blocks_off; /* offset to data blocks */ int block_resv; /* reserved space in data blocks */ }; /* there is one of these for every cabinet a folder spans */ struct mscabd_folder_data { struct mscabd_folder_data *next; struct mscabd_cabinet_p *cab; /* cabinet file of this folder span */ off_t offset; /* cabinet offset of first datablock */ }; struct mscabd_folder_p { struct mscabd_folder base; struct mscabd_folder_data data; /* where are the data blocks? */ struct mscabd_file *merge_prev; /* first file needing backwards merge */ struct mscabd_file *merge_next; /* first file needing forwards merge */ }; #endif cabextract-1.9/mspack/lzx.h0000664000175000017500000002442413370027445012705 00000000000000/* This file is part of libmspack. * (C) 2003-2013 Stuart Caie. * * The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted * by Microsoft Corporation. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_LZX_H #define MSPACK_LZX_H 1 #ifdef __cplusplus extern "C" { #endif /* LZX compression / decompression definitions */ /* some constants defined by the LZX specification */ #define LZX_MIN_MATCH (2) #define LZX_MAX_MATCH (257) #define LZX_NUM_CHARS (256) #define LZX_BLOCKTYPE_INVALID (0) /* also blocktypes 4-7 invalid */ #define LZX_BLOCKTYPE_VERBATIM (1) #define LZX_BLOCKTYPE_ALIGNED (2) #define LZX_BLOCKTYPE_UNCOMPRESSED (3) #define LZX_PRETREE_NUM_ELEMENTS (20) #define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */ #define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */ #define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */ /* LZX huffman defines: tweak tablebits as desired */ #define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS) #define LZX_PRETREE_TABLEBITS (6) #define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 290*8) #define LZX_MAINTREE_TABLEBITS (12) #define LZX_LENGTH_MAXSYMBOLS (LZX_NUM_SECONDARY_LENGTHS+1) #define LZX_LENGTH_TABLEBITS (12) #define LZX_ALIGNED_MAXSYMBOLS (LZX_ALIGNED_NUM_ELEMENTS) #define LZX_ALIGNED_TABLEBITS (7) #define LZX_LENTABLE_SAFETY (64) /* table decoding overruns are allowed */ #define LZX_FRAME_SIZE (32768) /* the size of a frame in LZX */ struct lzxd_stream { struct mspack_system *sys; /* I/O routines */ struct mspack_file *input; /* input file handle */ struct mspack_file *output; /* output file handle */ off_t offset; /* number of bytes actually output */ off_t length; /* overall decompressed length of stream */ unsigned char *window; /* decoding window */ unsigned int window_size; /* window size */ unsigned int ref_data_size; /* LZX DELTA reference data size */ unsigned int num_offsets; /* number of match_offset entries in table */ unsigned int window_posn; /* decompression offset within window */ unsigned int frame_posn; /* current frame offset within in window */ unsigned int frame; /* the number of 32kb frames processed */ unsigned int reset_interval; /* which frame do we reset the compressor? */ unsigned int R0, R1, R2; /* for the LRU offset system */ unsigned int block_length; /* uncompressed length of this LZX block */ unsigned int block_remaining; /* uncompressed bytes still left to decode */ signed int intel_filesize; /* magic header value used for transform */ signed int intel_curpos; /* current offset in transform space */ unsigned char intel_started; /* has intel E8 decoding started? */ unsigned char block_type; /* type of the current block */ unsigned char header_read; /* have we started decoding at all yet? */ unsigned char input_end; /* have we reached the end of input? */ unsigned char is_delta; /* does stream follow LZX DELTA spec? */ int error; /* I/O buffering */ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end; unsigned int bit_buffer, bits_left, inbuf_size; /* huffman code lengths */ unsigned char PRETREE_len [LZX_PRETREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY]; unsigned char MAINTREE_len [LZX_MAINTREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY]; unsigned char LENGTH_len [LZX_LENGTH_MAXSYMBOLS + LZX_LENTABLE_SAFETY]; unsigned char ALIGNED_len [LZX_ALIGNED_MAXSYMBOLS + LZX_LENTABLE_SAFETY]; /* huffman decoding tables */ unsigned short PRETREE_table [(1 << LZX_PRETREE_TABLEBITS) + (LZX_PRETREE_MAXSYMBOLS * 2)]; unsigned short MAINTREE_table[(1 << LZX_MAINTREE_TABLEBITS) + (LZX_MAINTREE_MAXSYMBOLS * 2)]; unsigned short LENGTH_table [(1 << LZX_LENGTH_TABLEBITS) + (LZX_LENGTH_MAXSYMBOLS * 2)]; unsigned short ALIGNED_table [(1 << LZX_ALIGNED_TABLEBITS) + (LZX_ALIGNED_MAXSYMBOLS * 2)]; unsigned char LENGTH_empty; /* this is used purely for doing the intel E8 transform */ unsigned char e8_buf[LZX_FRAME_SIZE]; }; /** * Allocates and initialises LZX decompression state for decoding an LZX * stream. * * This routine uses system->alloc() to allocate memory. If memory * allocation fails, or the parameters to this function are invalid, * NULL is returned. * * @param system an mspack_system structure used to read from * the input stream and write to the output * stream, also to allocate and free memory. * @param input an input stream with the LZX data. * @param output an output stream to write the decoded data to. * @param window_bits the size of the decoding window, which must be * between 15 and 21 inclusive for regular LZX * data, or between 17 and 25 inclusive for * LZX DELTA data. * @param reset_interval the interval at which the LZX bitstream is * reset, in multiples of LZX frames (32678 * bytes), e.g. a value of 2 indicates the input * stream resets after every 65536 output bytes. * A value of 0 indicates that the bitstream never * resets, such as in CAB LZX streams. * @param input_buffer_size the number of bytes to use as an input * bitstream buffer. * @param output_length the length in bytes of the entirely * decompressed output stream, if known in * advance. It is used to correctly perform the * Intel E8 transformation, which must stop 6 * bytes before the very end of the * decompressed stream. It is not otherwise used * or adhered to. If the full decompressed * length is known in advance, set it here. * If it is NOT known, use the value 0, and call * lzxd_set_output_length() once it is * known. If never set, 4 of the final 6 bytes * of the output stream may be incorrect. * @param is_delta should be zero for all regular LZX data, * non-zero for LZX DELTA encoded data. * @return a pointer to an initialised lzxd_stream structure, or NULL if * there was not enough memory or parameters to the function were wrong. */ extern struct lzxd_stream *lzxd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int window_bits, int reset_interval, int input_buffer_size, off_t output_length, char is_delta); /* see description of output_length in lzxd_init() */ extern void lzxd_set_output_length(struct lzxd_stream *lzx, off_t output_length); /** * Reads LZX DELTA reference data into the window and allows * lzxd_decompress() to reference it. * * Call this before the first call to lzxd_decompress(). * @param lzx the LZX stream to apply this reference data to * @param system an mspack_system implementation to use with the * input param. Only read() will be called. * @param input an input file handle to read reference data using * system->read(). * @param length the length of the reference data. Cannot be longer * than the LZX window size. * @return an error code, or MSPACK_ERR_OK if successful */ extern int lzxd_set_reference_data(struct lzxd_stream *lzx, struct mspack_system *system, struct mspack_file *input, unsigned int length); /** * Decompresses entire or partial LZX streams. * * The number of bytes of data that should be decompressed is given as the * out_bytes parameter. If more bytes are decoded than are needed, they * will be kept over for a later invocation. * * The output bytes will be passed to the system->write() function given in * lzxd_init(), using the output file handle given in lzxd_init(). More than * one call may be made to system->write(). * Input bytes will be read in as necessary using the system->read() * function given in lzxd_init(), using the input file handle given in * lzxd_init(). This will continue until system->read() returns 0 bytes, * or an error. Errors will be passed out of the function as * MSPACK_ERR_READ errors. Input streams should convey an "end of input * stream" by refusing to supply all the bytes that LZX asks for when they * reach the end of the stream, rather than return an error code. * * If any error code other than MSPACK_ERR_OK is returned, the stream * should be considered unusable and lzxd_decompress() should not be * called again on this stream. * * @param lzx LZX decompression state, as allocated by lzxd_init(). * @param out_bytes the number of bytes of data to decompress. * @return an error code, or MSPACK_ERR_OK if successful */ extern int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes); /** * Frees all state associated with an LZX data stream. This will call * system->free() using the system pointer given in lzxd_init(). * * @param lzx LZX decompression state to free. */ void lzxd_free(struct lzxd_stream *lzx); #ifdef __cplusplus } #endif #endif cabextract-1.9/mspack/readbits.h0000664000175000017500000002025713370027445013665 00000000000000/* This file is part of libmspack. * (C) 2003-2010 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_READBITS_H #define MSPACK_READBITS_H 1 /* this header defines macros that read data streams by * the individual bits * * INIT_BITS initialises bitstream state in state structure * STORE_BITS stores bitstream state in state structure * RESTORE_BITS restores bitstream state from state structure * ENSURE_BITS(n) ensure there are at least N bits in the bit buffer * READ_BITS(var,n) takes N bits from the buffer and puts them in var * PEEK_BITS(n) extracts without removing N bits from the bit buffer * REMOVE_BITS(n) removes N bits from the bit buffer * * READ_BITS simply calls ENSURE_BITS, PEEK_BITS and REMOVE_BITS, * which means it's limited to reading the number of bits you can * ensure at any one time. It also fails if asked to read zero bits. * If you need to read zero bits, or more bits than can be ensured in * one go, use READ_MANY_BITS instead. * * These macros have variable names baked into them, so to use them * you have to define some macros: * - BITS_TYPE: the type name of your state structure * - BITS_VAR: the variable that points to your state structure * - define BITS_ORDER_MSB if bits are read from the MSB, or * define BITS_ORDER_LSB if bits are read from the LSB * - READ_BYTES: some code that reads more data into the bit buffer, * it should use READ_IF_NEEDED (calls read_input if the byte buffer * is empty), then INJECT_BITS(data,n) to put data from the byte * buffer into the bit buffer. * * You also need to define some variables and structure members: * - unsigned char *i_ptr; // current position in the byte buffer * - unsigned char *i_end; // end of the byte buffer * - unsigned int bit_buffer; // the bit buffer itself * - unsigned int bits_left; // number of bits remaining * * If you use read_input() and READ_IF_NEEDED, they also expect these * structure members: * - struct mspack_system *sys; // to access sys->read() * - unsigned int error; // to record/return read errors * - unsigned char input_end; // to mark reaching the EOF * - unsigned char *inbuf; // the input byte buffer * - unsigned int inbuf_size; // the size of the input byte buffer * * Your READ_BYTES implementation should read data from *i_ptr and * put them in the bit buffer. READ_IF_NEEDED will call read_input() * if i_ptr reaches i_end, and will fill up inbuf and set i_ptr to * the start of inbuf and i_end to the end of inbuf. * * If you're reading in MSB order, the routines work by using the area * beyond the MSB and the LSB of the bit buffer as a free source of * zeroes when shifting. This avoids having to mask any bits. So we * have to know the bit width of the bit buffer variable. We use * and CHAR_BIT to find the size of the bit buffer in bits. * * If you are reading in LSB order, bits need to be masked. Normally * this is done by computing the mask: N bits are masked by the value * (1< #endif #ifndef CHAR_BIT # define CHAR_BIT (8) #endif #define BITBUF_WIDTH (sizeof(bit_buffer) * CHAR_BIT) #define INIT_BITS do { \ BITS_VAR->i_ptr = &BITS_VAR->inbuf[0]; \ BITS_VAR->i_end = &BITS_VAR->inbuf[0]; \ BITS_VAR->bit_buffer = 0; \ BITS_VAR->bits_left = 0; \ BITS_VAR->input_end = 0; \ } while (0) #define STORE_BITS do { \ BITS_VAR->i_ptr = i_ptr; \ BITS_VAR->i_end = i_end; \ BITS_VAR->bit_buffer = bit_buffer; \ BITS_VAR->bits_left = bits_left; \ } while (0) #define RESTORE_BITS do { \ i_ptr = BITS_VAR->i_ptr; \ i_end = BITS_VAR->i_end; \ bit_buffer = BITS_VAR->bit_buffer; \ bits_left = BITS_VAR->bits_left; \ } while (0) #define ENSURE_BITS(nbits) do { \ while (bits_left < (nbits)) READ_BYTES; \ } while (0) #define READ_BITS(val, nbits) do { \ ENSURE_BITS(nbits); \ (val) = PEEK_BITS(nbits); \ REMOVE_BITS(nbits); \ } while (0) #define READ_MANY_BITS(val, bits) do { \ unsigned char needed = (bits), bitrun; \ (val) = 0; \ while (needed > 0) { \ if (bits_left <= (BITBUF_WIDTH - 16)) READ_BYTES; \ bitrun = (bits_left < needed) ? bits_left : needed; \ (val) = ((val) << bitrun) | PEEK_BITS(bitrun); \ REMOVE_BITS(bitrun); \ needed -= bitrun; \ } \ } while (0) #ifdef BITS_ORDER_MSB # define PEEK_BITS(nbits) (bit_buffer >> (BITBUF_WIDTH - (nbits))) # define REMOVE_BITS(nbits) ((bit_buffer <<= (nbits)), (bits_left -= (nbits))) # define INJECT_BITS(bitdata,nbits) ((bit_buffer |= \ (bitdata) << (BITBUF_WIDTH - (nbits) - bits_left)), (bits_left += (nbits))) #else /* BITS_ORDER_LSB */ # define PEEK_BITS(nbits) (bit_buffer & ((1 << (nbits))-1)) # define REMOVE_BITS(nbits) ((bit_buffer >>= (nbits)), (bits_left -= (nbits))) # define INJECT_BITS(bitdata,nbits) ((bit_buffer |= \ (bitdata) << bits_left), (bits_left += (nbits))) #endif #ifdef BITS_LSB_TABLE /* lsb_bit_mask[n] = (1 << n) - 1 */ static const unsigned short lsb_bit_mask[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; # define PEEK_BITS_T(nbits) (bit_buffer & lsb_bit_mask[(nbits)]) # define READ_BITS_T(val, nbits) do { \ ENSURE_BITS(nbits); \ (val) = PEEK_BITS_T(nbits); \ REMOVE_BITS(nbits); \ } while (0) #endif #ifndef BITS_NO_READ_INPUT # define READ_IF_NEEDED do { \ if (i_ptr >= i_end) { \ if (read_input(BITS_VAR)) \ return BITS_VAR->error; \ i_ptr = BITS_VAR->i_ptr; \ i_end = BITS_VAR->i_end; \ } \ } while (0) static int read_input(BITS_TYPE *p) { int read = p->sys->read(p->input, &p->inbuf[0], (int)p->inbuf_size); if (read < 0) return p->error = MSPACK_ERR_READ; /* we might overrun the input stream by asking for bits we don't use, * so fake 2 more bytes at the end of input */ if (read == 0) { if (p->input_end) { D(("out of input bytes")) return p->error = MSPACK_ERR_READ; } else { read = 2; p->inbuf[0] = p->inbuf[1] = 0; p->input_end = 1; } } /* update i_ptr and i_end */ p->i_ptr = &p->inbuf[0]; p->i_end = &p->inbuf[read]; return MSPACK_ERR_OK; } #endif #endif cabextract-1.9/mspack/system.c0000664000175000017500000001432313370027445013404 00000000000000/* This file is part of libmspack. * (C) 2003-2004 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifdef HAVE_CONFIG_H # include #endif #include #if !LARGEFILE_SUPPORT const char *largefile_msg = "library not compiled to support large files."; #endif int mspack_version(int entity) { switch (entity) { /* CHM decoder version 1 -> 2 changes: * - added mschmd_sec_mscompressed::spaninfo * - added mschmd_header::first_pmgl * - added mschmd_header::last_pmgl * - added mschmd_header::chunk_cache; */ case MSPACK_VER_MSCHMD: /* CAB decoder version 1 -> 2 changes: * - added MSCABD_PARAM_SALVAGE */ case MSPACK_VER_MSCABD: return 2; case MSPACK_VER_LIBRARY: case MSPACK_VER_SYSTEM: case MSPACK_VER_MSSZDDD: case MSPACK_VER_MSKWAJD: case MSPACK_VER_MSOABD: return 1; case MSPACK_VER_MSCABC: case MSPACK_VER_MSCHMC: case MSPACK_VER_MSLITD: case MSPACK_VER_MSLITC: case MSPACK_VER_MSHLPD: case MSPACK_VER_MSHLPC: case MSPACK_VER_MSSZDDC: case MSPACK_VER_MSKWAJC: case MSPACK_VER_MSOABC: return 0; } return -1; } int mspack_sys_selftest_internal(int offt_size) { return (sizeof(off_t) == offt_size) ? MSPACK_ERR_OK : MSPACK_ERR_SEEK; } /* validates a system structure */ int mspack_valid_system(struct mspack_system *sys) { return (sys != NULL) && (sys->open != NULL) && (sys->close != NULL) && (sys->read != NULL) && (sys->write != NULL) && (sys->seek != NULL) && (sys->tell != NULL) && (sys->message != NULL) && (sys->alloc != NULL) && (sys->free != NULL) && (sys->copy != NULL) && (sys->null_ptr == NULL); } /* returns the length of a file opened for reading */ int mspack_sys_filelen(struct mspack_system *system, struct mspack_file *file, off_t *length) { off_t current; if (!system || !file || !length) return MSPACK_ERR_OPEN; /* get current offset */ current = system->tell(file); /* seek to end of file */ if (system->seek(file, (off_t) 0, MSPACK_SYS_SEEK_END)) { return MSPACK_ERR_SEEK; } /* get offset of end of file */ *length = system->tell(file); /* seek back to original offset */ if (system->seek(file, current, MSPACK_SYS_SEEK_START)) { return MSPACK_ERR_SEEK; } return MSPACK_ERR_OK; } /* definition of mspack_default_system -- if the library is compiled with * MSPACK_NO_DEFAULT_SYSTEM, no default system will be provided. Otherwise, * an appropriate default system (e.g. the standard C library, or some native * API calls) */ #ifdef MSPACK_NO_DEFAULT_SYSTEM struct mspack_system *mspack_default_system = NULL; #else /* implementation of mspack_default_system for standard C library */ #include #include #include #include struct mspack_file_p { FILE *fh; const char *name; }; static struct mspack_file *msp_open(struct mspack_system *self, const char *filename, int mode) { struct mspack_file_p *fh; const char *fmode; switch (mode) { case MSPACK_SYS_OPEN_READ: fmode = "rb"; break; case MSPACK_SYS_OPEN_WRITE: fmode = "wb"; break; case MSPACK_SYS_OPEN_UPDATE: fmode = "r+b"; break; case MSPACK_SYS_OPEN_APPEND: fmode = "ab"; break; default: return NULL; } if ((fh = (struct mspack_file_p *) malloc(sizeof(struct mspack_file_p)))) { fh->name = filename; if ((fh->fh = fopen(filename, fmode))) return (struct mspack_file *) fh; free(fh); } return NULL; } static void msp_close(struct mspack_file *file) { struct mspack_file_p *self = (struct mspack_file_p *) file; if (self) { fclose(self->fh); free(self); } } static int msp_read(struct mspack_file *file, void *buffer, int bytes) { struct mspack_file_p *self = (struct mspack_file_p *) file; if (self && buffer && bytes >= 0) { size_t count = fread(buffer, 1, (size_t) bytes, self->fh); if (!ferror(self->fh)) return (int) count; } return -1; } static int msp_write(struct mspack_file *file, void *buffer, int bytes) { struct mspack_file_p *self = (struct mspack_file_p *) file; if (self && buffer && bytes >= 0) { size_t count = fwrite(buffer, 1, (size_t) bytes, self->fh); if (!ferror(self->fh)) return (int) count; } return -1; } static int msp_seek(struct mspack_file *file, off_t offset, int mode) { struct mspack_file_p *self = (struct mspack_file_p *) file; if (self) { switch (mode) { case MSPACK_SYS_SEEK_START: mode = SEEK_SET; break; case MSPACK_SYS_SEEK_CUR: mode = SEEK_CUR; break; case MSPACK_SYS_SEEK_END: mode = SEEK_END; break; default: return -1; } #if HAVE_FSEEKO return fseeko(self->fh, offset, mode); #else return fseek(self->fh, offset, mode); #endif } return -1; } static off_t msp_tell(struct mspack_file *file) { struct mspack_file_p *self = (struct mspack_file_p *) file; #if HAVE_FSEEKO return (self) ? (off_t) ftello(self->fh) : 0; #else return (self) ? (off_t) ftell(self->fh) : 0; #endif } static void msp_msg(struct mspack_file *file, const char *format, ...) { va_list ap; if (file) fprintf(stderr, "%s: ", ((struct mspack_file_p *) file)->name); va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); fputc((int) '\n', stderr); fflush(stderr); } static void *msp_alloc(struct mspack_system *self, size_t bytes) { #if DEBUG /* make uninitialised data obvious */ char *buf = malloc(bytes + 8); if (buf) memset(buf, 0xDC, bytes); *((size_t *)buf) = bytes; return &buf[8]; #else return malloc(bytes); #endif } static void msp_free(void *buffer) { #if DEBUG char *buf = buffer; size_t bytes; if (buf) { buf -= 8; bytes = *((size_t *)buf); /* make freed data obvious */ memset(buf, 0xED, bytes); free(buf); } #else free(buffer); #endif } static void msp_copy(void *src, void *dest, size_t bytes) { memcpy(dest, src, bytes); } static struct mspack_system msp_system = { &msp_open, &msp_close, &msp_read, &msp_write, &msp_seek, &msp_tell, &msp_msg, &msp_alloc, &msp_free, &msp_copy, NULL }; struct mspack_system *mspack_default_system = &msp_system; #endif cabextract-1.9/mspack/qtm.h0000664000175000017500000001062313370027445012665 00000000000000/* This file is part of libmspack. * (C) 2003-2004 Stuart Caie. * * The Quantum method was created by David Stafford, adapted by Microsoft * Corporation. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_QTM_H #define MSPACK_QTM_H 1 #ifdef __cplusplus extern "C" { #endif /* Quantum compression / decompression definitions */ #define QTM_FRAME_SIZE (32768) struct qtmd_modelsym { unsigned short sym, cumfreq; }; struct qtmd_model { int shiftsleft, entries; struct qtmd_modelsym *syms; }; struct qtmd_stream { struct mspack_system *sys; /* I/O routines */ struct mspack_file *input; /* input file handle */ struct mspack_file *output; /* output file handle */ unsigned char *window; /* decoding window */ unsigned int window_size; /* window size */ unsigned int window_posn; /* decompression offset within window */ unsigned int frame_todo; /* bytes remaining for current frame */ unsigned short H, L, C; /* high/low/current: arith coding state */ unsigned char header_read; /* have we started decoding a new frame? */ int error; /* I/O buffers */ unsigned char *inbuf, *i_ptr, *i_end, *o_ptr, *o_end; unsigned int bit_buffer, inbuf_size; unsigned char bits_left, input_end; /* four literal models, each representing 64 symbols * model0 for literals from 0 to 63 (selector = 0) * model1 for literals from 64 to 127 (selector = 1) * model2 for literals from 128 to 191 (selector = 2) * model3 for literals from 129 to 255 (selector = 3) */ struct qtmd_model model0, model1, model2, model3; /* three match models. * model4 for match with fixed length of 3 bytes * model5 for match with fixed length of 4 bytes * model6 for variable length match, encoded with model6len model */ struct qtmd_model model4, model5, model6, model6len; /* selector model. 0-6 to say literal (0,1,2,3) or match (4,5,6) */ struct qtmd_model model7; /* symbol arrays for all models */ struct qtmd_modelsym m0sym[64 + 1]; struct qtmd_modelsym m1sym[64 + 1]; struct qtmd_modelsym m2sym[64 + 1]; struct qtmd_modelsym m3sym[64 + 1]; struct qtmd_modelsym m4sym[24 + 1]; struct qtmd_modelsym m5sym[36 + 1]; struct qtmd_modelsym m6sym[42 + 1], m6lsym[27 + 1]; struct qtmd_modelsym m7sym[7 + 1]; }; /* allocates Quantum decompression state for decoding the given stream. * * - returns NULL if window_bits is outwith the range 10 to 21 (inclusive). * * - uses system->alloc() to allocate memory * * - returns NULL if not enough memory * * - window_bits is the size of the Quantum window, from 1Kb (10) to 2Mb (21). * * - input_buffer_size is the number of bytes to use to store bitstream data. */ extern struct qtmd_stream *qtmd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int window_bits, int input_buffer_size); /* decompresses, or decompresses more of, a Quantum stream. * * - out_bytes of data will be decompressed and the function will return * with an MSPACK_ERR_OK return code. * * - decompressing will stop as soon as out_bytes is reached. if the true * amount of bytes decoded spills over that amount, they will be kept for * a later invocation of qtmd_decompress(). * * - the output bytes will be passed to the system->write() function given in * qtmd_init(), using the output file handle given in qtmd_init(). More * than one call may be made to system->write() * * - Quantum will read input bytes as necessary using the system->read() * function given in qtmd_init(), using the input file handle given in * qtmd_init(). This will continue until system->read() returns 0 bytes, * or an error. */ extern int qtmd_decompress(struct qtmd_stream *qtm, off_t out_bytes); /* frees all state associated with a Quantum data stream * * - calls system->free() using the system pointer given in qtmd_init() */ void qtmd_free(struct qtmd_stream *qtm); #ifdef __cplusplus } #endif #endif cabextract-1.9/mspack/mspack.h0000664000175000017500000026127113370027445013351 00000000000000/* libmspack -- a library for working with Microsoft compression formats. * (C) 2003-2016 Stuart Caie * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** \mainpage * * \section intro Introduction * * libmspack is a library which provides compressors and decompressors, * archivers and dearchivers for Microsoft compression formats. * * \section formats Formats supported * * The following file formats are supported: * - SZDD files, which use LZSS compression * - KWAJ files, which use LZSS, LZSS+Huffman or deflate compression * - .HLP (MS Help) files, which use LZSS compression * - .CAB (MS Cabinet) files, which use deflate, LZX or Quantum compression * - .CHM (HTML Help) files, which use LZX compression * - .LIT (MS EBook) files, which use LZX compression and DES encryption * - .LZX (Exchange Offline Addressbook) files, which use LZX compression * * To determine the capabilities of the library, and the binary * compatibility version of any particular compressor or decompressor, use * the mspack_version() function. The UNIX library interface version is * defined as the highest-versioned library component. * * \section starting Getting started * * The macro MSPACK_SYS_SELFTEST() should be used to ensure the library can * be used. In particular, it checks if the caller is using 32-bit file I/O * when the library is compiled for 64-bit file I/O and vice versa. * * If compiled normally, the library includes basic file I/O and memory * management functionality using the standard C library. This can be * customised and replaced entirely by creating a mspack_system structure. * * A compressor or decompressor for the required format must be * instantiated before it can be used. Each construction function takes * one parameter, which is either a pointer to a custom mspack_system * structure, or NULL to use the default. The instantiation returned, if * not NULL, contains function pointers (methods) to work with the given * file format. * * For compression: * - mspack_create_cab_compressor() creates a mscab_compressor * - mspack_create_chm_compressor() creates a mschm_compressor * - mspack_create_lit_compressor() creates a mslit_compressor * - mspack_create_hlp_compressor() creates a mshlp_compressor * - mspack_create_szdd_compressor() creates a msszdd_compressor * - mspack_create_kwaj_compressor() creates a mskwaj_compressor * - mspack_create_oab_compressor() creates a msoab_compressor * * For decompression: * - mspack_create_cab_decompressor() creates a mscab_decompressor * - mspack_create_chm_decompressor() creates a mschm_decompressor * - mspack_create_lit_decompressor() creates a mslit_decompressor * - mspack_create_hlp_decompressor() creates a mshlp_decompressor * - mspack_create_szdd_decompressor() creates a msszdd_decompressor * - mspack_create_kwaj_decompressor() creates a mskwaj_decompressor * - mspack_create_oab_decompressor() creates a msoab_decompressor * * Once finished working with a format, each kind of * compressor/decompressor has its own specific destructor: * - mspack_destroy_cab_compressor() * - mspack_destroy_cab_decompressor() * - mspack_destroy_chm_compressor() * - mspack_destroy_chm_decompressor() * - mspack_destroy_lit_compressor() * - mspack_destroy_lit_decompressor() * - mspack_destroy_hlp_compressor() * - mspack_destroy_hlp_decompressor() * - mspack_destroy_szdd_compressor() * - mspack_destroy_szdd_decompressor() * - mspack_destroy_kwaj_compressor() * - mspack_destroy_kwaj_decompressor() * - mspack_destroy_oab_compressor() * - mspack_destroy_oab_decompressor() * * Destroying a compressor or decompressor does not destroy any objects, * structures or handles that have been created using that compressor or * decompressor. Ensure that everything created or opened is destroyed or * closed before compressor/decompressor is itself destroyed. * * \section errors Error codes * * All compressors and decompressors use the same set of error codes. Most * methods return an error code directly. For methods which do not * return error codes directly, the error code can be obtained with the * last_error() method. * * - #MSPACK_ERR_OK is used to indicate success. This error code is defined * as zero, all other code are non-zero. * - #MSPACK_ERR_ARGS indicates that a method was called with inappropriate * arguments. * - #MSPACK_ERR_OPEN indicates that mspack_system::open() failed. * - #MSPACK_ERR_READ indicates that mspack_system::read() failed. * - #MSPACK_ERR_WRITE indicates that mspack_system::write() failed. * - #MSPACK_ERR_SEEK indicates that mspack_system::seek() failed. * - #MSPACK_ERR_NOMEMORY indicates that mspack_system::alloc() failed. * - #MSPACK_ERR_SIGNATURE indicates that the file being read does not * have the correct "signature". It is probably not a valid file for * whatever format is being read. * - #MSPACK_ERR_DATAFORMAT indicates that the file being used or read * is corrupt. * - #MSPACK_ERR_CHECKSUM indicates that a data checksum has failed. * - #MSPACK_ERR_CRUNCH indicates an error occured during compression. * - #MSPACK_ERR_DECRUNCH indicates an error occured during decompression. * * \section threading Multi-threading * * libmspack methods are reentrant and multithreading-safe when each * thread has its own compressor or decompressor. * You should not call multiple methods simultaneously on a single * compressor or decompressor instance. * * If this may happen, you can either use one compressor or * decompressor per thread, or you can use your preferred lock, * semaphore or mutex library to ensure no more than one method on a * compressor/decompressor is called simultaneously. libmspack will * not do this locking for you. * * Example of incorrect behaviour: * - thread 1 calls mspack_create_cab_decompressor() * - thread 1 calls open() * - thread 1 calls extract() for one file * - thread 2 simultaneously calls extract() for another file * * Correct behaviour: * - thread 1 calls mspack_create_cab_decompressor() * - thread 2 calls mspack_create_cab_decompressor() * - thread 1 calls its own open() / extract() * - thread 2 simultaneously calls its own open() / extract() * * Also correct behaviour: * - thread 1 calls mspack_create_cab_decompressor() * - thread 1 locks a mutex for with the decompressor before * calling any methods on it, and unlocks the mutex after each * method returns. * - thread 1 can share the results of open() with thread 2, and both * can call extract(), provided they both guard against simultaneous * use of extract(), and any other methods, with the mutex */ #ifndef LIB_MSPACK_H #define LIB_MSPACK_H 1 #ifdef __cplusplus extern "C" { #endif #include #include /** * System self-test function, to ensure both library and calling program * can use one another. * * A result of MSPACK_ERR_OK means the library and caller are * compatible. Any other result indicates that the library and caller are * not compatible and should not be used. In particular, a value of * MSPACK_ERR_SEEK means the library and caller use different off_t * datatypes. * * It should be used like so: * * @code * int selftest_result; * MSPACK_SYS_SELFTEST(selftest_result); * if (selftest_result != MSPACK_ERR_OK) { * fprintf(stderr, "incompatible with this build of libmspack\n"); * exit(0); * } * @endcode * * @param result an int variable to store the result of the self-test */ #define MSPACK_SYS_SELFTEST(result) do { \ (result) = mspack_sys_selftest_internal(sizeof(off_t)); \ } while (0) /** Part of the MSPACK_SYS_SELFTEST() macro, must not be used directly. */ extern int mspack_sys_selftest_internal(int); /** * Enquire about the binary compatibility version of a specific interface in * the library. Currently, the following interfaces are defined: * * - #MSPACK_VER_LIBRARY: the overall library * - #MSPACK_VER_SYSTEM: the mspack_system interface * - #MSPACK_VER_MSCABD: the mscab_decompressor interface * - #MSPACK_VER_MSCABC: the mscab_compressor interface * - #MSPACK_VER_MSCHMD: the mschm_decompressor interface * - #MSPACK_VER_MSCHMC: the mschm_compressor interface * - #MSPACK_VER_MSLITD: the mslit_decompressor interface * - #MSPACK_VER_MSLITC: the mslit_compressor interface * - #MSPACK_VER_MSHLPD: the mshlp_decompressor interface * - #MSPACK_VER_MSHLPC: the mshlp_compressor interface * - #MSPACK_VER_MSSZDDD: the msszdd_decompressor interface * - #MSPACK_VER_MSSZDDC: the msszdd_compressor interface * - #MSPACK_VER_MSKWAJD: the mskwaj_decompressor interface * - #MSPACK_VER_MSKWAJC: the mskwaj_compressor interface * - #MSPACK_VER_MSOABD: the msoab_decompressor interface * - #MSPACK_VER_MSOABC: the msoab_compressor interface * * The result of the function should be interpreted as follows: * - -1: this interface is completely unknown to the library * - 0: this interface is known, but non-functioning * - 1: this interface has all basic functionality * - 2, 3, ...: this interface has additional functionality, clearly marked * in the documentation as "version 2", "version 3" and so on. * * @param entity the interface to request current version of * @return the version of the requested interface */ extern int mspack_version(int entity); /** Pass to mspack_version() to get the overall library version */ #define MSPACK_VER_LIBRARY (0) /** Pass to mspack_version() to get the mspack_system version */ #define MSPACK_VER_SYSTEM (1) /** Pass to mspack_version() to get the mscab_decompressor version */ #define MSPACK_VER_MSCABD (2) /** Pass to mspack_version() to get the mscab_compressor version */ #define MSPACK_VER_MSCABC (3) /** Pass to mspack_version() to get the mschm_decompressor version */ #define MSPACK_VER_MSCHMD (4) /** Pass to mspack_version() to get the mschm_compressor version */ #define MSPACK_VER_MSCHMC (5) /** Pass to mspack_version() to get the mslit_decompressor version */ #define MSPACK_VER_MSLITD (6) /** Pass to mspack_version() to get the mslit_compressor version */ #define MSPACK_VER_MSLITC (7) /** Pass to mspack_version() to get the mshlp_decompressor version */ #define MSPACK_VER_MSHLPD (8) /** Pass to mspack_version() to get the mshlp_compressor version */ #define MSPACK_VER_MSHLPC (9) /** Pass to mspack_version() to get the msszdd_decompressor version */ #define MSPACK_VER_MSSZDDD (10) /** Pass to mspack_version() to get the msszdd_compressor version */ #define MSPACK_VER_MSSZDDC (11) /** Pass to mspack_version() to get the mskwaj_decompressor version */ #define MSPACK_VER_MSKWAJD (12) /** Pass to mspack_version() to get the mskwaj_compressor version */ #define MSPACK_VER_MSKWAJC (13) /** Pass to mspack_version() to get the msoab_decompressor version */ #define MSPACK_VER_MSOABD (14) /** Pass to mspack_version() to get the msoab_compressor version */ #define MSPACK_VER_MSOABC (15) /* --- file I/O abstraction ------------------------------------------------ */ /** * A structure which abstracts file I/O and memory management. * * The library always uses the mspack_system structure for interaction * with the file system and to allocate, free and copy all memory. It also * uses it to send literal messages to the library user. * * When the library is compiled normally, passing NULL to a compressor or * decompressor constructor will result in a default mspack_system being * used, where all methods are implemented with the standard C library. * However, all constructors support being given a custom created * mspack_system structure, with the library user's own methods. This * allows for more abstract interaction, such as reading and writing files * directly to memory, or from a network socket or pipe. * * Implementors of an mspack_system structure should read all * documentation entries for every structure member, and write methods * which conform to those standards. */ struct mspack_system { /** * Opens a file for reading, writing, appending or updating. * * @param self a self-referential pointer to the mspack_system * structure whose open() method is being called. If * this pointer is required by close(), read(), write(), * seek() or tell(), it should be stored in the result * structure at this time. * @param filename the file to be opened. It is passed directly from the * library caller without being modified, so it is up to * the caller what this parameter actually represents. * @param mode one of #MSPACK_SYS_OPEN_READ (open an existing file * for reading), #MSPACK_SYS_OPEN_WRITE (open a new file * for writing), #MSPACK_SYS_OPEN_UPDATE (open an existing * file for reading/writing from the start of the file) or * #MSPACK_SYS_OPEN_APPEND (open an existing file for * reading/writing from the end of the file) * @return a pointer to a mspack_file structure. This structure officially * contains no members, its true contents are up to the * mspack_system implementor. It should contain whatever is needed * for other mspack_system methods to operate. Returning the NULL * pointer indicates an error condition. * @see close(), read(), write(), seek(), tell(), message() */ struct mspack_file * (*open)(struct mspack_system *self, const char *filename, int mode); /** * Closes a previously opened file. If any memory was allocated for this * particular file handle, it should be freed at this time. * * @param file the file to close * @see open() */ void (*close)(struct mspack_file *file); /** * Reads a given number of bytes from an open file. * * @param file the file to read from * @param buffer the location where the read bytes should be stored * @param bytes the number of bytes to read from the file. * @return the number of bytes successfully read (this can be less than * the number requested), zero to mark the end of file, or less * than zero to indicate an error. The library does not "retry" * reads and assumes short reads are due to EOF, so you should * avoid returning short reads because of transient errors. * @see open(), write() */ int (*read)(struct mspack_file *file, void *buffer, int bytes); /** * Writes a given number of bytes to an open file. * * @param file the file to write to * @param buffer the location where the written bytes should be read from * @param bytes the number of bytes to write to the file. * @return the number of bytes successfully written, this can be less * than the number requested. Zero or less can indicate an error * where no bytes at all could be written. All cases where less * bytes were written than requested are considered by the library * to be an error. * @see open(), read() */ int (*write)(struct mspack_file *file, void *buffer, int bytes); /** * Seeks to a specific file offset within an open file. * * Sometimes the library needs to know the length of a file. It does * this by seeking to the end of the file with seek(file, 0, * MSPACK_SYS_SEEK_END), then calling tell(). Implementations may want * to make a special case for this. * * Due to the potentially varying 32/64 bit datatype off_t on some * architectures, the #MSPACK_SYS_SELFTEST macro MUST be used before * using the library. If not, the error caused by the library passing an * inappropriate stackframe to seek() is subtle and hard to trace. * * @param file the file to be seeked * @param offset an offset to seek, measured in bytes * @param mode one of #MSPACK_SYS_SEEK_START (the offset should be * measured from the start of the file), #MSPACK_SYS_SEEK_CUR * (the offset should be measured from the current file offset) * or #MSPACK_SYS_SEEK_END (the offset should be measured from * the end of the file) * @return zero for success, non-zero for an error * @see open(), tell() */ int (*seek)(struct mspack_file *file, off_t offset, int mode); /** * Returns the current file position (in bytes) of the given file. * * @param file the file whose file position is wanted * @return the current file position of the file * @see open(), seek() */ off_t (*tell)(struct mspack_file *file); /** * Used to send messages from the library to the user. * * Occasionally, the library generates warnings or other messages in * plain english to inform the human user. These are informational only * and can be ignored if not wanted. * * @param file may be a file handle returned from open() if this message * pertains to a specific open file, or NULL if not related to * a specific file. * @param format a printf() style format string. It does NOT include a * trailing newline. * @see open() */ void (*message)(struct mspack_file *file, const char *format, ...); /** * Allocates memory. * * @param self a self-referential pointer to the mspack_system * structure whose alloc() method is being called. * @param bytes the number of bytes to allocate * @result a pointer to the requested number of bytes, or NULL if * not enough memory is available * @see free() */ void * (*alloc)(struct mspack_system *self, size_t bytes); /** * Frees memory. * * @param ptr the memory to be freed. NULL is accepted and ignored. * @see alloc() */ void (*free)(void *ptr); /** * Copies from one region of memory to another. * * The regions of memory are guaranteed not to overlap, are usually less * than 256 bytes, and may not be aligned. Please note that the source * parameter comes before the destination parameter, unlike the standard * C function memcpy(). * * @param src the region of memory to copy from * @param dest the region of memory to copy to * @param bytes the size of the memory region, in bytes */ void (*copy)(void *src, void *dest, size_t bytes); /** * A null pointer to mark the end of mspack_system. It must equal NULL. * * Should the mspack_system structure extend in the future, this NULL * will be seen, rather than have an invalid method pointer called. */ void *null_ptr; }; /** mspack_system::open() mode: open existing file for reading. */ #define MSPACK_SYS_OPEN_READ (0) /** mspack_system::open() mode: open new file for writing */ #define MSPACK_SYS_OPEN_WRITE (1) /** mspack_system::open() mode: open existing file for writing */ #define MSPACK_SYS_OPEN_UPDATE (2) /** mspack_system::open() mode: open existing file for writing */ #define MSPACK_SYS_OPEN_APPEND (3) /** mspack_system::seek() mode: seek relative to start of file */ #define MSPACK_SYS_SEEK_START (0) /** mspack_system::seek() mode: seek relative to current offset */ #define MSPACK_SYS_SEEK_CUR (1) /** mspack_system::seek() mode: seek relative to end of file */ #define MSPACK_SYS_SEEK_END (2) /** * A structure which represents an open file handle. The contents of this * structure are determined by the implementation of the * mspack_system::open() method. */ struct mspack_file { int dummy; }; /* --- error codes --------------------------------------------------------- */ /** Error code: no error */ #define MSPACK_ERR_OK (0) /** Error code: bad arguments to method */ #define MSPACK_ERR_ARGS (1) /** Error code: error opening file */ #define MSPACK_ERR_OPEN (2) /** Error code: error reading file */ #define MSPACK_ERR_READ (3) /** Error code: error writing file */ #define MSPACK_ERR_WRITE (4) /** Error code: seek error */ #define MSPACK_ERR_SEEK (5) /** Error code: out of memory */ #define MSPACK_ERR_NOMEMORY (6) /** Error code: bad "magic id" in file */ #define MSPACK_ERR_SIGNATURE (7) /** Error code: bad or corrupt file format */ #define MSPACK_ERR_DATAFORMAT (8) /** Error code: bad checksum or CRC */ #define MSPACK_ERR_CHECKSUM (9) /** Error code: error during compression */ #define MSPACK_ERR_CRUNCH (10) /** Error code: error during decompression */ #define MSPACK_ERR_DECRUNCH (11) /* --- functions available in library -------------------------------------- */ /** Creates a new CAB compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mscab_compressor or NULL */ extern struct mscab_compressor * mspack_create_cab_compressor(struct mspack_system *sys); /** Creates a new CAB decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mscab_decompressor or NULL */ extern struct mscab_decompressor * mspack_create_cab_decompressor(struct mspack_system *sys); /** Destroys an existing CAB compressor. * @param self the #mscab_compressor to destroy */ extern void mspack_destroy_cab_compressor(struct mscab_compressor *self); /** Destroys an existing CAB decompressor. * @param self the #mscab_decompressor to destroy */ extern void mspack_destroy_cab_decompressor(struct mscab_decompressor *self); /** Creates a new CHM compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mschm_compressor or NULL */ extern struct mschm_compressor * mspack_create_chm_compressor(struct mspack_system *sys); /** Creates a new CHM decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mschm_decompressor or NULL */ extern struct mschm_decompressor * mspack_create_chm_decompressor(struct mspack_system *sys); /** Destroys an existing CHM compressor. * @param self the #mschm_compressor to destroy */ extern void mspack_destroy_chm_compressor(struct mschm_compressor *self); /** Destroys an existing CHM decompressor. * @param self the #mschm_decompressor to destroy */ extern void mspack_destroy_chm_decompressor(struct mschm_decompressor *self); /** Creates a new LIT compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mslit_compressor or NULL */ extern struct mslit_compressor * mspack_create_lit_compressor(struct mspack_system *sys); /** Creates a new LIT decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mslit_decompressor or NULL */ extern struct mslit_decompressor * mspack_create_lit_decompressor(struct mspack_system *sys); /** Destroys an existing LIT compressor. * @param self the #mslit_compressor to destroy */ extern void mspack_destroy_lit_compressor(struct mslit_compressor *self); /** Destroys an existing LIT decompressor. * @param self the #mslit_decompressor to destroy */ extern void mspack_destroy_lit_decompressor(struct mslit_decompressor *self); /** Creates a new HLP compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mshlp_compressor or NULL */ extern struct mshlp_compressor * mspack_create_hlp_compressor(struct mspack_system *sys); /** Creates a new HLP decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mshlp_decompressor or NULL */ extern struct mshlp_decompressor * mspack_create_hlp_decompressor(struct mspack_system *sys); /** Destroys an existing hlp compressor. * @param self the #mshlp_compressor to destroy */ extern void mspack_destroy_hlp_compressor(struct mshlp_compressor *self); /** Destroys an existing hlp decompressor. * @param self the #mshlp_decompressor to destroy */ extern void mspack_destroy_hlp_decompressor(struct mshlp_decompressor *self); /** Creates a new SZDD compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #msszdd_compressor or NULL */ extern struct msszdd_compressor * mspack_create_szdd_compressor(struct mspack_system *sys); /** Creates a new SZDD decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #msszdd_decompressor or NULL */ extern struct msszdd_decompressor * mspack_create_szdd_decompressor(struct mspack_system *sys); /** Destroys an existing SZDD compressor. * @param self the #msszdd_compressor to destroy */ extern void mspack_destroy_szdd_compressor(struct msszdd_compressor *self); /** Destroys an existing SZDD decompressor. * @param self the #msszdd_decompressor to destroy */ extern void mspack_destroy_szdd_decompressor(struct msszdd_decompressor *self); /** Creates a new KWAJ compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mskwaj_compressor or NULL */ extern struct mskwaj_compressor * mspack_create_kwaj_compressor(struct mspack_system *sys); /** Creates a new KWAJ decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #mskwaj_decompressor or NULL */ extern struct mskwaj_decompressor * mspack_create_kwaj_decompressor(struct mspack_system *sys); /** Destroys an existing KWAJ compressor. * @param self the #mskwaj_compressor to destroy */ extern void mspack_destroy_kwaj_compressor(struct mskwaj_compressor *self); /** Destroys an existing KWAJ decompressor. * @param self the #mskwaj_decompressor to destroy */ extern void mspack_destroy_kwaj_decompressor(struct mskwaj_decompressor *self); /** Creates a new OAB compressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #msoab_compressor or NULL */ extern struct msoab_compressor * mspack_create_oab_compressor(struct mspack_system *sys); /** Creates a new OAB decompressor. * @param sys a custom mspack_system structure, or NULL to use the default * @return a #msoab_decompressor or NULL */ extern struct msoab_decompressor * mspack_create_oab_decompressor(struct mspack_system *sys); /** Destroys an existing OAB compressor. * @param self the #msoab_compressor to destroy */ extern void mspack_destroy_oab_compressor(struct msoab_compressor *self); /** Destroys an existing OAB decompressor. * @param self the #msoab_decompressor to destroy */ extern void mspack_destroy_oab_decompressor(struct msoab_decompressor *self); /* --- support for .CAB (MS Cabinet) file format --------------------------- */ /** * A structure which represents a single cabinet file. * * All fields are READ ONLY. * * If this cabinet is part of a merged cabinet set, the #files and #folders * fields are common to all cabinets in the set, and will be identical. * * @see mscab_decompressor::open(), mscab_decompressor::close(), * mscab_decompressor::search() */ struct mscabd_cabinet { /** * The next cabinet in a chained list, if this cabinet was opened with * mscab_decompressor::search(). May be NULL to mark the end of the * list. */ struct mscabd_cabinet *next; /** * The filename of the cabinet. More correctly, the filename of the * physical file that the cabinet resides in. This is given by the * library user and may be in any format. */ const char *filename; /** The file offset of cabinet within the physical file it resides in. */ off_t base_offset; /** The length of the cabinet file in bytes. */ unsigned int length; /** The previous cabinet in a cabinet set, or NULL. */ struct mscabd_cabinet *prevcab; /** The next cabinet in a cabinet set, or NULL. */ struct mscabd_cabinet *nextcab; /** The filename of the previous cabinet in a cabinet set, or NULL. */ char *prevname; /** The filename of the next cabinet in a cabinet set, or NULL. */ char *nextname; /** The name of the disk containing the previous cabinet in a cabinet * set, or NULL. */ char *previnfo; /** The name of the disk containing the next cabinet in a cabinet set, * or NULL. */ char *nextinfo; /** A list of all files in the cabinet or cabinet set. */ struct mscabd_file *files; /** A list of all folders in the cabinet or cabinet set. */ struct mscabd_folder *folders; /** * The set ID of the cabinet. All cabinets in the same set should have * the same set ID. */ unsigned short set_id; /** * The index number of the cabinet within the set. Numbering should * start from 0 for the first cabinet in the set, and increment by 1 for * each following cabinet. */ unsigned short set_index; /** * The number of bytes reserved in the header area of the cabinet. * * If this is non-zero and flags has MSCAB_HDR_RESV set, this data can * be read by the calling application. It is of the given length, * located at offset (base_offset + MSCAB_HDR_RESV_OFFSET) in the * cabinet file. * * @see flags */ unsigned short header_resv; /** * Header flags. * * - MSCAB_HDR_PREVCAB indicates the cabinet is part of a cabinet set, and * has a predecessor cabinet. * - MSCAB_HDR_NEXTCAB indicates the cabinet is part of a cabinet set, and * has a successor cabinet. * - MSCAB_HDR_RESV indicates the cabinet has reserved header space. * * @see prevname, previnfo, nextname, nextinfo, header_resv */ int flags; }; /** Offset from start of cabinet to the reserved header data (if present). */ #define MSCAB_HDR_RESV_OFFSET (0x28) /** Cabinet header flag: cabinet has a predecessor */ #define MSCAB_HDR_PREVCAB (0x01) /** Cabinet header flag: cabinet has a successor */ #define MSCAB_HDR_NEXTCAB (0x02) /** Cabinet header flag: cabinet has reserved header space */ #define MSCAB_HDR_RESV (0x04) /** * A structure which represents a single folder in a cabinet or cabinet set. * * All fields are READ ONLY. * * A folder is a single compressed stream of data. When uncompressed, it * holds the data of one or more files. A folder may be split across more * than one cabinet. */ struct mscabd_folder { /** * A pointer to the next folder in this cabinet or cabinet set, or NULL * if this is the final folder. */ struct mscabd_folder *next; /** * The compression format used by this folder. * * The macro MSCABD_COMP_METHOD() should be used on this field to get * the algorithm used. The macro MSCABD_COMP_LEVEL() should be used to get * the "compression level". * * @see MSCABD_COMP_METHOD(), MSCABD_COMP_LEVEL() */ int comp_type; /** * The total number of data blocks used by this folder. This includes * data blocks present in other files, if this folder spans more than * one cabinet. */ unsigned int num_blocks; }; /** * Returns the compression method used by a folder. * * @param comp_type a mscabd_folder::comp_type value * @return one of #MSCAB_COMP_NONE, #MSCAB_COMP_MSZIP, #MSCAB_COMP_QUANTUM * or #MSCAB_COMP_LZX */ #define MSCABD_COMP_METHOD(comp_type) ((comp_type) & 0x0F) /** * Returns the compression level used by a folder. * * @param comp_type a mscabd_folder::comp_type value * @return the compression level. This is only defined by LZX and Quantum * compression */ #define MSCABD_COMP_LEVEL(comp_type) (((comp_type) >> 8) & 0x1F) /** Compression mode: no compression. */ #define MSCAB_COMP_NONE (0) /** Compression mode: MSZIP (deflate) compression. */ #define MSCAB_COMP_MSZIP (1) /** Compression mode: Quantum compression */ #define MSCAB_COMP_QUANTUM (2) /** Compression mode: LZX compression */ #define MSCAB_COMP_LZX (3) /** * A structure which represents a single file in a cabinet or cabinet set. * * All fields are READ ONLY. */ struct mscabd_file { /** * The next file in the cabinet or cabinet set, or NULL if this is the * final file. */ struct mscabd_file *next; /** * The filename of the file. * * A null terminated string of up to 255 bytes in length, it may be in * either ISO-8859-1 or UTF8 format, depending on the file attributes. * * @see attribs */ char *filename; /** The uncompressed length of the file, in bytes. */ unsigned int length; /** * File attributes. * * The following attributes are defined: * - #MSCAB_ATTRIB_RDONLY indicates the file is write protected. * - #MSCAB_ATTRIB_HIDDEN indicates the file is hidden. * - #MSCAB_ATTRIB_SYSTEM indicates the file is a operating system file. * - #MSCAB_ATTRIB_ARCH indicates the file is "archived". * - #MSCAB_ATTRIB_EXEC indicates the file is an executable program. * - #MSCAB_ATTRIB_UTF_NAME indicates the filename is in UTF8 format rather * than ISO-8859-1. */ int attribs; /** File's last modified time, hour field. */ char time_h; /** File's last modified time, minute field. */ char time_m; /** File's last modified time, second field. */ char time_s; /** File's last modified date, day field. */ char date_d; /** File's last modified date, month field. */ char date_m; /** File's last modified date, year field. */ int date_y; /** A pointer to the folder that contains this file. */ struct mscabd_folder *folder; /** The uncompressed offset of this file in its folder. */ unsigned int offset; }; /** mscabd_file::attribs attribute: file is read-only. */ #define MSCAB_ATTRIB_RDONLY (0x01) /** mscabd_file::attribs attribute: file is hidden. */ #define MSCAB_ATTRIB_HIDDEN (0x02) /** mscabd_file::attribs attribute: file is an operating system file. */ #define MSCAB_ATTRIB_SYSTEM (0x04) /** mscabd_file::attribs attribute: file is "archived". */ #define MSCAB_ATTRIB_ARCH (0x20) /** mscabd_file::attribs attribute: file is an executable program. */ #define MSCAB_ATTRIB_EXEC (0x40) /** mscabd_file::attribs attribute: filename is UTF8, not ISO-8859-1. */ #define MSCAB_ATTRIB_UTF_NAME (0x80) /** mscab_decompressor::set_param() parameter: search buffer size. */ #define MSCABD_PARAM_SEARCHBUF (0) /** mscab_decompressor::set_param() parameter: repair MS-ZIP streams? */ #define MSCABD_PARAM_FIXMSZIP (1) /** mscab_decompressor::set_param() parameter: size of decompression buffer */ #define MSCABD_PARAM_DECOMPBUF (2) /** mscab_decompressor::set_param() parameter: salvage data from bad cabinets? * If enabled, open() will skip file with bad folder indices or filenames * rather than reject the whole cabinet, and extract() will limit rather than * reject files with invalid offsets and lengths, and bad data block checksums * will be ignored. Available only in CAB decoder version 2 and above. */ #define MSCABD_PARAM_SALVAGE (3) /** TODO */ struct mscab_compressor { int dummy; }; /** * A decompressor for .CAB (Microsoft Cabinet) files * * All fields are READ ONLY. * * @see mspack_create_cab_decompressor(), mspack_destroy_cab_decompressor() */ struct mscab_decompressor { /** * Opens a cabinet file and reads its contents. * * If the file opened is a valid cabinet file, all headers will be read * and a mscabd_cabinet structure will be returned, with a full list of * folders and files. * * In the case of an error occuring, NULL is returned and the error code * is available from last_error(). * * The filename pointer should be considered "in use" until close() is * called on the cabinet. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param filename the filename of the cabinet file. This is passed * directly to mspack_system::open(). * @return a pointer to a mscabd_cabinet structure, or NULL on failure * @see close(), search(), last_error() */ struct mscabd_cabinet * (*open) (struct mscab_decompressor *self, const char *filename); /** * Closes a previously opened cabinet or cabinet set. * * This closes a cabinet, all cabinets associated with it via the * mscabd_cabinet::next, mscabd_cabinet::prevcab and * mscabd_cabinet::nextcab pointers, and all folders and files. All * memory used by these entities is freed. * * The cabinet pointer is now invalid and cannot be used again. All * mscabd_folder and mscabd_file pointers from that cabinet or cabinet * set are also now invalid, and cannot be used again. * * If the cabinet pointer given was created using search(), it MUST be * the cabinet pointer returned by search() and not one of the later * cabinet pointers further along the mscabd_cabinet::next chain. * If extra cabinets have been added using append() or prepend(), these * will all be freed, even if the cabinet pointer given is not the first * cabinet in the set. Do NOT close() more than one cabinet in the set. * * The mscabd_cabinet::filename is not freed by the library, as it is * not allocated by the library. The caller should free this itself if * necessary, before it is lost forever. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param cab the cabinet to close * @see open(), search(), append(), prepend() */ void (*close)(struct mscab_decompressor *self, struct mscabd_cabinet *cab); /** * Searches a regular file for embedded cabinets. * * This opens a normal file with the given filename and will search the * entire file for embedded cabinet files * * If any cabinets are found, the equivalent of open() is called on each * potential cabinet file at the offset it was found. All successfully * open()ed cabinets are kept in a list. * * The first cabinet found will be returned directly as the result of * this method. Any further cabinets found will be chained in a list * using the mscabd_cabinet::next field. * * In the case of an error occuring anywhere other than the simulated * open(), NULL is returned and the error code is available from * last_error(). * * If no error occurs, but no cabinets can be found in the file, NULL is * returned and last_error() returns MSPACK_ERR_OK. * * The filename pointer should be considered in use until close() is * called on the cabinet. * * close() should only be called on the result of search(), not on any * subsequent cabinets in the mscabd_cabinet::next chain. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param filename the filename of the file to search for cabinets. This * is passed directly to mspack_system::open(). * @return a pointer to a mscabd_cabinet structure, or NULL * @see close(), open(), last_error() */ struct mscabd_cabinet * (*search) (struct mscab_decompressor *self, const char *filename); /** * Appends one mscabd_cabinet to another, forming or extending a cabinet * set. * * This will attempt to append one cabinet to another such that * (cab->nextcab == nextcab) && (nextcab->prevcab == cab) and * any folders split between the two cabinets are merged. * * The cabinets MUST be part of a cabinet set -- a cabinet set is a * cabinet that spans more than one physical cabinet file on disk -- and * must be appropriately matched. * * It can be determined if a cabinet has further parts to load by * examining the mscabd_cabinet::flags field: * * - if (flags & MSCAB_HDR_PREVCAB) is non-zero, there is a * predecessor cabinet to open() and prepend(). Its MS-DOS * case-insensitive filename is mscabd_cabinet::prevname * - if (flags & MSCAB_HDR_NEXTCAB) is non-zero, there is a * successor cabinet to open() and append(). Its MS-DOS case-insensitive * filename is mscabd_cabinet::nextname * * If the cabinets do not match, an error code will be returned. Neither * cabinet has been altered, and both should be closed seperately. * * Files and folders in a cabinet set are a single entity. All cabinets * in a set use the same file list, which is updated as cabinets in the * set are added. All pointers to mscabd_folder and mscabd_file * structures in either cabinet must be discarded and re-obtained after * merging. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param cab the cabinet which will be appended to, * predecessor of nextcab * @param nextcab the cabinet which will be appended, * successor of cab * @return an error code, or MSPACK_ERR_OK if successful * @see prepend(), open(), close() */ int (*append) (struct mscab_decompressor *self, struct mscabd_cabinet *cab, struct mscabd_cabinet *nextcab); /** * Prepends one mscabd_cabinet to another, forming or extending a * cabinet set. * * This will attempt to prepend one cabinet to another, such that * (cab->prevcab == prevcab) && (prevcab->nextcab == cab). In * all other respects, it is identical to append(). See append() for the * full documentation. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param cab the cabinet which will be prepended to, * successor of prevcab * @param prevcab the cabinet which will be prepended, * predecessor of cab * @return an error code, or MSPACK_ERR_OK if successful * @see append(), open(), close() */ int (*prepend) (struct mscab_decompressor *self, struct mscabd_cabinet *cab, struct mscabd_cabinet *prevcab); /** * Extracts a file from a cabinet or cabinet set. * * This extracts a compressed file in a cabinet and writes it to the given * filename. * * The MS-DOS filename of the file, mscabd_file::filename, is NOT USED * by extract(). The caller must examine this MS-DOS filename, copy and * change it as necessary, create directories as necessary, and provide * the correct filename as a parameter, which will be passed unchanged * to the decompressor's mspack_system::open() * * If the file belongs to a split folder in a multi-part cabinet set, * and not enough parts of the cabinet set have been loaded and appended * or prepended, an error will be returned immediately. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param file the file to be decompressed * @param filename the filename of the file being written to * @return an error code, or MSPACK_ERR_OK if successful */ int (*extract)(struct mscab_decompressor *self, struct mscabd_file *file, const char *filename); /** * Sets a CAB decompression engine parameter. * * The following parameters are defined: * - #MSCABD_PARAM_SEARCHBUF: How many bytes should be allocated as a * buffer when using search()? The minimum value is 4. The default * value is 32768. * - #MSCABD_PARAM_FIXMSZIP: If non-zero, extract() will ignore bad * checksums and recover from decompression errors in MS-ZIP * compressed folders. The default value is 0 (don't recover). * - #MSCABD_PARAM_DECOMPBUF: How many bytes should be used as an input * bit buffer by decompressors? The minimum value is 4. The default * value is 4096. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @param param the parameter to set * @param value the value to set the parameter to * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there * is a problem with either parameter or value. * @see search(), extract() */ int (*set_param)(struct mscab_decompressor *self, int param, int value); /** * Returns the error code set by the most recently called method. * * This is useful for open() and search(), which do not return an error * code directly. * * @param self a self-referential pointer to the mscab_decompressor * instance being called * @return the most recent error code * @see open(), search() */ int (*last_error)(struct mscab_decompressor *self); }; /* --- support for .CHM (HTMLHelp) file format ----------------------------- */ /** * A structure which represents a file to be placed in a CHM helpfile. * * A contiguous array of these structures should be passed to * mschm_compressor::generate(). The array list is terminated with an * entry whose mschmc_file::section field is set to #MSCHMC_ENDLIST, the * other fields in this entry are ignored. */ struct mschmc_file { /** One of #MSCHMC_ENDLIST, #MSCHMC_UNCOMP or #MSCHMC_MSCOMP. */ int section; /** The filename of the source file that will be added to the CHM. This * is passed directly to mspack_system::open(). */ const char *filename; /** The full path and filename of the file within the CHM helpfile, a * UTF-1 encoded null-terminated string. */ char *chm_filename; /** The length of the file, in bytes. This will be adhered to strictly * and a read error will be issued if this many bytes cannot be read * from the real file at CHM generation time. */ off_t length; }; /** * A structure which represents a section of a CHM helpfile. * * All fields are READ ONLY. * * Not used directly, but used as a generic base type for * mschmd_sec_uncompressed and mschmd_sec_mscompressed. */ struct mschmd_section { /** A pointer to the CHM helpfile that contains this section. */ struct mschmd_header *chm; /** * The section ID. Either 0 for the uncompressed section * mschmd_sec_uncompressed, or 1 for the LZX compressed section * mschmd_sec_mscompressed. No other section IDs are known. */ unsigned int id; }; /** * A structure which represents the uncompressed section of a CHM helpfile. * * All fields are READ ONLY. */ struct mschmd_sec_uncompressed { /** Generic section data. */ struct mschmd_section base; /** The file offset of where this section begins in the CHM helpfile. */ off_t offset; }; /** * A structure which represents the LZX compressed section of a CHM helpfile. * * All fields are READ ONLY. */ struct mschmd_sec_mscompressed { /** Generic section data. */ struct mschmd_section base; /** A pointer to the meta-file which represents all LZX compressed data. */ struct mschmd_file *content; /** A pointer to the file which contains the LZX control data. */ struct mschmd_file *control; /** A pointer to the file which contains the LZX reset table. */ struct mschmd_file *rtable; /** A pointer to the file which contains the LZX span information. * Available only in CHM decoder version 2 and above. */ struct mschmd_file *spaninfo; }; /** * A structure which represents a CHM helpfile. * * All fields are READ ONLY. */ struct mschmd_header { /** The version of the CHM file format used in this file. */ unsigned int version; /** * The "timestamp" of the CHM helpfile. * * It is the lower 32 bits of a 64-bit value representing the number of * centiseconds since 1601-01-01 00:00:00 UTC, plus 42. It is not useful * as a timestamp, but it is useful as a semi-unique ID. */ unsigned int timestamp; /** * The default Language and Country ID (LCID) of the user who ran the * HTMLHelp Compiler. This is not the language of the CHM file itself. */ unsigned int language; /** * The filename of the CHM helpfile. This is given by the library user * and may be in any format. */ const char *filename; /** The length of the CHM helpfile, in bytes. */ off_t length; /** A list of all non-system files in the CHM helpfile. */ struct mschmd_file *files; /** * A list of all system files in the CHM helpfile. * * System files are files which begin with "::". They are meta-files * generated by the CHM creation process. */ struct mschmd_file *sysfiles; /** The section 0 (uncompressed) data in this CHM helpfile. */ struct mschmd_sec_uncompressed sec0; /** The section 1 (MSCompressed) data in this CHM helpfile. */ struct mschmd_sec_mscompressed sec1; /** The file offset of the first PMGL/PMGI directory chunk. */ off_t dir_offset; /** The number of PMGL/PMGI directory chunks in this CHM helpfile. */ unsigned int num_chunks; /** The size of each PMGL/PMGI chunk, in bytes. */ unsigned int chunk_size; /** The "density" of the quick-reference section in PMGL/PMGI chunks. */ unsigned int density; /** The depth of the index tree. * * - if 1, there are no PMGI chunks, only PMGL chunks. * - if 2, there is 1 PMGI chunk. All chunk indices point to PMGL chunks. * - if 3, the root PMGI chunk points to secondary PMGI chunks, which in * turn point to PMGL chunks. * - and so on... */ unsigned int depth; /** * The number of the root PMGI chunk. * * If there is no index in the CHM helpfile, this will be 0xFFFFFFFF. */ unsigned int index_root; /** * The number of the first PMGL chunk. Usually zero. * Available only in CHM decoder version 2 and above. */ unsigned int first_pmgl; /** * The number of the last PMGL chunk. Usually num_chunks-1. * Available only in CHM decoder version 2 and above. */ unsigned int last_pmgl; /** * A cache of loaded chunks, filled in by mschm_decoder::fast_find(). * Available only in CHM decoder version 2 and above. */ unsigned char **chunk_cache; }; /** * A structure which represents a file stored in a CHM helpfile. * * All fields are READ ONLY. */ struct mschmd_file { /** * A pointer to the next file in the list, or NULL if this is the final * file. */ struct mschmd_file *next; /** * A pointer to the section that this file is located in. Indirectly, * it also points to the CHM helpfile the file is located in. */ struct mschmd_section *section; /** The offset within the section data that this file is located at. */ off_t offset; /** The length of this file, in bytes */ off_t length; /** The filename of this file -- a null terminated string in UTF-8. */ char *filename; }; /** mschmc_file::section value: end of CHM file list */ #define MSCHMC_ENDLIST (0) /** mschmc_file::section value: this file is in the Uncompressed section */ #define MSCHMC_UNCOMP (1) /** mschmc_file::section value: this file is in the MSCompressed section */ #define MSCHMC_MSCOMP (2) /** mschm_compressor::set_param() parameter: "timestamp" header */ #define MSCHMC_PARAM_TIMESTAMP (0) /** mschm_compressor::set_param() parameter: "language" header */ #define MSCHMC_PARAM_LANGUAGE (1) /** mschm_compressor::set_param() parameter: LZX window size */ #define MSCHMC_PARAM_LZXWINDOW (2) /** mschm_compressor::set_param() parameter: intra-chunk quickref density */ #define MSCHMC_PARAM_DENSITY (3) /** mschm_compressor::set_param() parameter: whether to create indices */ #define MSCHMC_PARAM_INDEX (4) /** * A compressor for .CHM (Microsoft HTMLHelp) files. * * All fields are READ ONLY. * * @see mspack_create_chm_compressor(), mspack_destroy_chm_compressor() */ struct mschm_compressor { /** * Generates a CHM help file. * * The help file will contain up to two sections, an Uncompressed * section and potentially an MSCompressed (LZX compressed) * section. * * While the contents listing of a CHM file is always in lexical order, * the file list passed in will be taken as the correct order for files * within the sections. It is in your interest to place similar files * together for better compression. * * There are two modes of generation, to use a temporary file or not to * use one. See use_temporary_file() for the behaviour of generate() in * these two different modes. * * @param self a self-referential pointer to the mschm_compressor * instance being called * @param file_list an array of mschmc_file structures, terminated * with an entry whose mschmc_file::section field is * #MSCHMC_ENDLIST. The order of the list is * preserved within each section. The length of any * mschmc_file::chm_filename string cannot exceed * roughly 4096 bytes. Each source file must be able * to supply as many bytes as given in the * mschmc_file::length field. * @param output_file the file to write the generated CHM helpfile to. * This is passed directly to mspack_system::open() * @return an error code, or MSPACK_ERR_OK if successful * @see use_temporary_file() set_param() */ int (*generate)(struct mschm_compressor *self, struct mschmc_file file_list[], const char *output_file); /** * Specifies whether a temporary file is used during CHM generation. * * The CHM file format includes data about the compressed section (such * as its overall size) that is stored in the output CHM file prior to * the compressed section itself. This unavoidably requires that the * compressed section has to be generated, before these details can be * set. There are several ways this can be handled. Firstly, the * compressed section could be generated entirely in memory before * writing any of the output CHM file. This approach is not used in * libmspack, as the compressed section can exceed the addressable * memory space on most architectures. * * libmspack has two options, either to write these unknowable sections * with blank data, generate the compressed section, then re-open the * output file for update once the compressed section has been * completed, or to write the compressed section to a temporary file, * then write the entire output file at once, performing a simple * file-to-file copy for the compressed section. * * The simple solution of buffering the entire compressed section in * memory can still be used, if desired. As the temporary file's * filename is passed directly to mspack_system::open(), it is possible * for a custom mspack_system implementation to hold this file in memory, * without writing to a disk. * * If a temporary file is set, generate() performs the following * sequence of events: the temporary file is opened for writing, the * compression algorithm writes to the temporary file, the temporary * file is closed. Then the output file is opened for writing and the * temporary file is re-opened for reading. The output file is written * and the temporary file is read from. Both files are then closed. The * temporary file itself is not deleted. If that is desired, the * temporary file should be deleted after the completion of generate(), * if it exists. * * If a temporary file is set not to be used, generate() performs the * following sequence of events: the output file is opened for writing, * then it is written and closed. The output file is then re-opened for * update, the appropriate sections are seek()ed to and re-written, then * the output file is closed. * * @param self a self-referential pointer to the * mschm_compressor instance being called * @param use_temp_file non-zero if the temporary file should be used, * zero if the temporary file should not be used. * @param temp_file a file to temporarily write compressed data to, * before opening it for reading and copying the * contents to the output file. This is passed * directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful * @see generate() */ int (*use_temporary_file)(struct mschm_compressor *self, int use_temp_file, const char *temp_file); /** * Sets a CHM compression engine parameter. * * The following parameters are defined: * - #MSCHMC_PARAM_TIMESTAMP: Sets the "timestamp" of the CHM file * generated. This is not a timestamp, see mschmd_header::timestamp * for a description. If this timestamp is 0, generate() will use its * own algorithm for making a unique ID, based on the lengths and * names of files in the CHM itself. Defaults to 0, any value between * 0 and (2^32)-1 is valid. * - #MSCHMC_PARAM_LANGUAGE: Sets the "language" of the CHM file * generated. This is not the language used in the CHM file, but the * language setting of the user who ran the HTMLHelp compiler. It * defaults to 0x0409. The valid range is between 0x0000 and 0x7F7F. * - #MSCHMC_PARAM_LZXWINDOW: Sets the size of the LZX history window, * which is also the interval at which the compressed data stream can be * randomly accessed. The value is not a size in bytes, but a power of * two. The default value is 16 (which makes the window 2^16 bytes, or * 64 kilobytes), the valid range is from 15 (32 kilobytes) to 21 (2 * megabytes). * - #MSCHMC_PARAM_DENSITY: Sets the "density" of quick reference * entries stored at the end of directory listing chunk. Each chunk is * 4096 bytes in size, and contains as many file entries as there is * room for. At the other end of the chunk, a list of "quick reference" * pointers is included. The offset of every 'N'th file entry is given a * quick reference, where N = (2^density) + 1. The default density is * 2. The smallest density is 0 (N=2), the maximum is 10 (N=1025). As * each file entry requires at least 5 bytes, the maximum number of * entries in a single chunk is roughly 800, so the maximum value 10 * can be used to indicate there are no quickrefs at all. * - #MSCHMC_PARAM_INDEX: Sets whether or not to include quick lookup * index chunk(s), in addition to normal directory listing chunks. A * value of zero means no index chunks will be created, a non-zero value * means index chunks will be created. The default is zero, "don't * create an index". * * @param self a self-referential pointer to the mschm_compressor * instance being called * @param param the parameter to set * @param value the value to set the parameter to * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there * is a problem with either parameter or value. * @see generate() */ int (*set_param)(struct mschm_compressor *self, int param, unsigned int value); /** * Returns the error code set by the most recently called method. * * @param self a self-referential pointer to the mschm_compressor * instance being called * @return the most recent error code * @see set_param(), generate() */ int (*last_error)(struct mschm_compressor *self); }; /** * A decompressor for .CHM (Microsoft HTMLHelp) files * * All fields are READ ONLY. * * @see mspack_create_chm_decompressor(), mspack_destroy_chm_decompressor() */ struct mschm_decompressor { /** * Opens a CHM helpfile and reads its contents. * * If the file opened is a valid CHM helpfile, all headers will be read * and a mschmd_header structure will be returned, with a full list of * files. * * In the case of an error occuring, NULL is returned and the error code * is available from last_error(). * * The filename pointer should be considered "in use" until close() is * called on the CHM helpfile. * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @param filename the filename of the CHM helpfile. This is passed * directly to mspack_system::open(). * @return a pointer to a mschmd_header structure, or NULL on failure * @see close() */ struct mschmd_header *(*open)(struct mschm_decompressor *self, const char *filename); /** * Closes a previously opened CHM helpfile. * * This closes a CHM helpfile, frees the mschmd_header and all * mschmd_file structures associated with it (if any). This works on * both helpfiles opened with open() and helpfiles opened with * fast_open(). * * The CHM header pointer is now invalid and cannot be used again. All * mschmd_file pointers referencing that CHM are also now invalid, and * cannot be used again. * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @param chm the CHM helpfile to close * @see open(), fast_open() */ void (*close)(struct mschm_decompressor *self, struct mschmd_header *chm); /** * Extracts a file from a CHM helpfile. * * This extracts a file from a CHM helpfile and writes it to the given * filename. The filename of the file, mscabd_file::filename, is not * used by extract(), but can be used by the caller as a guide for * constructing an appropriate filename. * * This method works both with files found in the mschmd_header::files * and mschmd_header::sysfiles list and mschmd_file structures generated * on the fly by fast_find(). * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @param file the file to be decompressed * @param filename the filename of the file being written to * @return an error code, or MSPACK_ERR_OK if successful */ int (*extract)(struct mschm_decompressor *self, struct mschmd_file *file, const char *filename); /** * Returns the error code set by the most recently called method. * * This is useful for open() and fast_open(), which do not return an * error code directly. * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @return the most recent error code * @see open(), extract() */ int (*last_error)(struct mschm_decompressor *self); /** * Opens a CHM helpfile quickly. * * If the file opened is a valid CHM helpfile, only essential headers * will be read. A mschmd_header structure will be still be returned, as * with open(), but the mschmd_header::files field will be NULL. No * files details will be automatically read. The fast_find() method * must be used to obtain file details. * * In the case of an error occuring, NULL is returned and the error code * is available from last_error(). * * The filename pointer should be considered "in use" until close() is * called on the CHM helpfile. * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @param filename the filename of the CHM helpfile. This is passed * directly to mspack_system::open(). * @return a pointer to a mschmd_header structure, or NULL on failure * @see open(), close(), fast_find(), extract() */ struct mschmd_header *(*fast_open)(struct mschm_decompressor *self, const char *filename); /** * Finds file details quickly. * * Instead of reading all CHM helpfile headers and building a list of * files, fast_open() and fast_find() are intended for finding file * details only when they are needed. The CHM file format includes an * on-disk file index to allow this. * * Given a case-sensitive filename, fast_find() will search the on-disk * index for that file. * * If the file was found, the caller-provided mschmd_file structure will * be filled out like so: * - section: the correct value for the found file * - offset: the correct value for the found file * - length: the correct value for the found file * - all other structure elements: NULL or 0 * * If the file was not found, MSPACK_ERR_OK will still be returned as the * result, but the caller-provided structure will be filled out like so: * - section: NULL * - offset: 0 * - length: 0 * - all other structure elements: NULL or 0 * * This method is intended to be used in conjunction with CHM helpfiles * opened with fast_open(), but it also works with helpfiles opened * using the regular open(). * * @param self a self-referential pointer to the mschm_decompressor * instance being called * @param chm the CHM helpfile to search for the file * @param filename the filename of the file to search for * @param f_ptr a pointer to a caller-provded mschmd_file structure * @param f_size sizeof(struct mschmd_file) * @return an error code, or MSPACK_ERR_OK if successful * @see open(), close(), fast_find(), extract() */ int (*fast_find)(struct mschm_decompressor *self, struct mschmd_header *chm, const char *filename, struct mschmd_file *f_ptr, int f_size); }; /* --- support for .LIT (EBook) file format -------------------------------- */ /** TODO */ struct mslit_compressor { int dummy; }; /** TODO */ struct mslit_decompressor { int dummy; }; /* --- support for .HLP (MS Help) file format ------------------------------ */ /** TODO */ struct mshlp_compressor { int dummy; }; /** TODO */ struct mshlp_decompressor { int dummy; }; /* --- support for SZDD file format ---------------------------------------- */ /** msszdd_compressor::set_param() parameter: the missing character */ #define MSSZDDC_PARAM_MISSINGCHAR (0) /** msszddd_header::format value - a regular SZDD file */ #define MSSZDD_FMT_NORMAL (0) /** msszddd_header::format value - a special QBasic SZDD file */ #define MSSZDD_FMT_QBASIC (1) /** * A structure which represents an SZDD compressed file. * * All fields are READ ONLY. */ struct msszddd_header { /** The file format; either #MSSZDD_FMT_NORMAL or #MSSZDD_FMT_QBASIC */ int format; /** The amount of data in the SZDD file once uncompressed. */ off_t length; /** * The last character in the filename, traditionally replaced with an * underscore to show the file is compressed. The null character is used * to show that this character has not been stored (e.g. because the * filename is not known). Generally, only characters that may appear in * an MS-DOS filename (except ".") are valid. */ char missing_char; }; /** * A compressor for the SZDD file format. * * All fields are READ ONLY. * * @see mspack_create_szdd_compressor(), mspack_destroy_szdd_compressor() */ struct msszdd_compressor { /** * Reads an input file and creates a compressed output file in the * SZDD compressed file format. The SZDD compression format is quick * but gives poor compression. It is possible for the compressed output * file to be larger than the input file. * * Conventionally, SZDD compressed files have the final character in * their filename replaced with an underscore, to show they are * compressed. The missing character is stored in the compressed file * itself. This is due to the restricted filename conventions of MS-DOS, * most operating systems, such as UNIX, simply append another file * extension to the existing filename. As mspack does not deal with * filenames, this is left up to you. If you wish to set the missing * character stored in the file header, use set_param() with the * #MSSZDDC_PARAM_MISSINGCHAR parameter. * * "Stream" compression (where the length of the input data is not * known) is not possible. The length of the input data is stored in the * header of the SZDD file and must therefore be known before any data * is compressed. Due to technical limitations of the file format, the * maximum size of uncompressed file that will be accepted is 2147483647 * bytes. * * @param self a self-referential pointer to the msszdd_compressor * instance being called * @param input the name of the file to compressed. This is passed * passed directly to mspack_system::open() * @param output the name of the file to write compressed data to. * This is passed directly to mspack_system::open(). * @param length the length of the uncompressed file, or -1 to indicate * that this should be determined automatically by using * mspack_system::seek() on the input file. * @return an error code, or MSPACK_ERR_OK if successful * @see set_param() */ int (*compress)(struct msszdd_compressor *self, const char *input, const char *output, off_t length); /** * Sets an SZDD compression engine parameter. * * The following parameters are defined: * - #MSSZDDC_PARAM_CHARACTER: the "missing character", the last character * in the uncompressed file's filename, which is traditionally replaced * with an underscore to show the file is compressed. Traditionally, * this can only be a character that is a valid part of an MS-DOS, * filename, but libmspack permits any character between 0x00 and 0xFF * to be stored. 0x00 is the default, and it represents "no character * stored". * * @param self a self-referential pointer to the msszdd_compressor * instance being called * @param param the parameter to set * @param value the value to set the parameter to * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there * is a problem with either parameter or value. * @see compress() */ int (*set_param)(struct msszdd_compressor *self, int param, unsigned int value); /** * Returns the error code set by the most recently called method. * * @param self a self-referential pointer to the msszdd_compressor * instance being called * @return the most recent error code * @see compress() */ int (*last_error)(struct mschm_decompressor *self); }; /** * A decompressor for SZDD compressed files. * * All fields are READ ONLY. * * @see mspack_create_szdd_decompressor(), mspack_destroy_szdd_decompressor() */ struct msszdd_decompressor { /** * Opens a SZDD file and reads the header. * * If the file opened is a valid SZDD file, all headers will be read and * a msszddd_header structure will be returned. * * In the case of an error occuring, NULL is returned and the error code * is available from last_error(). * * The filename pointer should be considered "in use" until close() is * called on the SZDD file. * * @param self a self-referential pointer to the msszdd_decompressor * instance being called * @param filename the filename of the SZDD compressed file. This is * passed directly to mspack_system::open(). * @return a pointer to a msszddd_header structure, or NULL on failure * @see close() */ struct msszddd_header *(*open)(struct msszdd_decompressor *self, const char *filename); /** * Closes a previously opened SZDD file. * * This closes a SZDD file and frees the msszddd_header associated with * it. * * The SZDD header pointer is now invalid and cannot be used again. * * @param self a self-referential pointer to the msszdd_decompressor * instance being called * @param szdd the SZDD file to close * @see open() */ void (*close)(struct msszdd_decompressor *self, struct msszddd_header *szdd); /** * Extracts the compressed data from a SZDD file. * * This decompresses the compressed SZDD data stream and writes it to * an output file. * * @param self a self-referential pointer to the msszdd_decompressor * instance being called * @param szdd the SZDD file to extract data from * @param filename the filename to write the decompressed data to. This * is passed directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*extract)(struct msszdd_decompressor *self, struct msszddd_header *szdd, const char *filename); /** * Decompresses an SZDD file to an output file in one step. * * This opens an SZDD file as input, reads the header, then decompresses * the compressed data immediately to an output file, finally closing * both the input and output file. It is more convenient to use than * open() then extract() then close(), if you do not need to know the * SZDD output size or missing character. * * @param self a self-referential pointer to the msszdd_decompressor * instance being called * @param input the filename of the input SZDD file. This is passed * directly to mspack_system::open(). * @param output the filename to write the decompressed data to. This * is passed directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*decompress)(struct msszdd_decompressor *self, const char *input, const char *output); /** * Returns the error code set by the most recently called method. * * This is useful for open() which does not return an * error code directly. * * @param self a self-referential pointer to the msszdd_decompressor * instance being called * @return the most recent error code * @see open(), extract(), decompress() */ int (*last_error)(struct msszdd_decompressor *self); }; /* --- support for KWAJ file format ---------------------------------------- */ /** mskwaj_compressor::set_param() parameter: compression type */ #define MSKWAJC_PARAM_COMP_TYPE (0) /** mskwaj_compressor::set_param() parameter: include the length of the * uncompressed file in the header? */ #define MSKWAJC_PARAM_INCLUDE_LENGTH (1) /** KWAJ compression type: no compression. */ #define MSKWAJ_COMP_NONE (0) /** KWAJ compression type: no compression, 0xFF XOR "encryption". */ #define MSKWAJ_COMP_XOR (1) /** KWAJ compression type: LZSS (same method as SZDD) */ #define MSKWAJ_COMP_SZDD (2) /** KWAJ compression type: LZ+Huffman compression */ #define MSKWAJ_COMP_LZH (3) /** KWAJ compression type: MSZIP */ #define MSKWAJ_COMP_MSZIP (4) /** KWAJ optional header flag: decompressed file length is included */ #define MSKWAJ_HDR_HASLENGTH (0x01) /** KWAJ optional header flag: unknown 2-byte structure is included */ #define MSKWAJ_HDR_HASUNKNOWN1 (0x02) /** KWAJ optional header flag: unknown multi-sized structure is included */ #define MSKWAJ_HDR_HASUNKNOWN2 (0x04) /** KWAJ optional header flag: file name (no extension) is included */ #define MSKWAJ_HDR_HASFILENAME (0x08) /** KWAJ optional header flag: file extension is included */ #define MSKWAJ_HDR_HASFILEEXT (0x10) /** KWAJ optional header flag: extra text is included */ #define MSKWAJ_HDR_HASEXTRATEXT (0x20) /** * A structure which represents an KWAJ compressed file. * * All fields are READ ONLY. */ struct mskwajd_header { /** The compression type; should be one of #MSKWAJ_COMP_NONE, * #MSKWAJ_COMP_XOR, #MSKWAJ_COMP_SZDD or #MSKWAJ_COMP_LZH */ unsigned short comp_type; /** The offset in the file where the compressed data stream begins */ off_t data_offset; /** Flags indicating which optional headers were included. */ int headers; /** The amount of uncompressed data in the file, or 0 if not present. */ off_t length; /** output filename, or NULL if not present */ char *filename; /** extra uncompressed data (usually text) in the header. * This data can contain nulls so use extra_length to get the size. */ char *extra; /** length of extra uncompressed data in the header */ unsigned short extra_length; }; /** * A compressor for the KWAJ file format. * * All fields are READ ONLY. * * @see mspack_create_kwaj_compressor(), mspack_destroy_kwaj_compressor() */ struct mskwaj_compressor { /** * Reads an input file and creates a compressed output file in the * KWAJ compressed file format. The KWAJ compression format is quick * but gives poor compression. It is possible for the compressed output * file to be larger than the input file. * * @param self a self-referential pointer to the mskwaj_compressor * instance being called * @param input the name of the file to compressed. This is passed * passed directly to mspack_system::open() * @param output the name of the file to write compressed data to. * This is passed directly to mspack_system::open(). * @param length the length of the uncompressed file, or -1 to indicate * that this should be determined automatically by using * mspack_system::seek() on the input file. * @return an error code, or MSPACK_ERR_OK if successful * @see set_param() */ int (*compress)(struct mskwaj_compressor *self, const char *input, const char *output, off_t length); /** * Sets an KWAJ compression engine parameter. * * The following parameters are defined: * * - #MSKWAJC_PARAM_COMP_TYPE: the compression method to use. Must * be one of #MSKWAJC_COMP_NONE, #MSKWAJC_COMP_XOR, #MSKWAJ_COMP_SZDD * or #MSKWAJ_COMP_LZH. The default is #MSKWAJ_COMP_LZH. * * - #MSKWAJC_PARAM_INCLUDE_LENGTH: a boolean; should the compressed * output file should include the uncompressed length of the input * file in the header? This adds 4 bytes to the size of the output * file. A value of zero says "no", non-zero says "yes". The default * is "no". * * @param self a self-referential pointer to the mskwaj_compressor * instance being called * @param param the parameter to set * @param value the value to set the parameter to * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there * is a problem with either parameter or value. * @see generate() */ int (*set_param)(struct mskwaj_compressor *self, int param, unsigned int value); /** * Sets the original filename of the file before compression, * which will be stored in the header of the output file. * * The filename should be a null-terminated string, it must be an * MS-DOS "8.3" type filename (up to 8 bytes for the filename, then * optionally a "." and up to 3 bytes for a filename extension). * * If NULL is passed as the filename, no filename is included in the * header. This is the default. * * @param self a self-referential pointer to the mskwaj_compressor * instance being called * @param filename the original filename to use * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if the * filename is too long */ int (*set_filename)(struct mskwaj_compressor *self, const char *filename); /** * Sets arbitrary data that will be stored in the header of the * output file, uncompressed. It can be up to roughly 64 kilobytes, * as the overall size of the header must not exceed 65535 bytes. * The data can contain null bytes if desired. * * If NULL is passed as the data pointer, or zero is passed as the * length, no extra data is included in the header. This is the * default. * * @param self a self-referential pointer to the mskwaj_compressor * instance being called * @param data a pointer to the data to be stored in the header * @param bytes the length of the data in bytes * @return MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS extra data * is too long */ int (*set_extra_data)(struct mskwaj_compressor *self, void *data, size_t bytes); /** * Returns the error code set by the most recently called method. * * @param self a self-referential pointer to the mskwaj_compressor * instance being called * @return the most recent error code * @see compress() */ int (*last_error)(struct mschm_decompressor *self); }; /** * A decompressor for KWAJ compressed files. * * All fields are READ ONLY. * * @see mspack_create_kwaj_decompressor(), mspack_destroy_kwaj_decompressor() */ struct mskwaj_decompressor { /** * Opens a KWAJ file and reads the header. * * If the file opened is a valid KWAJ file, all headers will be read and * a mskwajd_header structure will be returned. * * In the case of an error occuring, NULL is returned and the error code * is available from last_error(). * * The filename pointer should be considered "in use" until close() is * called on the KWAJ file. * * @param self a self-referential pointer to the mskwaj_decompressor * instance being called * @param filename the filename of the KWAJ compressed file. This is * passed directly to mspack_system::open(). * @return a pointer to a mskwajd_header structure, or NULL on failure * @see close() */ struct mskwajd_header *(*open)(struct mskwaj_decompressor *self, const char *filename); /** * Closes a previously opened KWAJ file. * * This closes a KWAJ file and frees the mskwajd_header associated * with it. The KWAJ header pointer is now invalid and cannot be * used again. * * @param self a self-referential pointer to the mskwaj_decompressor * instance being called * @param kwaj the KWAJ file to close * @see open() */ void (*close)(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj); /** * Extracts the compressed data from a KWAJ file. * * This decompresses the compressed KWAJ data stream and writes it to * an output file. * * @param self a self-referential pointer to the mskwaj_decompressor * instance being called * @param kwaj the KWAJ file to extract data from * @param filename the filename to write the decompressed data to. This * is passed directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*extract)(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj, const char *filename); /** * Decompresses an KWAJ file to an output file in one step. * * This opens an KWAJ file as input, reads the header, then decompresses * the compressed data immediately to an output file, finally closing * both the input and output file. It is more convenient to use than * open() then extract() then close(), if you do not need to know the * KWAJ output size or output filename. * * @param self a self-referential pointer to the mskwaj_decompressor * instance being called * @param input the filename of the input KWAJ file. This is passed * directly to mspack_system::open(). * @param output the filename to write the decompressed data to. This * is passed directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*decompress)(struct mskwaj_decompressor *self, const char *input, const char *output); /** * Returns the error code set by the most recently called method. * * This is useful for open() which does not return an * error code directly. * * @param self a self-referential pointer to the mskwaj_decompressor * instance being called * @return the most recent error code * @see open(), search() */ int (*last_error)(struct mskwaj_decompressor *self); }; /* --- support for .LZX (Offline Address Book) file format ----------------- */ /** * A compressor for the Offline Address Book (OAB) format. * * All fields are READ ONLY. * * @see mspack_create_oab_compressor(), mspack_destroy_oab_compressor() */ struct msoab_compressor { /** * Compress a full OAB file. * * The input file will be read and the compressed contents written to the * output file. * * @param self a self-referential pointer to the msoab_decompressor * instance being called * @param input the filename of the input file. This is passed * directly to mspack_system::open(). * @param output the filename of the output file. This is passed * directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*compress) (struct msoab_compressor *self, const char *input, const char *output); /** * Generate a compressed incremental OAB patch file. * * The two uncompressed files "input" and "base" will be read, and an * incremental patch to generate "input" from "base" will be written to * the output file. * * @param self a self-referential pointer to the msoab_compressor * instance being called * @param input the filename of the input file containing the new * version of its contents. This is passed directly * to mspack_system::open(). * @param base the filename of the original base file containing * the old version of its contents, against which the * incremental patch shall generated. This is passed * directly to mspack_system::open(). * @param output the filename of the output file. This is passed * directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*compress_incremental) (struct msoab_compressor *self, const char *input, const char *base, const char *output); }; /** * A decompressor for .LZX (Offline Address Book) files * * All fields are READ ONLY. * * @see mspack_create_oab_decompressor(), mspack_destroy_oab_decompressor() */ struct msoab_decompressor { /** * Decompresses a full Offline Address Book file. * * If the input file is a valid compressed Offline Address Book file, * it will be read and the decompressed contents will be written to * the output file. * * @param self a self-referential pointer to the msoab_decompressor * instance being called * @param input the filename of the input file. This is passed * directly to mspack_system::open(). * @param output the filename of the output file. This is passed * directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*decompress) (struct msoab_decompressor *self, const char *input, const char *output); /** * Decompresses an Offline Address Book with an incremental patch file. * * This requires both a full UNCOMPRESSED Offline Address Book file to * act as the "base", and a compressed incremental patch file as input. * If the input file is valid, it will be decompressed with reference to * the base file, and the decompressed contents will be written to the * output file. * * There is no way to tell what the right base file is for the given * incremental patch, but if you get it wrong, this will usually result * in incorrect data being decompressed, which will then fail a checksum * test. * * @param self a self-referential pointer to the msoab_decompressor * instance being called * @param input the filename of the input file. This is passed * directly to mspack_system::open(). * @param base the filename of the base file to which the * incremental patch shall be applied. This is passed * directly to mspack_system::open(). * @param output the filename of the output file. This is passed * directly to mspack_system::open(). * @return an error code, or MSPACK_ERR_OK if successful */ int (*decompress_incremental) (struct msoab_decompressor *self, const char *input, const char *base, const char *output); }; #ifdef __cplusplus } #endif #endif cabextract-1.9/mspack/mszipd.c0000664000175000017500000004155013370027445013370 00000000000000/* This file is part of libmspack. * (C) 2003-2010 Stuart Caie. * * The deflate method was created by Phil Katz. MSZIP is equivalent to the * deflate method. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ /* MS-ZIP decompression implementation. */ #include #include /* import bit-reading macros and code */ #define BITS_TYPE struct mszipd_stream #define BITS_VAR zip #define BITS_ORDER_LSB #define BITS_LSB_TABLE #define READ_BYTES do { \ READ_IF_NEEDED; \ INJECT_BITS(*i_ptr++, 8); \ } while (0) #include /* import huffman macros and code */ #define TABLEBITS(tbl) MSZIP_##tbl##_TABLEBITS #define MAXSYMBOLS(tbl) MSZIP_##tbl##_MAXSYMBOLS #define HUFF_TABLE(tbl,idx) zip->tbl##_table[idx] #define HUFF_LEN(tbl,idx) zip->tbl##_len[idx] #define HUFF_ERROR return INF_ERR_HUFFSYM #include #define FLUSH_IF_NEEDED do { \ if (zip->window_posn == MSZIP_FRAME_SIZE) { \ if (zip->flush_window(zip, MSZIP_FRAME_SIZE)) { \ return INF_ERR_FLUSH; \ } \ zip->window_posn = 0; \ } \ } while (0) /* match lengths for literal codes 257.. 285 */ static const unsigned short lit_lengths[29] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; /* match offsets for distance codes 0 .. 29 */ static const unsigned short dist_offsets[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; /* extra bits required for literal codes 257.. 285 */ static const unsigned char lit_extrabits[29] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; /* extra bits required for distance codes 0 .. 29 */ static const unsigned char dist_extrabits[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; /* the order of the bit length Huffman code lengths */ static const unsigned char bitlen_order[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; /* inflate() error codes */ #define INF_ERR_BLOCKTYPE (-1) /* unknown block type */ #define INF_ERR_COMPLEMENT (-2) /* block size complement mismatch */ #define INF_ERR_FLUSH (-3) /* error from flush_window() callback */ #define INF_ERR_BITBUF (-4) /* too many bits in bit buffer */ #define INF_ERR_SYMLENS (-5) /* too many symbols in blocktype 2 header */ #define INF_ERR_BITLENTBL (-6) /* failed to build bitlens huffman table */ #define INF_ERR_LITERALTBL (-7) /* failed to build literals huffman table */ #define INF_ERR_DISTANCETBL (-8) /* failed to build distance huffman table */ #define INF_ERR_BITOVERRUN (-9) /* bitlen RLE code goes over table size */ #define INF_ERR_BADBITLEN (-10) /* invalid bit-length code */ #define INF_ERR_LITCODE (-11) /* out-of-range literal code */ #define INF_ERR_DISTCODE (-12) /* out-of-range distance code */ #define INF_ERR_DISTANCE (-13) /* somehow, distance is beyond 32k */ #define INF_ERR_HUFFSYM (-14) /* out of bits decoding huffman symbol */ static int zip_read_lens(struct mszipd_stream *zip) { /* for the bit buffer and huffman decoding */ register unsigned int bit_buffer; register int bits_left; unsigned char *i_ptr, *i_end; /* bitlen Huffman codes -- immediate lookup, 7 bit max code length */ unsigned short bl_table[(1 << 7)]; unsigned char bl_len[19]; unsigned char lens[MSZIP_LITERAL_MAXSYMBOLS + MSZIP_DISTANCE_MAXSYMBOLS]; unsigned int lit_codes, dist_codes, code, last_code=0, bitlen_codes, i, run; RESTORE_BITS; /* read the number of codes */ READ_BITS(lit_codes, 5); lit_codes += 257; READ_BITS(dist_codes, 5); dist_codes += 1; READ_BITS(bitlen_codes, 4); bitlen_codes += 4; if (lit_codes > MSZIP_LITERAL_MAXSYMBOLS) return INF_ERR_SYMLENS; if (dist_codes > MSZIP_DISTANCE_MAXSYMBOLS) return INF_ERR_SYMLENS; /* read in the bit lengths in their unusual order */ for (i = 0; i < bitlen_codes; i++) READ_BITS(bl_len[bitlen_order[i]], 3); while (i < 19) bl_len[bitlen_order[i++]] = 0; /* create decoding table with an immediate lookup */ if (make_decode_table(19, 7, &bl_len[0], &bl_table[0])) { return INF_ERR_BITLENTBL; } /* read literal / distance code lengths */ for (i = 0; i < (lit_codes + dist_codes); i++) { /* single-level huffman lookup */ ENSURE_BITS(7); code = bl_table[PEEK_BITS(7)]; REMOVE_BITS(bl_len[code]); if (code < 16) lens[i] = last_code = code; else { switch (code) { case 16: READ_BITS(run, 2); run += 3; code = last_code; break; case 17: READ_BITS(run, 3); run += 3; code = 0; break; case 18: READ_BITS(run, 7); run += 11; code = 0; break; default: D(("bad code!: %u", code)) return INF_ERR_BADBITLEN; } if ((i + run) > (lit_codes + dist_codes)) return INF_ERR_BITOVERRUN; while (run--) lens[i++] = code; i--; } } /* copy LITERAL code lengths and clear any remaining */ i = lit_codes; zip->sys->copy(&lens[0], &zip->LITERAL_len[0], i); while (i < MSZIP_LITERAL_MAXSYMBOLS) zip->LITERAL_len[i++] = 0; i = dist_codes; zip->sys->copy(&lens[lit_codes], &zip->DISTANCE_len[0], i); while (i < MSZIP_DISTANCE_MAXSYMBOLS) zip->DISTANCE_len[i++] = 0; STORE_BITS; return 0; } /* a clean implementation of RFC 1951 / inflate */ static int inflate(struct mszipd_stream *zip) { unsigned int last_block, block_type, distance, length, this_run, i; /* for the bit buffer and huffman decoding */ register unsigned int bit_buffer; register int bits_left; register unsigned short sym; unsigned char *i_ptr, *i_end; RESTORE_BITS; do { /* read in last block bit */ READ_BITS(last_block, 1); /* read in block type */ READ_BITS(block_type, 2); if (block_type == 0) { /* uncompressed block */ unsigned char lens_buf[4]; /* go to byte boundary */ i = bits_left & 7; REMOVE_BITS(i); /* read 4 bytes of data, emptying the bit-buffer if necessary */ for (i = 0; (bits_left >= 8); i++) { if (i == 4) return INF_ERR_BITBUF; lens_buf[i] = PEEK_BITS(8); REMOVE_BITS(8); } if (bits_left != 0) return INF_ERR_BITBUF; while (i < 4) { READ_IF_NEEDED; lens_buf[i++] = *i_ptr++; } /* get the length and its complement */ length = lens_buf[0] | (lens_buf[1] << 8); i = lens_buf[2] | (lens_buf[3] << 8); if (length != (~i & 0xFFFF)) return INF_ERR_COMPLEMENT; /* read and copy the uncompressed data into the window */ while (length > 0) { READ_IF_NEEDED; this_run = length; if (this_run > (unsigned int)(i_end - i_ptr)) this_run = i_end - i_ptr; if (this_run > (MSZIP_FRAME_SIZE - zip->window_posn)) this_run = MSZIP_FRAME_SIZE - zip->window_posn; zip->sys->copy(i_ptr, &zip->window[zip->window_posn], this_run); zip->window_posn += this_run; i_ptr += this_run; length -= this_run; FLUSH_IF_NEEDED; } } else if ((block_type == 1) || (block_type == 2)) { /* Huffman-compressed LZ77 block */ unsigned int match_posn, code; if (block_type == 1) { /* block with fixed Huffman codes */ i = 0; while (i < 144) zip->LITERAL_len[i++] = 8; while (i < 256) zip->LITERAL_len[i++] = 9; while (i < 280) zip->LITERAL_len[i++] = 7; while (i < 288) zip->LITERAL_len[i++] = 8; for (i = 0; i < 32; i++) zip->DISTANCE_len[i] = 5; } else { /* block with dynamic Huffman codes */ STORE_BITS; if ((i = zip_read_lens(zip))) return i; RESTORE_BITS; } /* now huffman lengths are read for either kind of block, * create huffman decoding tables */ if (make_decode_table(MSZIP_LITERAL_MAXSYMBOLS, MSZIP_LITERAL_TABLEBITS, &zip->LITERAL_len[0], &zip->LITERAL_table[0])) { return INF_ERR_LITERALTBL; } if (make_decode_table(MSZIP_DISTANCE_MAXSYMBOLS,MSZIP_DISTANCE_TABLEBITS, &zip->DISTANCE_len[0], &zip->DISTANCE_table[0])) { return INF_ERR_DISTANCETBL; } /* decode forever until end of block code */ for (;;) { READ_HUFFSYM(LITERAL, code); if (code < 256) { zip->window[zip->window_posn++] = (unsigned char) code; FLUSH_IF_NEEDED; } else if (code == 256) { /* END OF BLOCK CODE: loop break point */ break; } else { code -= 257; /* codes 257-285 are matches */ if (code >= 29) return INF_ERR_LITCODE; /* codes 286-287 are illegal */ READ_BITS_T(length, lit_extrabits[code]); length += lit_lengths[code]; READ_HUFFSYM(DISTANCE, code); if (code >= 30) return INF_ERR_DISTCODE; READ_BITS_T(distance, dist_extrabits[code]); distance += dist_offsets[code]; /* match position is window position minus distance. If distance * is more than window position numerically, it must 'wrap * around' the frame size. */ match_posn = ((distance > zip->window_posn) ? MSZIP_FRAME_SIZE : 0) + zip->window_posn - distance; /* copy match */ if (length < 12) { /* short match, use slower loop but no loop setup code */ while (length--) { zip->window[zip->window_posn++] = zip->window[match_posn++]; match_posn &= MSZIP_FRAME_SIZE - 1; FLUSH_IF_NEEDED; } } else { /* longer match, use faster loop but with setup expense */ unsigned char *runsrc, *rundest; do { this_run = length; if ((match_posn + this_run) > MSZIP_FRAME_SIZE) this_run = MSZIP_FRAME_SIZE - match_posn; if ((zip->window_posn + this_run) > MSZIP_FRAME_SIZE) this_run = MSZIP_FRAME_SIZE - zip->window_posn; rundest = &zip->window[zip->window_posn]; zip->window_posn += this_run; runsrc = &zip->window[match_posn]; match_posn += this_run; length -= this_run; while (this_run--) *rundest++ = *runsrc++; if (match_posn == MSZIP_FRAME_SIZE) match_posn = 0; FLUSH_IF_NEEDED; } while (length > 0); } } /* else (code >= 257) */ } /* for(;;) -- break point at 'code == 256' */ } else { /* block_type == 3 -- bad block type */ return INF_ERR_BLOCKTYPE; } } while (!last_block); /* flush the remaining data */ if (zip->window_posn) { if (zip->flush_window(zip, zip->window_posn)) return INF_ERR_FLUSH; } STORE_BITS; /* return success */ return 0; } /* inflate() calls this whenever the window should be flushed. As * MSZIP only expands to the size of the window, the implementation used * simply keeps track of the amount of data flushed, and if more than 32k * is flushed, an error is raised. */ static int mszipd_flush_window(struct mszipd_stream *zip, unsigned int data_flushed) { zip->bytes_output += data_flushed; if (zip->bytes_output > MSZIP_FRAME_SIZE) { D(("overflow: %u bytes flushed, total is now %u", data_flushed, zip->bytes_output)) return 1; } return 0; } struct mszipd_stream *mszipd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int input_buffer_size, int repair_mode) { struct mszipd_stream *zip; if (!system) return NULL; /* round up input buffer size to multiple of two */ input_buffer_size = (input_buffer_size + 1) & -2; if (input_buffer_size < 2) return NULL; /* allocate decompression state */ if (!(zip = (struct mszipd_stream *) system->alloc(system, sizeof(struct mszipd_stream)))) { return NULL; } /* allocate input buffer */ zip->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size); if (!zip->inbuf) { system->free(zip); return NULL; } /* initialise decompression state */ zip->sys = system; zip->input = input; zip->output = output; zip->inbuf_size = input_buffer_size; zip->input_end = 0; zip->error = MSPACK_ERR_OK; zip->repair_mode = repair_mode; zip->flush_window = &mszipd_flush_window; zip->i_ptr = zip->i_end = &zip->inbuf[0]; zip->o_ptr = zip->o_end = NULL; zip->bit_buffer = 0; zip->bits_left = 0; return zip; } int mszipd_decompress(struct mszipd_stream *zip, off_t out_bytes) { /* for the bit buffer */ register unsigned int bit_buffer; register int bits_left; unsigned char *i_ptr, *i_end; int i, state, error; /* easy answers */ if (!zip || (out_bytes < 0)) return MSPACK_ERR_ARGS; if (zip->error) return zip->error; /* flush out any stored-up bytes before we begin */ i = zip->o_end - zip->o_ptr; if ((off_t) i > out_bytes) i = (int) out_bytes; if (i) { if (zip->sys->write(zip->output, zip->o_ptr, i) != i) { return zip->error = MSPACK_ERR_WRITE; } zip->o_ptr += i; out_bytes -= i; } if (out_bytes == 0) return MSPACK_ERR_OK; while (out_bytes > 0) { /* unpack another block */ RESTORE_BITS; /* skip to next read 'CK' header */ i = bits_left & 7; REMOVE_BITS(i); /* align to bytestream */ state = 0; do { READ_BITS(i, 8); if (i == 'C') state = 1; else if ((state == 1) && (i == 'K')) state = 2; else state = 0; } while (state != 2); /* inflate a block, repair and realign if necessary */ zip->window_posn = 0; zip->bytes_output = 0; STORE_BITS; if ((error = inflate(zip))) { D(("inflate error %d", error)) if (zip->repair_mode) { /* recover partially-inflated buffers */ if (zip->bytes_output == 0 && zip->window_posn > 0) { zip->flush_window(zip, zip->window_posn); } zip->sys->message(NULL, "MSZIP error, %u bytes of data lost.", MSZIP_FRAME_SIZE - zip->bytes_output); for (i = zip->bytes_output; i < MSZIP_FRAME_SIZE; i++) { zip->window[i] = '\0'; } zip->bytes_output = MSZIP_FRAME_SIZE; } else { return zip->error = (error > 0) ? error : MSPACK_ERR_DECRUNCH; } } zip->o_ptr = &zip->window[0]; zip->o_end = &zip->o_ptr[zip->bytes_output]; /* write a frame */ i = (out_bytes < (off_t)zip->bytes_output) ? (int)out_bytes : zip->bytes_output; if (zip->sys->write(zip->output, zip->o_ptr, i) != i) { return zip->error = MSPACK_ERR_WRITE; } /* mspack errors (i.e. read errors) are fatal and can't be recovered */ if ((error > 0) && zip->repair_mode) return error; zip->o_ptr += i; out_bytes -= i; } if (out_bytes) { D(("bytes left to output")) return zip->error = MSPACK_ERR_DECRUNCH; } return MSPACK_ERR_OK; } int mszipd_decompress_kwaj(struct mszipd_stream *zip) { /* for the bit buffer */ register unsigned int bit_buffer; register int bits_left; unsigned char *i_ptr, *i_end; int i, error, block_len; /* unpack blocks until block_len == 0 */ for (;;) { RESTORE_BITS; /* align to bytestream, read block_len */ i = bits_left & 7; REMOVE_BITS(i); READ_BITS(block_len, 8); READ_BITS(i, 8); block_len |= i << 8; if (block_len == 0) break; /* read "CK" header */ READ_BITS(i, 8); if (i != 'C') return MSPACK_ERR_DATAFORMAT; READ_BITS(i, 8); if (i != 'K') return MSPACK_ERR_DATAFORMAT; /* inflate block */ zip->window_posn = 0; zip->bytes_output = 0; STORE_BITS; if ((error = inflate(zip))) { D(("inflate error %d", error)) return zip->error = (error > 0) ? error : MSPACK_ERR_DECRUNCH; } /* write inflated block */ if (zip->sys->write(zip->output, &zip->window[0], zip->bytes_output) != zip->bytes_output) return zip->error = MSPACK_ERR_WRITE; } return MSPACK_ERR_OK; } void mszipd_free(struct mszipd_stream *zip) { struct mspack_system *sys; if (zip) { sys = zip->sys; sys->free(zip->inbuf); sys->free(zip); } } cabextract-1.9/mspack/readhuff.h0000664000175000017500000001445613370027445013660 00000000000000/* This file is part of libmspack. * (C) 2003-2014 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ #ifndef MSPACK_READHUFF_H #define MSPACK_READHUFF_H 1 /* This implements a fast Huffman tree decoding system. */ #if !(defined(BITS_ORDER_MSB) || defined(BITS_ORDER_LSB)) # error "readhuff.h is used in conjunction with readbits.h, include that first" #endif #if !(defined(TABLEBITS) && defined(MAXSYMBOLS)) # error "define TABLEBITS(tbl) and MAXSYMBOLS(tbl) before using readhuff.h" #endif #if !(defined(HUFF_TABLE) && defined(HUFF_LEN)) # error "define HUFF_TABLE(tbl) and HUFF_LEN(tbl) before using readhuff.h" #endif #ifndef HUFF_ERROR # error "define HUFF_ERROR before using readhuff.h" #endif #ifndef HUFF_MAXBITS # define HUFF_MAXBITS 16 #endif /* Decodes the next huffman symbol from the input bitstream into var. * Do not use this macro on a table unless build_decode_table() succeeded. */ #define READ_HUFFSYM(tbl, var) do { \ ENSURE_BITS(HUFF_MAXBITS); \ sym = HUFF_TABLE(tbl, PEEK_BITS(TABLEBITS(tbl))); \ if (sym >= MAXSYMBOLS(tbl)) HUFF_TRAVERSE(tbl); \ (var) = sym; \ i = HUFF_LEN(tbl, sym); \ REMOVE_BITS(i); \ } while (0) #ifdef BITS_ORDER_LSB # define HUFF_TRAVERSE(tbl) do { \ i = TABLEBITS(tbl) - 1; \ do { \ if (i++ > HUFF_MAXBITS) HUFF_ERROR; \ sym = HUFF_TABLE(tbl, \ (sym << 1) | ((bit_buffer >> i) & 1)); \ } while (sym >= MAXSYMBOLS(tbl)); \ } while (0) #else #define HUFF_TRAVERSE(tbl) do { \ i = 1 << (BITBUF_WIDTH - TABLEBITS(tbl)); \ do { \ if ((i >>= 1) == 0) HUFF_ERROR; \ sym = HUFF_TABLE(tbl, \ (sym << 1) | ((bit_buffer & i) ? 1 : 0)); \ } while (sym >= MAXSYMBOLS(tbl)); \ } while (0) #endif /* make_decode_table(nsyms, nbits, length[], table[]) * * This function was originally coded by David Tritscher. * It builds a fast huffman decoding table from * a canonical huffman code lengths table. * * nsyms = total number of symbols in this huffman tree. * nbits = any symbols with a code length of nbits or less can be decoded * in one lookup of the table. * length = A table to get code lengths from [0 to nsyms-1] * table = The table to fill up with decoded symbols and pointers. * Should be ((1<> 1; /* don't do 0 length codes */ /* fill entries for codes short enough for a direct mapping */ for (bit_num = 1; bit_num <= nbits; bit_num++) { for (sym = 0; sym < nsyms; sym++) { if (length[sym] != bit_num) continue; #ifdef BITS_ORDER_MSB leaf = pos; #else /* reverse the significant bits */ fill = length[sym]; reverse = pos >> (nbits - fill); leaf = 0; do {leaf <<= 1; leaf |= reverse & 1; reverse >>= 1;} while (--fill); #endif if((pos += bit_mask) > table_mask) return 1; /* table overrun */ /* fill all possible lookups of this symbol with the symbol itself */ #ifdef BITS_ORDER_MSB for (fill = bit_mask; fill-- > 0;) table[leaf++] = sym; #else fill = bit_mask; next_symbol = 1 << bit_num; do { table[leaf] = sym; leaf += next_symbol; } while (--fill); #endif } bit_mask >>= 1; } /* exit with success if table is now complete */ if (pos == table_mask) return 0; /* mark all remaining table entries as unused */ for (sym = pos; sym < table_mask; sym++) { #ifdef BITS_ORDER_MSB table[sym] = 0xFFFF; #else reverse = sym; leaf = 0; fill = nbits; do { leaf <<= 1; leaf |= reverse & 1; reverse >>= 1; } while (--fill); table[leaf] = 0xFFFF; #endif } /* next_symbol = base of allocation for long codes */ next_symbol = ((table_mask >> 1) < nsyms) ? nsyms : (table_mask >> 1); /* give ourselves room for codes to grow by up to 16 more bits. * codes now start at bit nbits+16 and end at (nbits+16-codelength) */ pos <<= 16; table_mask <<= 16; bit_mask = 1 << 15; for (bit_num = nbits+1; bit_num <= HUFF_MAXBITS; bit_num++) { for (sym = 0; sym < nsyms; sym++) { if (length[sym] != bit_num) continue; if (pos >= table_mask) return 1; /* table overflow */ #ifdef BITS_ORDER_MSB leaf = pos >> 16; #else /* leaf = the first nbits of the code, reversed */ reverse = pos >> 16; leaf = 0; fill = nbits; do {leaf <<= 1; leaf |= reverse & 1; reverse >>= 1;} while (--fill); #endif for (fill = 0; fill < (bit_num - nbits); fill++) { /* if this path hasn't been taken yet, 'allocate' two entries */ if (table[leaf] == 0xFFFF) { table[(next_symbol << 1) ] = 0xFFFF; table[(next_symbol << 1) + 1 ] = 0xFFFF; table[leaf] = next_symbol++; } /* follow the path and select either left or right for next bit */ leaf = table[leaf] << 1; if ((pos >> (15-fill)) & 1) leaf++; } table[leaf] = sym; pos += bit_mask; } bit_mask >>= 1; } /* full table? */ return (pos == table_mask) ? 0 : 1; } #endif cabextract-1.9/mspack/cabd.c0000664000175000017500000014256313370027445012761 00000000000000/* This file is part of libmspack. * (C) 2003-2018 Stuart Caie. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ /* Cabinet (.CAB) files are a form of file archive. Each cabinet contains * "folders", which are compressed spans of data. Each cabinet has * "files", whose metadata is in the cabinet header, but whose actual data * is stored compressed in one of the "folders". Cabinets can span more * than one physical file on disk, in which case they are a "cabinet set", * and usually the last folder of each cabinet extends into the next * cabinet. * * For a complete description of the format, see the MSDN site: * http://msdn.microsoft.com/en-us/library/bb267310.aspx */ /* CAB decompression implementation */ #include #include #include #include #include /* Notes on compliance with cabinet specification: * * One of the main changes between cabextract 0.6 and libmspack's cab * decompressor is the move from block-oriented decompression to * stream-oriented decompression. * * cabextract would read one data block from disk, decompress it with the * appropriate method, then write the decompressed data. The CAB * specification is specifically designed to work like this, as it ensures * compression matches do not span the maximum decompressed block size * limit of 32kb. * * However, the compression algorithms used are stream oriented, with * specific hacks added to them to enforce the "individual 32kb blocks" * rule in CABs. In other file formats, they do not have this limitation. * * In order to make more generalised decompressors, libmspack's CAB * decompressor has moved from being block-oriented to more stream * oriented. This also makes decompression slightly faster. * * However, this leads to incompliance with the CAB specification. The * CAB controller can no longer ensure each block of input given to the * decompressors is matched with their output. The "decompressed size" of * each individual block is thrown away. * * Each CAB block is supposed to be seen as individually compressed. This * means each consecutive data block can have completely different * "uncompressed" sizes, ranging from 1 to 32768 bytes. However, in * reality, all data blocks in a folder decompress to exactly 32768 bytes, * excepting the final block. * * Given this situation, the decompression algorithms are designed to * realign their input bitstreams on 32768 output-byte boundaries, and * various other special cases have been made. libmspack will not * correctly decompress LZX or Quantum compressed folders where the blocks * do not follow this "32768 bytes until last block" pattern. It could be * implemented if needed, but hopefully this is not necessary -- it has * not been seen in over 3Gb of CAB archives. */ /* prototypes */ static struct mscabd_cabinet * cabd_open( struct mscab_decompressor *base, const char *filename); static void cabd_close( struct mscab_decompressor *base, struct mscabd_cabinet *origcab); static int cabd_read_headers( struct mspack_system *sys, struct mspack_file *fh, struct mscabd_cabinet_p *cab, off_t offset, int salvage, int quiet); static char *cabd_read_string( struct mspack_system *sys, struct mspack_file *fh, int *error); static struct mscabd_cabinet *cabd_search( struct mscab_decompressor *base, const char *filename); static int cabd_find( struct mscab_decompressor_p *self, unsigned char *buf, struct mspack_file *fh, const char *filename, off_t flen, off_t *firstlen, struct mscabd_cabinet_p **firstcab); static int cabd_prepend( struct mscab_decompressor *base, struct mscabd_cabinet *cab, struct mscabd_cabinet *prevcab); static int cabd_append( struct mscab_decompressor *base, struct mscabd_cabinet *cab, struct mscabd_cabinet *nextcab); static int cabd_merge( struct mscab_decompressor *base, struct mscabd_cabinet *lcab, struct mscabd_cabinet *rcab); static int cabd_can_merge_folders( struct mspack_system *sys, struct mscabd_folder_p *lfol, struct mscabd_folder_p *rfol); static int cabd_extract( struct mscab_decompressor *base, struct mscabd_file *file, const char *filename); static int cabd_init_decomp( struct mscab_decompressor_p *self, unsigned int ct); static void cabd_free_decomp( struct mscab_decompressor_p *self); static int cabd_sys_read( struct mspack_file *file, void *buffer, int bytes); static int cabd_sys_write( struct mspack_file *file, void *buffer, int bytes); static int cabd_sys_read_block( struct mspack_system *sys, struct mscabd_decompress_state *d, int *out, int ignore_cksum, int ignore_blocksize); static unsigned int cabd_checksum( unsigned char *data, unsigned int bytes, unsigned int cksum); static struct noned_state *noned_init( struct mspack_system *sys, struct mspack_file *in, struct mspack_file *out, int bufsize); static int noned_decompress( struct noned_state *s, off_t bytes); static void noned_free( struct noned_state *state); static int cabd_param( struct mscab_decompressor *base, int param, int value); static int cabd_error( struct mscab_decompressor *base); /*************************************** * MSPACK_CREATE_CAB_DECOMPRESSOR *************************************** * constructor */ struct mscab_decompressor * mspack_create_cab_decompressor(struct mspack_system *sys) { struct mscab_decompressor_p *self = NULL; if (!sys) sys = mspack_default_system; if (!mspack_valid_system(sys)) return NULL; if ((self = (struct mscab_decompressor_p *) sys->alloc(sys, sizeof(struct mscab_decompressor_p)))) { self->base.open = &cabd_open; self->base.close = &cabd_close; self->base.search = &cabd_search; self->base.extract = &cabd_extract; self->base.prepend = &cabd_prepend; self->base.append = &cabd_append; self->base.set_param = &cabd_param; self->base.last_error = &cabd_error; self->system = sys; self->d = NULL; self->error = MSPACK_ERR_OK; self->param[MSCABD_PARAM_SEARCHBUF] = 32768; self->param[MSCABD_PARAM_FIXMSZIP] = 0; self->param[MSCABD_PARAM_DECOMPBUF] = 4096; self->param[MSCABD_PARAM_SALVAGE] = 0; } return (struct mscab_decompressor *) self; } /*************************************** * MSPACK_DESTROY_CAB_DECOMPRESSOR *************************************** * destructor */ void mspack_destroy_cab_decompressor(struct mscab_decompressor *base) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; if (self) { struct mspack_system *sys = self->system; if (self->d) { if (self->d->infh) sys->close(self->d->infh); cabd_free_decomp(self); sys->free(self->d); } sys->free(self); } } /*************************************** * CABD_OPEN *************************************** * opens a file and tries to read it as a cabinet file */ static struct mscabd_cabinet *cabd_open(struct mscab_decompressor *base, const char *filename) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; struct mscabd_cabinet_p *cab = NULL; struct mspack_system *sys; struct mspack_file *fh; int error; if (!base) return NULL; sys = self->system; if ((fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ))) { if ((cab = (struct mscabd_cabinet_p *) sys->alloc(sys, sizeof(struct mscabd_cabinet_p)))) { cab->base.filename = filename; error = cabd_read_headers(sys, fh, cab, (off_t) 0, self->param[MSCABD_PARAM_SALVAGE], 0); if (error) { cabd_close(base, (struct mscabd_cabinet *) cab); cab = NULL; } self->error = error; } else { self->error = MSPACK_ERR_NOMEMORY; } sys->close(fh); } else { self->error = MSPACK_ERR_OPEN; } return (struct mscabd_cabinet *) cab; } /*************************************** * CABD_CLOSE *************************************** * frees all memory associated with a given mscabd_cabinet. */ static void cabd_close(struct mscab_decompressor *base, struct mscabd_cabinet *origcab) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; struct mscabd_folder_data *dat, *ndat; struct mscabd_cabinet *cab, *ncab; struct mscabd_folder *fol, *nfol; struct mscabd_file *fi, *nfi; struct mspack_system *sys; if (!base) return; sys = self->system; self->error = MSPACK_ERR_OK; while (origcab) { /* free files */ for (fi = origcab->files; fi; fi = nfi) { nfi = fi->next; sys->free(fi->filename); sys->free(fi); } /* free folders */ for (fol = origcab->folders; fol; fol = nfol) { nfol = fol->next; /* free folder decompression state if it has been decompressed */ if (self->d && (self->d->folder == (struct mscabd_folder_p *) fol)) { if (self->d->infh) sys->close(self->d->infh); cabd_free_decomp(self); sys->free(self->d); self->d = NULL; } /* free folder data segments */ for (dat = ((struct mscabd_folder_p *)fol)->data.next; dat; dat = ndat) { ndat = dat->next; sys->free(dat); } sys->free(fol); } /* free predecessor cabinets (and the original cabinet's strings) */ for (cab = origcab; cab; cab = ncab) { ncab = cab->prevcab; sys->free(cab->prevname); sys->free(cab->nextname); sys->free(cab->previnfo); sys->free(cab->nextinfo); if (cab != origcab) sys->free(cab); } /* free successor cabinets */ for (cab = origcab->nextcab; cab; cab = ncab) { ncab = cab->nextcab; sys->free(cab->prevname); sys->free(cab->nextname); sys->free(cab->previnfo); sys->free(cab->nextinfo); sys->free(cab); } /* free actual cabinet structure */ cab = origcab->next; sys->free(origcab); /* repeat full procedure again with the cab->next pointer (if set) */ origcab = cab; } } /*************************************** * CABD_READ_HEADERS *************************************** * reads the cabinet file header, folder list and file list. * fills out a pre-existing mscabd_cabinet structure, allocates memory * for folders and files as necessary */ static int cabd_read_headers(struct mspack_system *sys, struct mspack_file *fh, struct mscabd_cabinet_p *cab, off_t offset, int salvage, int quiet) { int num_folders, num_files, folder_resv, i, x, err, fidx; struct mscabd_folder_p *fol, *linkfol = NULL; struct mscabd_file *file, *linkfile = NULL; unsigned char buf[64]; /* initialise pointers */ cab->base.next = NULL; cab->base.files = NULL; cab->base.folders = NULL; cab->base.prevcab = cab->base.nextcab = NULL; cab->base.prevname = cab->base.nextname = NULL; cab->base.previnfo = cab->base.nextinfo = NULL; cab->base.base_offset = offset; /* seek to CFHEADER */ if (sys->seek(fh, offset, MSPACK_SYS_SEEK_START)) { return MSPACK_ERR_SEEK; } /* read in the CFHEADER */ if (sys->read(fh, &buf[0], cfhead_SIZEOF) != cfhead_SIZEOF) { return MSPACK_ERR_READ; } /* check for "MSCF" signature */ if (EndGetI32(&buf[cfhead_Signature]) != 0x4643534D) { return MSPACK_ERR_SIGNATURE; } /* some basic header fields */ cab->base.length = EndGetI32(&buf[cfhead_CabinetSize]); cab->base.set_id = EndGetI16(&buf[cfhead_SetID]); cab->base.set_index = EndGetI16(&buf[cfhead_CabinetIndex]); /* get the number of folders */ num_folders = EndGetI16(&buf[cfhead_NumFolders]); if (num_folders == 0) { if (!quiet) sys->message(fh, "no folders in cabinet."); return MSPACK_ERR_DATAFORMAT; } /* get the number of files */ num_files = EndGetI16(&buf[cfhead_NumFiles]); if (num_files == 0) { if (!quiet) sys->message(fh, "no files in cabinet."); return MSPACK_ERR_DATAFORMAT; } /* check cabinet version */ if ((buf[cfhead_MajorVersion] != 1) && (buf[cfhead_MinorVersion] != 3)) { if (!quiet) sys->message(fh, "WARNING; cabinet version is not 1.3"); } /* read the reserved-sizes part of header, if present */ cab->base.flags = EndGetI16(&buf[cfhead_Flags]); if (cab->base.flags & cfheadRESERVE_PRESENT) { if (sys->read(fh, &buf[0], cfheadext_SIZEOF) != cfheadext_SIZEOF) { return MSPACK_ERR_READ; } cab->base.header_resv = EndGetI16(&buf[cfheadext_HeaderReserved]); folder_resv = buf[cfheadext_FolderReserved]; cab->block_resv = buf[cfheadext_DataReserved]; if (cab->base.header_resv > 60000) { if (!quiet) sys->message(fh, "WARNING; reserved header > 60000."); } /* skip the reserved header */ if (cab->base.header_resv) { if (sys->seek(fh, (off_t) cab->base.header_resv, MSPACK_SYS_SEEK_CUR)) { return MSPACK_ERR_SEEK; } } } else { cab->base.header_resv = 0; folder_resv = 0; cab->block_resv = 0; } /* read name and info of preceeding cabinet in set, if present */ if (cab->base.flags & cfheadPREV_CABINET) { cab->base.prevname = cabd_read_string(sys, fh, &err); if (err) return err; cab->base.previnfo = cabd_read_string(sys, fh, &err); if (err) return err; } /* read name and info of next cabinet in set, if present */ if (cab->base.flags & cfheadNEXT_CABINET) { cab->base.nextname = cabd_read_string(sys, fh, &err); if (err) return err; cab->base.nextinfo = cabd_read_string(sys, fh, &err); if (err) return err; } /* read folders */ for (i = 0; i < num_folders; i++) { if (sys->read(fh, &buf[0], cffold_SIZEOF) != cffold_SIZEOF) { return MSPACK_ERR_READ; } if (folder_resv) { if (sys->seek(fh, (off_t) folder_resv, MSPACK_SYS_SEEK_CUR)) { return MSPACK_ERR_SEEK; } } if (!(fol = (struct mscabd_folder_p *) sys->alloc(sys, sizeof(struct mscabd_folder_p)))) { return MSPACK_ERR_NOMEMORY; } fol->base.next = NULL; fol->base.comp_type = EndGetI16(&buf[cffold_CompType]); fol->base.num_blocks = EndGetI16(&buf[cffold_NumBlocks]); fol->data.next = NULL; fol->data.cab = (struct mscabd_cabinet_p *) cab; fol->data.offset = offset + (off_t) ( (unsigned int) EndGetI32(&buf[cffold_DataOffset]) ); fol->merge_prev = NULL; fol->merge_next = NULL; /* link folder into list of folders */ if (!linkfol) cab->base.folders = (struct mscabd_folder *) fol; else linkfol->base.next = (struct mscabd_folder *) fol; linkfol = fol; } /* read files */ for (i = 0; i < num_files; i++) { if (sys->read(fh, &buf[0], cffile_SIZEOF) != cffile_SIZEOF) { return MSPACK_ERR_READ; } if (!(file = (struct mscabd_file *) sys->alloc(sys, sizeof(struct mscabd_file)))) { return MSPACK_ERR_NOMEMORY; } file->next = NULL; file->length = EndGetI32(&buf[cffile_UncompressedSize]); file->attribs = EndGetI16(&buf[cffile_Attribs]); file->offset = EndGetI32(&buf[cffile_FolderOffset]); /* set folder pointer */ fidx = EndGetI16(&buf[cffile_FolderIndex]); if (fidx < cffileCONTINUED_FROM_PREV) { /* normal folder index; count up to the correct folder */ if (fidx < num_folders) { struct mscabd_folder *ifol = cab->base.folders; while (fidx--) if (ifol) ifol = ifol->next; file->folder = ifol; } else { D(("invalid folder index")) file->folder = NULL; } } else { /* either CONTINUED_TO_NEXT, CONTINUED_FROM_PREV or * CONTINUED_PREV_AND_NEXT */ if ((fidx == cffileCONTINUED_TO_NEXT) || (fidx == cffileCONTINUED_PREV_AND_NEXT)) { /* get last folder */ struct mscabd_folder *ifol = cab->base.folders; while (ifol->next) ifol = ifol->next; file->folder = ifol; /* set "merge next" pointer */ fol = (struct mscabd_folder_p *) ifol; if (!fol->merge_next) fol->merge_next = file; } if ((fidx == cffileCONTINUED_FROM_PREV) || (fidx == cffileCONTINUED_PREV_AND_NEXT)) { /* get first folder */ file->folder = cab->base.folders; /* set "merge prev" pointer */ fol = (struct mscabd_folder_p *) file->folder; if (!fol->merge_prev) fol->merge_prev = file; } } /* get time */ x = EndGetI16(&buf[cffile_Time]); file->time_h = x >> 11; file->time_m = (x >> 5) & 0x3F; file->time_s = (x << 1) & 0x3E; /* get date */ x = EndGetI16(&buf[cffile_Date]); file->date_d = x & 0x1F; file->date_m = (x >> 5) & 0xF; file->date_y = (x >> 9) + 1980; /* get filename */ file->filename = cabd_read_string(sys, fh, &err); /* if folder index or filename are bad, either skip it or fail */ if (err || !file->folder) { sys->free(file->filename); sys->free(file); if (salvage) continue; return err ? err : MSPACK_ERR_DATAFORMAT; } /* link file entry into file list */ if (!linkfile) cab->base.files = file; else linkfile->next = file; linkfile = file; } if (cab->base.files == NULL) { /* We never actually added any files to the file list. Something went wrong. * The file header may have been invalid */ D(("No files found, even though header claimed to have %d files", num_files)) return MSPACK_ERR_DATAFORMAT; } return MSPACK_ERR_OK; } static char *cabd_read_string(struct mspack_system *sys, struct mspack_file *fh, int *error) { off_t base = sys->tell(fh); char buf[256], *str; int len, i, ok; /* read up to 256 bytes */ if ((len = sys->read(fh, &buf[0], 256)) <= 0) { *error = MSPACK_ERR_READ; return NULL; } /* search for a null terminator in the buffer */ for (i = 0, ok = 0; i < len; i++) if (!buf[i]) { ok = 1; break; } /* reject empty strings */ if (i == 0) ok = 0; if (!ok) { *error = MSPACK_ERR_DATAFORMAT; return NULL; } len = i + 1; /* set the data stream to just after the string and return */ if (sys->seek(fh, base + (off_t)len, MSPACK_SYS_SEEK_START)) { *error = MSPACK_ERR_SEEK; return NULL; } if (!(str = (char *) sys->alloc(sys, len))) { *error = MSPACK_ERR_NOMEMORY; return NULL; } sys->copy(&buf[0], str, len); *error = MSPACK_ERR_OK; return str; } /*************************************** * CABD_SEARCH, CABD_FIND *************************************** * cabd_search opens a file, finds its extent, allocates a search buffer, * then reads through the whole file looking for possible cabinet headers. * if it finds any, it tries to read them as real cabinets. returns a linked * list of results * * cabd_find is the inner loop of cabd_search, to make it easier to * break out of the loop and be sure that all resources are freed */ static struct mscabd_cabinet *cabd_search(struct mscab_decompressor *base, const char *filename) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; struct mscabd_cabinet_p *cab = NULL; struct mspack_system *sys; unsigned char *search_buf; struct mspack_file *fh; off_t filelen, firstlen = 0; if (!base) return NULL; sys = self->system; /* allocate a search buffer */ search_buf = (unsigned char *) sys->alloc(sys, (size_t) self->param[MSCABD_PARAM_SEARCHBUF]); if (!search_buf) { self->error = MSPACK_ERR_NOMEMORY; return NULL; } /* open file and get its full file length */ if ((fh = sys->open(sys, filename, MSPACK_SYS_OPEN_READ))) { if (!(self->error = mspack_sys_filelen(sys, fh, &filelen))) { self->error = cabd_find(self, search_buf, fh, filename, filelen, &firstlen, &cab); } /* truncated / extraneous data warning: */ if (firstlen && (firstlen != filelen) && (!cab || (cab->base.base_offset == 0))) { if (firstlen < filelen) { sys->message(fh, "WARNING; possible %" LD " extra bytes at end of file.", filelen - firstlen); } else { sys->message(fh, "WARNING; file possibly truncated by %" LD " bytes.", firstlen - filelen); } } sys->close(fh); } else { self->error = MSPACK_ERR_OPEN; } /* free the search buffer */ sys->free(search_buf); return (struct mscabd_cabinet *) cab; } static int cabd_find(struct mscab_decompressor_p *self, unsigned char *buf, struct mspack_file *fh, const char *filename, off_t flen, off_t *firstlen, struct mscabd_cabinet_p **firstcab) { struct mscabd_cabinet_p *cab, *link = NULL; off_t caboff, offset, length; struct mspack_system *sys = self->system; unsigned char *p, *pend, state = 0; unsigned int cablen_u32 = 0, foffset_u32 = 0; int false_cabs = 0, salvage = self->param[MSCABD_PARAM_SALVAGE]; #if !LARGEFILE_SUPPORT /* detect 32-bit off_t overflow */ if (flen < 0) { sys->message(fh, largefile_msg); return MSPACK_ERR_OK; } #endif /* search through the full file length */ for (offset = 0; offset < flen; offset += length) { /* search length is either the full length of the search buffer, or the * amount of data remaining to the end of the file, whichever is less. */ length = flen - offset; if (length > self->param[MSCABD_PARAM_SEARCHBUF]) { length = self->param[MSCABD_PARAM_SEARCHBUF]; } /* fill the search buffer with data from disk */ if (sys->read(fh, &buf[0], (int) length) != (int) length) { return MSPACK_ERR_READ; } /* FAQ avoidance strategy */ if ((offset == 0) && (EndGetI32(&buf[0]) == 0x28635349)) { sys->message(fh, "WARNING; found InstallShield header. Use unshield " "(https://github.com/twogood/unshield) to unpack this file"); } /* read through the entire buffer. */ for (p = &buf[0], pend = &buf[length]; p < pend; ) { switch (state) { /* starting state */ case 0: /* we spend most of our time in this while loop, looking for * a leading 'M' of the 'MSCF' signature */ while (p < pend && *p != 0x4D) p++; /* if we found tht 'M', advance state */ if (p++ < pend) state = 1; break; /* verify that the next 3 bytes are 'S', 'C' and 'F' */ case 1: state = (*p++ == 0x53) ? 2 : 0; break; case 2: state = (*p++ == 0x43) ? 3 : 0; break; case 3: state = (*p++ == 0x46) ? 4 : 0; break; /* we don't care about bytes 4-7 (see default: for action) */ /* bytes 8-11 are the overall length of the cabinet */ case 8: cablen_u32 = *p++; state++; break; case 9: cablen_u32 |= *p++ << 8; state++; break; case 10: cablen_u32 |= *p++ << 16; state++; break; case 11: cablen_u32 |= *p++ << 24; state++; break; /* we don't care about bytes 12-15 (see default: for action) */ /* bytes 16-19 are the offset within the cabinet of the filedata */ case 16: foffset_u32 = *p++; state++; break; case 17: foffset_u32 |= *p++ << 8; state++; break; case 18: foffset_u32 |= *p++ << 16; state++; break; case 19: foffset_u32 |= *p++ << 24; /* now we have recieved 20 bytes of potential cab header. work out * the offset in the file of this potential cabinet */ caboff = offset + (p - &buf[0]) - 20; /* should reading cabinet fail, restart search just after 'MSCF' */ offset = caboff + 4; /* capture the "length of cabinet" field if there is a cabinet at * offset 0 in the file, regardless of whether the cabinet can be * read correctly or not */ if (caboff == 0) *firstlen = (off_t) cablen_u32; /* check that the files offset is less than the alleged length of * the cabinet, and that the offset + the alleged length are * 'roughly' within the end of overall file length. In salvage * mode, don't check the alleged length, allow it to be garbage */ if ((foffset_u32 < cablen_u32) && ((caboff + (off_t) foffset_u32) < (flen + 32)) && (((caboff + (off_t) cablen_u32) < (flen + 32)) || salvage)) { /* likely cabinet found -- try reading it */ if (!(cab = (struct mscabd_cabinet_p *) sys->alloc(sys, sizeof(struct mscabd_cabinet_p)))) { return MSPACK_ERR_NOMEMORY; } cab->base.filename = filename; if (cabd_read_headers(sys, fh, cab, caboff, salvage, 1)) { /* destroy the failed cabinet */ cabd_close((struct mscab_decompressor *) self, (struct mscabd_cabinet *) cab); false_cabs++; } else { /* cabinet read correctly! */ /* link the cab into the list */ if (!link) *firstcab = cab; else link->base.next = (struct mscabd_cabinet *) cab; link = cab; /* cause the search to restart after this cab's data. */ offset = caboff + (off_t) cablen_u32; #if !LARGEFILE_SUPPORT /* detect 32-bit off_t overflow */ if (offset < caboff) { sys->message(fh, largefile_msg); return MSPACK_ERR_OK; } #endif } } /* restart search */ if (offset >= flen) return MSPACK_ERR_OK; if (sys->seek(fh, offset, MSPACK_SYS_SEEK_START)) { return MSPACK_ERR_SEEK; } length = 0; p = pend; state = 0; break; /* for bytes 4-7 and 12-15, just advance state/pointer */ default: p++, state++; } /* switch(state) */ } /* for (... p < pend ...) */ } /* for (... offset < length ...) */ if (false_cabs) { D(("%d false cabinets found", false_cabs)) } return MSPACK_ERR_OK; } /*************************************** * CABD_MERGE, CABD_PREPEND, CABD_APPEND *************************************** * joins cabinets together, also merges split folders between these two * cabinets only. This includes freeing the duplicate folder and file(s) * and allocating a further mscabd_folder_data structure to append to the * merged folder's data parts list. */ static int cabd_prepend(struct mscab_decompressor *base, struct mscabd_cabinet *cab, struct mscabd_cabinet *prevcab) { return cabd_merge(base, prevcab, cab); } static int cabd_append(struct mscab_decompressor *base, struct mscabd_cabinet *cab, struct mscabd_cabinet *nextcab) { return cabd_merge(base, cab, nextcab); } static int cabd_merge(struct mscab_decompressor *base, struct mscabd_cabinet *lcab, struct mscabd_cabinet *rcab) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; struct mscabd_folder_data *data, *ndata; struct mscabd_folder_p *lfol, *rfol; struct mscabd_file *fi, *rfi, *lfi; struct mscabd_cabinet *cab; struct mspack_system *sys; if (!self) return MSPACK_ERR_ARGS; sys = self->system; /* basic args check */ if (!lcab || !rcab || (lcab == rcab)) { D(("lcab NULL, rcab NULL or lcab = rcab")) return self->error = MSPACK_ERR_ARGS; } /* check there's not already a cabinet attached */ if (lcab->nextcab || rcab->prevcab) { D(("cabs already joined")) return self->error = MSPACK_ERR_ARGS; } /* do not create circular cabinet chains */ for (cab = lcab->prevcab; cab; cab = cab->prevcab) { if (cab == rcab) {D(("circular!")) return self->error = MSPACK_ERR_ARGS;} } for (cab = rcab->nextcab; cab; cab = cab->nextcab) { if (cab == lcab) {D(("circular!")) return self->error = MSPACK_ERR_ARGS;} } /* warn about odd set IDs or indices */ if (lcab->set_id != rcab->set_id) { sys->message(NULL, "WARNING; merged cabinets with differing Set IDs."); } if (lcab->set_index > rcab->set_index) { sys->message(NULL, "WARNING; merged cabinets with odd order."); } /* merging the last folder in lcab with the first folder in rcab */ lfol = (struct mscabd_folder_p *) lcab->folders; rfol = (struct mscabd_folder_p *) rcab->folders; while (lfol->base.next) lfol = (struct mscabd_folder_p *) lfol->base.next; /* do we need to merge folders? */ if (!lfol->merge_next && !rfol->merge_prev) { /* no, at least one of the folders is not for merging */ /* attach cabs */ lcab->nextcab = rcab; rcab->prevcab = lcab; /* attach folders */ lfol->base.next = (struct mscabd_folder *) rfol; /* attach files */ fi = lcab->files; while (fi->next) fi = fi->next; fi->next = rcab->files; } else { /* folder merge required - do the files match? */ if (! cabd_can_merge_folders(sys, lfol, rfol)) { return self->error = MSPACK_ERR_DATAFORMAT; } /* allocate a new folder data structure */ if (!(data = (struct mscabd_folder_data *) sys->alloc(sys, sizeof(struct mscabd_folder_data)))) { return self->error = MSPACK_ERR_NOMEMORY; } /* attach cabs */ lcab->nextcab = rcab; rcab->prevcab = lcab; /* append rfol's data to lfol */ ndata = &lfol->data; while (ndata->next) ndata = ndata->next; ndata->next = data; *data = rfol->data; rfol->data.next = NULL; /* lfol becomes rfol. * NOTE: special case, don't merge if rfol is merge prev and next, * rfol->merge_next is going to be deleted, so keep lfol's version * instead */ lfol->base.num_blocks += rfol->base.num_blocks - 1; if ((rfol->merge_next == NULL) || (rfol->merge_next->folder != (struct mscabd_folder *) rfol)) { lfol->merge_next = rfol->merge_next; } /* attach the rfol's folder (except the merge folder) */ while (lfol->base.next) lfol = (struct mscabd_folder_p *) lfol->base.next; lfol->base.next = rfol->base.next; /* free disused merge folder */ sys->free(rfol); /* attach rfol's files */ fi = lcab->files; while (fi->next) fi = fi->next; fi->next = rcab->files; /* delete all files from rfol's merge folder */ lfi = NULL; for (fi = lcab->files; fi ; fi = rfi) { rfi = fi->next; /* if file's folder matches the merge folder, unlink and free it */ if (fi->folder == (struct mscabd_folder *) rfol) { if (lfi) lfi->next = rfi; else lcab->files = rfi; sys->free(fi->filename); sys->free(fi); } else lfi = fi; } } /* all done! fix files and folders pointers in all cabs so they all * point to the same list */ for (cab = lcab->prevcab; cab; cab = cab->prevcab) { cab->files = lcab->files; cab->folders = lcab->folders; } for (cab = lcab->nextcab; cab; cab = cab->nextcab) { cab->files = lcab->files; cab->folders = lcab->folders; } return self->error = MSPACK_ERR_OK; } /* decides if two folders are OK to merge */ static int cabd_can_merge_folders(struct mspack_system *sys, struct mscabd_folder_p *lfol, struct mscabd_folder_p *rfol) { struct mscabd_file *lfi, *rfi, *l, *r; int matching = 1; /* check that both folders use the same compression method/settings */ if (lfol->base.comp_type != rfol->base.comp_type) { D(("folder merge: compression type mismatch")) return 0; } /* check there are not too many data blocks after merging */ if ((lfol->base.num_blocks + rfol->base.num_blocks) > CAB_FOLDERMAX) { D(("folder merge: too many data blocks in merged folders")) return 0; } if (!(lfi = lfol->merge_next) || !(rfi = rfol->merge_prev)) { D(("folder merge: one cabinet has no files to merge")) return 0; } /* for all files in lfol (which is the last folder in whichever cab and * only has files to merge), compare them to the files from rfol. They * should be identical in number and order. to verify this, check the * offset and length of each file. */ for (l=lfi, r=rfi; l; l=l->next, r=r->next) { if (!r || (l->offset != r->offset) || (l->length != r->length)) { matching = 0; break; } } if (matching) return 1; /* if rfol does not begin with an identical copy of the files in lfol, make * make a judgement call; if at least ONE file from lfol is in rfol, allow * the merge with a warning about missing files. */ matching = 0; for (l = lfi; l; l = l->next) { for (r = rfi; r; r = r->next) { if (l->offset == r->offset && l->length == r->length) break; } if (r) matching = 1; else sys->message(NULL, "WARNING; merged file %s not listed in both cabinets", l->filename); } return matching; } /*************************************** * CABD_EXTRACT *************************************** * extracts a file from a cabinet */ static int cabd_extract(struct mscab_decompressor *base, struct mscabd_file *file, const char *filename) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; struct mscabd_folder_p *fol; struct mspack_system *sys; struct mspack_file *fh; off_t filelen; if (!self) return MSPACK_ERR_ARGS; if (!file) return self->error = MSPACK_ERR_ARGS; sys = self->system; fol = (struct mscabd_folder_p *) file->folder; /* if offset is beyond 2GB, nothing can be extracted */ if (file->offset > CAB_LENGTHMAX) { return self->error = MSPACK_ERR_DATAFORMAT; } /* if file claims to go beyond 2GB either error out, * or in salvage mode reduce file length so it fits 2GB limit */ filelen = file->length; if (filelen > CAB_LENGTHMAX || (file->offset + filelen) > CAB_LENGTHMAX) { if (self->param[MSCABD_PARAM_SALVAGE]) { filelen = CAB_LENGTHMAX - file->offset; } else { return self->error = MSPACK_ERR_DATAFORMAT; } } /* extraction impossible if no folder, or folder needs predecessor */ if (!fol || fol->merge_prev) { sys->message(NULL, "ERROR; file \"%s\" cannot be extracted, " "cabinet set is incomplete", file->filename); return self->error = MSPACK_ERR_DECRUNCH; } /* if file goes beyond what can be decoded, given an error. * In salvage mode, don't assume block sizes, just try decoding */ if (!self->param[MSCABD_PARAM_SALVAGE]) { off_t maxlen = fol->base.num_blocks * CAB_BLOCKMAX; if ((file->offset + filelen) > maxlen) { sys->message(NULL, "ERROR; file \"%s\" cannot be extracted, " "cabinet set is incomplete", file->filename); return self->error = MSPACK_ERR_DECRUNCH; } } /* allocate generic decompression state */ if (!self->d) { self->d = (struct mscabd_decompress_state *) sys->alloc(sys, sizeof(struct mscabd_decompress_state)); if (!self->d) return self->error = MSPACK_ERR_NOMEMORY; self->d->folder = NULL; self->d->data = NULL; self->d->sys = *sys; self->d->sys.read = &cabd_sys_read; self->d->sys.write = &cabd_sys_write; self->d->state = NULL; self->d->infh = NULL; self->d->incab = NULL; } /* do we need to change folder or reset the current folder? */ if ((self->d->folder != fol) || (self->d->offset > file->offset) || !self->d->state) { /* free any existing decompressor */ cabd_free_decomp(self); /* do we need to open a new cab file? */ if (!self->d->infh || (fol->data.cab != self->d->incab)) { /* close previous file handle if from a different cab */ if (self->d->infh) sys->close(self->d->infh); self->d->incab = fol->data.cab; self->d->infh = sys->open(sys, fol->data.cab->base.filename, MSPACK_SYS_OPEN_READ); if (!self->d->infh) return self->error = MSPACK_ERR_OPEN; } /* seek to start of data blocks */ if (sys->seek(self->d->infh, fol->data.offset, MSPACK_SYS_SEEK_START)) { return self->error = MSPACK_ERR_SEEK; } /* set up decompressor */ if (cabd_init_decomp(self, (unsigned int) fol->base.comp_type)) { return self->error; } /* initialise new folder state */ self->d->folder = fol; self->d->data = &fol->data; self->d->offset = 0; self->d->block = 0; self->d->outlen = 0; self->d->i_ptr = self->d->i_end = &self->d->input[0]; /* read_error lasts for the lifetime of a decompressor */ self->read_error = MSPACK_ERR_OK; } /* open file for output */ if (!(fh = sys->open(sys, filename, MSPACK_SYS_OPEN_WRITE))) { return self->error = MSPACK_ERR_OPEN; } self->error = MSPACK_ERR_OK; /* if file has more than 0 bytes */ if (filelen) { off_t bytes; int error; /* get to correct offset. * - use NULL fh to say 'no writing' to cabd_sys_write() * - if cabd_sys_read() has an error, it will set self->read_error * and pass back MSPACK_ERR_READ */ self->d->outfh = NULL; if ((bytes = file->offset - self->d->offset)) { error = self->d->decompress(self->d->state, bytes); self->error = (error == MSPACK_ERR_READ) ? self->read_error : error; } /* if getting to the correct offset was error free, unpack file */ if (!self->error) { self->d->outfh = fh; error = self->d->decompress(self->d->state, filelen); self->error = (error == MSPACK_ERR_READ) ? self->read_error : error; } } /* close output file */ sys->close(fh); self->d->outfh = NULL; return self->error; } /*************************************** * CABD_INIT_DECOMP, CABD_FREE_DECOMP *************************************** * cabd_init_decomp initialises decompression state, according to which * decompression method was used. relies on self->d->folder being the same * as when initialised. * * cabd_free_decomp frees decompression state, according to which method * was used. */ static int cabd_init_decomp(struct mscab_decompressor_p *self, unsigned int ct) { struct mspack_file *fh = (struct mspack_file *) self; self->d->comp_type = ct; switch (ct & cffoldCOMPTYPE_MASK) { case cffoldCOMPTYPE_NONE: self->d->decompress = (int (*)(void *, off_t)) &noned_decompress; self->d->state = noned_init(&self->d->sys, fh, fh, self->param[MSCABD_PARAM_DECOMPBUF]); break; case cffoldCOMPTYPE_MSZIP: self->d->decompress = (int (*)(void *, off_t)) &mszipd_decompress; self->d->state = mszipd_init(&self->d->sys, fh, fh, self->param[MSCABD_PARAM_DECOMPBUF], self->param[MSCABD_PARAM_FIXMSZIP]); break; case cffoldCOMPTYPE_QUANTUM: self->d->decompress = (int (*)(void *, off_t)) &qtmd_decompress; self->d->state = qtmd_init(&self->d->sys, fh, fh, (int) (ct >> 8) & 0x1f, self->param[MSCABD_PARAM_DECOMPBUF]); break; case cffoldCOMPTYPE_LZX: self->d->decompress = (int (*)(void *, off_t)) &lzxd_decompress; self->d->state = lzxd_init(&self->d->sys, fh, fh, (int) (ct >> 8) & 0x1f, 0, self->param[MSCABD_PARAM_DECOMPBUF], (off_t)0,0); break; default: return self->error = MSPACK_ERR_DATAFORMAT; } return self->error = (self->d->state) ? MSPACK_ERR_OK : MSPACK_ERR_NOMEMORY; } static void cabd_free_decomp(struct mscab_decompressor_p *self) { if (!self || !self->d || !self->d->state) return; switch (self->d->comp_type & cffoldCOMPTYPE_MASK) { case cffoldCOMPTYPE_NONE: noned_free((struct noned_state *) self->d->state); break; case cffoldCOMPTYPE_MSZIP: mszipd_free((struct mszipd_stream *) self->d->state); break; case cffoldCOMPTYPE_QUANTUM: qtmd_free((struct qtmd_stream *) self->d->state); break; case cffoldCOMPTYPE_LZX: lzxd_free((struct lzxd_stream *) self->d->state); break; } self->d->decompress = NULL; self->d->state = NULL; } /*************************************** * CABD_SYS_READ, CABD_SYS_WRITE *************************************** * cabd_sys_read is the internal reader function which the decompressors * use. will read data blocks (and merge split blocks) from the cabinet * and serve the read bytes to the decompressors * * cabd_sys_write is the internal writer function which the decompressors * use. it either writes data to disk (self->d->outfh) with the real * sys->write() function, or does nothing with the data when * self->d->outfh == NULL. advances self->d->offset */ static int cabd_sys_read(struct mspack_file *file, void *buffer, int bytes) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) file; unsigned char *buf = (unsigned char *) buffer; struct mspack_system *sys = self->system; int avail, todo, outlen, ignore_cksum, ignore_blocksize; ignore_cksum = self->param[MSCABD_PARAM_SALVAGE] || (self->param[MSCABD_PARAM_FIXMSZIP] && ((self->d->comp_type & cffoldCOMPTYPE_MASK) == cffoldCOMPTYPE_MSZIP)); ignore_blocksize = self->param[MSCABD_PARAM_SALVAGE]; todo = bytes; while (todo > 0) { avail = self->d->i_end - self->d->i_ptr; /* if out of input data, read a new block */ if (avail) { /* copy as many input bytes available as possible */ if (avail > todo) avail = todo; sys->copy(self->d->i_ptr, buf, (size_t) avail); self->d->i_ptr += avail; buf += avail; todo -= avail; } else { /* out of data, read a new block */ /* check if we're out of input blocks, advance block counter */ if (self->d->block++ >= self->d->folder->base.num_blocks) { if (!self->param[MSCABD_PARAM_SALVAGE]) { self->read_error = MSPACK_ERR_DATAFORMAT; } else { D(("Ran out of CAB input blocks prematurely")) } break; } /* read a block */ self->read_error = cabd_sys_read_block(sys, self->d, &outlen, ignore_cksum, ignore_blocksize); if (self->read_error) return -1; self->d->outlen += outlen; /* special Quantum hack -- trailer byte to allow the decompressor * to realign itself. CAB Quantum blocks, unlike LZX blocks, can have * anything from 0 to 4 trailing null bytes. */ if ((self->d->comp_type & cffoldCOMPTYPE_MASK)==cffoldCOMPTYPE_QUANTUM) { *self->d->i_end++ = 0xFF; } /* is this the last block? */ if (self->d->block >= self->d->folder->base.num_blocks) { if ((self->d->comp_type & cffoldCOMPTYPE_MASK) == cffoldCOMPTYPE_LZX) { /* special LZX hack -- on the last block, inform LZX of the * size of the output data stream. */ lzxd_set_output_length((struct lzxd_stream *) self->d->state, self->d->outlen); } } } /* if (avail) */ } /* while (todo > 0) */ return bytes - todo; } static int cabd_sys_write(struct mspack_file *file, void *buffer, int bytes) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) file; self->d->offset += bytes; if (self->d->outfh) { return self->system->write(self->d->outfh, buffer, bytes); } return bytes; } /*************************************** * CABD_SYS_READ_BLOCK *************************************** * reads a whole data block from a cab file. the block may span more than * one cab file, if it does then the fragments will be reassembled */ static int cabd_sys_read_block(struct mspack_system *sys, struct mscabd_decompress_state *d, int *out, int ignore_cksum, int ignore_blocksize) { unsigned char hdr[cfdata_SIZEOF]; unsigned int cksum; int len, full_len; /* reset the input block pointer and end of block pointer */ d->i_ptr = d->i_end = &d->input[0]; do { /* read the block header */ if (sys->read(d->infh, &hdr[0], cfdata_SIZEOF) != cfdata_SIZEOF) { return MSPACK_ERR_READ; } /* skip any reserved block headers */ if (d->data->cab->block_resv && sys->seek(d->infh, (off_t) d->data->cab->block_resv, MSPACK_SYS_SEEK_CUR)) { return MSPACK_ERR_SEEK; } /* blocks must not be over CAB_INPUTMAX in size */ len = EndGetI16(&hdr[cfdata_CompressedSize]); full_len = (d->i_end - d->i_ptr) + len; /* include cab-spanning blocks */ if (full_len > CAB_INPUTMAX) { D(("block size %d > CAB_INPUTMAX", full_len)); /* in salvage mode, blocks can be 65535 bytes but no more than that */ if (!ignore_blocksize || full_len > CAB_INPUTMAX_SALVAGE) { return MSPACK_ERR_DATAFORMAT; } } /* blocks must not expand to more than CAB_BLOCKMAX */ if (EndGetI16(&hdr[cfdata_UncompressedSize]) > CAB_BLOCKMAX) { D(("block size > CAB_BLOCKMAX")) if (!ignore_blocksize) return MSPACK_ERR_DATAFORMAT; } /* read the block data */ if (sys->read(d->infh, d->i_end, len) != len) { return MSPACK_ERR_READ; } /* perform checksum test on the block (if one is stored) */ if ((cksum = EndGetI32(&hdr[cfdata_CheckSum]))) { unsigned int sum2 = cabd_checksum(d->i_end, (unsigned int) len, 0); if (cabd_checksum(&hdr[4], 4, sum2) != cksum) { if (!ignore_cksum) return MSPACK_ERR_CHECKSUM; sys->message(d->infh, "WARNING; bad block checksum found"); } } /* advance end of block pointer to include newly read data */ d->i_end += len; /* uncompressed size == 0 means this block was part of a split block * and it continues as the first block of the next cabinet in the set. * otherwise, this is the last part of the block, and no more block * reading needs to be done. */ /* EXIT POINT OF LOOP -- uncompressed size != 0 */ if ((*out = EndGetI16(&hdr[cfdata_UncompressedSize]))) { return MSPACK_ERR_OK; } /* otherwise, advance to next cabinet */ /* close current file handle */ sys->close(d->infh); d->infh = NULL; /* advance to next member in the cabinet set */ if (!(d->data = d->data->next)) { sys->message(d->infh, "WARNING; ran out of cabinets in set. Are any missing?"); return MSPACK_ERR_DATAFORMAT; } /* open next cab file */ d->incab = d->data->cab; if (!(d->infh = sys->open(sys, d->incab->base.filename, MSPACK_SYS_OPEN_READ))) { return MSPACK_ERR_OPEN; } /* seek to start of data blocks */ if (sys->seek(d->infh, d->data->offset, MSPACK_SYS_SEEK_START)) { return MSPACK_ERR_SEEK; } } while (1); /* not reached */ return MSPACK_ERR_OK; } static unsigned int cabd_checksum(unsigned char *data, unsigned int bytes, unsigned int cksum) { unsigned int len, ul = 0; for (len = bytes >> 2; len--; data += 4) { cksum ^= ((data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24)); } switch (bytes & 3) { case 3: ul |= *data++ << 16; /*@fallthrough@*/ case 2: ul |= *data++ << 8; /*@fallthrough@*/ case 1: ul |= *data; } cksum ^= ul; return cksum; } /*************************************** * NONED_INIT, NONED_DECOMPRESS, NONED_FREE *************************************** * the "not compressed" method decompressor */ struct noned_state { struct mspack_system *sys; struct mspack_file *i; struct mspack_file *o; unsigned char *buf; int bufsize; }; static struct noned_state *noned_init(struct mspack_system *sys, struct mspack_file *in, struct mspack_file *out, int bufsize) { struct noned_state *state = (struct noned_state *) sys->alloc(sys, sizeof(struct noned_state)); unsigned char *buf = (unsigned char *) sys->alloc(sys, (size_t) bufsize); if (state && buf) { state->sys = sys; state->i = in; state->o = out; state->buf = buf; state->bufsize = bufsize; } else { sys->free(buf); sys->free(state); state = NULL; } return state; } static int noned_decompress(struct noned_state *s, off_t bytes) { int run; while (bytes > 0) { run = (bytes > s->bufsize) ? s->bufsize : (int) bytes; if (s->sys->read(s->i, &s->buf[0], run) != run) return MSPACK_ERR_READ; if (s->sys->write(s->o, &s->buf[0], run) != run) return MSPACK_ERR_WRITE; bytes -= run; } return MSPACK_ERR_OK; } static void noned_free(struct noned_state *state) { struct mspack_system *sys; if (state) { sys = state->sys; sys->free(state->buf); sys->free(state); } } /*************************************** * CABD_PARAM *************************************** * allows a parameter to be set */ static int cabd_param(struct mscab_decompressor *base, int param, int value) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; if (!self) return MSPACK_ERR_ARGS; switch (param) { case MSCABD_PARAM_SEARCHBUF: if (value < 4) return MSPACK_ERR_ARGS; self->param[MSCABD_PARAM_SEARCHBUF] = value; break; case MSCABD_PARAM_FIXMSZIP: self->param[MSCABD_PARAM_FIXMSZIP] = value; break; case MSCABD_PARAM_DECOMPBUF: if (value < 4) return MSPACK_ERR_ARGS; self->param[MSCABD_PARAM_DECOMPBUF] = value; break; case MSCABD_PARAM_SALVAGE: self->param[MSCABD_PARAM_SALVAGE] = value; break; default: return MSPACK_ERR_ARGS; } return MSPACK_ERR_OK; } /*************************************** * CABD_ERROR *************************************** * returns the last error that occurred */ static int cabd_error(struct mscab_decompressor *base) { struct mscab_decompressor_p *self = (struct mscab_decompressor_p *) base; return (self) ? self->error : MSPACK_ERR_ARGS; } cabextract-1.9/mspack/ChangeLog0000664000175000017500000007275613367433576013520 000000000000002018-11-03 Stuart Caie * configure.ac, doc/Makefile.in, doc/Doxyfile.in: remove these template files and replace with static files. You can still build the documentation with make -C doc 2018-11-03 Stuart Caie * Makefile.am, src: move the "useful" programs in src/ to examples/ and don't auto-install them. Even though they're useful, they are intended as examples and aren't productised (no commmand-line options, no man pages, etc.) -- if you disagree, feel free to send in a patch 2018-11-01 Stuart Caie * cabd_extract(): would not do decompression for random-access offsets if the folder type was LZX. This is a fairly major bug, and affects any decompression where you skip directly to a file, or decompress data out-of-order. Thanks to austin987 for alerting me to this. This bug was introduced by the recent 'salvage mode' patch. Even though I'd reviewed all the differences in clamav's copy of libmspack and said "wtf" to this particular change, I didn't notice it was still in the resulting patch I merged. Mea culpa :) * test/cabd_test.c: now has a regression test to cover this 2018-10-31 Stuart Caie * Makefile.am, test/*_test.c: use the automake test-suite system with the test-suite programs (cabd_test, chmd_test, kwajd_test). This also fixes a longstanding bugbear that these programs don't access their test files using an absolute path. Now this is passed to them and you can run them from any directory. Thanks to Richard Jones for requesting this. 2018-10-31 Stuart Caie * configure.ac: require at least automake 1.11, use AM_SILENT_RULES unconditionally 2018-10-30 Stuart Caie * configure.ac: remove obsolescent C library tests. AC_HEADER_STDC is removed, and so are most checks for standard C headers. libmspack now makes these assumptions: - exist - defines tolower() - defines memset(), memcmp(), strlen() - if towlower() exists, it's defined in 2018-10-22 Stuart Caie * cabd.c: remove the only use of assert() 2018-10-20 Stuart Caie * src/chmextract.c: add anti "../" and leading slash protection to chmextract. I'm not pleased about this. All the sample code provided with libmspack is meant to be simple examples of library use, not "productised" binaries. Making the "useful" code samples install as binaries was a mistake. They were never intended to protect you from unpacking archive files with relative/absolute paths, and I would prefer that they never will be. 2018-10-17 Stuart Caie * cab.h: Make the CAB block input buffer one byte larger, to allow a maximum-allowed-size input block and the special extra byte added after the block by cabd_sys_read_block to help Quantum alignment. Thanks to Henri Salo for reporting this. 2018-10-17 Stuart Caie * chmd_read_headers(): again reject files with blank filenames, this time because their 1st or 2nd byte is null, not because their length is zero. Thanks again to Hanno Böck for finding the issue. 2018-10-16 Stuart Caie * Makefile.am: using automake _DEPENDENCIES for chmd_test appears to override the default dependencies (e.g. sources), so libchmd.la was no longer considered a dependency of chmd_test. This breaks parallel builds like "make -j4". Added libchmd.la explicitly to dependencies. Thanks to Thomas Deutschmann for reporting this. 2018-10-16 Stuart Caie * cabd.c: add new parameter, MSCABD_PARAM_SALVAGE, which makes CAB file reading and extraction more lenient, to allow damaged or mangled CABs to be extracted. When enabled: - cabd->open() won't reject cabinets with files that have invalid folder indices or filenames. These files will simply be skipped - cabd->extract() won't reject files with invalid lengths, but will limit them to the maximum possible - block output sizes over 32768 bytes won't be rejected - invalid data block checksums won't be rejected It's still possible for corrupted files to fail extraction, but more data can be extracted before they do. This new parameter doesn't affect the existing MSCABD_PARAM_FIXMSZIP parameter, which ignores MSZIP decompression failures. You can enable both at once. Thanks to Micah Snyder from ClamAV for working with me to get this feature into libmspack. This also helps ClamAV move towards using a vanilla copy of libmspack without needing their own patchset. 2018-08-13 Stuart Caie * mspack.h: clarify that mspack_system.free() should allow NULL. If your mspack_system implementation doesn't, it would already have crashed, as there are several places where libmspack calls sys->free(NULL). This change makes it official, and amends a few "if (x) sys->free(x)" cases to the simpler "sys->free(x)" to make it clearer. 2018-08-09 Stuart Caie * Makefile.am: the test file cve-2015-4467-reset-interval-zero.chm is detected by ClamAV as BC.Legacy.Exploit.CVE_2012_1458-1 "infected". My hosting deletes anything that ClamAV calls "infected", so has been continually deleting the official libmspack 0.7alpha release. CVE-2012-1458 is the same issue as CVE-2015-4467: both libmspack, and ClamAV using libmspack, could get a division-by-zero crash when the LZX reset interval was zero. This was fixed years ago, but ClamAV still has it as a signature, which today prevents me from releasing libmspack. BC.Legacy.Exploit.CVE_2012_1458-1 is a bytecode signature, so I can't see the exact trigger conditions, but I can see that it looks for the "LZXC" signature of the LZX control file, so I've changed this to "lzxc" and added a step in the Makefile to change it back to LZXC, so I can release libmspack whether or not ClamAV keeps the signature. 2018-04-26 Stuart Caie * read_chunk(): the test that chunk numbers are in bounds was off by one, so read_chunk() returned a pointer taken from outside allocated memory that usually crashes libmspack when accessed. Thanks to Hanno Böck for finding the issue and providing a sample. * chmd_read_headers(): reject files with blank filenames. Thanks again to Hanno Böck for finding the issue and providing a sample file. 2018-02-06 Stuart Caie * chmd.c: fixed an off-by-one error in the TOLOWER() macro, reported by Dmitry Glavatskikh. Thanks Dmitry! 2017-11-26 Stuart Caie * kwajd_read_headers(): fix up the logic of reading the filename and extension headers to avoid a one or two byte overwrite. Thanks to Jakub Wilk for finding the issue. * test/kwajd_test.c: add tests for KWAJ filename.ext handling 2017-10-16 Stuart Caie * test/cabd_test.c: update the short string tests to expect not only MSPACK_ERR_DATAFORMAT but also MSPACK_ERR_READ, because of the recent change to cabd_read_string(). Thanks to maitreyee43 for spotting this. * test/msdecompile_md5: update the setup instructions for this script, and also change the script so it works with current Wine. Again, thanks to maitreyee43 for trying to use it and finding it not working. 2017-08-13 Stuart Caie * src/chmextract.c: support MinGW one-arg mkdir(). Thanks to AntumDeluge for reporting this. 2017-08-13 Stuart Caie * read_spaninfo(): a CHM file can have no ResetTable and have a negative length in SpanInfo, which then feeds a negative output length to lzxd_init(), which then sets frame_size to a value of your choosing, the lower 32 bits of output length, larger than LZX_FRAME_SIZE. If the first LZX block is uncompressed, this writes data beyond the end of the window. This issue was raised by ClamAV as CVE-2017-6419. Thanks to Sebastian Andrzej Siewior for finding this by chance! * lzxd_init(), lzxd_set_output_length(), mszipd_init(): due to the issue mentioned above, these functions now reject negative lengths 2017-08-05 Stuart Caie * cabd_read_string(): add missing error check on result of read(). If an mspack_system implementation returns an error, it's interpreted as a huge positive integer, which leads to reading past the end of the stack-based buffer. Thanks to Sebastian Andrzej Siewior for explaining the problem. This issue was raised by ClamAV as CVE-2017-11423 2016-04-20 Stuart Caie * configure.ac: change my email address to kyzer@cabextract.org.uk 2015-05-10 Stuart Caie * cabd_read_string(): correct rejection of empty strings. Thanks to Hanno Böck for finding the issue and providing a sample file. 2015-05-10 Stuart Caie * Makefile.am: Add subdir-objects option as suggested by autoreconf. * configure.ac: Add AM_PROG_AR as suggested by autoreconf. 2015-01-29 Stuart Caie * system.h: if C99 inttypes.h exists, use its PRI{d,u}{32,64} macros. Thanks to Johnathan Kollasch for the suggestion. 2015-01-18 Stuart Caie * lzxd_decompress(): the byte-alignment code for reading uncompressed block headers presumed it could wind i_ptr back 2 bytes, but this hasn't been true since READ_BYTES was allowed to read bytes straddling two blocks, leaving just 1 byte in the read buffer. Thanks to Jakub Wilk for finding the issue and providing a sample file. * inflate(): off-by-one error. Distance codes are 0-29, not 0-30. Thanks to Jakub Wilk again. * chmd_read_headers(), search_chunk(): another fix for checking pointer is within a chunk, thanks again to Jakub Wilk. 2015-01-17 Stuart Caie * GET_UTF8_CHAR(): Remove 5/6-byte encoding support and check decoded chars are no more than U+10FFFF. * chmd_init_decomp(): A reset interval of 0 is invalid. Thanks to Jakub Wilk for finding the issue and providing a sample and patch. 2015-01-15 Stuart Caie * chmd_read_headers(): add a bounds check to prevent over-reading data, which caused a segfault on 32-bit architectures. Thanks to Jakub Wilk. * search_chunk(): change the order of pointer arithmetic operations to avoid overflow during bounds checks, which lead to segfaults on 32-bit architectures. Again, thanks to Jakub Wilk for finding this issue, providing sample files and a patch. 2015-01-08 Stuart Caie * cabd_extract(): No longer uses broken state data if extracting from folder 1, 2, 1 and setting up folder 2 fails. This prevents a jump to null and thus segfault. Thanks to Jakub Wilk again. * cabd_read_string: reject empty strings. They are not found in any valid CAB files. Thanks to Hanno Böck for sending me an example. 2015-01-05 Stuart Caie * cabd_can_merge_folders(): disallow folder merging if the combined folder would have more than 65535 data blocks. * cabd_decompress(): disallow files if their offset, length or offset+length is more than 65535*32768, the maximum size of any folder. Thanks to Jakub Wilk for identifying the problem and providing a sample file. 2014-04-20 Stuart Caie * readhuff.h: fixed the table overflow check, which allowed one more code after capacity had been reached, resulting in a read of uninitialized data inside the decoding table. Thanks to Denis Kroshin for identifying the problem and providing a sample file. 2013-05-27 Stuart Caie * test/oabx.c: added new example command for unpacking OAB files. 2013-05-17 Stuart Caie * mspack.h: Support for decompressing a new file format, the Exchange Offline Address Book (OAB). Thanks to David Woodhouse for writing the implementation. I've bumped the version to 0.4alpha in celebration. 2012-04-15 Stuart Caie * chmd_read_headers(): More thorough validation of CHM header values. Thanks to Sergei Trofimovich for finding sample files. * read_reset_table(): Better test for overflow. Thanks again to Sergei Trofimovich for generating a good example. * test/chminfo.c: this test program reads the reset table by itself and was also susceptible to the same overflow problems. 2012-03-16 Stuart Caie * Makefile.am, configure.ac: make the GCC warning flags conditional on using the GCC compiler. Thanks to Dagobert Michelsen for letting me know. 2011-11-25 Stuart Caie * lzxd_decompress(): Prevent matches that go beyond the start of the LZX stream. Thanks to Sergei Trofimovich for testing with valgrind and finding a corrupt sample file that exercises this scenario. 2011-11-23 Stuart Caie * chmd_fast_find(): add a simple check against infinite PMGL loops. Thanks to Sergei Trofimovich for finding sample files. Multi-step PMGL/PMGI infinite loops remain possible. 2011-06-17 Stuart Caie * read_reset_table(): wasn't reading the right offset for getting the LZX uncompressed length. Thanks to Sergei Trofimovich for finding the bug. 2011-05-31 Stuart Caie * kwajd.c, mszipd.c: KWAJ type 4 files (MSZIP) are now supported. Thanks to Clive Turvey for sending me the format details. * doc/szdd_kwaj_format.html: Updated documentation to cover KWAJ's MSZIP compression. 2011-05-11 Stuart Caie * cabd_find(): rethought how large vs small file support is handled, as users were getting "library not compiled to support large files" message on some small files. Now checks for actual off_t overflow, rather than trying to preempt it. 2011-05-10: Stuart Caie * chmd.c: implemented fast_find() * test/chmx.c: removed the multiple extraction orders, now it just extracts in the fastest order * test/chmd_order.c: new program added to test that different extraction orders don't affect the results of extraction * test/chmd_find.c: new program to test that fast_find() works. Either supply your own filename to find, or it will try finding every file in the CHM. * configure.ac: because CHM fast find requires case-insensitive comparisons, tolower() or towlower() are used where possible. These functions and their headers are checked for. * mspack.h: exposed struct mschmd_sec_mscompressed's spaninfo and struct mschmd_header's first_pmgl, last_pmgl and chunk_cache to the world. Check that the CHM decoder version is v2 or higher before using them. * system.c: set CHM decoder version to v2 2011-04-27: Stuart Caie * many files: Made C++ compilers much happier with libmspack. Changed char * to const char * where possible. * mspack.h: Changed user-supplied char * to const char *. Unless you've written your own mspack_system implementation, you will likely be unaffected. If you have written your own mspack_system implementation: 1: change open() so it takes a const char *filename 2: change message() so it takes a const char *format If you cast your function into the mspack_system struct, you can change the cast instead of the function. 2011-04-27: Stuart Caie * Makefile.am: changed CFLAGS from "-Wsign-compare -Wconversion -pedantic" to "-W -Wno-unused". This enables more warnings, and disables these specific warnings which are now a hinderance. 2011-04-27: Stuart Caie * test/cabrip.c, test/chminfo.c: used macros from system.h for printing offsets and reading 64-bit values, rather than reinvent the wheel. * cabd_can_merge_folders(): declare variables at the start of a block so older C compilers won't choke. * cabd_find(): avoid compiler complaints about non-initialised variables. We know they'll get initialised before use, but the compiler can't reverse a state machine to draw the same conclusion. 2011-04-26: Stuart Caie * configure.ac, mspack/system.h: Added a configure test to get the size of off_t. If off_t is 8 bytes or more, we presume this system has large file support. This fixes LFS detection for Fedora x86_64 and Darwin/Mac OS X, neither of which declare FILESIZEBITS in . It's not against the POSIX standard to do this: "A definition of [FILESIZEBITS] shall be omitted from the header on specific implementations where the corresponding value is equal to or greater than the stated minimum, but where the value can vary depending on the file to which it is applied." (http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html) Thanks to Edward Sheldrake for the patch. 2011-04-26: Stuart Caie * chmd.c: all 64-bit integer reads are now consolidated into the read_off64() function * chmd_read_headers(): this function has been made resilient against accessing memory past the end of a chunk. Thanks to Sergei Trofimovich for sending me examples and analysis. * chmd_init_decomp(): this function now reads the SpanInfo file if the ResetTable file isn't available, it also checks that each system file it needs is large enough before accessing it, and some of its code has been split into several new functions: find_sys_file(), read_reset_table() and read_spaninfo() 2011-04-26: Stuart Caie * mspack.h, chmd.c: now reads the SpanInfo system file if the ResetTable file isn't available. This adds a new spaninfo pointer into struct mschmd_sec_mscompressed 2011-04-26: Stuart Caie * test/chminfo.c: more sanity checks for corrupted CHM files where entries go past the end of a PMGL/PMGI chunk, thanks to Sergei Trofimovich for sending me examples and analysis. 2011-04-25: Stuart Caie * cabd_merge(): Drew D'Addesio showed me spanning cabinets which don't have all the CFFILE entries they should, but otherwise have all necessary data for extraction. Changed the merging folders test to be less strict; if folders don't exactly match, warn which files are missing, but allow merging if at least one necessary file is present. 2010-09-24: Stuart Caie * readhuff.h: Don't let build_decode_table() allow empty trees. It's meant to be special case just for the LZX length tree, so move that logic out to the LZX code. Thanks to Danny Kroshin for discovering the bug. * lzxd.c: Allow empty length trees, but not other trees. If the length tree is empty, fail if asked to decode a length symbol. Again, thanks to Danny Kroshin for discovering the bug. 2010-09-20: Stuart Caie * Makefile.am: Set EXTRA_DIST so it doesn't include .svn directories in the distribution, but does include docs. 2010-09-20: Stuart Caie * Makefile.am, configure.ac: Use modern auto* practises; turn on automake silent rules where possible, use "m4" directory for libtool macros, use LT_INIT instead of AC_PROG_LIBTOOL and use AM_CPPFLAGS instead of INCLUDES. Thanks to Sergei Trofimovich for the patch. 2010-09-15: Stuart Caie * many files: Made the code compile with C++ - Renamed all 'this' variables/parameters to 'self' - Added casts to all memory allocations. - Added extern "C" to header files with extern declarations. - Made system.c include system.h. - Changed the K&R-style headers to ANSI-style headers in md5.c 2010-08-04: Stuart Caie * many files: removed unnecessary include 2010-07-19: Stuart Caie * cabd_md5.c, chmd_md5.c: Replace writing files to disk then MD5summing them, with an MD5summer built into mspack_system. Much, much faster results. * qtmd_decompress(): Robert Riebisch pointed out a Quantum data integrity check that could never be tripped, because frame_todo is unsigned, so it will never be decremented below zero. Replaced the check with one that assumes that decrementing past zero wraps frame_todo round to a number more than its maximum value (QTM_FRAME_SIZE). 2010-07-18: Stuart Caie * cabd.c: Special logic to pass cabd_sys_read() errors back to cabd_extract() wasn't compatible with the decompressor logic of returning the same error repeatedly once unpacking fails. This meant that if decompressing failed because of a read error, then the next file in the same folder would come back as "no error", but the decompressed wouldn't have even attempted to decompress the file. Added a new state variable, read_error, with the same lifespan as a decompressor, to pass the underlying reason for MSPACK_ERR_READ errors back. * mszipd.c: improve MS-ZIP recovery by saving all the bytes decoded prior to a block failing. This requires remembering how far we got through the block, so the code has been made slightly slower (about 0.003 seconds slower per gigabyte unpacked) by removing the local variable window_posn and keeping it in the state structure instead. 2010-07-16: Stuart Caie * Makefile.am: strange interactions. When -std=c99 is used, my Ubuntu's (libc6-dev 2.11.1-0ubuntu7.2) does NOT define fseeko() unless _LARGEFILE_SOURCE is also defined. But configure always uses -std=gnu99, not -std=c99, so its test determines _LARGEFILE_SOURCE isn't needed but HAVE_FSEEKO is true. The implicit fseeko definition has a 32-bit rather than 64-bit offset, which means the mode parameter is interpreted as part of the offset, and the mode is taken from the stack, which is generally 0 (SEEK_SET). This breaks all SEEK_CURs. The code works fine when -std=c99 is not set, so just remove it for the time being. 2010-07-12: Stuart Caie * system.c: Reject reading/writing a negative number of bytes. * chmd.c: allow zero-length files to be seen. Previously they were skipped because they were mistaken for directory entries. 2010-07-08: Stuart Caie * qtmd.c: Larry Frieson found an important bug in the Quantum decoder. Window wraps flush all unwritten data to disk. However, sometimes less data is needed, which makes out_bytes negative, which is then passed to write(). Some write() implementations treat negative sizes it as a large positive integer and segfault trying to write the buffer. * Makefile.am, test/*.c: fixed automake file so that the package passes a "make distcheck". 2010-07-07: Stuart Caie * doc/szdd_kwaj_format.html: explain SZDD/KWAJ file format. * lzssd.c: fixed SZDD decompression bugs. * test/chmd_compare: Add scripts for comparing chmd_md5 against Microsoft's own code. * test/chmd_md5.c: remove the need to decompress everything twice, as this is already in chmx.c if needed. 2010-07-06: Stuart Caie * many files: added SZDD and KWAJ decompression support. 2010-06-18: Stuart Caie * system.h: expanded the test for 64-bit largefile support so it also works on 64-bit native operating systems where you don't have to define _FILE_OFFSET_BITS. 2010-06-17: Stuart Caie * libmspack.pc.in: Added pkg-config support. Thanks to Patrice Dumas for the patch. 2010-06-14: Stuart Caie * qtmd.c, lzxd.c, mszipd.c: created new headers, readbits.h and readhuff.h, which bundle up the bit-reading and huffman-reading code found in the MSZIP, LZX and Quantum decoders. 2010-06-11: Stuart Caie * qtmd_static_init(): Removed function in favour of static const tables, same rationale as for lzxd_static_init(). * qtmd_read_input(), zipd_read_input(): After testing against my set of CABs from the wild, I've found both these functions _need_ an extra EOF flag, like lzxd_read_input() has. So I've added it. This means CABs get decoded properly AND there's no reading fictional bytes. 2010-06-03: Stuart Caie * test/cabd_md5.c: updated this so it has better output and doesn't need to be in the same directory as the files for multi- part sets. 2010-05-20: Stuart Caie * qtmd_read_input(), zipd_read_input(): Both these functions are essentially copies of lzxd_read_input(), but that has a feature they don't have - an extra EOF flag. So if EOF is encountered (sys->read() returns 0 bytes), these don't pass on the error. Their respective bit-reading functions that called them then go on to access at least one byte of the input buffer, which doesn't exist as sys->read() returned 0. Thanks to Michael Vidrevich for spotting this and providing a test case. 2010-05-20: Stuart Caie * system.h: It turns out no configure.ac tests are needed to decide between __func__ and __FUNCTION__, so I put the standard one (__func__) back into the D() macro, along with some special-case ifdefs for old versions of GCC. * lzxd_static_init(): Removed function in favour of static const tables. Jorge Lodos thinks it causes multithreading problems, I disagree. However, there are speed benefits to declaring the tables as static const. * cabd_init_decomp(): Fixed code which never runs but would write to a null pointer if it could. Changed it to an assert() as it will only trip if someone rewrites the internals of cabd.c. Thanks to Jorge Lodos for finding it. * inflate(): Fixed an off-by-one error: if the LITERAL table emitted code 286, this would read one byte past the end of lit_extrabits[]. Thanks to Jorge Lodos for finding it. 2010-05-06: Stuart Caie * test/cabrip.c, test/chminfo.c: add fseeko() support 2009-06-01: Stuart Caie * README: clarify the extended license terms * doc, Makefile.am: make the doxygen makefile work when using an alternate build directory 2006-09-20: Stuart Caie * system.h: I had a choice of adding more to configure.ac to test for __func__ and __FUNCTION__, or just removing __FUNCTION__ from the D() macro. I chose the latter. * Makefile.am: Now the --enable-debug in configure will actually apply -DDEBUG to the sources. 2006-09-20: Stuart Caie * qtmd_decompress(): Fixed a major bug in the QTM decoder, as reported by Tomasz Kojm last year. Removed the restriction on window sizes as a result. Correctly decodes the XLVIEW cabinets. 2006-08-31: Stuart Caie * lzxd_decompress(): Two major bugs fixed. Firstly, the R0/R1/R2 local variables weren't set to 1 after lzxd_reset_state(). Secondly, the LZX decompression stream can sometimes become odd-aligned (after an uncompressed block) and the next 16 bit fetch needs to be split across two input buffers, ENSURE_BITS() didn't cover this case. Many thanks to Igor Glucksmann for discovering both these bugs. 2005-06-30: Stuart Caie * cabd_search(): fixed problems with searching files > 4GB for cabinets. 2005-06-23: Stuart Caie * qtmd_init(): The QTM decoder is broken for QTM streams with a window size less than the frame size. Until this is fixed, fail to initialise QTM window sizes less than 15. Thanks to Tomasz Kojm for finding the bug. 2005-03-22: Stuart Caie * system.h: now undefs "read", as the latest glibc defines read() as a macro which messes everything up. Thanks to Ville Skyttä for the update. 2005-03-14: Stuart Caie * test/multifh.c: write an mspack_system implementation that can handle normal disk files, open file handles, open file descriptors and raw memory all at the same time. 2005-02-24: Stuart Caie * chmd_read_headers(): avoid infinite loop when chmhs1_ChunkSize is zero. Thanks to Serge Semashko for the research and discovery. 2005-02-18: Stuart Caie * mspack.h: renamed the "interface" parameter of mspack_version() to "entity", as interface is a reserved word in C++. Thanks to Yuriy Z for the discovery. 2004-12-09: Stuart Caie * lzss.h, szdd.h, szddd.h: more work on the SZDD/LZSS design. 2004-06-12: Stuart Caie * lzxd_static_init(): removed write to lzxd_extra_bits[52], thanks to Nigel Horne from the ClamAV project. 2004-04-23: Stuart Caie * mspack.h: changed 'this' parameters to 'self' to allow compiling in C++ compilers, thanks to Michal Cihar for the suggestion. * mspack.h, system.h, mspack.def, winbuild.sh: integrated some changes from Petr Blahos to let libmspack build as a Win32 DLL. * chmd_fast_find(): added the first part of this code, and comments sufficient to finish it :) 2004-04-08 Stuart Caie * test/chminfo.c: added a program for dumping useful data from CHM files, e.g. index entries and reset tables. I wrote this a while ago for investigating a corrupt cabinet, but I never committed it. 2004-03-26 Stuart Caie * test/cabd_memory.c: added a new test example which shows an mspack_system implementation that reads and writes from memory only, no file I/O. Even the source code has a little cab file embedded in it. 2004-03-10 Stuart Caie * cabd.c: updated the location of the CAB SDK. * cabd.c: changed a couple of MSPACK_ERR_READ errors not based on read() failures into MSPACK_ERR_DATAFORMAT errors. * mszipd_decompress(): repair mode now aborts after writing a repaired block if the error was a hard error (e.g. read error, out of blocks, etc) 2004-03-08 Stuart Caie * Makefile.am: now builds and installs a versioned library. * mszipd.c: completed a new MS-ZIP and inflate implementation. * system.c: added mspack_version() and committed to a versioned ABI for the library. * cabd.c: made mszip repair functionality work correctly. * cabd.c: now identifies invalid block headers * doc/: API documentation is now included with the library, not just on the web. * chmd.c: fixed error messages and 64-bit debug output. * chmd.c: now also catches NULL files in section 1. * test/chmx.c: now acts more like cabextract. 2003-08-29 Stuart Caie * ChangeLog: started keeping a ChangeLog :) cabextract-1.9/mspack/lzxd.c0000664000175000017500000010465613370027445013052 00000000000000/* This file is part of libmspack. * (C) 2003-2013 Stuart Caie. * * The LZX method was created by Jonathan Forbes and Tomi Poutanen, adapted * by Microsoft Corporation. * * libmspack is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL) version 2.1 * * For further details, see the file COPYING.LIB distributed with libmspack */ /* LZX decompression implementation */ #include #include /* Microsoft's LZX document (in cab-sdk.exe) and their implementation * of the com.ms.util.cab Java package do not concur. * * In the LZX document, there is a table showing the correlation between * window size and the number of position slots. It states that the 1MB * window = 40 slots and the 2MB window = 42 slots. In the implementation, * 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the * first slot whose position base is equal to or more than the required * window size'. This would explain why other tables in the document refer * to 50 slots rather than 42. * * The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode * is not defined in the specification. * * The LZX document does not state the uncompressed block has an * uncompressed length field. Where does this length field come from, so * we can know how large the block is? The implementation has it as the 24 * bits following after the 3 blocktype bits, before the alignment * padding. * * The LZX document states that aligned offset blocks have their aligned * offset huffman tree AFTER the main and length trees. The implementation * suggests that the aligned offset tree is BEFORE the main and length * trees. * * The LZX document decoding algorithm states that, in an aligned offset * block, if an extra_bits value is 1, 2 or 3, then that number of bits * should be read and the result added to the match offset. This is * correct for 1 and 2, but not 3, where just a huffman symbol (using the * aligned tree) should be read. * * Regarding the E8 preprocessing, the LZX document states 'No translation * may be performed on the last 6 bytes of the input block'. This is * correct. However, the pseudocode provided checks for the *E8 leader* * up to the last 6 bytes. If the leader appears between -10 and -7 bytes * from the end, this would cause the next four bytes to be modified, at * least one of which would be in the last 6 bytes, which is not allowed * according to the spec. * * The specification states that the huffman trees must always contain at * least one element. However, many CAB files contain blocks where the * length tree is completely empty (because there are no matches), and * this is expected to succeed. * * The errors in LZX documentation appear have been corrected in the * new documentation for the LZX DELTA format. * * http://msdn.microsoft.com/en-us/library/cc483133.aspx * * However, this is a different format, an extension of regular LZX. * I have noticed the following differences, there may be more: * * The maximum window size has increased from 2MB to 32MB. This also * increases the maximum number of position slots, etc. * * If the match length is 257 (the maximum possible), this signals * a further length decoding step, that allows for matches up to * 33024 bytes long. * * The format now allows for "reference data", supplied by the caller. * If match offsets go further back than the number of bytes * decompressed so far, that is them accessing the reference data. */ /* import bit-reading macros and code */ #define BITS_TYPE struct lzxd_stream #define BITS_VAR lzx #define BITS_ORDER_MSB #define READ_BYTES do { \ unsigned char b0, b1; \ READ_IF_NEEDED; b0 = *i_ptr++; \ READ_IF_NEEDED; b1 = *i_ptr++; \ INJECT_BITS((b1 << 8) | b0, 16); \ } while (0) #include /* import huffman-reading macros and code */ #define TABLEBITS(tbl) LZX_##tbl##_TABLEBITS #define MAXSYMBOLS(tbl) LZX_##tbl##_MAXSYMBOLS #define HUFF_TABLE(tbl,idx) lzx->tbl##_table[idx] #define HUFF_LEN(tbl,idx) lzx->tbl##_len[idx] #define HUFF_ERROR return lzx->error = MSPACK_ERR_DECRUNCH #include /* BUILD_TABLE(tbl) builds a huffman lookup table from code lengths */ #define BUILD_TABLE(tbl) \ if (make_decode_table(MAXSYMBOLS(tbl), TABLEBITS(tbl), \ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0))) \ { \ D(("failed to build %s table", #tbl)) \ return lzx->error = MSPACK_ERR_DECRUNCH; \ } #define BUILD_TABLE_MAYBE_EMPTY(tbl) do { \ lzx->tbl##_empty = 0; \ if (make_decode_table(MAXSYMBOLS(tbl), TABLEBITS(tbl), \ &HUFF_LEN(tbl,0), &HUFF_TABLE(tbl,0))) \ { \ for (i = 0; i < MAXSYMBOLS(tbl); i++) { \ if (HUFF_LEN(tbl, i) > 0) { \ D(("failed to build %s table", #tbl)) \ return lzx->error = MSPACK_ERR_DECRUNCH; \ } \ } \ /* empty tree - allow it, but don't decode symbols with it */ \ lzx->tbl##_empty = 1; \ } \ } while (0) /* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols * first to last in the given table. The code lengths are stored in their * own special LZX way. */ #define READ_LENGTHS(tbl, first, last) do { \ STORE_BITS; \ if (lzxd_read_lens(lzx, &HUFF_LEN(tbl, 0), (first), \ (unsigned int)(last))) return lzx->error; \ RESTORE_BITS; \ } while (0) static int lzxd_read_lens(struct lzxd_stream *lzx, unsigned char *lens, unsigned int first, unsigned int last) { /* bit buffer and huffman symbol decode variables */ register unsigned int bit_buffer; register int bits_left, i; register unsigned short sym; unsigned char *i_ptr, *i_end; unsigned int x, y; int z; RESTORE_BITS; /* read lengths for pretree (20 symbols, lengths stored in fixed 4 bits) */ for (x = 0; x < 20; x++) { READ_BITS(y, 4); lzx->PRETREE_len[x] = y; } BUILD_TABLE(PRETREE); for (x = first; x < last; ) { READ_HUFFSYM(PRETREE, z); if (z == 17) { /* code = 17, run of ([read 4 bits]+4) zeros */ READ_BITS(y, 4); y += 4; while (y--) lens[x++] = 0; } else if (z == 18) { /* code = 18, run of ([read 5 bits]+20) zeros */ READ_BITS(y, 5); y += 20; while (y--) lens[x++] = 0; } else if (z == 19) { /* code = 19, run of ([read 1 bit]+4) [read huffman symbol] */ READ_BITS(y, 1); y += 4; READ_HUFFSYM(PRETREE, z); z = lens[x] - z; if (z < 0) z += 17; while (y--) lens[x++] = z; } else { /* code = 0 to 16, delta current length entry */ z = lens[x] - z; if (z < 0) z += 17; lens[x++] = z; } } STORE_BITS; return MSPACK_ERR_OK; } /* LZX static data tables: * * LZX uses 'position slots' to represent match offsets. For every match, * a small 'position slot' number and a small offset from that slot are * encoded instead of one large offset. * * The number of slots is decided by how many are needed to encode the * largest offset for a given window size. This is easy when the gap between * slots is less than 128Kb, it's a linear relationship. But when extra_bits * reaches its limit of 17 (because LZX can only ensure reading 17 bits of * data at a time), we can only jump 128Kb at a time and have to start * using more and more position slots as each window size doubles. * * position_base[] is an index to the position slot bases * * extra_bits[] states how many bits of offset-from-base data is needed. * * They are calculated as follows: * extra_bits[i] = 0 where i < 4 * extra_bits[i] = floor(i/2)-1 where i >= 4 && i < 36 * extra_bits[i] = 17 where i >= 36 * position_base[0] = 0 * position_base[i] = position_base[i-1] + (1 << extra_bits[i-1]) */ static const unsigned int position_slots[11] = { 30, 32, 34, 36, 38, 42, 50, 66, 98, 162, 290 }; static const unsigned char extra_bits[36] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16 }; static const unsigned int position_base[290] = { 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 655360, 786432, 917504, 1048576, 1179648, 1310720, 1441792, 1572864, 1703936, 1835008, 1966080, 2097152, 2228224, 2359296, 2490368, 2621440, 2752512, 2883584, 3014656, 3145728, 3276800, 3407872, 3538944, 3670016, 3801088, 3932160, 4063232, 4194304, 4325376, 4456448, 4587520, 4718592, 4849664, 4980736, 5111808, 5242880, 5373952, 5505024, 5636096, 5767168, 5898240, 6029312, 6160384, 6291456, 6422528, 6553600, 6684672, 6815744, 6946816, 7077888, 7208960, 7340032, 7471104, 7602176, 7733248, 7864320, 7995392, 8126464, 8257536, 8388608, 8519680, 8650752, 8781824, 8912896, 9043968, 9175040, 9306112, 9437184, 9568256, 9699328, 9830400, 9961472, 10092544, 10223616, 10354688, 10485760, 10616832, 10747904, 10878976, 11010048, 11141120, 11272192, 11403264, 11534336, 11665408, 11796480, 11927552, 12058624, 12189696, 12320768, 12451840, 12582912, 12713984, 12845056, 12976128, 13107200, 13238272, 13369344, 13500416, 13631488, 13762560, 13893632, 14024704, 14155776, 14286848, 14417920, 14548992, 14680064, 14811136, 14942208, 15073280, 15204352, 15335424, 15466496, 15597568, 15728640, 15859712, 15990784, 16121856, 16252928, 16384000, 16515072, 16646144, 16777216, 16908288, 17039360, 17170432, 17301504, 17432576, 17563648, 17694720, 17825792, 17956864, 18087936, 18219008, 18350080, 18481152, 18612224, 18743296, 18874368, 19005440, 19136512, 19267584, 19398656, 19529728, 19660800, 19791872, 19922944, 20054016, 20185088, 20316160, 20447232, 20578304, 20709376, 20840448, 20971520, 21102592, 21233664, 21364736, 21495808, 21626880, 21757952, 21889024, 22020096, 22151168, 22282240, 22413312, 22544384, 22675456, 22806528, 22937600, 23068672, 23199744, 23330816, 23461888, 23592960, 23724032, 23855104, 23986176, 24117248, 24248320, 24379392, 24510464, 24641536, 24772608, 24903680, 25034752, 25165824, 25296896, 25427968, 25559040, 25690112, 25821184, 25952256, 26083328, 26214400, 26345472, 26476544, 26607616, 26738688, 26869760, 27000832, 27131904, 27262976, 27394048, 27525120, 27656192, 27787264, 27918336, 28049408, 28180480, 28311552, 28442624, 28573696, 28704768, 28835840, 28966912, 29097984, 29229056, 29360128, 29491200, 29622272, 29753344, 29884416, 30015488, 30146560, 30277632, 30408704, 30539776, 30670848, 30801920, 30932992, 31064064, 31195136, 31326208, 31457280, 31588352, 31719424, 31850496, 31981568, 32112640, 32243712, 32374784, 32505856, 32636928, 32768000, 32899072, 33030144, 33161216, 33292288, 33423360 }; static void lzxd_reset_state(struct lzxd_stream *lzx) { int i; lzx->R0 = 1; lzx->R1 = 1; lzx->R2 = 1; lzx->header_read = 0; lzx->block_remaining = 0; lzx->block_type = LZX_BLOCKTYPE_INVALID; /* initialise tables to 0 (because deltas will be applied to them) */ for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) lzx->MAINTREE_len[i] = 0; for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++) lzx->LENGTH_len[i] = 0; } /*-------- main LZX code --------*/ struct lzxd_stream *lzxd_init(struct mspack_system *system, struct mspack_file *input, struct mspack_file *output, int window_bits, int reset_interval, int input_buffer_size, off_t output_length, char is_delta) { unsigned int window_size = 1 << window_bits; struct lzxd_stream *lzx; if (!system) return NULL; /* LZX DELTA window sizes are between 2^17 (128KiB) and 2^25 (32MiB), * regular LZX windows are between 2^15 (32KiB) and 2^21 (2MiB) */ if (is_delta) { if (window_bits < 17 || window_bits > 25) return NULL; } else { if (window_bits < 15 || window_bits > 21) return NULL; } if (reset_interval < 0 || output_length < 0) { D(("reset interval or output length < 0")) return NULL; } /* round up input buffer size to multiple of two */ input_buffer_size = (input_buffer_size + 1) & -2; if (input_buffer_size < 2) return NULL; /* allocate decompression state */ if (!(lzx = (struct lzxd_stream *) system->alloc(system, sizeof(struct lzxd_stream)))) { return NULL; } /* allocate decompression window and input buffer */ lzx->window = (unsigned char *) system->alloc(system, (size_t) window_size); lzx->inbuf = (unsigned char *) system->alloc(system, (size_t) input_buffer_size); if (!lzx->window || !lzx->inbuf) { system->free(lzx->window); system->free(lzx->inbuf); system->free(lzx); return NULL; } /* initialise decompression state */ lzx->sys = system; lzx->input = input; lzx->output = output; lzx->offset = 0; lzx->length = output_length; lzx->inbuf_size = input_buffer_size; lzx->window_size = 1 << window_bits; lzx->ref_data_size = 0; lzx->window_posn = 0; lzx->frame_posn = 0; lzx->frame = 0; lzx->reset_interval = reset_interval; lzx->intel_filesize = 0; lzx->intel_curpos = 0; lzx->intel_started = 0; lzx->error = MSPACK_ERR_OK; lzx->num_offsets = position_slots[window_bits - 15] << 3; lzx->is_delta = is_delta; lzx->o_ptr = lzx->o_end = &lzx->e8_buf[0]; lzxd_reset_state(lzx); INIT_BITS; return lzx; } int lzxd_set_reference_data(struct lzxd_stream *lzx, struct mspack_system *system, struct mspack_file *input, unsigned int length) { if (!lzx) return MSPACK_ERR_ARGS; if (!lzx->is_delta) { D(("only LZX DELTA streams support reference data")) return MSPACK_ERR_ARGS; } if (lzx->offset) { D(("too late to set reference data after decoding starts")) return MSPACK_ERR_ARGS; } if (length > lzx->window_size) { D(("reference length (%u) is longer than the window", length)) return MSPACK_ERR_ARGS; } if (length > 0 && (!system || !input)) { D(("length > 0 but no system or input")) return MSPACK_ERR_ARGS; } lzx->ref_data_size = length; if (length > 0) { /* copy reference data */ unsigned char *pos = &lzx->window[lzx->window_size - length]; int bytes = system->read(input, pos, length); /* length can't be more than 2^25, so no signedness problem */ if (bytes < (int)length) return MSPACK_ERR_READ; } lzx->ref_data_size = length; return MSPACK_ERR_OK; } void lzxd_set_output_length(struct lzxd_stream *lzx, off_t out_bytes) { if (lzx && out_bytes > 0) lzx->length = out_bytes; } int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) { /* bitstream and huffman reading variables */ register unsigned int bit_buffer; register int bits_left, i=0; unsigned char *i_ptr, *i_end; register unsigned short sym; int match_length, length_footer, extra, verbatim_bits, bytes_todo; int this_run, main_element, aligned_bits, j, warned = 0; unsigned char *window, *runsrc, *rundest, buf[12]; unsigned int frame_size=0, end_frame, match_offset, window_posn; unsigned int R0, R1, R2; /* easy answers */ if (!lzx || (out_bytes < 0)) return MSPACK_ERR_ARGS; if (lzx->error) return lzx->error; /* flush out any stored-up bytes before we begin */ i = lzx->o_end - lzx->o_ptr; if ((off_t) i > out_bytes) i = (int) out_bytes; if (i) { if (lzx->sys->write(lzx->output, lzx->o_ptr, i) != i) { return lzx->error = MSPACK_ERR_WRITE; } lzx->o_ptr += i; lzx->offset += i; out_bytes -= i; } if (out_bytes == 0) return MSPACK_ERR_OK; /* restore local state */ RESTORE_BITS; window = lzx->window; window_posn = lzx->window_posn; R0 = lzx->R0; R1 = lzx->R1; R2 = lzx->R2; end_frame = (unsigned int)((lzx->offset + out_bytes) / LZX_FRAME_SIZE) + 1; while (lzx->frame < end_frame) { /* have we reached the reset interval? (if there is one?) */ if (lzx->reset_interval && ((lzx->frame % lzx->reset_interval) == 0)) { if (lzx->block_remaining) { /* this is a file format error, we can make a best effort to extract what we can */ D(("%d bytes remaining at reset interval", lzx->block_remaining)) if (!warned) { lzx->sys->message(NULL, "WARNING; invalid reset interval detected during LZX decompression"); warned++; } } /* re-read the intel header and reset the huffman lengths */ lzxd_reset_state(lzx); R0 = lzx->R0; R1 = lzx->R1; R2 = lzx->R2; } /* LZX DELTA format has chunk_size, not present in LZX format */ if (lzx->is_delta) { ENSURE_BITS(16); REMOVE_BITS(16); } /* read header if necessary */ if (!lzx->header_read) { /* read 1 bit. if bit=0, intel filesize = 0. * if bit=1, read intel filesize (32 bits) */ j = 0; READ_BITS(i, 1); if (i) { READ_BITS(i, 16); READ_BITS(j, 16); } lzx->intel_filesize = (i << 16) | j; lzx->header_read = 1; } /* calculate size of frame: all frames are 32k except the final frame * which is 32kb or less. this can only be calculated when lzx->length * has been filled in. */ frame_size = LZX_FRAME_SIZE; if (lzx->length && (lzx->length - lzx->offset) < (off_t)frame_size) { frame_size = lzx->length - lzx->offset; } /* decode until one more frame is available */ bytes_todo = lzx->frame_posn + frame_size - window_posn; while (bytes_todo > 0) { /* initialise new block, if one is needed */ if (lzx->block_remaining == 0) { /* realign if previous block was an odd-sized UNCOMPRESSED block */ if ((lzx->block_type == LZX_BLOCKTYPE_UNCOMPRESSED) && (lzx->block_length & 1)) { READ_IF_NEEDED; i_ptr++; } /* read block type (3 bits) and block length (24 bits) */ READ_BITS(lzx->block_type, 3); READ_BITS(i, 16); READ_BITS(j, 8); lzx->block_remaining = lzx->block_length = (i << 8) | j; /*D(("new block t%d len %u", lzx->block_type, lzx->block_length))*/ /* read individual block headers */ switch (lzx->block_type) { case LZX_BLOCKTYPE_ALIGNED: /* read lengths of and build aligned huffman decoding tree */ for (i = 0; i < 8; i++) { READ_BITS(j, 3); lzx->ALIGNED_len[i] = j; } BUILD_TABLE(ALIGNED); /* rest of aligned header is same as verbatim */ /*@fallthrough@*/ case LZX_BLOCKTYPE_VERBATIM: /* read lengths of and build main huffman decoding tree */ READ_LENGTHS(MAINTREE, 0, 256); READ_LENGTHS(MAINTREE, 256, LZX_NUM_CHARS + lzx->num_offsets); BUILD_TABLE(MAINTREE); /* if the literal 0xE8 is anywhere in the block... */ if (lzx->MAINTREE_len[0xE8] != 0) lzx->intel_started = 1; /* read lengths of and build lengths huffman decoding tree */ READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS); BUILD_TABLE_MAYBE_EMPTY(LENGTH); break; case LZX_BLOCKTYPE_UNCOMPRESSED: /* because we can't assume otherwise */ lzx->intel_started = 1; /* read 1-16 (not 0-15) bits to align to bytes */ if (bits_left == 0) ENSURE_BITS(16); bits_left = 0; bit_buffer = 0; /* read 12 bytes of stored R0 / R1 / R2 values */ for (rundest = &buf[0], i = 0; i < 12; i++) { READ_IF_NEEDED; *rundest++ = *i_ptr++; } R0 = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); R1 = buf[4] | (buf[5] << 8) | (buf[6] << 16) | (buf[7] << 24); R2 = buf[8] | (buf[9] << 8) | (buf[10] << 16) | (buf[11] << 24); break; default: D(("bad block type")) return lzx->error = MSPACK_ERR_DECRUNCH; } } /* decode more of the block: * run = min(what's available, what's needed) */ this_run = lzx->block_remaining; if (this_run > bytes_todo) this_run = bytes_todo; /* assume we decode exactly this_run bytes, for now */ bytes_todo -= this_run; lzx->block_remaining -= this_run; /* decode at least this_run bytes */ switch (lzx->block_type) { case LZX_BLOCKTYPE_VERBATIM: while (this_run > 0) { READ_HUFFSYM(MAINTREE, main_element); if (main_element < LZX_NUM_CHARS) { /* literal: 0 to LZX_NUM_CHARS-1 */ window[window_posn++] = main_element; this_run--; } else { /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ main_element -= LZX_NUM_CHARS; /* get match length */ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; if (match_length == LZX_NUM_PRIMARY_LENGTHS) { if (lzx->LENGTH_empty) { D(("LENGTH symbol needed but tree is empty")) return lzx->error = MSPACK_ERR_DECRUNCH; } READ_HUFFSYM(LENGTH, length_footer); match_length += length_footer; } match_length += LZX_MIN_MATCH; /* get match offset */ switch ((match_offset = (main_element >> 3))) { case 0: match_offset = R0; break; case 1: match_offset = R1; R1=R0; R0 = match_offset; break; case 2: match_offset = R2; R2=R0; R0 = match_offset; break; case 3: match_offset = 1; R2=R1; R1=R0; R0 = match_offset; break; default: extra = (match_offset >= 36) ? 17 : extra_bits[match_offset]; READ_BITS(verbatim_bits, extra); match_offset = position_base[match_offset] - 2 + verbatim_bits; R2 = R1; R1 = R0; R0 = match_offset; } /* LZX DELTA uses max match length to signal even longer match */ if (match_length == LZX_MAX_MATCH && lzx->is_delta) { int extra_len = 0; ENSURE_BITS(3); /* 4 entry huffman tree */ if (PEEK_BITS(1) == 0) { REMOVE_BITS(1); /* '0' -> 8 extra length bits */ READ_BITS(extra_len, 8); } else if (PEEK_BITS(2) == 2) { REMOVE_BITS(2); /* '10' -> 10 extra length bits + 0x100 */ READ_BITS(extra_len, 10); extra_len += 0x100; } else if (PEEK_BITS(3) == 6) { REMOVE_BITS(3); /* '110' -> 12 extra length bits + 0x500 */ READ_BITS(extra_len, 12); extra_len += 0x500; } else { REMOVE_BITS(3); /* '111' -> 15 extra length bits */ READ_BITS(extra_len, 15); } match_length += extra_len; } if ((window_posn + match_length) > lzx->window_size) { D(("match ran over window wrap")) return lzx->error = MSPACK_ERR_DECRUNCH; } /* copy match */ rundest = &window[window_posn]; i = match_length; /* does match offset wrap the window? */ if (match_offset > window_posn) { if (match_offset > lzx->offset && (match_offset - window_posn) > lzx->ref_data_size) { D(("match offset beyond LZX stream")) return lzx->error = MSPACK_ERR_DECRUNCH; } /* j = length from match offset to end of window */ j = match_offset - window_posn; if (j > (int) lzx->window_size) { D(("match offset beyond window boundaries")) return lzx->error = MSPACK_ERR_DECRUNCH; } runsrc = &window[lzx->window_size - j]; if (j < i) { /* if match goes over the window edge, do two copy runs */ i -= j; while (j-- > 0) *rundest++ = *runsrc++; runsrc = window; } while (i-- > 0) *rundest++ = *runsrc++; } else { runsrc = rundest - match_offset; while (i-- > 0) *rundest++ = *runsrc++; } this_run -= match_length; window_posn += match_length; } } /* while (this_run > 0) */ break; case LZX_BLOCKTYPE_ALIGNED: while (this_run > 0) { READ_HUFFSYM(MAINTREE, main_element); if (main_element < LZX_NUM_CHARS) { /* literal: 0 to LZX_NUM_CHARS-1 */ window[window_posn++] = main_element; this_run--; } else { /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ main_element -= LZX_NUM_CHARS; /* get match length */ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; if (match_length == LZX_NUM_PRIMARY_LENGTHS) { if (lzx->LENGTH_empty) { D(("LENGTH symbol needed but tree is empty")) return lzx->error = MSPACK_ERR_DECRUNCH; } READ_HUFFSYM(LENGTH, length_footer); match_length += length_footer; } match_length += LZX_MIN_MATCH; /* get match offset */ switch ((match_offset = (main_element >> 3))) { case 0: match_offset = R0; break; case 1: match_offset = R1; R1 = R0; R0 = match_offset; break; case 2: match_offset = R2; R2 = R0; R0 = match_offset; break; default: extra = (match_offset >= 36) ? 17 : extra_bits[match_offset]; match_offset = position_base[match_offset] - 2; if (extra > 3) { /* verbatim and aligned bits */ extra -= 3; READ_BITS(verbatim_bits, extra); match_offset += (verbatim_bits << 3); READ_HUFFSYM(ALIGNED, aligned_bits); match_offset += aligned_bits; } else if (extra == 3) { /* aligned bits only */ READ_HUFFSYM(ALIGNED, aligned_bits); match_offset += aligned_bits; } else if (extra > 0) { /* extra==1, extra==2 */ /* verbatim bits only */ READ_BITS(verbatim_bits, extra); match_offset += verbatim_bits; } else /* extra == 0 */ { /* ??? not defined in LZX specification! */ match_offset = 1; } /* update repeated offset LRU queue */ R2 = R1; R1 = R0; R0 = match_offset; } /* LZX DELTA uses max match length to signal even longer match */ if (match_length == LZX_MAX_MATCH && lzx->is_delta) { int extra_len = 0; ENSURE_BITS(3); /* 4 entry huffman tree */ if (PEEK_BITS(1) == 0) { REMOVE_BITS(1); /* '0' -> 8 extra length bits */ READ_BITS(extra_len, 8); } else if (PEEK_BITS(2) == 2) { REMOVE_BITS(2); /* '10' -> 10 extra length bits + 0x100 */ READ_BITS(extra_len, 10); extra_len += 0x100; } else if (PEEK_BITS(3) == 6) { REMOVE_BITS(3); /* '110' -> 12 extra length bits + 0x500 */ READ_BITS(extra_len, 12); extra_len += 0x500; } else { REMOVE_BITS(3); /* '111' -> 15 extra length bits */ READ_BITS(extra_len, 15); } match_length += extra_len; } if ((window_posn + match_length) > lzx->window_size) { D(("match ran over window wrap")) return lzx->error = MSPACK_ERR_DECRUNCH; } /* copy match */ rundest = &window[window_posn]; i = match_length; /* does match offset wrap the window? */ if (match_offset > window_posn) { if (match_offset > lzx->offset && (match_offset - window_posn) > lzx->ref_data_size) { D(("match offset beyond LZX stream")) return lzx->error = MSPACK_ERR_DECRUNCH; } /* j = length from match offset to end of window */ j = match_offset - window_posn; if (j > (int) lzx->window_size) { D(("match offset beyond window boundaries")) return lzx->error = MSPACK_ERR_DECRUNCH; } runsrc = &window[lzx->window_size - j]; if (j < i) { /* if match goes over the window edge, do two copy runs */ i -= j; while (j-- > 0) *rundest++ = *runsrc++; runsrc = window; } while (i-- > 0) *rundest++ = *runsrc++; } else { runsrc = rundest - match_offset; while (i-- > 0) *rundest++ = *runsrc++; } this_run -= match_length; window_posn += match_length; } } /* while (this_run > 0) */ break; case LZX_BLOCKTYPE_UNCOMPRESSED: /* as this_run is limited not to wrap a frame, this also means it * won't wrap the window (as the window is a multiple of 32k) */ rundest = &window[window_posn]; window_posn += this_run; while (this_run > 0) { if ((i = i_end - i_ptr) == 0) { READ_IF_NEEDED; } else { if (i > this_run) i = this_run; lzx->sys->copy(i_ptr, rundest, (size_t) i); rundest += i; i_ptr += i; this_run -= i; } } break; default: return lzx->error = MSPACK_ERR_DECRUNCH; /* might as well */ } /* did the final match overrun our desired this_run length? */ if (this_run < 0) { if ((unsigned int)(-this_run) > lzx->block_remaining) { D(("overrun went past end of block by %d (%d remaining)", -this_run, lzx->block_remaining )) return lzx->error = MSPACK_ERR_DECRUNCH; } lzx->block_remaining -= -this_run; } } /* while (bytes_todo > 0) */ /* streams don't extend over frame boundaries */ if ((window_posn - lzx->frame_posn) != frame_size) { D(("decode beyond output frame limits! %d != %d", window_posn - lzx->frame_posn, frame_size)) return lzx->error = MSPACK_ERR_DECRUNCH; } /* re-align input bitstream */ if (bits_left > 0) ENSURE_BITS(16); if (bits_left & 15) REMOVE_BITS(bits_left & 15); /* check that we've used all of the previous frame first */ if (lzx->o_ptr != lzx->o_end) { D(("%ld avail bytes, new %d frame", (long)(lzx->o_end - lzx->o_ptr), frame_size)) return lzx->error = MSPACK_ERR_DECRUNCH; } /* does this intel block _really_ need decoding? */ if (lzx->intel_started && lzx->intel_filesize && (lzx->frame <= 32768) && (frame_size > 10)) { unsigned char *data = &lzx->e8_buf[0]; unsigned char *dataend = &lzx->e8_buf[frame_size - 10]; signed int curpos = lzx->intel_curpos; signed int filesize = lzx->intel_filesize; signed int abs_off, rel_off; /* copy e8 block to the e8 buffer and tweak if needed */ lzx->o_ptr = data; lzx->sys->copy(&lzx->window[lzx->frame_posn], data, frame_size); while (data < dataend) { if (*data++ != 0xE8) { curpos++; continue; } abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24); if ((abs_off >= -curpos) && (abs_off < filesize)) { rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize; data[0] = (unsigned char) rel_off; data[1] = (unsigned char) (rel_off >> 8); data[2] = (unsigned char) (rel_off >> 16); data[3] = (unsigned char) (rel_off >> 24); } data += 4; curpos += 5; } lzx->intel_curpos += frame_size; } else { lzx->o_ptr = &lzx->window[lzx->frame_posn]; if (lzx->intel_filesize) lzx->intel_curpos += frame_size; } lzx->o_end = &lzx->o_ptr[frame_size]; /* write a frame */ i = (out_bytes < (off_t)frame_size) ? (unsigned int)out_bytes : frame_size; if (lzx->sys->write(lzx->output, lzx->o_ptr, i) != i) { return lzx->error = MSPACK_ERR_WRITE; } lzx->o_ptr += i; lzx->offset += i; out_bytes -= i; /* advance frame start position */ lzx->frame_posn += frame_size; lzx->frame++; /* wrap window / frame position pointers */ if (window_posn == lzx->window_size) window_posn = 0; if (lzx->frame_posn == lzx->window_size) lzx->frame_posn = 0; } /* while (lzx->frame < end_frame) */ if (out_bytes) { D(("bytes left to output")) return lzx->error = MSPACK_ERR_DECRUNCH; } /* store local state */ STORE_BITS; lzx->window_posn = window_posn; lzx->R0 = R0; lzx->R1 = R1; lzx->R2 = R2; return MSPACK_ERR_OK; } void lzxd_free(struct lzxd_stream *lzx) { struct mspack_system *sys; if (lzx) { sys = lzx->sys; sys->free(lzx->inbuf); sys->free(lzx->window); sys->free(lzx); } } cabextract-1.9/getopt.h0000664000175000017500000001403313370030226012076 00000000000000/* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if defined __STDC__ && __STDC__ const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if defined __STDC__ && __STDC__ # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int __argc, char *const *__argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ cabextract-1.9/test-driver0000755000175000017500000001104013370076347012630 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: cabextract-1.9/Makefile.am0000664000175000017500000000277413370027101012466 00000000000000AUTOMAKE_OPTIONS = no-dependencies subdir-objects bundled_mspack = mspack/mspack.h \ mspack/system.h mspack/system.c \ mspack/cab.h mspack/cabd.c \ mspack/lzx.h mspack/lzxd.c \ mspack/mszip.h mspack/mszipd.c \ mspack/qtm.h mspack/qtmd.c \ mspack/readbits.h mspack/readhuff.h TESTS = test/bugs.test test/case.test test/dirwalk-vulns.test \ test/encoding.test test/mixed.test test/search.test \ test/simple.test test/split.test test/utf8-stresstest.test EXTRA_DIST = cabextract.spec \ doc/cabextract.1 doc/ja/cabextract.1 \ doc/magic doc/wince_cab_format.html \ fnmatch_.h getopt.h src/cabsplit \ src/wince_info src/wince_rename \ mspack/ChangeLog $(bundled_mspack) \ $(TESTS) test/bugs test/cabs bin_PROGRAMS = cabextract check_PROGRAMS = cabextract noinst_PROGRAMS = src/cabinfo man_MANS = doc/cabextract.1 cabextract_SOURCES = src/cabextract.c md5.h md5.c cabextract_LDADD = @LIBOBJS@ @LIBICONV@ if !EXTERNAL_LIBMSPACK cabextract_LDADD += libmscab.a noinst_LIBRARIES = libmscab.a libmscab_a_SOURCES = $(bundled_mspack) AM_CPPFLAGS = -I$(srcdir)/mspack -DMSPACK_NO_DEFAULT_SYSTEM endif cabextract-1.9/md5.h0000664000175000017500000001305313370030226011262 00000000000000/* md5.h - Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MD5_H #define _MD5_H 1 #include #include /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but doing that would require that the configure script compile and *run* the resulting executable. Locally running cross-compiled executables is usually not possible. */ #if HAVE_INTTYPES_H || HAVE_STDINT_H # if HAVE_INTTYPES_H # include # else # include # endif typedef uint32_t md5_uint32; typedef uintptr_t md5_uintptr; #else # if defined __STDC__ && __STDC__ # define UINT_MAX_32_BITS 4294967295U # else # define UINT_MAX_32_BITS 0xFFFFFFFF # endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ # ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS # endif # if UINT_MAX == UINT_MAX_32_BITS typedef unsigned int md5_uint32; # else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short md5_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long md5_uint32; # else /* The following line is intended to evoke an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif # endif /* We have to make a guess about the integer type equivalent in size to pointers which should always be correct. */ typedef unsigned long int md5_uintptr; #endif #undef __P #if defined (__STDC__) && __STDC__ #define __P(x) x #else #define __P(x) () #endif /* Structure to save state of computation between the single steps. */ struct md5_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128]; }; /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ extern void md5_init_ctx __P ((struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void md5_process_block __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void md5_process_bytes __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF be correctly aligned for a 32 bits value. */ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ extern int md5_stream __P ((FILE *stream, void *resblock)); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); /* The following is from gnupg-1.0.2's cipher/bithelp.h. */ /* Rotate a 32 bit integer by n bytes */ #if defined __GNUC__ && defined __i386__ static inline md5_uint32 rol(md5_uint32 x, int n) { __asm__("roll %%cl,%0" :"=r" (x) :"0" (x),"c" (n)); return x; } #else # define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) #endif #endif cabextract-1.9/missing0000755000175000017500000001533013370076346012036 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: cabextract-1.9/config.sub0000755000175000017500000010645013370076346012426 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: cabextract-1.9/NEWS0000644000175000017500000002071213367425154011137 00000000000000New in 1.9 * Fixed invisible bad extraction when using cabextract -F (broken in 1.8) * Fixed configure --with-external-libmspack which was broken in 1.8 * configure --with-external-libmspack will now use pkg-config. To configure it manually, set environment variables libmspack_CFLAGS and libmspack_LIBS before running configure. * Now includes the test suite (make check) New in 1.8 * cabextract -f now extracts even more badly damaged files than before New in 1.7 * cabextract now supports an --encoding parameter, to specify the character encoding of CAB filenames if they are not ASCII or UTF8 * cabextract -L now lowercases non-ASCII characters New in 1.6 * cabextract now prevents archive files giving themselves absolute path access using badly UTF-8 encoded slashes. * Because Cygwin allows both '/' and '\' as path separators, cabextract now removes both leading '/'s and '\'s and changes both "../" and "..\" in CAB filenames to "xx". You can no longer have a CAB filename called e.g "\/t" (file "t" in the directory "\"). If you need this, create a CAB file where the filename is "./\/t" instead. New in 1.5 * cabextract replaces bad Unicode characters in filenames with the standard Unicode replacement character * wince_rename now puts files under the correct installation path * Several crashes and hangs were found by Debian project members using the afl (American fuzzy lop) tool to generate corrupt cabinet files. These crashes and hangs have been fixed. New in 1.4: * A bug in the LZX decompressor was fixed. * cabextract is now more tolerant when processing cabinet sets. * cabextract is now compatible with even more compilers, and now supports 64-bit file I/O on platforms where it's completely native, like Mac OS X 10.6 and Fedora x86_64. * cabextract will no longer print "library not compiled to support large files" while reading small files. * The Windows CE installation format document was improved. New in 1.3: * Bugs in the MS-ZIP and Quantum decompressors have been fixed. * MS-ZIP recovery has been improved. * cabextract should now compile with MinGW New in 1.2: * "-t" option: Allows you to test that every file can be extracted without having to extract it. This also prints the MD5 checksum of the file. * UTF-8 filenames are now decoded correctly. * Large files (>2GB) are now searched correctly for cabinets. * Problems with the GNU library code have been fixed. * Several bugs in the LZX and Quantum decompressors have been fixed. New in 1.1: * A security vulnerability has been fixed. If the files within a cabinet file include the directory ".." in their filename, this will be changed to "xx", to prevent directory traversal by a malicious cabinet (e.g. a cabinet with "..\etc\passwd", "..\..\etc\passwd" and so on) * The GNU library code used has been upgraded to the latest from libiberty, so it should now work better with Cygwin. * cabextract should now compile cleanly on AIX. New in 1.0: * The libmspack library is used for all the hard work. You should find cabextract more robust, and fractionally faster. See the libmspack website at https://www.cabextract.org.uk/libmspack/ for more on this library. * Fixed a bug (now moved to libmspack) where CAB files that had two kinds of compression would crash. * CAB files should no longer get "/" and "\" mixed up, even with non MS-DOS cabinet files created by tools like Powerarchiver and Cablinux. * Now ignores CAB files listed on the command line that have already been used as part of a multipart set. You can now type "cabextract *.cab" on your Win95 cabinet set, and cabextract will not extract all the files sixty times over. * Now supports reading and extracting large (more than 2Gb) files. * "-L" option: viewing the archive pays attention to the "-L" flag, and shows the filenames in lowercase. * "-L" option: cabextract now correctly lowercases cabinet files with Unicode filenames. * "-l" option: viewing the archive should always show forward slashes as directory seperators. * "-F" option: Now you can choose which files are extracted from the cab. For example, "cabextract -F '*.wav' music.cab" extracts only WAV files. * "-s" option: Now you can limit which multipart cabinets are used. For example, "cabextract -s WIN98_5*.CAB" will only extract files from WIN98_50.CAB through WIN98_59.CAB. * "-p" option: Now you can extract files to stdout rather than disk. * Now comes with an experimental "wince_info" and "wince_rename" perl scripts in the src/ directory, for examining and processing Windows CE installation cabinet header files. There is also the "cabinfo" command for examining the structure of a cab file. As this information is not very useful to most people, none of these three tools are installed. * Both the English and Japanese manual page have been updated. * cabextract now alerts you if you try to unpack InstallShield cabinets. * The definition of Microsoft cabinet files for UNIX's "magic" file, in doc/magic, has been fixed, and a definition of Windows CE install cabinet header files has also been added. New in 0.6: * Quantum method is now supported! Many thanks to Matthew Russotto for this. * Fixed more build problems on non-glibc systems. I have now followed the 'FSF approved' method for including getopt_long, so hopefully Solaris and all the other OSes won't have a problem building cabextract any more. * Japanese manual page included -- you will have to install the file ja/cabextract.1 by yourself, it's not part of the install process. * Now searches for spanning cabinet files in a case-insensitive way. It also searches in both directions for spanned cabinets (each spanned cabinet can include a 'previous' and 'next' cabinet filename), so you can also specify a cabinet in the middle of a set and get the full set, rather than have to work out what the first cabinet is. * An off-by-one month error in file dates was fixed. * Cabinets with files beginning with "/" (or rather, "\") no longer extract to your root directory. * A better embeded cabinet search algorithm was introduced for finding those elusive cabinets in files and executables :) * Now you can find more than one cabinet in a file (if there is more than one to find), and it will be extracted or listed as normal. * Files and directories created now honour your umask settings. * Errors and warnings are now printed to stderr. New in 0.5: * Fixed build problems on non-glibc systems. New in 0.4: * Fixed a new bug I added by myself to 0.3... :) It corrupts all MS-ZIP compressed cabinets after the first 32k, and it should be very obvious that corruption has taken place. * cabextract should be happier building on Cygwin and other such architectures -- you should be able to "./configure; make; make install" again. This was broken in 0.3 due to the getopt.c / getopt1.c weirdness I copied from GNU hello. * Now prints 'Finished processing cabinet.' after completing the extraction a cabinet. New in 0.3: * Fixed very rare, but invisible decrunching bug... if you have any important things you extracted with cabextract, extract them again to be sure they're not corrupt. * cabextract now tells you if a file isn't a cabinet file. * cabextract now goes on to the next file, if extracting one fails. * cabextract now goes on to the next cabinet, if extracting one fails. * cabextract lets you try to 'fix' some cabinets by skipping over bad blocks rather than failing on them. If you have a corrupt cabinet, try the '-f' option, and see how it goes. * Use the new '-d dir' option to extract cabinets to a given directory. * Use the new '-L' option to turn the extracted filenames to lowercase. * Use the new '-q' option to be quiet while extracting archives. * cabextract now prints more information while it's probing multi-part cabinets New in 0.2: * new even-easier installation: ./configure; make; make install * Extracted files now have their timestamps set * Fixed bug which occured when extracting tiny files * Fixed completely invisible intel E8 decoding bug... if you have any important things you extracted with cabextract, extract them again to be sure they're not corrupt. * cabinet search extended to look through *any* file for cabinets, not just MS-DOS/Windows executables. * Now looks for multipart cabinets in the same directory as the base cabinet. This means you can do stuff like 'cd /tmp && cabextract /cdrom/part01.cab' New in 0.1: * supports MSZIP and LZX compression methods * supports split cabs and cabs embedded in executables * initial release cabextract-1.9/TODO0000644000175000017500000000153512534254616011130 00000000000000Automatic renaming of files in their long form, for Windows CE install cabs. This would probably be another program using libmspack, rather than auto-detected by cabextract. Provide tool for finding OLE2 streams and dumping them. Some InstallShield Wizard use MS CAB files inside MS OLE2 streams. They look normal, but every so often, there's a 512 bytes extra here and a 512 bytes missing there, so the cabinets aren't contiguous. More advanced repair of corrupted CABs? Possible? cabjoin - a new program that will read multipart cabinets and output a single cabinet file containing all parts. Allow reading a cabinet from stdin. Allow an exacting list of files to be matched rather than a single pattern match. Allow more than one pattern match? cabextract should be localised. cabextract should not overwrite the source cabinet files when unpacking. cabextract-1.9/install-sh0000755000175000017500000003546313370076346012454 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: cabextract-1.9/aclocal.m40000664000175000017500000032454413370076344012311 00000000000000# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # iconv.m4 serial 19 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) # lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) cabextract-1.9/cabextract.spec.in0000644000175000017500000000161313323412475014032 00000000000000Summary: A program to extract Microsoft Cabinet files Name: cabextract Version: @VERSION@ Release: 1 License: GPL Group: Applications/Archiving Source: https://www.cabextract.org.uk/%{name}-%{version}.tar.gz URL: https://www.cabextract.org.uk/ Vendor: Stuart Caie Packager: Stuart Caie BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: /usr %description Cabinet (.CAB) files are a form of archive, which Microsoft use to distribute their software, and things like Windows Font Packs. The cabextract program unpacks these files. %prep %setup %build CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} make %install rm -rf ${RPM_BUILD_ROOT} %makeinstall %clean [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(0644, root, root, 0755) %doc AUTHORS ChangeLog NEWS README %attr(0755, root, root) %{_bindir}/cabextract %{_mandir}/man1/cabextract.1* cabextract-1.9/doc/0000775000175000017500000000000013370076412011256 500000000000000cabextract-1.9/doc/cabextract.10000644000175000017500000000577513361333742013416 00000000000000.TH CABEXTRACT 1 "March 7, 2018" .SH NAME cabextract \- program to extract files from Microsoft cabinet (.cab) archives .SH SYNOPSIS .B cabextract .RB [ -d \fIdir\fP ] .RB [ -f ] .RB [ -F \fIpattern\fP ] .RB [ -e \fIencoding\fP ] .RB [ -h ] .RB [ -l ] .RB [ -L ] .RB [ -p ] .RB [ -q ] .RB [ -s ] .RB [ -t ] .RB [ -v ] .I " cabinet files" ... .SH DESCRIPTION .B cabextract is a program that un-archives files in the Microsoft cabinet file format (.cab) or any binary file which contains an embedded cabinet file (frequently found in .exe files). .PP .B cabextract will extract all files from all cabinet files specified on the command line. .PP To extract a multi\-part cabinet consisting of several files, only the .I first cabinet file needs to be given as an argument to .B cabextract as it will automatically look for the remaining files. To prevent .B cabextract from extracting cabinet files you did not specify, use the .B -s option. .SH OPTIONS A summary of options is included below. .TP .B \-d \fIdir\fP Extracts all files into the directory \fIdir\fP. .TP .B \-f Corrupted cabinet files will be 'fixed' to salvage whatever is possible from them. File entries with bad folders or names will be skipped rather than rejecting the entire cabinet file. Impossible file lengths will be truncated to extract as much as possible, including when you're missing later files in a cabinet set. Corrupted MSZIP blocks and failed block checksums will be ignored. Warnings will be printed if any of these conditions are met. .TP .B \-F \fIpattern\fP Only files with names that match the shell pattern \fIpattern\fP shall be listed, tested or extracted. On non-GNU systems, this match may be case-sensitive. .TP .B \-e \fIencoding\fP Specify the character encoding of filenames inside the cabinet files. This is only needed if you find cabinet files with garbled filenames; most software creates CAB files with either ASCII or UTF8 filenames. The list of supported encodings is given by the command "iconv \-l". .TP .B \-h Prints a page of help and exits. .TP .B \-l Lists the contents of the given cabinet files, rather than extracting them. .TP .B \-L When extracting cabinet files, makes each extracted file's name lowercase. .TP .B \-p Files shall be extracted to standard output. .TP .B \-q When extracting cabinet files, suppresses all messages except errors and warnings. .TP .B \-s When testing, listing or extracting cabinets which span multiple files, only cabinet files given on the command line shall be used. .TP .B \-t Tests the integrity of the cabinet. Files are decompressed, but not written to disk or standard output. If the file successfully decompresses, the MD5 checksum of the file is printed. .TP .B \-v If given alone on the command line, prints the version of .B cabextract and exits. Given with a list of cabinet files, it will list the contents of the cabinet files. .SH AUTHOR This manual page was written by Stuart Caie , based on the one written by Eric Sharkey , for the Debian GNU/Linux system. cabextract-1.9/doc/wince_cab_format.html0000644000175000017500000005630213323412475015353 00000000000000 Windows CE installation cabinet (.CAB) file format

Windows CE installation cabinet (.CAB) file format

Table of Contents

About the format

The Windows CE installation cabinet format was designed by Microsoft make it easy to create packaged software for the Windows CE platform. After generating all his executable programs, data files, help files and so on, a developer can then write an "installation script" which lists the name of the software package, where each file should be installed on the target device's filesystem, registry entries to make on the target system's Windows Registry, and so on. A tool called "CabWiz" takes the installation script and produces a single CAB file with a special control file stored in it. On the target Windows CE device, a program called WCELOAD.EXE will read cabinet files, install them, register them as installed packages, set their registry entries, and so on.

The Cabinet format was previously developed by Microsoft for creating a simple archive format for packaged software, from entire operating systems down to ActiveX Web plugins. They also intended to displace Sun's JAR format for packaging Java software, but this did not succeed.

Overall cabinet file format

Firstly, the overall file format of a Windows CE installation cabinet is the standard Microsoft Cabinet file format. This was originally documented in the Microsoft document CABFMT.DOC as part of the Microsoft Cabinet SDK (CAB-SDK.EXE), it is now documented in the Windows Installer documentation. The format can also be gleaned from open source tools and libraries such as cabextract and libmspack. Windows CE installation cabinets typically use no compression (the NONE compression method in the cabinet specification), sometimes MSZIP compression.

Cabinet file contents

The filenames of the files in the cabinet use the MS-DOS "8.3" convention, where the first eight characters in the filename come from the "true filename", and are followed by a period and three numeric digits. The digits form a decimal number from 000 to 999. The name part before the period is currently always 8 characters (shorter names are padded on the left with "0"), but this shouldn't be relied upon. Only the numeric extension should be used to identify the file. There should not be more than one file in the cabinet with the same numeric extension. As an example:

Name in cab fileOriginal filename
BLKJAC~4.000--- (installation data)
BLACKJ~1.999Blackjack Setup.dll
SELFRE~1.006SelfRegister.dll
0Blkjack.005Blkjack.exe
00Sample.004Sample.BJL
WINGAM~1.003Win Game.wav
LOSEGA~1.002Lose Game.wav
BLACKJ~1.001Blackjack Help.htp

The order of these files within the cab file is important. The first file in the cabinet should be the ".000" file. It should then be followed by all other files in descending numerical order of their extensions.

These original filenames are not recoverable, they are not stored anywhere. The only names available are the target filenames given in the FILES section of the .000 file.

All installation data is contained in the .000 file. If a .999 file exists, it is an "application specific Setup.DLL"; a Microsoft standard Dynamic Link Library that will be loaded and executed after installation by the installation program. All other files are files for installation on the Windows CE device, and the three digits should be resolved into an integer "file number".

Format of the .000 file

All multi-byte integers are little-endian. Values given in this document are in decimal, unless otherwise specified. The overall file format of the .000 file is as follows:

Only the fixed size header has a fixed file offset, all other strings and sections may be at any file offset, in any order. They are typically in the order given above. Each file offset is given in the fixed size header.

The fixed size header

The .000 file begins at file offset 0 with a fixed size header of exactly 100 bytes. The format of this header is as follows:

OffsetSize in bytesDescription
04An ASCII signature, "MSCE". This is 0x4543534D as a little-endian integer.
44Unknown purpose, usually 0.
84The overall length of this .000 header file, in bytes.
124Unknown purpose, usually 0.
164Unknown purpose, usually 1.
204Target architecture for this cabinet: see Appendix A.
244Minimal version of WinCE (major version number) required to install this cabinet, or 0 to indicate no restriction.
284Minimal version of WinCE (minor version number) required to install this cabinet, or 0 to indicate no restriction.
324Maximal version of WinCE (major version number) required to install this cabinet, or 0 to indicate no restriction.
364Maximal version of WinCE (minor version number) required to install this cabinet, or 0 to indicate no restriction.
404Minmal version of WinCE (build number) required to install this cabinet, or 0 to indicate no restriction.
444Maximal version of WinCE (build number) required to install this cabinet, or 0 to indicate no restriction.
482The number of entries in the STRINGS section.
502The number of entries in the DIRS section.
522The number of entries in the FILES section.
542The number of entries in the REGHIVES section.
562The number of entries in the REGKEYS section.
582The number of entries in the LINKS section.
604The file offset of the STRINGS section in bytes.
644The file offset of the DIRS section in bytes.
684The file offset of the FILES section in bytes.
724The file offset of the REGHIVES section in bytes.
764The file offset of the REGKEYS section in bytes.
804The file offset of the LINKS section, in bytes.
842The file offset of the APPNAME string in bytes.
862The length of the APPNAME string in bytes, including null terminating byte.
882The file offset of the PROVIDER string in bytes.
902The length of the PROVIDER string in bytes, including null terminating byte.
922The file offset of the UNSUPPORTED multi string in bytes.
942The length of the UNSUPPORTED multi string in bytes, including null terminating byte.
962Unknown purpose, usually 0.
982Unknown purpose, usually 0.

The APPNAME string

This is a null-terminated ASCII string that gives the name of the packaged application.

The PROVIDER string

This is a null-terminated ASCII string that gives the name of the author or publisher of the packaged application.

The UNSUPPORTED multi string

If this string has more than zero bytes length according to the fixed size header, then this is a sequence of consecutive null terminated ASCII strings. The sequence always terminates with an empty string. Each string is the ASCII name of a Windows CE platform where this software is not supported and will not run. Platforms seen in this sequence include "PALM PC", "HPC", "JORDAN", "PALM PC2" and "POCKETPC".

The STRINGS section

The STRINGS section is a number of common ASCII strings that may be used in the installation data. In other sections, strings from the STRINGS section are referred to by their string ID. The total number of entries in this section is given in the fixed size header. There is no padding between string entries. The format of each STRING entry is as follows:

  • 2 bytes: An integer string ID.
  • 2 bytes: The length of the string, including the null terminator byte.
  • X bytes: the string itself, for the length given above.

As an example, the hexadecimal byte stream 04 00 09 00 53 6F 66 74 77 61 72 65 00 decodes to "ID=4 (04 00), length=9 (09 00), string=Software". The hexadecimal byte stream 05 00 0A 00 4D 69 63 72 6F 73 6F 66 74 00 decodes to "ID=5 (05 00), length=10 (0A 00), string=Microsoft".

The DIRS section

The DIRS section is a list of directory paths used in the installation. In other sections, paths from the DIRS section are referred to by their directory ID. The total number of entries in this section is given in the fixed size header. There is no padding between directory entries. The format of each directory entry is as follows:

  • 2 bytes: An integer directory ID.
  • 2 bytes: The length of the following directory specification, in bytes.
  • X bytes: A directory specification. This is simply an array of 16-bit (2 byte) numbers, where each number is a string ID. The final number is always 0, which terminates the list.

For example, the hexidecimal byte stream 01 00 0A 00 01 00 02 00 03 00 04 00 00 translates "dir ID=1 (01 00), length=10 (0A 00), specification={1, 2, 3, 4}". Assuming string ID 1 is "foo", string ID 2 is "bar", string ID 3 is "baz" and string ID 4 is "quux", the specification translates from {1, 2, 3, 4} to "foo\bar\baz\quux".

The directory specification may begin with a path member of the form "%CEn%", where n is a decimal integer from 1 to 17. This is an abbreviation for one of the CE standard directories, as listed in Appendix B.

The FILES section

The FILES section is a list of files to be installed on the target device. All files in the list should be installed. In other sections, files from the FILES section are referred to by their file ID. The total number of entries in this section is given in the fixed size header. There is no padding between file entries. The format of each file entry is as follows:

  • 2 bytes: An integer file ID. The file for installation is the file in the cabinet which has this integer as a three digit file extension.
  • 2 bytes: The directory ID for where this file should be installed.
  • 2 bytes: Unknown purpose, usually the same as the file ID.
  • 4 bytes: File flags. A 32-bit integer. The following bits are known:
    FlagDescription
    Bit 31 (0x80000000) If bit is set, this file is a reference-counting shared file. It is not deleted at uninstall time unless its reference count is 0.
    Bit 30 (0x40000000)If bit is set, ignore file date (stored in the cabinet file) and always overwrite target (on CE device). Mutually exclusive with bit 29.
    Bit 29 (0x20000000)If bit is set, do not overwrite target if target is newer. Mutually exclusive with bit 30.
    Bit 28 (0x10000000)If bit is set, self-register this DLL.
    Bit 10 (0x00000400)If bit is set, do not copy this file to the target unless the target already exists. Mutually exclusive with bit 4.
    Bit 4 (0x00000010)If bit is set, do not overwrite target if it already exists. Mutually exclusive with bit 10.
    Bit 1 (0x00000002)If bit is set, do not skip this file.
    Bit 0 (0x00000001)If bit is set, warn the user if this file is skipped.
    All other bits are unknown.
  • 2 bytes: the length of the installed file's filename, including the null terminator.
  • X bytes: the installed file's filename, with the length given above. A null terminated ASCII string.

The REGHIVES section

The REGHIVES section is a list of hives in the Windows Registry. These hives are then used in the REGKEYS section for actual registry entries. In other sections, hives from the REGHIVES section are referred to by their hive ID. The total number of entries in this section is given in the fixed size header. There is no padding between hive entries. The format of each hive entry is as follows:

  • 2 bytes: An integer hive ID.
  • 2 bytes: The hive root, an integer from 1 to 4:
    1. HKCR: HKEY_CLASSES_ROOT
    2. HKCU: HKEY_CURRENT_USER
    3. HKLM: HKEY_LOCAL_MACHINE
    4. HKU: HKEY_USERS
  • 2 bytes: Unknown purpose, usually 0.
  • 2 bytes: Length of the registry hive specification to follow, in bytes.
  • X bytes: A registry hive specification. This is simply an array of 16-bit (2 byte) numbers, where each number is a string ID. The final number is always 0, which terminates the list.

The REGKEYS section

The REGKEYS is a list of registry entries -- key / data pairs -- to be added to the Windows Registry upon installation. All entries in the list should be added. The total number of entries in this section is given in the fixed size header. There is no padding between entries. The format of each entry is as follows:

  • 2 bytes: An integer key ID.
  • 2 bytes: The hive ID of the hive to store this entry in.
  • 2 bytes: A Boolean value, either 1 if variable substitution should be performed or 0 if not. The entry data should have substrings such as %InstallDir% or one the %CEn% values.
  • 4 bytes: The type of entry data, and flags.
    FlagDescription
    Bit 16 set, bit 0 set (0x00010001)This key is of type TYPE_DWORD, a 32-bit integer.
    Bit 16 clear, bit 0 clear (0x00000000)This key is of type TYPE_SZ, a null terminated ASCII string.
    Bit 16 set, bit 0 clear (0x00010000)This key is of type TYPE_MULTI_SZ, a list of null terminated ASCII strings.
    Bit 16 clear, bit 0 set (0x00000001)This key is of type TYPE_BINARY, raw binary data in no particular format.
    Bit 1 (0x00000002)This is the only known flag, NOCLOBBER. If this bit is set, the registry entry should not be overwritten if it already exists in the registry.
    All other bits are undefined.
  • 2 bytes: The length of entry data to follow, in bytes.
  • X bytes: Registry entry data. This begins with a null terminated ASCII string, giving the name of the registry key. If the empty string is used here, this is the default key for the given hive. Immediately following the null byte of the string is the data for the registry entry, whose format depends on the entry type given in the flags:
    • TYPE_DWORD: four bytes, giving a single 32-bit integer.
    • TYPE_SZ: a single null terminated ASCII string.
    • TYPE_MULTI_SZ: a sequence of consecutive null terminated ASCII strings. The sequence always terminates with an empty string.
    • TYPE_BINARY: no specific format, just raw data.

The LINKS section

The LINKS section is a list of symbolic links to be made in the standard installation directories, to link to installed directories or files. The total number of links in this section is given in the fixed size header. There is no padding between links. Each link has the following format:

  • 2 bytes: An integer link ID.
  • 2 bytes: Unknown purpose.
  • 2 bytes: The base directory where the link will be stored, either 0 to indicate "%InstallDir%", the default directory where the application is installed, or a number from 1 to 17 to indicate "%CEn%", one of the standard installation directories as defined in Appendix B. The link specification, given below, should be added to this base directory, to get the full name of the link.
  • 2 bytes: Integer ID of the file or directory that the link should point to. It is either a file ID, or a directory ID, depending on the link type. If it is a directory ID, the ID 0 can be used to refer to %InstallDir%.
  • 2 bytes: The link type. This is 0 if the link target is a directory, or 1 if the link target is a file.
  • 2 bytes: The length of the link specification in bytes.
  • X bytes: The link specification. This is simply an array of 16-bit (2 byte) numbers, where each number is a string ID. The final number is always 0, which terminates the list.

Appendix A: a list of processor architectures

ValueDescription
0No specific architecture
103SHx SH3
104SHx SH4
386Intel 386
486Intel 486
586Intel Pentium
601PowerPC 601
603PowerPC 603
604PowerPC 604
620PowerPC 620
821Motorola 821
1824ARM 720
2080ARM 820
2336ARM 920
2577StrongARM
4000MIPS R4000
10003Hitachi SH3
10004Hitachi SH3E
10005Hitachi SH4
21064Alpha 21064
70001ARM 7TDMI

Appendix B: a list of %CEn% shortcuts

First, for a Handheld PC:

ValueStandard directory
%CE1%\Program Files
%CE2%\Windows
%CE3%\Windows\Desktop
%CE4%\Windows\StartUp
%CE5%\My Documents
%CE6%\Program Files\Accessories
%CE7%\Program Files\Communications
%CE8%\Program Files\Games
%CE9%\Program Files\Pocket Outlook
%CE10%\Program Files\Office
%CE11%\Windows\Programs
%CE12%\Windows\Programs\Accessories
%CE13%\Windows\Programs\Communications
%CE14%\Windows\Programs\Games
%CE15%\Windows\Fonts
%CE16%\Windows\Recent
%CE17%\Windows\Favorites

For a Pocket PC version 1.0 or 2.0, as per Handheld PCs, except

ValueStandard directory
%CE3%undefined
%CE9%undefined
%CE10%undefined
%CE11%\Windows\Start Menu\Programs
%CE12%\Windows\Start Menu\Accessories
%CE13%\Windows\Start Menu\Communications
%CE14%\Windows\Start Menu\Games
%CE16%undefined
%CE17%\Windows\Start Menu

For a Pocket PC version 3.0, as for 1.0 or 2.0, except

ValueStandard directory
%CE6%undefined
%CE7%undefined
%CE8%undefined
%CE12%undefined
%CE13%undefined
%CE16%undefined
cabextract-1.9/doc/ja/0000775000175000017500000000000013370076412011650 500000000000000cabextract-1.9/doc/ja/cabextract.10000644000175000017500000000663512704420232013773 00000000000000.TH CABEXTRACT 1 "2005年10月30日" .SH 名前 cabextract \- Microsoft cabinet (.cab) archives からファイルを解凍するプログラム .SH 書式 .B cabextract .RB [ -d \fIdir\fP ] .RB [ -f ] .RB [ -F \fIpattern\fP ] .RB [ -h ] .RB [ -l ] .RB [ -L ] .RB [ -p ] .RB [ -q ] .RB [ -s ] .RB [ -t ] .RB [ -v ] .I " キャビネットファイル" ... .SH 詳細 .B cabextract は、Microsoft キャビネットファイル形式 (.cab) または、 キャビネットファイルが埋め込まれた バイナリファイル (よく .exe ファイルで見つかる) から解凍するプログラムです。 .PP .B cabextract は、コマンドライン上で指定された全キャビネットファイルから ファイルを抽出するでしょう。 .PP 幾つかのファイルに分割されたマルチパートのキャビネットファイル の場合は、 .I 最初の ファイルのみを .B cabextract の引数に与えれば、残りのファイルを自動的に検出します。 指定しないキャビネットファイルを .B cabextract がリストまたは解凍してしまうのを 抑止するには、-s オプションを使用してください。 .SH オプション オプションの要約は、以下を参照下さい。 .TP .B \-d \fIdir\fP ディレクトリ \fIdir\fP に全てのファイルを解凍します。 .TP .B \-f キャビネットファイルを抽出する場合、 問題があった MSZIP ブロックを無視します。 問題があった MSZIP ブロックがあった場合には、 警告メッセージを表示します。 .TP .B \-F \fIpattern\fP シェル・パターン \fIpattern\fP と一致する名前のファイルのみが解凍されます。 非GNU システムにおいては、この一致は、ケースセンシティブです。 .TP .B \-h ヘルプのページを表示し終了します。 .TP .B \-l それらを抽出するのではなく、 指定されたキャビネットファイルの内容を一覧表示します。 .TP .B \-L キャビネットファイルを抽出する場合、 各解凍されたファイル名を小文字として作成する。 .TP .B \-p ファイルは、標準出力に解凍されます。 .TP .B \-q キャビネットファイルを抽出する場合、 エラーと警告メッセージを除き、全てのメッセージを表示しません。 .TP .B \-s 複数のファイルにまたがるキャビネットをリストするか解凍する場合、 コマンドライン上で指定したキャビネット・ファイルのみを使用します。 .TP .B \-t キャビネットの整合性をテストします。ファイルは、解凍されますが、 ディスクまたは標準出力には書かれません。ファイルの解凍に成功した場合には、 ファイルのMD5チェックサムが表示されます。 .TP .B \-v コマンドラインから、単独で指定された場合は、 .B cabextract のバージョン番号を表示して終了します。 キャビネットファイルのリストを与えた場合は、 キャビネットファイルの内容を一覧表示します。 .SH 著者 このマニュアルページは、 Stuart Caie によって書かれ、 Debian GNU/Linux システムのために、 Eric Sharkey のみによってベースが書かれました。 .SH 訳者 日本語訳は、Katsumi Saito が行いました。 cabextract-1.9/doc/magic0000664000175000017500000000335213370030321012171 00000000000000#------------------------------------------------------------------------------ # Microsoft Cabinet files # # From (part of cabextract package) 0 string MSCF\0\0\0\0 Microsoft Cabinet file >8 lelong x \b, %u bytes >28 leshort 1 \b, 1 file >28 leshort >1 \b, %u files #------------------------------------------------------------------------------ # InstallShield Cabinet files # # From (part of cabextract package) 0 string ISc( InstallShield Cabinet file >5 byte&0xf0 =0x60 version 6, >5 byte&0xf0 !0x60 version 4/5, >(12.l+40) lelong x %u files #------------------------------------------------------------------------------ # Windows CE package files # # From (part of cabextract package) 0 string MSCE\0\0\0\0 Microsoft WinCE install header >20 lelong 0 \b, architecture-independent >20 lelong 103 \b, Hitachi SH3 >20 lelong 104 \b, Hitachi SH4 >20 lelong 0xA11 \b, StrongARM >20 lelong 4000 \b, MIPS R4000 >20 lelong 10003 \b, Hitachi SH3 >20 lelong 10004 \b, Hitachi SH3E >20 lelong 10005 \b, Hitachi SH4 >20 lelong 70001 \b, ARM 7TDMI >52 leshort 1 \b, 1 file >52 leshort >1 \b, %u files >56 leshort 1 \b, 1 registry entry >56 leshort >1 \b, %u registry entries cabextract-1.9/configure.ac0000664000175000017500000000304613367434314012727 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([cabextract],[1.9],[kyzer@cabextract.org.uk]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/cabextract.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC AM_PROG_AR AC_PROG_INSTALL AC_PROG_RANLIB # Checks for header files. AC_CHECK_HEADERS([getopt.h inttypes.h strings.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_CHECK_SIZEOF([off_t]) AC_SYS_LARGEFILE # Checks for library functions. AC_FUNC_FNMATCH AC_FUNC_FSEEKO AX_FUNC_MKDIR AC_CHECK_FUNCS([towlower umask utime utimes]) AC_CHECK_FUNCS([getopt_long],,[AC_CHECK_LIB([gnugetopt], [getopt_long], [AC_DEFINE([HAVE_GETOPT_LONG])],[AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1)])]) AC_REPLACE_FNMATCH AM_ICONV # use an external libmspack if requested cabextract_external_libmspack=no AC_ARG_WITH([external-libmspack], [AS_HELP_STRING([--with-external-libmspack],[use external libmspack (default no)])], [cabextract_external_libmspack=$withval]) if test "z$cabextract_external_libmspack" != 'zno'; then PKG_CHECK_MODULES([libmspack], [libmspack >= 0.8alpha]) AC_CHECK_HEADER([mspack.h], ,[AC_MSG_ERROR([Cannot find libmspack header])]) AC_CHECK_LIB([mspack],[mspack_create_cab_decompressor], , [AC_MSG_ERROR([Cannot find libmspack library])]) fi AM_CONDITIONAL([EXTERNAL_LIBMSPACK], [test "z$cabextract_external_libmspack" != 'zno']) AC_CONFIG_FILES([Makefile cabextract.spec test/testcase]) AC_OUTPUT cabextract-1.9/fnmatch_.h0000664000175000017500000000467313370030226012364 00000000000000/* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #ifdef __cplusplus extern "C" { #endif #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) #undef __P #define __P(args) args #else /* Not C++ or ANSI C. */ #undef __P #define __P(args) () /* We can get away without defining `const' here only because in this file it is used only inside the prototype for `fnmatch', which is elided in non-ANSI C where `const' is problematical. */ #endif /* C++ or ANSI C. */ /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ #define FNM_NOMATCH 1 /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch __P ((const char *__pattern, const char *__string, int __flags)); #ifdef __cplusplus } #endif #endif /* fnmatch.h */ cabextract-1.9/getopt.c0000664000175000017500000010243013370030217012070 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ # ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) # else # define _(msgid) (msgid) # endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # include # if HAVE_STRINGS_H # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (new_str + nonoption_flags_max_len, '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { memcpy (__getopt_nonoption_flags, orig_str, len); memset (__getopt_nonoption_flags + len, '\0', nonoption_flags_max_len - len); } } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) fprintf (stderr, _("%s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ cabextract-1.9/cabextract.spec0000664000175000017500000000160513370076407013433 00000000000000Summary: A program to extract Microsoft Cabinet files Name: cabextract Version: 1.9 Release: 1 License: GPL Group: Applications/Archiving Source: https://www.cabextract.org.uk/%{name}-%{version}.tar.gz URL: https://www.cabextract.org.uk/ Vendor: Stuart Caie Packager: Stuart Caie BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: /usr %description Cabinet (.CAB) files are a form of archive, which Microsoft use to distribute their software, and things like Windows Font Packs. The cabextract program unpacks these files. %prep %setup %build CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} make %install rm -rf ${RPM_BUILD_ROOT} %makeinstall %clean [ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(0644, root, root, 0755) %doc AUTHORS ChangeLog NEWS README %attr(0755, root, root) %{_bindir}/cabextract %{_mandir}/man1/cabextract.1* cabextract-1.9/configure0000775000175000017500000076275413370076345012372 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for cabextract 1.9. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: kyzer@cabextract.org.uk about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cabextract' PACKAGE_TARNAME='cabextract' PACKAGE_VERSION='1.9' PACKAGE_STRING='cabextract 1.9' PACKAGE_BUGREPORT='kyzer@cabextract.org.uk' PACKAGE_URL='' ac_unique_file="src/cabextract.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS EXTERNAL_LIBMSPACK_FALSE EXTERNAL_LIBMSPACK_TRUE libmspack_LIBS libmspack_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LTLIBICONV LIBICONV host_os host_vendor host_cpu host build_os build_vendor build_cpu build ALLOCA LIBOBJS EGREP GREP CPP RANLIB ac_ct_AR AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile with_gnu_ld enable_rpath with_libiconv_prefix with_external_libmspack ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR libmspack_CFLAGS libmspack_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures cabextract 1.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/cabextract] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of cabextract 1.9:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-external-libmspack use external libmspack (default no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path libmspack_CFLAGS C compiler flags for libmspack, overriding pkg-config libmspack_LIBS linker flags for libmspack, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF cabextract configure 1.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------------- ## ## Report this to kyzer@cabextract.org.uk ## ## -------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by cabextract $as_me 1.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='cabextract' VERSION='1.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in getopt.h inttypes.h strings.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes; then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main () { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : $as_echo "#define HAVE_FNMATCH 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi for ac_func in mkdir _mkdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir takes one argument" >&5 $as_echo_n "checking whether mkdir takes one argument... " >&6; } if ${ac_cv_mkdir_takes_one_arg+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if HAVE_UNISTD_H # include #endif int main () { mkdir ("."); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_mkdir_takes_one_arg=yes else ac_cv_mkdir_takes_one_arg=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mkdir_takes_one_arg" >&5 $as_echo "$ac_cv_mkdir_takes_one_arg" >&6; } if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then $as_echo "#define MKDIR_TAKES_ONE_ARG 1" >>confdefs.h fi for ac_func in towlower umask utime utimes do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getopt_long do : ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG 1 _ACEOF else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getopt_long in -lgnugetopt" >&5 $as_echo_n "checking for getopt_long in -lgnugetopt... " >&6; } if ${ac_cv_lib_gnugetopt_getopt_long+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnugetopt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getopt_long (); int main () { return getopt_long (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gnugetopt_getopt_long=yes else ac_cv_lib_gnugetopt_getopt_long=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnugetopt_getopt_long" >&5 $as_echo "$ac_cv_lib_gnugetopt_getopt_long" >&6; } if test "x$ac_cv_lib_gnugetopt_getopt_long" = xyes; then : $as_echo "#define HAVE_GETOPT_LONG 1" >>confdefs.h else case " $LIBOBJS " in *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac case " $LIBOBJS " in *" getopt1.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt1.$ac_objext" ;; esac fi fi done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 $as_echo_n "checking for mbstate_t... " >&6; } if ${ac_cv_type_mbstate_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default # include int main () { mbstate_t x; return sizeof x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_mbstate_t=yes else ac_cv_type_mbstate_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 $as_echo "$ac_cv_type_mbstate_t" >&6; } if test $ac_cv_type_mbstate_t = yes; then $as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h else $as_echo "#define mbstate_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working POSIX fnmatch" >&5 $as_echo_n "checking for working POSIX fnmatch... " >&6; } if ${ac_cv_func_fnmatch_works+:} false; then : $as_echo_n "(cached) " >&6 else # Some versions of Solaris, SCO, and the GNU C Library # have a broken or incompatible fnmatch. # So we run a test program. If we are cross-compiling, take no chance. # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. if test "$cross_compiling" = yes; then : ac_cv_func_fnmatch_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) int main () { return (!(y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fnmatch_works=yes else ac_cv_func_fnmatch_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fnmatch_works" >&5 $as_echo "$ac_cv_func_fnmatch_works" >&6; } if test $ac_cv_func_fnmatch_works = yes; then : rm -f "$ac_config_libobj_dir/fnmatch.h" else ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default" if test "x$ac_cv_have_decl_getenv" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV $ac_have_decl _ACEOF for ac_func in btowc mbsrtowcs mempcpy wmempcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h wctype.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done case " $LIBOBJS " in *" fnmatch.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fnmatch.$ac_objext" ;; esac ac_config_links="$ac_config_links $ac_config_libobj_dir/fnmatch.h:$ac_config_libobj_dir/fnmatch_.h" $as_echo "#define fnmatch rpl_fnmatch" >>confdefs.h fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_proto_iconv" >&5 $as_echo " $am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi # use an external libmspack if requested cabextract_external_libmspack=no # Check whether --with-external-libmspack was given. if test "${with_external_libmspack+set}" = set; then : withval=$with_external_libmspack; cabextract_external_libmspack=$withval fi if test "z$cabextract_external_libmspack" != 'zno'; then if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmspack" >&5 $as_echo_n "checking for libmspack... " >&6; } if test -n "$libmspack_CFLAGS"; then pkg_cv_libmspack_CFLAGS="$libmspack_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmspack >= 0.8alpha\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmspack >= 0.8alpha") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libmspack_CFLAGS=`$PKG_CONFIG --cflags "libmspack >= 0.8alpha" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libmspack_LIBS"; then pkg_cv_libmspack_LIBS="$libmspack_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmspack >= 0.8alpha\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmspack >= 0.8alpha") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libmspack_LIBS=`$PKG_CONFIG --libs "libmspack >= 0.8alpha" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libmspack_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmspack >= 0.8alpha" 2>&1` else libmspack_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmspack >= 0.8alpha" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libmspack_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libmspack >= 0.8alpha) were not met: $libmspack_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables libmspack_CFLAGS and libmspack_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables libmspack_CFLAGS and libmspack_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else libmspack_CFLAGS=$pkg_cv_libmspack_CFLAGS libmspack_LIBS=$pkg_cv_libmspack_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi ac_fn_c_check_header_mongrel "$LINENO" "mspack.h" "ac_cv_header_mspack_h" "$ac_includes_default" if test "x$ac_cv_header_mspack_h" = xyes; then : else as_fn_error $? "Cannot find libmspack header" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mspack_create_cab_decompressor in -lmspack" >&5 $as_echo_n "checking for mspack_create_cab_decompressor in -lmspack... " >&6; } if ${ac_cv_lib_mspack_mspack_create_cab_decompressor+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char mspack_create_cab_decompressor (); int main () { return mspack_create_cab_decompressor (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mspack_mspack_create_cab_decompressor=yes else ac_cv_lib_mspack_mspack_create_cab_decompressor=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mspack_mspack_create_cab_decompressor" >&5 $as_echo "$ac_cv_lib_mspack_mspack_create_cab_decompressor" >&6; } if test "x$ac_cv_lib_mspack_mspack_create_cab_decompressor" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMSPACK 1 _ACEOF LIBS="-lmspack $LIBS" else as_fn_error $? "Cannot find libmspack library" "$LINENO" 5 fi fi if test "z$cabextract_external_libmspack" != 'zno'; then EXTERNAL_LIBMSPACK_TRUE= EXTERNAL_LIBMSPACK_FALSE='#' else EXTERNAL_LIBMSPACK_TRUE='#' EXTERNAL_LIBMSPACK_FALSE= fi ac_config_files="$ac_config_files Makefile cabextract.spec test/testcase" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EXTERNAL_LIBMSPACK_TRUE}" && test -z "${EXTERNAL_LIBMSPACK_FALSE}"; then as_fn_error $? "conditional \"EXTERNAL_LIBMSPACK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by cabextract $as_me 1.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration links: $config_links Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ cabextract config.status 1.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "$ac_config_libobj_dir/fnmatch.h") CONFIG_LINKS="$CONFIG_LINKS $ac_config_libobj_dir/fnmatch.h:$ac_config_libobj_dir/fnmatch_.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "cabextract.spec") CONFIG_FILES="$CONFIG_FILES cabextract.spec" ;; "test/testcase") CONFIG_FILES="$CONFIG_FILES test/testcase" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :L) # # CONFIG_LINK # if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then : else # Prefer the file from the source tree if names are identical. if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then ac_source=$srcdir/$ac_source fi { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;} if test ! -r "$ac_source"; then as_fn_error $? "$ac_source: file not found" "$LINENO" 5 fi rm -f "$ac_file" # Try a relative symlink, then a hard link, then a copy. case $ac_source in [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; *) ac_rel_source=$ac_top_build_prefix$ac_source ;; esac ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || ln "$ac_source" "$ac_file" 2>/dev/null || cp -p "$ac_source" "$ac_file" || as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5 fi ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi cabextract-1.9/md5.c0000664000175000017500000003566013370030217011265 00000000000000/* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. Copyright (C) 1995, 1996, 2001, 2003 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Ulrich Drepper , 1995. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #ifdef _LIBC # include # if __BYTE_ORDER == __BIG_ENDIAN # define WORDS_BIGENDIAN 1 # endif /* We need to keep the namespace clean so define the MD5 function protected using leading __ . */ # define md5_init_ctx __md5_init_ctx # define md5_process_block __md5_process_block # define md5_process_bytes __md5_process_bytes # define md5_finish_ctx __md5_finish_ctx # define md5_read_ctx __md5_read_ctx # define md5_stream __md5_stream # define md5_buffer __md5_buffer #endif #ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else # define SWAP(n) (n) #endif #define BLOCKSIZE 4096 /* Ensure that BLOCKSIZE is a multiple of 64. */ #if BLOCKSIZE % 64 != 0 /* FIXME-someday (soon?): use #error instead of this kludge. */ "invalid BLOCKSIZE" #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1321, 3.1: Step 1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void md5_init_ctx (struct md5_ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, resbuf); } /* Compute MD5 message digest for bytes read from STREAM. The resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int md5_stream (FILE *stream, void *resblock) { struct md5_ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Iterate over full file contents. */ while (1) { /* We read the file in blocks of BLOCKSIZE bytes. One call of the computation function processes the whole buffer so that with the next round of the loop another block can be read. */ size_t n; sum = 0; /* Read block. Take care for partial reads. */ while (1) { n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); sum += n; if (sum == BLOCKSIZE) break; if (n == 0) { /* Check for the error flag IFF N == 0, so that we don't exit the loop after a partial read due to e.g., EAGAIN or EWOULDBLOCK. */ if (ferror (stream)) return 1; goto process_partial_block; } /* We've read at least one byte, so ignore errors. But always check for EOF, since feof may be true even though N > 0. Otherwise, we could end up calling fread after EOF. */ if (feof (stream)) goto process_partial_block; } /* Process buffer with BLOCKSIZE bytes. Note that BLOCKSIZE % 64 == 0 */ md5_process_block (buffer, BLOCKSIZE, &ctx); } process_partial_block:; /* Process any remaining bytes. */ if (sum > 0) md5_process_bytes (buffer, sum, &ctx); /* Construct result in desired memory. */ md5_finish_ctx (&ctx, resblock); return 0; } /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ void * md5_buffer (const char *buffer, size_t len, void *resblock) { struct md5_ctx ctx; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Process whole buffer but last len % 64 bytes. */ md5_process_bytes (buffer, len, &ctx); /* Put result in desired memory area. */ return md5_finish_ctx (&ctx, resblock); } void md5_process_bytes ( const void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (ctx->buflen > 64) { md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen); } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len >= 64) { #if !_STRING_ARCH_unaligned /* To check alignment gcc has an appropriate operator. Other compilers don't. */ # if __GNUC__ >= 2 # define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0) # else # define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0) # endif if (UNALIGNED_P (buffer)) while (len > 64) { memcpy (ctx->buffer, buffer, 64); md5_process_block (ctx->buffer, 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } else #endif { md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } } /* Move remaining bytes in internal buffer. */ if (len > 0) { size_t left_over = ctx->buflen; memcpy (&ctx->buffer[left_over], buffer, len); left_over += len; if (left_over >= 64) { md5_process_block (ctx->buffer, 64, ctx); left_over -= 64; memcpy (ctx->buffer, &ctx->buffer[64], left_over); } ctx->buflen = left_over; } } /* These are the four functions used in the four steps of the MD5 algorithm and defined in the RFC 1321. The first function is a little bit optimized (as found in Colin Plumbs public domain implementation). */ /* #define FF(b, c, d) ((b & c) | (~b & d)) */ #define FF(b, c, d) (d ^ (b & (c ^ d))) #define FG(b, c, d) FF (d, b, c) #define FH(b, c, d) (b ^ c ^ d) #define FI(b, c, d) (c ^ (b | ~d)) /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = (const md5_uint32 *) buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 A = ctx->A; md5_uint32 B = ctx->B; md5_uint32 C = ctx->C; md5_uint32 D = ctx->D; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ while (words < endp) { md5_uint32 *cwp = correct_words; md5_uint32 A_save = A; md5_uint32 B_save = B; md5_uint32 C_save = C; md5_uint32 D_save = D; /* First round: using the given function, the context and a constant the next context is computed. Because the algorithms processing unit is a 32-bit word and it is determined to work on words in little endian byte order we perhaps have to change the byte order before the computation. To reduce the work for the next steps we store the swapped words in the array CORRECT_WORDS. */ #define OP(a, b, c, d, s, T) \ do \ { \ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ ++words; \ a = rol (a, s); \ a += b; \ } \ while (0) /* Before we start, one word to the strange constants. They are defined in RFC 1321 as T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}' */ /* Round 1. */ OP (A, B, C, D, 7, 0xd76aa478); OP (D, A, B, C, 12, 0xe8c7b756); OP (C, D, A, B, 17, 0x242070db); OP (B, C, D, A, 22, 0xc1bdceee); OP (A, B, C, D, 7, 0xf57c0faf); OP (D, A, B, C, 12, 0x4787c62a); OP (C, D, A, B, 17, 0xa8304613); OP (B, C, D, A, 22, 0xfd469501); OP (A, B, C, D, 7, 0x698098d8); OP (D, A, B, C, 12, 0x8b44f7af); OP (C, D, A, B, 17, 0xffff5bb1); OP (B, C, D, A, 22, 0x895cd7be); OP (A, B, C, D, 7, 0x6b901122); OP (D, A, B, C, 12, 0xfd987193); OP (C, D, A, B, 17, 0xa679438e); OP (B, C, D, A, 22, 0x49b40821); /* For the second to fourth round we have the possibly swapped words in CORRECT_WORDS. Redefine the macro to take an additional first argument specifying the function to use. */ #undef OP #define OP(f, a, b, c, d, k, s, T) \ do \ { \ a += f (b, c, d) + correct_words[k] + T; \ a = rol (a, s); \ a += b; \ } \ while (0) /* Round 2. */ OP (FG, A, B, C, D, 1, 5, 0xf61e2562); OP (FG, D, A, B, C, 6, 9, 0xc040b340); OP (FG, C, D, A, B, 11, 14, 0x265e5a51); OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); OP (FG, A, B, C, D, 5, 5, 0xd62f105d); OP (FG, D, A, B, C, 10, 9, 0x02441453); OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); OP (FG, D, A, B, C, 14, 9, 0xc33707d6); OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); OP (FG, B, C, D, A, 8, 20, 0x455a14ed); OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); OP (FG, C, D, A, B, 7, 14, 0x676f02d9); OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); /* Round 3. */ OP (FH, A, B, C, D, 5, 4, 0xfffa3942); OP (FH, D, A, B, C, 8, 11, 0x8771f681); OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); OP (FH, B, C, D, A, 14, 23, 0xfde5380c); OP (FH, A, B, C, D, 1, 4, 0xa4beea44); OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); OP (FH, B, C, D, A, 6, 23, 0x04881d05); OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); /* Round 4. */ OP (FI, A, B, C, D, 0, 6, 0xf4292244); OP (FI, D, A, B, C, 7, 10, 0x432aff97); OP (FI, C, D, A, B, 14, 15, 0xab9423a7); OP (FI, B, C, D, A, 5, 21, 0xfc93a039); OP (FI, A, B, C, D, 12, 6, 0x655b59c3); OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); OP (FI, C, D, A, B, 10, 15, 0xffeff47d); OP (FI, B, C, D, A, 1, 21, 0x85845dd1); OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); OP (FI, C, D, A, B, 6, 15, 0xa3014314); OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); OP (FI, A, B, C, D, 4, 6, 0xf7537e82); OP (FI, D, A, B, C, 11, 10, 0xbd3af235); OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); OP (FI, B, C, D, A, 9, 21, 0xeb86d391); /* Add the starting values of the context. */ A += A_save; B += B_save; C += C_save; D += D_save; } /* Put checksum in context given as argument. */ ctx->A = A; ctx->B = B; ctx->C = C; ctx->D = D; } cabextract-1.9/getopt1.c0000664000175000017500000000573013370030217012156 00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ cabextract-1.9/config.rpath0000744000175000017500000004421613247753370012754 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2015 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = cabextract$(EXEEXT) check_PROGRAMS = cabextract$(EXEEXT) noinst_PROGRAMS = src/cabinfo$(EXEEXT) @EXTERNAL_LIBMSPACK_FALSE@am__append_1 = libmscab.a subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = cabextract.spec test/testcase CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libmscab_a_AR = $(AR) $(ARFLAGS) libmscab_a_LIBADD = am__libmscab_a_SOURCES_DIST = mspack/mspack.h mspack/system.h \ mspack/system.c mspack/cab.h mspack/cabd.c mspack/lzx.h \ mspack/lzxd.c mspack/mszip.h mspack/mszipd.c mspack/qtm.h \ mspack/qtmd.c mspack/readbits.h mspack/readhuff.h am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = mspack/system.$(OBJEXT) mspack/cabd.$(OBJEXT) \ mspack/lzxd.$(OBJEXT) mspack/mszipd.$(OBJEXT) \ mspack/qtmd.$(OBJEXT) @EXTERNAL_LIBMSPACK_FALSE@am_libmscab_a_OBJECTS = $(am__objects_1) libmscab_a_OBJECTS = $(am_libmscab_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_cabextract_OBJECTS = src/cabextract.$(OBJEXT) md5.$(OBJEXT) cabextract_OBJECTS = $(am_cabextract_OBJECTS) cabextract_DEPENDENCIES = @LIBOBJS@ $(am__append_1) src_cabinfo_SOURCES = src/cabinfo.c src_cabinfo_OBJECTS = src/cabinfo.$(OBJEXT) src_cabinfo_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmscab_a_SOURCES) $(cabextract_SOURCES) src/cabinfo.c DIST_SOURCES = $(am__libmscab_a_SOURCES_DIST) $(cabextract_SOURCES) \ src/cabinfo.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/cabextract.spec.in \ $(srcdir)/config.h.in $(top_srcdir)/test/testcase.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README TODO ar-lib compile \ config.guess config.rpath config.sub fnmatch.c getopt.c \ getopt1.c install-sh missing test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libmspack_CFLAGS = @libmspack_CFLAGS@ libmspack_LIBS = @libmspack_LIBS@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = no-dependencies subdir-objects bundled_mspack = mspack/mspack.h \ mspack/system.h mspack/system.c \ mspack/cab.h mspack/cabd.c \ mspack/lzx.h mspack/lzxd.c \ mspack/mszip.h mspack/mszipd.c \ mspack/qtm.h mspack/qtmd.c \ mspack/readbits.h mspack/readhuff.h TESTS = test/bugs.test test/case.test test/dirwalk-vulns.test \ test/encoding.test test/mixed.test test/search.test \ test/simple.test test/split.test test/utf8-stresstest.test EXTRA_DIST = cabextract.spec \ doc/cabextract.1 doc/ja/cabextract.1 \ doc/magic doc/wince_cab_format.html \ fnmatch_.h getopt.h src/cabsplit \ src/wince_info src/wince_rename \ mspack/ChangeLog $(bundled_mspack) \ $(TESTS) test/bugs test/cabs man_MANS = doc/cabextract.1 cabextract_SOURCES = src/cabextract.c md5.h md5.c cabextract_LDADD = @LIBOBJS@ @LIBICONV@ $(am__append_1) @EXTERNAL_LIBMSPACK_FALSE@noinst_LIBRARIES = libmscab.a @EXTERNAL_LIBMSPACK_FALSE@libmscab_a_SOURCES = $(bundled_mspack) @EXTERNAL_LIBMSPACK_FALSE@AM_CPPFLAGS = -I$(srcdir)/mspack -DMSPACK_NO_DEFAULT_SYSTEM all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 cabextract.spec: $(top_builddir)/config.status $(srcdir)/cabextract.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ test/testcase: $(top_builddir)/config.status $(top_srcdir)/test/testcase.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) mspack/$(am__dirstamp): @$(MKDIR_P) mspack @: > mspack/$(am__dirstamp) mspack/system.$(OBJEXT): mspack/$(am__dirstamp) mspack/cabd.$(OBJEXT): mspack/$(am__dirstamp) mspack/lzxd.$(OBJEXT): mspack/$(am__dirstamp) mspack/mszipd.$(OBJEXT): mspack/$(am__dirstamp) mspack/qtmd.$(OBJEXT): mspack/$(am__dirstamp) libmscab.a: $(libmscab_a_OBJECTS) $(libmscab_a_DEPENDENCIES) $(EXTRA_libmscab_a_DEPENDENCIES) $(AM_V_at)-rm -f libmscab.a $(AM_V_AR)$(libmscab_a_AR) libmscab.a $(libmscab_a_OBJECTS) $(libmscab_a_LIBADD) $(AM_V_at)$(RANLIB) libmscab.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/cabextract.$(OBJEXT): src/$(am__dirstamp) cabextract$(EXEEXT): $(cabextract_OBJECTS) $(cabextract_DEPENDENCIES) $(EXTRA_cabextract_DEPENDENCIES) @rm -f cabextract$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cabextract_OBJECTS) $(cabextract_LDADD) $(LIBS) src/cabinfo.$(OBJEXT): src/$(am__dirstamp) src/cabinfo$(EXEEXT): $(src_cabinfo_OBJECTS) $(src_cabinfo_DEPENDENCIES) $(EXTRA_src_cabinfo_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/cabinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(src_cabinfo_OBJECTS) $(src_cabinfo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f mspack/*.$(OBJEXT) -rm -f src/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f mspack/$(am__dirstamp) -rm -f src/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-noinstLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: all check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \ check-am clean clean-binPROGRAMS clean-checkPROGRAMS \ clean-cscope clean-generic clean-noinstLIBRARIES \ clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: cabextract-1.9/COPYING0000644000175000017500000010451313370076346011474 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . cabextract-1.9/README0000644000175000017500000000344613367434321011321 00000000000000cabextract 1.9 - a program to extract Microsoft Cabinet files. (C) 2000-2018 Stuart Caie This is free software with ABSOLUTELY NO WARRANTY. Cabinet (.CAB) files are a form of archive, which Microsoft use to distribute their software, and things like Windows Font Packs. The cabextract program unpacks these files. For more information, see https://www.cabextract.org.uk/ or run the command 'cabextract --help'. Microsoft cabinet files should not be confused with InstallShield cabinet files. InstallShield files are generally called "_sys.cab", "data1.hdr" "data1.cab", "data2.cab" and so on, and are found in the same directory as "setup.exe". They begin with the magic characters "ISc(" rather than "MSCF". cabextract will print the message "This is probably an InstallShield file." when it finds such a file. The file "doc/magic" in the cabextract source archive includes additional file-identification rules for the UNIX file(1) command, which distinguishes between Microsoft and InstallShield cabinet files. Example usage: Extracting files from a cabinet file: $ cabextract wibble.cab Extracting files from an executable which contains a cabinet file: $ cabextract wibble.exe [cabextract will automatically search executables for embedded cabinets] Extracting files from a set of cabinet files; wib01.cab, wib02.cab, ...: $ cabextract wib01.cab [cabextract will automatically get the names of the other files] Extracting files to a directory of your choice (in this case, 'boogie'): $ cabextract -d boogie wibble.cab [cabextract will create the directory if it does not already exist] Listing files from a cabinet file: $ cabextract -l wibble.cab Testing the integrity of a cabinet file, without extracting it: $ cabextract -t wibble.cab Stuart Caie , April 2016 cabextract-1.9/ar-lib0000755000175000017500000001330213370076346011530 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2017 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat < cabextract uses a cut-down version of the libmspack library, available at https://www.cabextract.org.uk/libmspack/ Japanese manual page by Katsumi Saito. Original manual page and Debian packaging by Eric Sharkey. FreeBSD packaging by Maxim Sovolev. NetBSD packaging by Ben Collver et al. SuSE packaging by Stefan Dirsch. RPM spec file by Soos Peter. cabextract uses GNU versions of the getopt_long() and fnmatch() functions, (C) Free Software Foundation, if not found as part of the operating system. cabextract-1.9/compile0000755000175000017500000001624513370076346012023 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: cabextract-1.9/src/0000775000175000017500000000000013370076412011300 500000000000000cabextract-1.9/src/wince_info0000744000175000017500000001417013370027236013265 00000000000000#!/usr/bin/perl -w # this is complementary to the wince_cab_format.html file, # which gives a full description of all components use strict; my %arch = ( 0 => 'none', 103 => 'SHx SH3', 104 => 'SHx SH4', 386 => 'Intel 386', 486 => 'Intel 486', 586 => 'Intel Pentium', 601 => 'PowerPC 601', 603 => 'PowerPC 603', 604 => 'PowerPC 604', 620 => 'PowerPC 620', 821 => 'Motorola 821', 0x720 => 'ARM 720', 0x820 => 'ARM 820', 0x920 => 'ARM 920', 0xA11 => 'StrongARM', 4000 => 'MIPS R4000', 10003 => 'Hitachi SH3', 10004 => 'Hitachi SH3E', 10005 => 'Hitachi SH4', 21064 => 'Alpha 21064', 70001 => 'ARM 7TDMI' ); my @ce = ( undef, '\Program Files', '\Windows', '\Windows\Desktop', '\Windows\StartUp', '\My Documents', '\Program Files\Accessories', '\Program Files\Communications', '\Program Files\Games', '\Program Files\Pocket Outlook', '\Program Files\Office', '\Windows\Programs', '\Windows\Programs\Accessories', '\Windows\Programs\Communications', '\Windows\Programs\Games', '\Windows\Fonts', '\Windows\Recent', '\Windows\Favorites' ); my @hkeys = ( undef, 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS' ); my @strings; sub seek_to { seek FH, $_[0], 0; } sub read_data { my $buf; read FH, $buf, $_[0]; return $buf; } sub read_string { my $str = read_data($_[0]); $str =~ s/\000*$//; return $str; } sub read_strings { my @ids = unpack 'v*', read_data($_[0]); pop @ids; return map { $strings[$_] } @ids; } # replaces nulls with commas sub denull { $_[0] =~ s/\000/,/g; return $_[0]; } for my $hdrfile (@ARGV) { if (! open FH, '<', $hdrfile) { warn "$hdrfile: $!\n"; next; } # read fixed-size header my @hdr = unpack 'V12v6V6v8', read_data(100); if ($hdr[0] != 0x4543534D) { warn "$hdrfile: not a Windows CE install cabinet header\n"; close FH; next; } # HEADER section print "$hdrfile HEADER\n"; printf " length = %d bytes\n", $hdr[2]; printf " architecture = %s (%d)\n", $arch{$hdr[5]} || 'unknown', $hdr[5]; printf " counts = %s\n", join ',', @hdr[12..17]; printf " offsets = %s\n", join ',', @hdr[18..23]; printf " strings = %s\n", join ',', @hdr[24..29]; printf " unknowns = %s\n", join ',', @hdr[1,3,4,30,31]; printf " min WinCE v. = %d.%d%s\n", $hdr[6], $hdr[7], $hdr[10] ? " [build $hdr[10]]" : ""; printf " max WinCE v. = %d.%d%s\n", $hdr[8], $hdr[9], $hdr[11] ? " [build $hdr[11]]" : ""; seek_to($hdr[24]) && printf " app name = %s\n", read_string($hdr[25]); seek_to($hdr[26]) && printf " provider = %s\n", read_string($hdr[27]); seek_to($hdr[28]) && printf " unsupported = %s\n", denull(read_string($hdr[29])) if $hdr[29]; # STRINGS section print "$hdrfile STRINGS\n"; @strings = (); seek_to($hdr[18]); for (1 .. $hdr[12]) { my ($id, $len) = unpack 'vv', read_data(4); $strings[$id] = read_string($len); printf " s%02d: %s\n", $id, $strings[$id]; } # DIRS section print "$hdrfile DIRS\n"; my @dirs; seek_to($hdr[19]); for (1 .. $hdr[13]) { my ($id, $len) = unpack 'vv', read_data(4); $dirs[$id] = join '\\', read_strings($len); $dirs[$id] =~ s/%CE(\d+)%/$ce[$1]/eg; printf " d%02d: %s\n", $id, $dirs[$id]; } # FILES section print "$hdrfile FILES\n"; my @files; seek_to($hdr[20]); for (1 .. $hdr[14]) { my ($id, $dirid, $unk, $flags, $len) = unpack 'vvvVv', read_data(12); $files[$id] = "$dirs[$dirid]\\" . read_string($len); printf " f%02d: %s\n", $id, $files[$id]; printf " unknown=%d flags=0x%08x\n", $unk, $flags; } # REGHIVES section print "$hdrfile REGHIVES\n"; my @reghives; seek_to($hdr[21]); for (1 .. $hdr[15]) { my ($id, $root, $unk, $len) = unpack 'vvvv', read_data(8); $reghives[$id] = join '\\', $hkeys[$root], read_strings($len); printf " h%02d: %s\n", $id, $reghives[$id], $unk; } # REGKEYS section print "$hdrfile REGKEYS\n"; seek_to($hdr[22]); for (1 .. $hdr[16]) { my ($id, $hive, $subst, $flags, $len) = unpack 'vvvVv', read_data(12); my $data = read_data($len); my $name = $1 if $data =~ s/^([^\000]*)\000//; # data begins with key name printf " k%02d: hive=%s\n", $id, $reghives[$hive]; printf " name=<<%s>> subst=%d flags=0x%08x\n", $name, $subst, $flags; if (($flags & 0x10001) == 0x10001) { my $dword = unpack 'V', $data; printf " [DWORD] %08x (%d)\n", $dword, $dword;; } elsif (($flags & 0x10001) == 0x10000) { for my $sz (split /\000/, $data) { printf " [MULTI_SZ] <<%s>>\n", $sz } } elsif (($flags & 0x10001) == 0x00001) { printf " [BINARY] (%d bytes hexdump follows)\n", length($data); while ($data =~ /(.{1,12})/gs) { my ($text, $hex) = ($1, unpack('h*', $1)); $hex =~ s/(.{8})/$1 /g; # space every 8 hexdigits $text =~ s/[^[:print:]]/./g; # replace unprintables printf " %-28s%s\n", $hex, $text; } } else { chop $data; printf " [SZ] %s\n", $data; } } # LINKS section print "$hdrfile LINKS\n"; my @links; seek_to($hdr[23]); for (1 .. $hdr[17]) { my ($id, $unk, $dir, $fid, $type, $len) = unpack 'vvvvvv', read_data(12); my $name = join '\\', read_strings($len); my $dest = ($dir == 0) ? "%InstallDir%\\$name" : ($dir > 0) ? "$ce[$dir]\\$name" : $name; my $src = ($type == 1) ? $files[$fid] : ($fid == 0) ? '%InstallDir%' : $dirs[$fid]; printf " l%02d: src=<<%s>>\n", $id, $src; printf " dest=<<%s>> (unk=%d)\n", $dest, $unk; } print "\n"; close FH; } cabextract-1.9/src/wince_rename0000744000175000017500000001362113370027203013573 00000000000000#!/usr/bin/perl -w # wince_rename # - when run in a directory containing files extracted from # a Windows CE installation cabinet, it will rename all files # to their "installed" filenames, including path # - the header file (*.000) will be renamed to header.bin # - the setup DLL (*.999) will be renamed to setup.dll # - a REGEDIT4 style file will be made, called setup.reg use strict; use File::Basename qw(dirname); use File::Copy qw(move); use File::Path qw(make_path); use File::Spec; use File::Spec::Win32; my @ce = ( undef, '\Program Files', '\Windows', '\Windows\Desktop', '\Windows\StartUp', '\My Documents', '\Program Files\Accessories', '\Program Files\Communications', '\Program Files\Games', '\Program Files\Pocket Outlook', '\Program Files\Office', '\Windows\Programs', '\Windows\Programs\Accessories', '\Windows\Programs\Communications', '\Windows\Programs\Games', '\Windows\Fonts', '\Windows\Recent', '\Windows\Favorites' ); # expands a decimal number from 0-999 into a filename with a three digit # decimal number as a file extension, if one exists. Otherwise, undef is # is returned. sub get_fname { my $pattern = sprintf '*.%03d', $_[0]; my @files = glob $pattern; if (@files > 1) { warn "WARNING: more than one '$pattern' file, using '$files[0]'\n"; } return shift @files; } sub rename_file { my ($src, $dest) = @_; print "moving \"$src\" to \"$dest\"\n"; make_path(dirname($dest)); move($src, $dest) || warn "$src: $!\n"; } sub win32_path_to_local { my ($volume, $dir, $file) = File::Spec::Win32->splitpath($_[0]) ; my @dirs = File::Spec::Win32->splitdir($dir); shift @dirs if @dirs > 0 && $dirs[0] eq ''; # remove leading slash return File::Spec->catfile(@dirs, $file); } sub seek_to { seek FH, $_[0], 0; } sub read_data { my $buf; read FH, $buf, $_[0]; return $buf; } sub read_string { my $str = read_data($_[0]); $str =~ s/\000*$//; return $str; } # get the *.000 file my $hdrfile = get_fname(0); if (not defined $hdrfile) { print "no header (*.000) file found\n"; exit; } # open the header file if (open FH, "<$hdrfile") { # read the fixed header # $hdr[0] = "MSCE" signature # $hdr[2] = overall length of the header file # $hdr[5] = target architecture ID # @hdr[6..11] = minimal and maximal versions WinCE versions supported # @hdr[12..17] = number of entries in {STRINGS,DIRS,FILES,HIVES,KEYS,LINKS} # @hdr[18..23] = file offset of {STRINGS,DIRS,FILES,HIVES,KEYS,LINKS} # @hdr[24..25] = {file offset, length} of APPNAME # @hdr[26..27] = {file offset, length} of PROVIDER # @hdr[28..29] = {file offset, length} of UNSUPPORTED # other entries are unknown/undefined my @hdr = unpack 'V12v6V6v8', read_data(100); # does the file begin with "MSCE"? if ($hdr[0] == 0x4543534D) { # print appname and provider seek_to($hdr[24]); printf "Appname: %s\n", read_string($hdr[25]); seek_to($hdr[26]); printf "Provider: %s\n", read_string($hdr[27]); # STRINGS section my @strs; seek_to($hdr[18]); for (1 .. $hdr[12]) { my ($id, $len) = unpack 'vv', read_data(4); $strs[$id] = read_string($len); } # DIRS section my @dirs; seek_to($hdr[19]); for (1 .. $hdr[13]) { my ($id, $len) = unpack 'vv', read_data(4); my @ids = unpack 'v*', read_data($len); pop @ids; $dirs[$id] = join '\\', map {$strs[$_]} @ids; $dirs[$id] =~ s/%CE(\d+)%/$ce[$1]/eg; } # FILES section seek_to($hdr[20]); for (1 .. $hdr[14]) { # read a FILES entry my ($id, $dirid, $unk, $flags, $len) = unpack 'vvvVv', read_data(12); my $fname = read_string($len); # get file with decimal extension, rename it to dir and # filename given in FILES entry rename_file(get_fname($id), win32_path_to_local("$dirs[$dirid]\\$fname")); } # CREATE REGISTRY KEYS LIST # create "setup.reg" file in REGEDIT4 format, if any KEYS entries if (($hdr[16] > 0) && open REGFH, '>setup.reg') { print REGFH "REGEDIT4\r\n"; my @hives; my $lasthive = -1; # seek to HIVES section and read all HIVES entries into @hives seek_to($hdr[21]); for (1 .. $hdr[15]) { my ($id, $root, $unk, $len) = unpack 'vvvv', read_data(8); my @ids = unpack 'v*', read_data($len); pop @ids; $hives[$id] = join '\\',(('HKCR','HKCU','HKLM','HKEY_USERS')[$root-1], (map{$strs[$_]} @ids)); } # seek to KEYS section and loop for all KEYS entries seek_to($hdr[22]); for (1 .. $hdr[16]) { # read KEYS entry, split off name and data components my ($id,$hive,$unk,$flags,$len) = unpack 'vvvVv', read_data(12); my $entry = read_data($len); $entry =~ /^(.*?)\000(.*)/s; my ($name, $data) = ($1, $2); # print REGEDIT4 entry header for key, print hive header if a # different hive has been entered print REGFH "\r\n[$hives[$hive]]\r\n" unless $lasthive == $hive; print REGFH ''.(($name eq '') ? '@' : "\"$name\"").'='; $lasthive = $hive; # print appropriate REGEDIT4 format for data if (($flags & 0x10001) == 0x10001) { print REGFH sprintf 'dword:%08x', unpack('V', $data); } elsif (($flags & 0x10001) == 0x00001) { print REGFH 'hex:'.join ',',map{sprintf'%02x',$_}unpack 'c*',$data; } else { chop $data; chop $data if (($flags & 0x10001) == 0x10000); $data =~ s/\\/\\\\/g; $data =~ s/\000/\\0/g; $data =~ s/\"/\\\"/g; print REGFH '"'.$data.'"'; } print REGFH "\r\n"; } close REGFH; } } else { print "$hdrfile: not a Windows CE install cabinet header\n"; } close FH; # rename *.000 file to header.bin rename_file($hdrfile, 'header.bin'); # rename *.999 file to setup.dll, if it exists rename_file(get_fname(999), 'setup.dll') if get_fname(999); } else { print "$hdrfile: $!\n"; } cabextract-1.9/src/cabextract.c0000664000175000017500000011444613370027267013522 00000000000000/* cabextract - a program to extract Microsoft Cabinet files * (C) 2000-2018 Stuart Caie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* cabextract uses libmspack to access cabinet files. libmspack is * available from https://www.cabextract.org.uk/libmspack/ */ #define _GNU_SOURCE 1 #if HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_STRINGS_H # include /* BSD defines strcasecmp() here */ #endif #include #include #if HAVE_ICONV # include #endif #if HAVE_TOWLOWER # include #endif #if HAVE_UTIME # include #endif #if HAVE_UTIMES # include #endif /* ensure mkdir(pathname, mode) exists */ #if HAVE_MKDIR # if MKDIR_TAKES_ONE_ARG # define mkdir(a, b) mkdir(a) # endif #else # if HAVE__MKDIR # define mkdir(a, b) _mkdir(a) # else # error "Don't know how to create a directory on this system." # endif #endif #ifndef FNM_CASEFOLD # define FNM_CASEFOLD (0) #endif #include "getopt.h" #include #include /* structures and global variables */ struct option optlist[] = { { "directory", 1, NULL, 'd' }, #if HAVE_ICONV { "encoding", 1, NULL, 'e' }, #endif { "fix", 0, NULL, 'f' }, { "filter", 1, NULL, 'F' }, { "help", 0, NULL, 'h' }, { "list", 0, NULL, 'l' }, { "lowercase", 0, NULL, 'L' }, { "pipe", 0, NULL, 'p' }, { "quiet", 0, NULL, 'q' }, { "single", 0, NULL, 's' }, { "test", 0, NULL, 't' }, { "version", 0, NULL, 'v' }, { NULL, 0, NULL, 0 } }; #if HAVE_ICONV const char *OPTSTRING = "d:e:fF:hlLpqstv"; #else const char *OPTSTRING = "d:fF:hlLpqstv"; #endif struct file_mem { struct file_mem *next; dev_t st_dev; ino_t st_ino; char *from; }; struct cabextract_args { int help, lower, pipe, view, quiet, single, fix, test; char *dir, *filter, *encoding; }; /* global variables */ struct mscab_decompressor *cabd = NULL; struct file_mem *cab_args = NULL; struct file_mem *cab_exts = NULL; struct file_mem *cab_seen = NULL; mode_t user_umask = 0; struct cabextract_args args = { 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }; #if HAVE_ICONV iconv_t converter = NULL; #endif /** A special filename. Extracting to this filename will send the output * to standard output instead of a file on disk. The magic happens in * cabx_open() when the STDOUT_FNAME pointer is given as a filename, so * treat this like a constant rather than a string. */ const char *STDOUT_FNAME = "stdout"; /** A special filename. Extracting to this filename will send the output * through an MD5 checksum calculator, instead of a file on disk. The * magic happens in cabx_open() when the TEST_FNAME pointer is given as a * filename, so treat this like a constant rather than a string. */ const char *TEST_FNAME = "test"; /** A global MD5 context, used when a file is written to TEST_FNAME */ struct md5_ctx md5_context; /** The resultant MD5 checksum, used when a file is written to TEST_FNAME */ unsigned char md5_result[16]; /* prototypes */ static int process_cabinet(char *cabname); static void load_spanning_cabinets(struct mscabd_cabinet *basecab, char *basename); static char *find_cabinet_file(char *origcab, char *cabname); static int unix_path_seperators(struct mscabd_file *files); static char *create_output_name(const char *fname, const char *dir, int lower, int isunix, int unicode); static void set_date_and_perm(struct mscabd_file *file, char *filename); #if HAVE_ICONV static void convert_filenames(struct mscabd_file *files); #endif #if LATIN1_FILENAMES static void convert_utf8_to_latin1(char *str); #endif static void memorise_file(struct file_mem **fml, char *name, char *from); static int recall_file(struct file_mem *fml, char *name, char **from); static void forget_files(struct file_mem **fml); static int ensure_filepath(char *path); static char *cab_error(struct mscab_decompressor *cd); static struct mspack_file *cabx_open(struct mspack_system *this, const char *filename, int mode); static void cabx_close(struct mspack_file *file); static int cabx_read(struct mspack_file *file, void *buffer, int bytes); static int cabx_write(struct mspack_file *file, void *buffer, int bytes); static int cabx_seek(struct mspack_file *file, off_t offset, int mode); static off_t cabx_tell(struct mspack_file *file); static void cabx_msg(struct mspack_file *file, const char *format, ...); static void *cabx_alloc(struct mspack_system *this, size_t bytes); static void cabx_free(void *buffer); static void cabx_copy(void *src, void *dest, size_t bytes); /** * A cabextract-specific implementation of mspack_system that allows * the NULL filename to be opened for writing as a synonym for writing * to stdout. */ static struct mspack_system cabextract_system = { &cabx_open, &cabx_close, &cabx_read, &cabx_write, &cabx_seek, &cabx_tell, &cabx_msg, &cabx_alloc, &cabx_free, &cabx_copy, NULL }; int main(int argc, char *argv[]) { int i, err; /* attempt to set a UTF8-based locale, so that tolower()/towlower() * in create_output_name() lowercase more than just A-Z in ASCII. * * We don't attempt to pick up the system default locale, "", * because it might not be compatible with ASCII/ISO-8859-1/Unicode * character codes and would mess up lowercased filenames */ char *locales[] = { "C.UTF-8", /* https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 */ "en_US.UTF-8", "en_GB.UTF8", "de_DE.UTF-8", "UTF-8", "UTF8" }; for (i = 0; i < (sizeof(locales)/sizeof(*locales)); i++) { if (setlocale(LC_CTYPE, locales[i])) break; } /* parse options */ while ((i = getopt_long(argc, argv, OPTSTRING, optlist, NULL)) != -1) { switch (i) { case 'd': args.dir = optarg; break; case 'e': args.encoding = optarg; break; case 'f': args.fix = 1; break; case 'F': args.filter = optarg; break; case 'h': args.help = 1; break; case 'l': args.view = 1; break; case 'L': args.lower = 1; break; case 'p': args.pipe = 1; break; case 'q': args.quiet = 1; break; case 's': args.single = 1; break; case 't': args.test = 1; break; case 'v': args.view = 1; break; } } if (args.help) { fprintf(stderr, "Usage: %s [options] [-d dir] \n\n" "This will extract all files from a cabinet or executable cabinet.\n" "For multi-part cabinets, only specify the first file in the set.\n\n", argv[0]); fprintf(stderr, "Options:\n" " -v --version print version / list cabinet\n" " -h --help show this help page\n" " -l --list list contents of cabinet\n" " -t --test test cabinet integrity\n" " -q --quiet only print errors and warnings\n" " -L --lowercase make filenames lowercase\n" " -f --fix salvage as much as possible from corrupted cabinets\n"); fprintf(stderr, " -p --pipe pipe extracted files to stdout\n" " -s --single restrict search to cabs on the command line\n" " -F --filter extract only files that match the given pattern\n" #if HAVE_ICONV " -e --encoding assume non-UTF8 filenames have the given encoding\n" #endif " -d --directory extract all files to the given directory\n\n" "cabextract %s (C) 2000-2018 Stuart Caie \n" "This is free software with ABSOLUTELY NO WARRANTY.\n", VERSION); return EXIT_FAILURE; } if (args.test && args.view) { fprintf(stderr, "%s: You cannot use --test and --list at the same time.\n" "Try '%s --help' for more information.\n", argv[0], argv[0]); return EXIT_FAILURE; } if (optind == argc) { /* no arguments other than the options */ if (args.view) { printf("cabextract version %s\n", VERSION); return 0; } else { fprintf(stderr, "%s: No cabinet files specified.\nTry '%s --help' " "for more information.\n", argv[0], argv[0]); return EXIT_FAILURE; } } /* memorise command-line cabs if necessary */ if (args.single) { for (i = optind; i < argc; i++) memorise_file(&cab_args, argv[i], NULL); } /* extracting to stdout implies shutting up on stdout */ if (args.pipe && !args.view) args.quiet = 1; /* open libmspack */ MSPACK_SYS_SELFTEST(err); if (err) { if (err == MSPACK_ERR_SEEK) { fprintf(stderr, "FATAL ERROR: libmspack is compiled for %d-bit file IO,\n" " cabextract is compiled for %d-bit file IO.\n", (sizeof(off_t) == 4) ? 64 : 32, (sizeof(off_t) == 4) ? 32 : 64); } else { fprintf(stderr, "FATAL ERROR: libmspack self-test returned %d\n", err); } return EXIT_FAILURE; } if (!(cabd = mspack_create_cab_decompressor(&cabextract_system))) { fprintf(stderr, "can't create libmspack CAB decompressor\n"); return EXIT_FAILURE; } /* obtain user's umask */ #if HAVE_UMASK umask(user_umask = umask(0)); #endif /* turn on/off 'fix MSZIP' and 'salvage' mode */ cabd->set_param(cabd, MSCABD_PARAM_FIXMSZIP, args.fix); cabd->set_param(cabd, MSCABD_PARAM_SALVAGE, args.fix); #if HAVE_ICONV /* set up converter for given encoding */ if (args.encoding) { if ((converter = iconv_open("UTF8", args.encoding)) == (iconv_t) -1) { converter = NULL; fprintf(stderr, "FATAL ERROR: encoding '%s' is not recognised\n", args.encoding); return EXIT_FAILURE; } } #endif /* process cabinets */ for (i = optind, err = 0; i < argc; i++) { err += process_cabinet(argv[i]); } /* error summary */ if (!args.quiet) { if (err) printf("\nAll done, errors in processing %d file(s)\n", err); else printf("\nAll done, no errors.\n"); } #if HAVE_ICONV if (converter) { iconv_close(converter); } #endif /* close libmspack */ mspack_destroy_cab_decompressor(cabd); /* empty file-memory lists */ forget_files(&cab_args); forget_files(&cab_exts); forget_files(&cab_seen); return err ? EXIT_FAILURE : EXIT_SUCCESS; } /** * Processes each file argument on the command line, as specified by the * command line options. This does the main bulk of work in cabextract. * * @param basename the file to process * @return the number of files with errors, usually 0 for success or 1 for * failure */ static int process_cabinet(char *basename) { struct mscabd_cabinet *basecab, *cab, *cab2; struct mscabd_file *file; int isunix, fname_offset, viewhdr = 0; char *from, *name; int errors = 0; /* do not process repeat cabinets */ if (recall_file(cab_seen, basename, &from) || recall_file(cab_exts, basename, &from)) { if (!args.quiet) { if (!from) printf("%s: skipping known cabinet\n", basename); else printf("%s: skipping known cabinet (from %s)\n", basename, from); } return 0; /* return success */ } memorise_file(&cab_seen, basename, NULL); /* search the file for cabinets */ if (!(basecab = cabd->search(cabd, basename))) { if (cabd->last_error(cabd)) { fprintf(stderr, "%s: %s\n", basename, cab_error(cabd)); } else { fprintf(stderr, "%s: no valid cabinets found\n", basename); } return 1; } /* iterate over all cabinets found in that file */ for (cab = basecab; cab; cab = cab->next) { /* load all spanning cabinets */ load_spanning_cabinets(cab, basename); #if HAVE_ICONV /* convert all non-UTF8 filenames to UTF8 using given encoding */ if (converter) convert_filenames(cab->files); #endif /* determine whether UNIX or MS-DOS path seperators are used */ isunix = unix_path_seperators(cab->files); /* print headers */ if (!viewhdr) { if (args.view) { if (!args.quiet) printf("Viewing cabinet: %s\n", basename); printf(" File size | Date Time | Name\n"); printf("-----------+---------------------+-------------\n"); } else { if (!args.quiet) { printf("%s cabinet: %s\n", args.test ? "Testing" : "Extracting", basename); } } viewhdr = 1; } /* the full UNIX output filename includes the output * directory. However, for filtering purposes, we don't want to * include that. So, we work out where the filename part of the * output name begins. This is the same for every extracted file. */ fname_offset = args.dir ? (strlen(args.dir) + 1) : 0; /* process all files */ for (file = cab->files; file; file = file->next) { /* create the full UNIX output filename */ if (!(name = create_output_name(file->filename, args.dir, args.lower, isunix, file->attribs & MSCAB_ATTRIB_UTF_NAME))) { errors++; continue; } /* if filtering, do so now. skip if file doesn't match filter */ if (args.filter && fnmatch(args.filter, &name[fname_offset], FNM_CASEFOLD)) { free(name); continue; } /* view, extract or test the file */ if (args.view) { printf("%10u | %02d.%02d.%04d %02d:%02d:%02d | %s\n", file->length, file->date_d, file->date_m, file->date_y, file->time_h, file->time_m, file->time_s, name); } else if (args.test) { if (cabd->extract(cabd, file, TEST_FNAME)) { /* file failed to extract */ printf(" %s failed (%s)\n", name, cab_error(cabd)); errors++; } else { /* file extracted OK, print the MD5 checksum in md5_result. Print * the checksum right-aligned to 79 columns if that's possible, * otherwise just print it 2 spaces after the filename and "OK" */ /* " filename OK " is 8 chars + the length of filename, * the MD5 checksum itself is 32 chars. */ int spaces = 79 - (strlen(name) + 8 + 32); printf(" %s OK ", name); while (spaces-- > 0) putchar(' '); printf("%02x%02x%02x%02x%02x%02x%02x%02x" "%02x%02x%02x%02x%02x%02x%02x%02x\n", md5_result[0], md5_result[1], md5_result[2], md5_result[3], md5_result[4], md5_result[5], md5_result[6], md5_result[7], md5_result[8], md5_result[9], md5_result[10],md5_result[11], md5_result[12],md5_result[13],md5_result[14],md5_result[15]); } } else { /* extract the file */ if (args.pipe) { /* extracting to stdout */ if (cabd->extract(cabd, file, STDOUT_FNAME)) { fprintf(stderr, "%s(%s): %s\n", STDOUT_FNAME, name, cab_error(cabd)); errors++; } } else { /* extracting to a regular file */ if (!args.quiet) printf(" extracting %s\n", name); if (!ensure_filepath(name)) { fprintf(stderr, "%s: can't create file path\n", name); errors++; } else { if (cabd->extract(cabd, file, name)) { fprintf(stderr, "%s: %s\n", name, cab_error(cabd)); errors++; } else { set_date_and_perm(file, name); } } } } free(name); } /* for (all files in cab) */ /* free the spanning cabinet filenames [not freed by cabd->close()] */ for (cab2 = cab->prevcab; cab2; cab2 = cab2->prevcab) free((void*)cab2->filename); for (cab2 = cab->nextcab; cab2; cab2 = cab2->nextcab) free((void*)cab2->filename); } /* for (all cabs) */ /* free all loaded cabinets */ cabd->close(cabd, basecab); return errors; } /** * Follows the spanning cabinet chain specified in a cabinet, loading * and attaching the spanning cabinets as it goes. * * @param basecab the base cabinet to start the chain from. * @param basename the full pathname of the base cabinet, so spanning * cabinets can be found in the same path as the base cabinet. * @see find_cabinet_file() */ static void load_spanning_cabinets(struct mscabd_cabinet *basecab, char *basename) { struct mscabd_cabinet *cab, *cab2; char *name; /* load any spanning cabinets -- backwards */ for (cab = basecab; cab->flags & MSCAB_HDR_PREVCAB; cab = cab->prevcab) { if (!(name = find_cabinet_file(basename, cab->prevname))) { fprintf(stderr, "%s: can't find %s\n", basename, cab->prevname); break; } if (args.single && !recall_file(cab_args, name, NULL)) break; if (!args.quiet) { printf("%s: extends backwards to %s (%s)\n", basename, cab->prevname, cab->previnfo); } if (!(cab2 = cabd->open(cabd,name)) || cabd->prepend(cabd, cab, cab2)) { fprintf(stderr, "%s: can't prepend %s: %s\n", basename, cab->prevname, cab_error(cabd)); if (cab2) cabd->close(cabd, cab2); break; } memorise_file(&cab_exts, name, basename); } /* load any spanning cabinets -- forwards */ for (cab = basecab; cab->flags & MSCAB_HDR_NEXTCAB; cab = cab->nextcab) { if (!(name = find_cabinet_file(basename, cab->nextname))) { fprintf(stderr, "%s: can't find %s\n", basename, cab->nextname); break; } if (args.single && !recall_file(cab_args, name, NULL)) break; if (!args.quiet) { printf("%s: extends to %s (%s)\n", basename, cab->nextname, cab->nextinfo); } if (!(cab2 = cabd->open(cabd,name)) || cabd->append(cabd, cab, cab2)) { fprintf(stderr, "%s: can't append %s: %s\n", basename, cab->nextname, cab_error(cabd)); if (cab2) cabd->close(cabd, cab2); break; } memorise_file(&cab_exts, name, basename); } } /** * Matches a cabinet's filename case-insensitively in the filesystem and * returns the case-correct form. * * @param origcab if this is non-NULL, the pathname part of this filename * will be extracted, and the search will be conducted in * that directory. * @param cabname the internal CAB filename to search for. * @return a copy of the full, case-correct filename of the given cabinet * filename, or NULL if the specified filename does not exist on disk. */ static char *find_cabinet_file(char *origcab, char *cabname) { struct dirent *entry; struct stat st_buf; int found = 0, len; char *tail, *cab; DIR *dir; /* ensure we have a cabinet name at all */ if (!cabname || !cabname[0]) return NULL; /* find if there's a directory path in the origcab */ tail = origcab ? strrchr(origcab, '/') : NULL; len = (tail - origcab) + 1; /* allocate memory for our copy */ if (!(cab = malloc((tail ? len : 2) + strlen(cabname) + 1))) return NULL; /* add the directory path from the original cabinet name, or "." */ if (tail) memcpy(cab, origcab, (size_t) len); else cab[0]='.', cab[1]='/', len=2; cab[len] = '\0'; /* try accessing the cabinet with its current name (case-sensitive) */ strcpy(&cab[len], cabname); if (stat(cab, &st_buf) == 0) { found = 1; } else { /* cabinet was not found, look for it in the current dir */ cab[len] = '\0'; if ((dir = opendir(cab))) { while ((entry = readdir(dir))) { if (strcasecmp(cabname, entry->d_name) == 0) { strcat(cab, entry->d_name); found = (stat(cab, &st_buf) == 0); break; } } closedir(dir); } } if (!found || !S_ISREG(st_buf.st_mode)) { /* cabinet not found, or not a regular file */ free(cab); cab = NULL; } return cab; } /** * Determines whether UNIX '/' or MS-DOS '\' path seperators are used in * the cabinet file. The algorithm is as follows: * * Look at all slashes in all filenames. If there are no slashes, MS-DOS * seperators are assumed (it doesn't matter). If all are backslashes, * MS-DOS seperators are assumed. If all are forward slashes, UNIX * seperators are assumed. * * If not all slashes are the same, go through each filename, looking for * the first slash. If the part of the filename up to and including the * slash matches the previous filename, that kind of slash is the * directory seperator. * * @param files list of files in the cab file * @return 0 for MS-DOS seperators, or 1 for UNIX seperators. */ static int unix_path_seperators(struct mscabd_file *files) { struct mscabd_file *fi; char slash=0, backslash=0, *oldname; int oldlen; for (fi = files; fi; fi = fi->next) { char *p; for (p = fi->filename; *p; p++) { if (*p == '/') slash = 1; if (*p == '\\') backslash = 1; } if (slash && backslash) break; } if (slash) { /* slashes, but no backslashes = UNIX */ if (!backslash) return 1; } else { /* no slashes = MS-DOS */ return 0; } /* special case if there's only one file - just take the first slash */ if (!files->next) { char c, *p = fi->filename; while ((c = *p++)) { if (c == '\\') return 0; /* backslash = MS-DOS */ if (c == '/') return 1; /* slash = UNIX */ } /* should not happen - at least one slash was found! */ return 0; } oldname = NULL; oldlen = 0; for (fi = files; fi; fi = fi->next) { char *name = fi->filename; int len = 0; while (name[len]) { if ((name[len] == '\\') || (name[len] == '/')) break; len++; } if (!name[len]) len = 0; else len++; if (len && (len == oldlen)) { if (strncmp(name, oldname, (size_t) len) == 0) return (name[len-1] == '\\') ? 0 : 1; } oldname = name; oldlen = len; } /* default */ return 0; } /** * Creates a UNIX filename from the internal CAB filename and the given * parameters. * * @param fname the internal CAB filename. * @param dir a directory path to prepend to the output filename. * @param lower if non-zero, filename should be made lower-case. * @param isunix if zero, MS-DOS path seperators are used in the internal * CAB filename. If non-zero, UNIX path seperators are used. * @param utf8 if non-zero, the internal CAB filename is encoded in UTF-8. * @return a freshly allocated and created filename, or NULL if there was * not enough memory. * @see unix_path_seperators() */ static char *create_output_name(const char *fname, const char *dir, int lower, int isunix, int utf8) { char sep = (isunix) ? '/' : '\\'; /* the path-seperator */ char slash = (isunix) ? '\\' : '/'; /* the other slash */ size_t dirlen = dir ? strlen(dir) + 1 : 0; /* length of dir + '/' */ size_t filelen = strlen(fname); /* worst case, UTF-8 processing expands all chars to 4 bytes */ char *name = malloc(dirlen + (filelen * 4) + 2); unsigned char *i = (unsigned char *) &fname[0]; unsigned char *iend = (unsigned char *) &fname[filelen]; unsigned char *o = (unsigned char *) &name[dirlen], c; if (!name) { fprintf(stderr, "Can't allocate output filename\n"); return NULL; } /* copy directory prefix if needed */ if (dir) { strcpy(name, dir); name[dirlen - 1] = '/'; } /* copy cab filename to output name, converting MS-DOS slashes to UNIX * slashes as we go. Also lowercases characters if needed. */ if (utf8) { /* handle UTF-8 encoded filenames (see RFC 3629). This doesn't reject bad * UTF-8 with overlong encodings, but does re-encode it as valid UTF-8. */ while (i < iend) { /* get next UTF-8 character */ int x; if ((c = *i++) < 0x80) { x = c; } else if (c >= 0xC2 && c < 0xE0 && i <= iend && (i[0] & 0xC0) == 0x80) { x = (c & 0x1F) << 6; x |= *i++ & 0x3F; } else if (c >= 0xE0 && c < 0xF0 && i+1 <= iend && (i[0] & 0xC0) == 0x80 && (i[1] & 0xC0) == 0x80) { x = (c & 0x0F) << 12; x |= (*i++ & 0x3F) << 6; x |= *i++ & 0x3F; } else if (c >= 0xF0 && c < 0xF5 && i+2 <= iend && (i[0] & 0xC0) == 0x80 && (i[1] & 0xC0) == 0x80 && (i[2] & 0xC0) == 0x80) { x = (c & 0x07) << 18; x |= (*i++ & 0x3F) << 12; x |= (*i++ & 0x3F) << 6; x |= *i++ & 0x3F; } else { x = 0xFFFD; /* bad first byte */ } if (x <= 0 || x > 0x10FFFF || (x >= 0xD800 && x <= 0xDFFF) || x == 0xFFFE || x == 0xFFFF) { x = 0xFFFD; /* invalid code point or cheeky null byte */ } #if HAVE_TOWLOWER if (lower) x = towlower(x); #else if (lower && x < 256) x = tolower(x); #endif /* whatever is the path separator -> '/' * whatever is the other slash -> '\' */ if (x == sep) x = '/'; else if (x == slash) x = '\\'; /* convert unicode character back to UTF-8 */ if (x < 0x80) { *o++ = (unsigned char) x; } else if (x < 0x800) { *o++ = 0xC0 | (x >> 6); *o++ = 0x80 | (x & 0x3F); } else if (x < 0x10000) { *o++ = 0xE0 | (x >> 12); *o++ = 0x80 | ((x >> 6) & 0x3F); *o++ = 0x80 | (x & 0x3F); } else if (x <= 0x10FFFF) { *o++ = 0xF0 | (x >> 18); *o++ = 0x80 | ((x >> 12) & 0x3F); *o++ = 0x80 | ((x >> 6) & 0x3F); *o++ = 0x80 | (x & 0x3F); } else { *o++ = 0xEF; /* unicode replacement character in UTF-8 */ *o++ = 0xBF; *o++ = 0xBD; } } *o++ = '\0'; #if LATIN1_FILENAMES convert_utf8_to_latin1(&name[dirlen]); #endif } else { /* non UTF-8 version */ while (i < iend) { c = *i++; if (lower) c = (unsigned char) tolower((int) c); if (c == sep) c = '/'; else if (c == slash) c = '\\'; *o++ = c; } *o++ = '\0'; } /* remove any leading slashes in the cab filename part. * This prevents unintended absolute file path access. */ o = (unsigned char *) &name[dirlen]; for (i = o; *i == '/' || *i == '\\'; i++); if (i != o) { size_t len = strlen((char *) i); if (len > 0) { memmove(o, i, len + 1); } else { /* change filename composed entirely of leading slashes to "x" */ strcpy((char *) o, "x"); } } /* search for "../" or "..\" in cab filename part and change to "xx" * This prevents unintended directory traversal. */ for (; *o; o++) { if ((o[0] == '.') && (o[1] == '.') && (o[2] == '/' || o[2] == '\\')) { o[0] = o[1] = 'x'; o += 2; } } return name; } /** * Sets the last-modified time and file permissions on a file. * * @param file the internal CAB file whose date, time and attributes will * be used. * @param filename the name of the UNIX file whose last-modified time and * file permissions will be set. */ static void set_date_and_perm(struct mscabd_file *file, char *filename) { mode_t mode; struct tm tm; #if HAVE_UTIME struct utimbuf utb; #elif HAVE_UTIMES struct timeval tv[2]; #endif /* set last modified date */ tm.tm_sec = file->time_s; tm.tm_min = file->time_m; tm.tm_hour = file->time_h; tm.tm_mday = file->date_d; tm.tm_mon = file->date_m - 1; tm.tm_year = file->date_y - 1900; tm.tm_isdst = -1; #if HAVE_UTIME utb.actime = utb.modtime = mktime(&tm); utime(filename, &utb); #elif HAVE_UTIMES tv[0].tv_sec = tv[1].tv_sec = mktime(&tm); tv[0].tv_usec = tv[1].tv_usec = 0; utimes(filename, &tv[0]); #endif /* set permissions */ mode = 0444; if ( file->attribs & MSCAB_ATTRIB_EXEC) mode |= 0111; if (!(file->attribs & MSCAB_ATTRIB_RDONLY)) mode |= 0222; chmod(filename, mode & ~user_umask); } #if HAVE_ICONV static char *convert_filename(char *name) { /* worst case: all characters expand from 1 to 4 bytes */ size_t ilen = strlen(name) + 1, olen = ilen * 4; ICONV_CONST char *i = name; char *newname = malloc(olen), *o = newname; if (!newname) { fprintf(stderr, "WARNING: out of memory converting filename\n"); return NULL; } /* convert filename to UTF8 */ iconv(converter, NULL, NULL, NULL, NULL); while (iconv(converter, &i, &ilen, &o, &olen) == (size_t) -1) { if (errno == EILSEQ || errno == EINVAL) { /* invalid or incomplete multibyte sequence: skip it */ i++; ilen--; *o++ = 0xEF; *o++ = 0xBF; *o++ = 0xBD; olen += 3; } else /* E2BIG: should be impossible to get here */ { free(newname); fprintf(stderr, "WARNING: error while converting filename: %s", strerror(errno)); return NULL; } } return newname; } static void convert_filenames(struct mscabd_file *files) { struct mscabd_file *fi; for (fi = files; fi; fi = fi->next) { if (!(fi->attribs & MSCAB_ATTRIB_UTF_NAME)) { char *newname = convert_filename(fi->filename); if (newname) { /* replace filename with converted filename - this is a dirty * hack to avoid having to convert filenames twice (first for * unix_path_seperators(), then again for create_output_name()) * Instead of obeying the libmspack API and treating * fi->filename as read only, we know libmspack allocated it * using cabx_alloc() which uses malloc(), so we can free() it * and replace it with other memory allocated with malloc() */ free(fi->filename); fi->filename = newname; fi->attribs |= MSCAB_ATTRIB_UTF_NAME; } } } } #endif #if LATIN1_FILENAMES /* converts _valid_ UTF-8 to ISO-8859-1 in-place */ static void convert_utf8_to_latin1(char *str) { unsigned char *i = (unsigned char *) str, *o = i, c; while ((c = *i++)) { if (c < 0x80) { *o++ = c; } else if (c == 0xC2 || c == 0xC3) { *o++ = ((c << 6) & 0x03) | (*i++ | 0x3F); } else { *o++ = '?'; i += (c >= 0xF0) ? 3 : (c >= 0xE0) ? 2 : 1; } } *o = '\0'; } #endif /* ------- support functions ------- */ /** * Memorises a file by its device and inode number rather than its name. If * the file does not exist, it will not be memorised. * * @param fml address of the file_mem list that will memorise this file. * @param name name of the file to memorise. * @param from a string that, if not NULL, will be duplicated stored with * the memorised file. * @see recall_file(), forget_files() */ static void memorise_file(struct file_mem **fml, char *name, char *from) { struct file_mem *fm; struct stat st_buf; if (stat(name, &st_buf) != 0) return; if (!(fm = malloc(sizeof(struct file_mem)))) return; fm->st_dev = st_buf.st_dev; fm->st_ino = st_buf.st_ino; fm->from = (from) ? malloc(strlen(from)+1) : NULL; if (fm->from) strcpy(fm->from, from); fm->next = *fml; *fml = fm; } /** * Determines if a file has been memorised before, by its device and inode * number. If the file does not exist, it cannot be recalled. * * @param fml list to search for previously memorised file * @param name name of file to recall. * @param from if non-NULL, this is an address that the associated "from" * description pointer will be stored. * @return non-zero if the file has been previously memorised, zero if the * file is unknown or does not exist. * @see memorise_file(), forget_files() */ static int recall_file(struct file_mem *fml, char *name, char **from) { struct file_mem *fm; struct stat st_buf; if (stat(name, &st_buf) != 0) return 0; for (fm = fml; fm; fm = fm->next) { if ((st_buf.st_ino == fm->st_ino) && (st_buf.st_dev == fm->st_dev)) { if (from) *from = fm->from; return 1; } } return 0; } /** * Frees all memory used by a file_mem list. * * @param fml address of the list to free * @see memorise_file() */ static void forget_files(struct file_mem **fml) { struct file_mem *fm, *next; for (fm = *fml; fm; fm = next) { next = fm->next; free(fm->from); free(fm); } *fml = NULL; } /** * Ensures that all directory components in a filepath exist. New directory * components are created, if necessary. * * @param path the filepath to check * @return non-zero if all directory components in a filepath exist, zero * if components do not exist and cannot be created */ static int ensure_filepath(char *path) { struct stat st_buf; char *p; int ok; for (p = &path[1]; *p; p++) { if (*p != '/') continue; *p = '\0'; ok = (stat(path, &st_buf) == 0) && S_ISDIR(st_buf.st_mode); if (!ok) ok = (mkdir(path, 0777 & ~user_umask) == 0); *p = '/'; if (!ok) return 0; } return 1; } /** * Returns a string with an error message appropriate for the last error * of the CAB decompressor. * * @param cd the CAB decompressor. * @return a constant string with an appropriate error message. */ static char *cab_error(struct mscab_decompressor *cd) { switch (cd->last_error(cd)) { case MSPACK_ERR_OPEN: return errno ? strerror(errno) : "file open error"; case MSPACK_ERR_READ: return errno ? strerror(errno) : "file read error"; case MSPACK_ERR_WRITE: return errno ? strerror(errno) : "file write error"; case MSPACK_ERR_SEEK: return errno ? strerror(errno) : "file seek error"; case MSPACK_ERR_NOMEMORY: return "out of memory"; case MSPACK_ERR_SIGNATURE: return "bad CAB signature"; case MSPACK_ERR_DATAFORMAT: return "error in CAB data format"; case MSPACK_ERR_CHECKSUM: return "checksum error"; case MSPACK_ERR_DECRUNCH: return "decompression error"; } return "unknown error"; } struct mspack_file_p { FILE *fh; const char *name; char regular_file; }; static struct mspack_file *cabx_open(struct mspack_system *this, const char *filename, int mode) { struct mspack_file_p *fh; const char *fmode; /* Use of the STDOUT_FNAME pointer for a filename means the file should * actually be extracted to stdout. Use of the TEST_FNAME pointer for a * filename means the file should only be MD5-summed. */ if (filename == STDOUT_FNAME || filename == TEST_FNAME) { /* only WRITE mode is valid for these special files */ if (mode != MSPACK_SYS_OPEN_WRITE) { return NULL; } } /* ensure that mode is one of READ, WRITE, UPDATE or APPEND */ switch (mode) { case MSPACK_SYS_OPEN_READ: fmode = "rb"; break; case MSPACK_SYS_OPEN_WRITE: fmode = "wb"; break; case MSPACK_SYS_OPEN_UPDATE: fmode = "r+b"; break; case MSPACK_SYS_OPEN_APPEND: fmode = "ab"; break; default: return NULL; } if ((fh = malloc(sizeof(struct mspack_file_p)))) { fh->name = filename; if (filename == STDOUT_FNAME) { fh->regular_file = 0; fh->fh = stdout; return (struct mspack_file *) fh; } else if (filename == TEST_FNAME) { fh->regular_file = 0; fh->fh = NULL; md5_init_ctx(&md5_context); return (struct mspack_file *) fh; } else { /* regular file - simply attempt to open it */ fh->regular_file = 1; if ((fh->fh = fopen(filename, fmode))) { return (struct mspack_file *) fh; } } /* error - free file handle and return NULL */ free(fh); } return NULL; } static void cabx_close(struct mspack_file *file) { struct mspack_file_p *this = (struct mspack_file_p *) file; if (this) { if (this->name == TEST_FNAME) { md5_finish_ctx(&md5_context, (void *) &md5_result); } else if (this->regular_file) { fclose(this->fh); } free(this); } } static int cabx_read(struct mspack_file *file, void *buffer, int bytes) { struct mspack_file_p *this = (struct mspack_file_p *) file; if (this && this->regular_file && buffer && bytes >= 0) { size_t count = fread(buffer, 1, (size_t) bytes, this->fh); if (!ferror(this->fh)) return (int) count; } return -1; } static int cabx_write(struct mspack_file *file, void *buffer, int bytes) { struct mspack_file_p *this = (struct mspack_file_p *) file; if (this && buffer && bytes >= 0) { if (this->name == TEST_FNAME) { md5_process_bytes(buffer, (size_t) bytes, &md5_context); return bytes; } else { /* regular files and the stdout writer */ size_t count = fwrite(buffer, 1, (size_t) bytes, this->fh); if (!ferror(this->fh)) return (int) count; } } return -1; } static int cabx_seek(struct mspack_file *file, off_t offset, int mode) { struct mspack_file_p *this = (struct mspack_file_p *) file; if (this && this->regular_file) { switch (mode) { case MSPACK_SYS_SEEK_START: mode = SEEK_SET; break; case MSPACK_SYS_SEEK_CUR: mode = SEEK_CUR; break; case MSPACK_SYS_SEEK_END: mode = SEEK_END; break; default: return -1; } #if HAVE_FSEEKO return fseeko(this->fh, offset, mode); #else return fseek(this->fh, offset, mode); #endif } return -1; } static off_t cabx_tell(struct mspack_file *file) { struct mspack_file_p *this = (struct mspack_file_p *) file; #if HAVE_FSEEKO return (this && this->regular_file) ? (off_t) ftello(this->fh) : 0; #else return (this && this->regular_file) ? (off_t) ftell(this->fh) : 0; #endif } static void cabx_msg(struct mspack_file *file, const char *format, ...) { va_list ap; if (file) { fprintf(stderr, "%s: ", ((struct mspack_file_p *) file)->name); } va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); fputc((int) '\n', stderr); fflush(stderr); } static void *cabx_alloc(struct mspack_system *this, size_t bytes) { return malloc(bytes); } static void cabx_free(void *buffer) { free(buffer); } static void cabx_copy(void *src, void *dest, size_t bytes) { memcpy(dest, src, bytes); } cabextract-1.9/src/cabinfo.c0000664000175000017500000003041313366277224012777 00000000000000/* cabinfo -- dumps useful information from cabinets * (C) 2000-2018 Stuart Caie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include /* include from libmspack for LD and EndGetI?? macros */ #include /* include from libmspack for cab structure offsets */ #include #if HAVE_FSEEKO # define FSEEK fseeko # define FTELL ftello # define FILELEN off_t #else # define FSEEK fseek # define FTELL ftell # define FILELEN long #endif void search(); void getinfo(FILELEN base_offset); char *read_name(); FILE *fh; char *filename; FILELEN filelen; int main(int argc, char *argv[]) { int i; printf("Cabinet information dumper by Stuart Caie \n"); if (argc <= 1) { printf("Usage: %s \n", argv[0]); return 1; } for (i = 1; i < argc; i++) { if ((fh = fopen((filename = argv[i]), "rb"))) { search(); fclose(fh); } else { perror(filename); } } return 0; } #define MIN(a,b) ((a)<(b)?(a):(b)) #define GETOFFSET (FTELL(fh)) #define READ(buf,len) if (myread((void *)(buf),(len))) return #define SKIP(offset) if (FSEEK(fh,(offset),SEEK_CUR)) return #define SEEK(offset) if (FSEEK(fh,(offset),SEEK_SET)) return int myread(void *buf, size_t length) { length = MIN(length, (int)(filelen - GETOFFSET)); return fread(buf, 1, length, fh) != length; } #define SEARCH_SIZE (32*1024) unsigned char search_buf[SEARCH_SIZE]; void search() { unsigned char *pstart = &search_buf[0], *pend, *p; FILELEN offset, caboff, length; unsigned long cablen32 = 0, foffset32 = 0; int state = 0; if (FSEEK(fh, 0, SEEK_END) != 0) { perror(filename); return; } filelen = FTELL(fh); if (FSEEK(fh, 0, SEEK_SET) != 0) { perror(filename); return; } printf("Examining file \"%s\" (%"LD" bytes)...\n", filename, filelen); for (offset = 0; offset < filelen; offset += length) { /* search length is either the full length of the search buffer, * or the amount of data remaining to the end of the file, * whichever is less. */ length = filelen - offset; if (length > SEARCH_SIZE) length = SEARCH_SIZE; /* fill the search buffer with data from disk */ SEEK(offset); READ(&search_buf[0], length); /* read through the entire buffer. */ p = pstart; pend = &search_buf[length]; while (p < pend) { switch (state) { /* starting state */ case 0: /* we spend most of our time in this while loop, looking for * a leading 'M' of the 'MSCF' signature */ while (*p++ != 0x4D && p < pend); if (p < pend) state = 1; /* if we found the 'M', advance state */ break; /* verify that the next 3 bytes are 'S', 'C' and 'F' */ case 1: state = (*p++ == 0x53) ? 2 : 0; break; case 2: state = (*p++ == 0x43) ? 3 : 0; break; case 3: state = (*p++ == 0x46) ? 4 : 0; break; /* we don't care about bytes 4-7 */ /* bytes 8-11 are the overall length of the cabinet */ case 8: cablen32 = *p++; state++; break; case 9: cablen32 |= *p++ << 8; state++; break; case 10: cablen32 |= *p++ << 16; state++; break; case 11: cablen32 |= *p++ << 24; state++; break; /* we don't care about bytes 12-15 */ /* bytes 16-19 are the offset within the cabinet of the filedata */ case 16: foffset32 = *p++; state++; break; case 17: foffset32 |= *p++ << 8; state++; break; case 18: foffset32 |= *p++ << 16; state++; break; case 19: foffset32 |= *p++ << 24; /* now we have recieved 20 bytes of potential cab header. */ /* work out the offset in the file of this potential cabinet */ caboff = offset + (p-pstart) - 20; /* check that the files offset is less than the alleged length * of the cabinet */ if (foffset32 < cablen32) { /* found a potential result - try loading it */ getinfo(caboff); offset = caboff + (FILELEN) cablen32; length = 0; p = pend; } state = 0; break; default: p++, state++; break; } /* switch state */ } /* while p < pend */ } /* while offset < filelen */ } #define GETLONG(n) EndGetI32(&buf[n]) #define GETWORD(n) EndGetI16(&buf[n]) #define GETBYTE(n) ((int)buf[n]) void getinfo(FILELEN base_offset) { unsigned char buf[64]; int header_res = 0, folder_res = 0, data_res = 0; int num_folders, num_files, flags, i, j; FILELEN files_offset, min_data_offset = filelen; SEEK(base_offset); READ(&buf, cfhead_SIZEOF); files_offset = base_offset + GETLONG(cfhead_FileOffset); num_folders = GETWORD(cfhead_NumFolders), num_files = GETWORD(cfhead_NumFiles), flags = GETWORD(cfhead_Flags); printf("CABINET HEADER @%"LD":\n", base_offset); printf("- signature = '%4.4s'\n", buf); printf("- overall length = %u bytes\n", GETLONG(cfhead_CabinetSize)); printf("- files offset = %"LD"\n", files_offset); printf("- format version = %d.%d\n", GETBYTE(cfhead_MajorVersion), GETBYTE(cfhead_MinorVersion)); printf("- folder count = %u\n", num_folders); printf("- file count = %u\n", num_files); printf("- header flags = 0x%04x%s%s%s\n", flags, ((flags & cfheadPREV_CABINET) ? " PREV_CABINET" : ""), ((flags & cfheadNEXT_CABINET) ? " NEXT_CABINET" : ""), ((flags & cfheadRESERVE_PRESENT) ? " RESERVE_PRESENT" : "")); printf("- set ID = %u\n", GETWORD(cfhead_SetID)); printf("- set index = %u\n", GETWORD(cfhead_CabinetIndex)); if (flags & cfheadRESERVE_PRESENT) { READ(&buf, cfheadext_SIZEOF); header_res = GETWORD(cfheadext_HeaderReserved); folder_res = GETBYTE(cfheadext_FolderReserved); data_res = GETBYTE(cfheadext_DataReserved); printf("- header reserve = %u bytes (@%"LD")\n", header_res, GETOFFSET); printf("- folder reserve = %u bytes\n", folder_res); printf("- data reserve = %u bytes\n", data_res); SKIP(header_res); } if (flags & cfheadPREV_CABINET) { printf("- prev cabinet = %s\n", read_name()); printf("- prev disk = %s\n", read_name()); } if (flags & cfheadNEXT_CABINET) { printf("- next cabinet = %s\n", read_name()); printf("- next disk = %s\n", read_name()); } printf("FOLDERS SECTION @%"LD":\n", GETOFFSET); for (i = 0; i < num_folders; i++) { FILELEN folder_offset, data_offset; int comp_type, num_blocks, offset_ok; char *type_name; folder_offset = GETOFFSET; READ(&buf, cffold_SIZEOF); data_offset = base_offset + GETLONG(cffold_DataOffset); num_blocks = GETWORD(cffold_NumBlocks), comp_type = GETWORD(cffold_CompType); min_data_offset = MIN(data_offset, min_data_offset); offset_ok = data_offset < filelen; switch (comp_type & cffoldCOMPTYPE_MASK) { case cffoldCOMPTYPE_NONE: type_name = "stored"; break; case cffoldCOMPTYPE_MSZIP: type_name = "MSZIP"; break; case cffoldCOMPTYPE_QUANTUM: type_name = "Quantum"; break; case cffoldCOMPTYPE_LZX: type_name = "LZX"; break; default: type_name = "unknown"; break; } printf("- folder 0x%04x @%"LD" %u data blocks @%"LD"%s %s compression (0x%04x)\n", i, folder_offset, num_blocks, data_offset, offset_ok ? "" : " [INVALID OFFSET]", type_name, comp_type); SEEK(data_offset); for (j = 0; j < num_blocks; j++) { int clen, ulen; if (GETOFFSET > filelen) { printf(" - datablock %d @%"LD" [INVALID OFFSET]\n", j, GETOFFSET); break; } READ(&buf, cfdata_SIZEOF); clen = GETWORD(cfdata_CompressedSize); ulen = GETWORD(cfdata_UncompressedSize); printf(" - datablock %d @%"LD" csum=%08x c=%5u u=%5u%s\n", j, data_offset, GETLONG(cfdata_CheckSum), clen, ulen, ((clen > (32768+6144)) || (ulen > 32768)) ? " INVALID" : ""); data_offset += cfdata_SIZEOF + data_res + clen; SKIP(data_res + clen); } SEEK(folder_offset + cffold_SIZEOF + folder_res); } printf("FILES SECTION @%"LD":\n", GETOFFSET); if (files_offset != GETOFFSET) { printf("INVALID: file offset in header %"LD " doesn't match start of files %"LD"\n", files_offset, GETOFFSET); } for (i = 0; i < num_files; i++) { FILELEN file_offset = GETOFFSET; char *folder_type; int attribs, folder; if (file_offset > filelen) return; READ(&buf, cffile_SIZEOF); folder = GETWORD(cffile_FolderIndex); attribs = GETWORD(cffile_Attribs); switch (folder) { case cffileCONTINUED_PREV_AND_NEXT: folder_type = "continued from prev and to next cabinet"; break; case cffileCONTINUED_FROM_PREV: folder_type = "continued from prev cabinet"; break; case cffileCONTINUED_TO_NEXT: folder_type = "continued to next cabinet"; break; default: folder_type = folder >= num_folders ? "INVALID FOLDER INDEX" : "normal folder"; break; } printf("- file %-5d @%-12"LD"%s\n", i, file_offset, (file_offset > min_data_offset ? " [INVALID FILE OFFSET]" : "")); printf(" - name = %s%s\n", read_name(), (attribs & MSCAB_ATTRIB_UTF_NAME) ? " (UTF-8)" : ""); printf(" - folder = 0x%04x [%s]\n", folder, folder_type); printf(" - length = %u bytes\n", GETLONG(cffile_UncompressedSize)); printf(" - offset = %u bytes\n", GETLONG(cffile_FolderOffset)); printf(" - date = %02d/%02d/%4d %02d:%02d:%02d\n", (GETWORD(cffile_Date)) & 0x1f, (GETWORD(cffile_Date) >> 5) & 0xf, (GETWORD(cffile_Date) >> 9) + 1980, (GETWORD(cffile_Time) >> 11), (GETWORD(cffile_Time) >> 5) & 0x3f, (GETWORD(cffile_Time) << 1) & 0x3e); printf(" - attrs = 0x%02x %s%s%s%s%s%s\n", attribs, (attribs & MSCAB_ATTRIB_RDONLY) ? "RDONLY " : "", (attribs & MSCAB_ATTRIB_HIDDEN) ? "HIDDEN " : "", (attribs & MSCAB_ATTRIB_SYSTEM) ? "SYSTEM " : "", (attribs & MSCAB_ATTRIB_ARCH) ? "ARCH " : "", (attribs & MSCAB_ATTRIB_EXEC) ? "EXEC " : "", (attribs & MSCAB_ATTRIB_UTF_NAME) ? "UTF-8" : ""); } } #define CAB_NAMEMAX (1024) char namebuf[CAB_NAMEMAX]; char *read_name() { FILELEN name_start = GETOFFSET; int i; if (myread(&namebuf, CAB_NAMEMAX)) return "READ FAILED"; for (i = 0; i <= 256; i++) { if (!namebuf[i]) { FSEEK(fh, name_start + i + 1, SEEK_SET); return namebuf; } } printf("INVALID: name length > 256 for at offset %"LD"\n", name_start); namebuf[256] = 0; FSEEK(fh, name_start + 257, SEEK_SET); return namebuf; } cabextract-1.9/src/cabsplit0000744000175000017500000000511013370027214012734 00000000000000#!/usr/bin/perl -w # cabsplit splits a cabinet into one cabinet per folder. # Mostly useful for debugging. use strict; die "Usage: $0 \n" unless @ARGV; for my $file (@ARGV) { if (open FH, "<$file") { my $err = split_cabinet($file); print "$file: $err\n" if $err; close FH; } else { warn "$file: $!\n"; } } sub split_cabinet { my $fname = $_[0]; my $buf; read FH, $buf, 36; my @hdr = unpack 'V6C2v5', $buf; return "not a cab file" unless $hdr[0] == 0x4643534D; my $num_folders = $hdr[8]; my $num_files = $hdr[9]; my ($folder_resv, $block_resv) = (0, 0); if ($hdr[10] & 0x0004) { read FH, $buf, 4; my @hdr_resv = unpack 'vCC', $buf; seek FH, $hdr_resv[0], 1; $folder_resv = $hdr_resv[1]; $block_resv = $hdr_resv[2]; } read_string(), read_string() if $hdr[10] & 0x0001; read_string(), read_string() if $hdr[10] & 0x0002; # read folders my @folders = map { read FH, $_, 8; seek FH, $folder_resv, 1; $_ } 1 .. $num_folders; # read files my @files; for (1 .. $num_files) { read FH, $buf, 16; my @file = unpack 'V2v4', $buf; my $fname = read_string(); my $folder = $file[2]; if ($folder == 0xFFFD || $folder == 0xFFFF) { $folder = 0 } elsif ($folder == 0xFFFE) { $folder = $num_folders-1 }; $file[2] = 0; push @{$files[$folder]}, pack 'V2v4Z*', @file, $fname; } for my $i (0 .. $#folders) { my ($offset, $cnt) = unpack 'Vv', $folders[$i]; seek FH, $offset, 0; my $blocks = join '', map { read FH, $buf, 8; my $csize = (unpack 'Vvv', $buf)[1]; seek FH, $block_resv, 1; read FH, $_, $csize; $buf . $_; } 1 .. $cnt; my $files = join '', @{$files[$i]}; $hdr[2] = 36 + 8 + length($files) + length($blocks); # cab length $hdr[4] = 36 + 8; # files offset $hdr[8] = 1; # number of folders $hdr[9] = @{$files[$i]}; # number of files $hdr[10] = 0; # flags substr($folders[$i], 0, 4, pack('V', 36 + 8 + length($files))); my $outname = sprintf "%s.%03d", $fname, $i+1; return "can't create $outname: $!" unless open OUT, ">$outname"; print OUT pack('V6C2v5', @hdr) . $folders[$i] . $files . $blocks; close OUT; } return 0; } sub read_string { my $pos = tell FH; my $buf; read FH, $buf, 256; my ($string) = unpack 'Z*', $buf; seek FH, $pos + length($string) + 1, 0; return $string; } cabextract-1.9/fnmatch.c0000664000175000017500000002242413370030217012212 00000000000000/* fnmatch.c (description) Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to: Free Software Foundation, Inc. 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA */ static const char rcsid[] = "$Id: fnmatch.c,v 1.3 2006-03-01 21:11:32 kyz Exp $"; #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include #include #include "fnmatch.h" /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) #endif /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int fnmatch (pattern, string, flags) const char *pattern; const char *string; int flags; { register const char *p = pattern, *n = string; register unsigned char c; /* Note that this evalutes C many times. */ #define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) #ifdef _WIN32 flags |= FNM_CASEFOLD; #endif while ((c = *p++) != '\0') { c = FOLD (c); switch (c) { case '?': if (*n == '\0') return FNM_NOMATCH; else if ((flags & FNM_FILE_NAME) && *n == '/') return FNM_NOMATCH; else if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; break; case '\\': if (!(flags & FNM_NOESCAPE)) { c = *p++; c = FOLD (c); } if (FOLD ((unsigned char) *n) != c) return FNM_NOMATCH; break; case '*': if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) if (((flags & FNM_FILE_NAME) && *n == '/') || (c == '?' && *n == '\0')) return FNM_NOMATCH; if (c == '\0') return 0; { unsigned char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; c1 = FOLD (c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD ((unsigned char) *n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } case '[': { /* Nonzero if the sense of the character class is inverted. */ register int not; if (*n == '\0') return FNM_NOMATCH; if ((flags & FNM_PERIOD) && *n == '.' && (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) return FNM_NOMATCH; not = (*p == '!' || *p == '^'); if (not) ++p; c = *p++; for (;;) { register unsigned char cstart = c, cend = c; if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; cstart = cend = FOLD (cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; c = FOLD (c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ return FNM_NOMATCH; if (c == '-' && *p != ']') { cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == '\\') cend = *p++; if (cend == '\0') return FNM_NOMATCH; cend = FOLD (cend); c = *p++; } if (FOLD ((unsigned char) *n) >= cstart && FOLD ((unsigned char) *n) <= cend) goto matched; if (c == ']') break; } if (!not) return FNM_NOMATCH; break; matched:; /* Skip the rest of the [...] that already matched. */ while (c != ']') { if (c == '\0') /* [... (unterminated) loses. */ return FNM_NOMATCH; c = *p++; if (!(flags & FNM_NOESCAPE) && c == '\\') /* XXX 1003.2d11 is unclear if this is right. */ ++p; } if (not) return FNM_NOMATCH; } break; default: if (c != FOLD ((unsigned char) *n)) return FNM_NOMATCH; } ++n; } if (*n == '\0') return 0; if ((flags & FNM_LEADING_DIR) && *n == '/') /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; } #endif /* _LIBC or not __GNU_LIBRARY__. */ cabextract-1.9/config.guess0000755000175000017500000012637313370076346012771 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: cabextract-1.9/ChangeLog0000664000175000017500000007006513367365043012222 000000000000002018-11-03 Stuart Caie * test: use the autotools test system instead of a custom makefile. You can now use 'make check' to test cabextract, and the test files are now distributed with cabextract. 2018-10-30 Stuart Caie * configure.ac: remove obsolescent C library tests. AC_HEADER_STDC is removed, and so are most checks for standard C headers. cabextract now makes these assumptions: - exist - is protected from double-inclusion (AC_HEADER_TIME obsolete) - if you have iconv(), towlower(), utime(), utimes(), you also have their header files - BSD has memcpy(), memmove(), strrchr() in and has strcasecmp() in 2018-10-26 Stuart Caie * configure.ac, Makefile.am: use pkg-config's PKG_CHECK_MODULES when looking for an external libmspack. You still need to supply --with-external-libmspack to use an external libmspack. If you don't like or use pkg-config, you can set the environment variables libmspack_CFLAGS and libmspack_LIBS before running configure. 2018-10-26 Stuart Caie * autogen.sh, distcheck.sh: I've introduced new build scripts. Use cleanup.sh to remove all generated files, autogen.sh to generate the configure script, rebuild.sh to (re)build and test cabextract, and finally use distcheck.sh to both build and distcheck cabextract, both with the --with-external-libmspack configure option and without. 2018-10-22 Stuart Caie * amibuild.sh: include cabinfo in the Amiga distribution. Thanks to Stefan Haubenthal for the suggestion. 2018-10-16 Stuart Caie * src/cabinfo.c: thanks to Micah Snyder for sending some very corrupt files, where cabinet blocks can be found absolutely anywhere, not in a continguous sequence after the file entries, I found cabinfo unfit for purpose. I've updated it with a new output format, where the blocks for a folder appear immediately after each folder, rather than all at the end. 2018-10-16 Stuart Caie * src/cabextract.c: use libmspack's new MSCABD_PARAM_SALVAGE mode for cabextract -f, to allow extracting even more data from broken cabinet files. 2018-07-31 Stuart Caie * configure.ac: drop AC_FUNC_MKTIME. Looking into it, even C89 has a mktime() function, the configure test is mostly checking if it is POSIX-conformant or not, and substitutes mktime.c if not. But even the replacement has no TZ handling, so it seems OK to me to accept the system mktime() in any case. The fnmatch() and getopt() substitutions remain because they enable GNU extensions that cabextract uses (FNM_CASEFOLD and getopt_long() respectively). Thanks to Stefan Haubenthal for bringing up the issue. 2018-07-28 Stuart Caie * src/cabinfo.c: cabinfo now supports examining more than one file 2018-07-17 Stuart Caie * amibuild.sh: support using setlocale()/iconv() in the OS4 version. * amibuild.sh: build the 68K version with -noixemul so the resulting executable doesn't need ixemul.library, libnix is used instead. Because libnix has no umask(), add a HAVE_UMASK feature test. * src/cabextract.c: add a new feature flag, LATIN1_FILENAMES, which should be defined if the host environment expects ISO-8859-1 filenames rather than UTF-8. This adds in a step to translate even UTF-8 filenames to ISO-8859-1. It's only enabled for the Amiga build so far. 2018-03-07 Stuart Caie * configure.ac, src/cabextract.c: add support for choosing the character encoding of non-UTF8 filenames, using the iconv library. This is based on a patch originally developed by Kevin Tardif. * src/cabextract.c: try setting various UTF8 locales for LC_CTYPE, in order to get tolower() / towlower() to lowercase non-ASCII characters. Again, thanks to Kevin Tardif for discussing this and supplying a proposed patch. 2016-04-16 Stuart Caie * configure.ac: change my email address to kyzer@cabextract.org.uk 2015-05-10 Stuart Caie * wince_rename, wince_info: allow the possibility that strings have more than one null byte. Thanks to Stefan Riegler for the suggestion. 2015-05-10 Stuart Caie * Makefile.am: Add subdir-objects option as suggested by autoreconf. * configure.ac: Add AM_PROG_AR as suggested by autoreconf. 2015-02-25 Stuart Caie * create_output_name(): Simplify code; do path checking only after output name has been constructed. Use towlower to lowercase UTF-8 characters. Remove both leading '/' and '\' from cab filenames and change both "../" and "..\" to "xx", for Cygwin and other Cygwin-like environments that use both '/' and '\' as path separators. Thanks to Alexander Cherepanov and the MITRE team. 2015-02-18 Stuart Caie * create_output_name(): the check against leading slashes could be evaded with malformed UTF-8. Thanks to Alexander Cherepanov for reporting the issue. 2015-01-18 Stuart Caie * wince_rename: installed files now include their install directories. Thanks to Alfonso Acosta for sending a patch. 2015-01-08 Stuart Caie * create_output_name: avoid invalid memory reads because of invalid UTF-8 encodings. Use the Unicode substitution character for most bad UTF-8 or Unicode encodings. Thanks to Hanno Böck. * src/cabinfo.c: stop trying to convert UTF-8 to ASCII in filename. Instead, prepend "UTF: " and print it to the terminal verbatim. 2011-07-19 Stuart Caie * doc/ja/cabextract.1: Katsumi Saito updated the Japanese translation of cabextract's manpage to include the -t option. Thanks again! 2011-05-11 Stuart Caie * src/cabinfo.c: changed the largefile detection header to the same as mspack/system.h 2011-04-27 Stuart Caie * src/cabextract.c: changed char* to const char* in line with changes in libmspack. See mspack/ChangeLog for more details. 2011-04-25 Stuart Caie * load_spanning_cabinets(): Print the error code caused by a failed cabinet merge, before ruining the error code by calling cabd->close(). Thanks to Drew D'Addesio for reporting the problem. 2011-01-19 Stuart Caie * doc/wince_cab_format.html: Identified a new file flag in the WinCE header file. Thanks to Paul Sokolovsky for asking me to look into it. 2010-07-19 Stuart Caie * mspack: MS-ZIP recovery now recovers more bytes. Also, when a file fails to unpack because of a read error during decompression, all subsequent files in the same folder will give the same error, instead of claiming to be OK. See mspack/ChangeLog for full details. 2010-07-17 Stuart Caie * src/cabsplit: added new program, cabsplit, which splits cabinet files into one cabinet file per folder. Useful for debugging. 2010-06-17 Stuart Caie * configure.ac: Added --external-libmspack option, which allows you to use the libmspack library installed on your system rather than the copy bundled with cabextract. Thanks to Patrice Dumas for the patch. 2010-06-10 Stuart Caie * mspack: bugs in MS-ZIP and Quantum decoders have been fixed. See mspack/ChangeLog for full details. 2010-05-06 Stuart Caie * configure.ac, cabextract.c: added support for the one-arg mkdir() found in the MinGW32 environment. Thanks to Kevin O'Rourke for reporting this. 2009-09-24 Stuart Caie * doc/wince_cab_format.html, src/wince_info, src/wince_rename: The files in Windows CE cabinets are numbered after the first ID in the FILES section, rather than what I termed the "real ID". Fixed the documentation and the wince tools to match. The purpose of the field previously called "real ID" is now unknown. Thanks to Marco Schindler for discovering this. 2007-08-07 Stuart Caie * all: cabextract and libmspack have moved to the domain www.cabextract.org.uk. Updated the documentation to reflect this. 2007-01-20 Stuart Caie * create_output_name(): add UTF-8 support for 6-byte characters. Apparently they go that far these days. 2007-01-20 Stuart Caie * doc/wince_cab_format.html, src/wince_info: The REGKEYS "unknown" flag appears to be a boolean indicating whether variable substitution should take place. Thanks to Dominique Gallot for discovering it. 2006-06-21 Stuart Caie * create_output_name(): add UTF-8 support for 4-byte characters. 2006-03-01 Stuart Caie * process_cabinets(): on the advice of Mike Mohr, cabextract no longer skips entire cabinets, when create_output_filename() returns NULL, it only skips the affected files now. 2005-10-30 Stuart Caie * src/cabextract.c: added test mode to cabextract, wherein files aren't extracted, only passed through an MD5 checksum generator. cabextract then lists which files passed and which files failed. * process_cabinets(): fixed the problem where filters don't match when -d option is also used. The filters match on the full output-file path, including the -d directory specified. We now trim this off before matching. 2005-10-29 Stuart Caie * fnmatch.c, getopt.c: finally resolved problems with all the GNU replacement functions. Obtained new versions of fnmatch and getopt, removing the need for alloca.c, coded out the requirement for mempcpy in getopt.c (I don't think it was needed anyway, but just to be sure I changed it to use just memcpy). Tested on Mac OS X (both native and using fink), Solaris 8 and Cygwin as well as Debian. * configure.ac: Removed the AC_FUNC_ALLOCA and AC_REPLACE_FUNCS([mempcpy]) 2005-07-05 Stuart Caie * src/cabinfo.c: This can now search and print accurate output for cabinets (and files containing cabinets) over 2GB. 2005-04-21 Stuart Caie * src/cabinfo.c: This now prints if the NAME_IS_UTF flag is set for each file. 2004-10-19 Stuart Caie * create_output_name(): fixed out-by-one error in UTF-8 decoder. All UTF-8 filenames would reach the "error in UTF-8 decode" section, because the test for that section was "pointer >= last_character", not "pointer > last_character". 2004-10-18 Stuart Caie * process_cabinet(): now accepts that failure of create_output_name() is an error, and also lets that function print an error message rather than printing one itself. * create_output_name(): improved the two error messages that could be printed. 2004-10-15 Stuart Caie * create_output_name(): removes leading "./" and "../" as well as leading slashes from the input filename. Thanks to David Banz for pointing this out, as well as http://www.securityfocus.com/bid/11376/ 2004-07-16 Stuart Caie * Makefile.am: added -DMSPACK_NO_DEFAULT_SYSTEM. Why wasn't this in earlier? * src/cabextract.c: added prototypes of the cabx_ functions, removed the prototype of cabextract_system and moved the real cabextract_system to before main(). This is so AIX doesn't fail on seeing an extern and a static definition of the same global. That's messed up! * alloca.c, fnmatch*, getopt*, mempcpy.c: imported these from gcc's latest libiberty. This should fix problems with Cygwin. 2004-03-18 Stuart Caie * process_cabinet(): added missing printf argument when errors on extracting to stdout occur. Thanks to Moritz Barsnick for finding it. 2004-03-08 Stuart Caie * all: tidy-ups for 1.0 release 2003-09-04 Stuart Caie * set_date_and_perm(): implemented the utimes() alternative to utime(). * set_date_and_perm(): sets the date before the permissions are set, in case read-only files really do get -r--r--r-- permissions and your dumb OS won't let the date can't be changed. 2003-08-14 Stuart Caie * wince_cab_format.html: Shaun Jackman worked out six more fields in the header. 2003-08-12 Stuart Caie * cabextract.c: rewrote all function documentation in javadoc / doxygen format. * configure.ac: added AC_FUNC_ALLOCA / @ALLOCA@ / alloca.c because I noticed that fnmatch.c uses alloca(). 2003-08-11 Stuart Caie * main(): Removed the redundant args.list with args.view. I was wondering why cabextract -l file.cab was trying to extract instead of list... 2003-08-06 Stuart Caie * configure.in, Makefile.am: rewrote the configure and build scripts, in the new style. fnmatch sources are now bundled, and now all the support code and tools are in the top directory, leaving src/ with nothing but cabextract code in it. 2003-08-05 Stuart Caie * wince_cab_format.html: converted the WinCE CAB format document from text to HTML. 2003-07-29 Stuart Caie * cabextract.c: now rewritten to use libmspack. * process_cabinet(): the cabinet listing now has space for 10 digits in the size field, for those really big compressed files. The maximum size of a file is 4294967295 bytes. 2003-07-18 Stuart Caie * cabextract.c: started refactoring cabextract to use the libmspack library. Moved everything out of cabextract.c and will start moving things back in as necessary. * doc, mspack: added a doc directory, where fun things like manual pages, magic files and file format documents go. Made a directory for libmspack files. 2003-06-07 Stuart Caie * mspack: started creation of the libmspack library, based on the cabextract code. See http://www.kyz.uklinux.net/libmspack/ for more details about the library. 2003-05-14 Stuart Caie * magic.cabinet: fixed errors in CAB magic definition * magic.wince: added magic file entry for WinCE install format * configure.in: added large file support 2003-04-21 Stuart Caie * ja/cabextract.1: Katsumi Saito kindly translated the updated manual page into Japanese for me. 2003-04-20 Stuart Caie * cabextract.1: finally decided on feature set for cabextract 0.7, so I updated the manual to reflect that. 2003-03-12 Stuart Caie * wince_cab_format.txt: reverse engineered most of the file format for Windows CE installation CAB header files. Windows CE uses normal cabinet files, but the files inside the cabinets use short filenames and a special binary header to specify full filenames, install directories, registry entries and symbolic links. If anyone wants to help fill in the remaining fields, I'm all ears. 2002-11-19 Stuart Caie * cabextract.c: moved the generation of the correct unix filename for an extracted file out of file_open() and into the main process_cabinet() function (it now has a helper function called create_output_name()). This is to make the real filename available outside of file_open(). (See below) * file_close(): chmod() and utime() are now called on the correct filename :) 2002-11-13 Stuart Caie * unix_directory_seperators(): this is a new function added to determine whether the CAB file is using "wrong" UNIX-style forward slashes as directory seperators. Microsoft CAB files use MS-DOS backslashes, however the tools Cablinux and PowerArchiver create CABs with forward-slashes. 2002-09-12 Stuart Caie * file_cabs_in_file(): if the file itself doesn't exist, we no longer print "Not a Microsoft cabinet file" for not finding any cabinets in that file. 2002-09-08 Stuart Caie * cabextract.c: cabextract used to segv if an LZX or Quantum folder came after an MSZIP folder, because the window pointer would be filled in by MSZIP's state. To solve this, I took the window pointers and associated variables out of the state union, and I also started clearing the state structure on startup. I also removed the 'what was the old compression type / free window' code and replaced it with a simple 'free LZX/QTM window if it exists' before ZIP initialisation. 2002-09-08 Stuart Caie * find_cabs_in_file(): if a file begins with "ISc(", cabextract now prints a message about how to unpack InstallShield '.cab' files, which begin with this signature. 2002-09-08 Stuart Caie * cabextract.c: After seeing what some people think the command line syntax is for cabextract is (e.g. http://slashdot.org/comments.pl?sid=39401&cid=4210033) I have decided to be nice to people who don't read manuals, and refuse to extract files given on the command line if they've already been extracted as part of another cabinet. This does preclude the scenario where a file is not only part of a multi-part set, but has a cabinet at offset 0 and _also_ has embedded cabs later on. The new functionality is implemented by the new functions remember_cabinet() and known_cabinet(), which use a simple linked list. If you want the old behaviour of cabextract back, do "find -exec cabextract {} \;". 2002-09-08 Stuart Caie * configure.in: Upgraded my autoconf to one that has the AC_EXEEXT bug fixed (look up AC_EXEEXT xSYM on the Internet :). Now it complains about me writing to LIBOBJS directly, so I use the macro AC_LIBOBJ twice to add getopt and getopt1 to LIBOBJS. 2002-08-20 Stuart Caie * AUTHORS, ChangeLog, NEWS, cabextract.c: fixed mis-spellings of Matthew Russotto's name. * ChangeLog: finished a half-completed changelog entry. 2002-08-12 Stuart Caie * cabextract.c: now prints all errors and warnings to stderr rather that stdout. I finally noticed that perror() prints to stderr, and I want to follow suit. 2002-08-11 Stuart Caie * extract_file(): now prints out the correct cabinet name in error messages, in the case of files which are split over multiple cabinet files and the 2nd or later split cabinet contains the error. * QTMdecompress(): fixed the QTM decoding error - basically, Matthew used the bitstream reading macros from my LZX decompressor. Sadly, these macros can only guarantee at maximum 17 bits available in the bit buffer, and Quantum uses up to 19 bits. I rewrote the Quantum bit buffer macros to be multi-pass (and therefore slower) so they can get the requisite number of bits. * QTMinit(): after fixing the decoding bug, I noticed that files always failed extraction when going to a second folder. It turns out that I forgot to reset QTM's window_posn. * configure.in: added limits.h to the list of checked includes * cabextract.c: ULONG_BITS now defined in terms of CHAR_BIT from rather than fixed to 8 bits per char. Oddly, my system seems to include rather than . So, for people like me, I also define CHAR_BIT to be 8 if it's not already defined. 2002-07-29 Stuart Caie * cabextract.c: The Ministry of Sensible Naming dictates that load_cab() be renamed find_cabs_in_file(), and lose the 'search' argument. Calls to load_cab() where the search argument = 0 (i.e., when loading spanning cabinets) be changed to load_cab_offset(x,0). 2002-07-25 Stuart Caie * load_cab(): Bah! off_t is defined as a signed long int, and not an unsigned long int as I had previously thought. This means the 'valid cabinet' comparisions may fail. I have fixed this by making these comparisons unsigned. * cabinfo.c: added the new search mechanism to cabinfo. 2002-07-25 Stuart Caie * process_cabinet(): rewrote the loading mechanism. Uses the new load_cab() to get a list of cabinets in the base file. Also does bi-directional loading of spanning cabinets. * load_cab(): now takes a 'search' parameter. if search=0, the old loading behaviour is performed, but if search=1, it now does the exhaustive search for all matching cabinets and tries to load them. If a load succeeds, it skips that section of the file. Therefore, all embedded cabinets are found, yet most of the file does not need to be searched. * cabinet_find_header(): removed, see above. Also, in shifting the search, I altered the search mechanism. It now uses a state machine to get around border cases, rather than the flaky 'save the last 20 bytes and put them at the start the next time around'. * cabinet_read_entries(): now checks the MSCF signature, as there is no longer a cabinet_find_header() to do this. 2002-07-23 Stuart Caie * LZXdecompress(), QTMdecompress(): On systems where the LZ window pointer is in "low memory", runsrc (window pointer - match offset) could be below address 0, which wraps around to the end of memory, so it appears runsrc is ahead of the LZ window, and so it does not need 'fixing' before the match copy. Therefore the match data is read from the incorrect, high address. Thanks to the NetBSD team for discovering this and providing the patch. 2002-07-22 Stuart Caie * file_close(): now honours your umask settings when extracting files. Thanks to the NetBSD team for the patch. * cabinet_seek(), cabinet_skip(): these now print errors if fseek() returns an error. * QTMdecompress(): finally! Added an implementation of the Quantum method which was researched and written by Matthew Russotto. Many thanks to him for all the hard work he did to produce this. I tidied up the code to be more my style (and to be quite a bit faster by inlining the bit buffer, H, L and C), but it's still all his code running. * find_next_cabinet_file(): this is a new function which finds the "next cabinet" by opening the directory it would be in and reading each filename case-insensitively. It also handles any such "next cabinets" with directory elements (delimited with MS-DOS backslashes). * process_cabinet(): now uses find_next_cabinet_file() to get the next cabinet file. This function also replaces the hack that gets any directory path which might be embedded in the base cabinet filename (as mentioned on the command line). 2002-07-21 Stuart Caie * file_close(): fixed off-by-one error in setting the extracted file date. Thanks to Claus Rasmussen. 2002-07-20 Stuart Caie * file_open(): now removes any leading slashes from the name of the file to be extracted. Thanks to the James Henstridge and David Leonard for patches. * ensure_filepath(): now does not try to examine the directory "" (i.e. no directory at all) if given an absolute path (one that start with a slash). Thanks to the James Henstridge for the patch. 2002-04-30 Stuart Caie * cabextract.spec.in: changed the fixed version number to @VERSION@ 2002-04-06 Stuart Caie * Makefile.am, configure.in: used the guide no_getopt_long.txt included with the gengetopt package to add getopt_long configuration to cabextract. Hopefully it all works now. Thanks to the many people who pointed out this problem and to the many people who offered solutions. 2001-09-06 Stuart Caie * Makefile.am, configure.in: made cabextract.spec one of the auto- generated files. Now I can do 'make distcheck' here to build a distribution which can be installed using 'rpm -tb cabextract-0.6.tar.gz'. Thanks to Daniel Resare for the know-how. 2001-08-20 Stuart Caie * Makefile.am: added an LDADD line for cabextract's LIBOBJS generated by configure. This means the AC_REPLACE_FUNCS line should actually have an effect. * configure.in: Removed getopt_long and mktime from the AC_CHECK_FUNCS, as this is done anyway. 2001-08-19 Stuart Caie * Makefile.am, configure.in, cabextract.c: moved the GNU getopt sources to become an automatically added dependency if getopt_long() can't be found in the standard library, just like mktime() is handled. The getopt_long(), struct option and optarg and optind definitions are taken from getopt.h if possible. If they're not there, but getopt_long() was found with standard includes files, it's assumed they're defined in the standard include files. Otherwise, we define them ourselves. * cabextract.c: now gets VERSION defined from configure via config.h. * decompress(): if the 'fix' option was used, the output buffer would always be cleared before block decompression. A nice idea, but the MSZIP method likes to keep the output buffer between blocks. Thanks to Fernando Trias for spotting this. Stopped clearing the output buffer. * main(): the 'fix' variable wasn't initialised to zero, so on some architectures, where the stack-space allocated to the variable isn't cleared to zero, you always got the 'fix' option selected. See above for why this was bad. * process_cabinet(): now prints "Finished processing cabinet" when finished extracting, instead of just a blank line. Still prints blank lines for listing files. 2001-08-05 Stuart Caie * Makefile.am: the manpage wasn't included in the distribution. Fixed and re-issued the 0.3 release. 2001-08-02 Stuart Caie * decompress(): now takes a 'fix' flag, which causes MSZIP errors to be ignored. * cabinet_get_entries(): now keeps the printable information about previous and next cabinet parts * process_cabinet(): now prints the printable information about the next cabinet part in a multi-part cabinet * file_open(): now prepends a given directory if wanted, and can make the filename lowercase if wanted. * main(): changed to using getopt_long to parse arguments. Added -L (lowercase), -d (output to directory), -f (fix corrupt cabs), -h (help), -q (quiet) and -v was recycled to become --version, when used on its own. * LZXdecompress(): major bug fixed; the updated R0, R1 and R2 in uncompressed blocks were being stored in the uncomp_state block, not local variables. At the end of the function, the local values are always written back to the uncomp_state block. So the values placed there by the uncompressed block header were always overwritten. Thanks to Pavel Turbin for providing an example of this. * rindex(): this is the BSD precursor of the ANSI standard function strrchr(). Oops! Now uses strrchr(), or rindex() if strrchr() isn't available. * cabinet_find_header(): now prints an error message if it can't find a header. 2001-04-30 Stuart Caie * fixed includes to include both and if they both exist, and made some signedness conversions explicit. This should let cabextract compile with SGI's native compiler. Thanks to Markus Nullmeier for the patch. 2001-03-04 Stuart Caie * main(): now prints the version of cabextract in the copyright line. * cabinet_find_header(): now searches any kind of file, not just files beginning with 'MZ' header. Also, always searches entire file. This slows the search down, but increases the usefulness of the search overall, IMHO. Thanks to Eric Sharkey for pointing this out. * LZXdecompress(): fixed problem in intel decoding: E8 must not appear in the last 10 bytes, not the last 6 bytes... Thanks to Jae Jung who pointed this out to me. I didn't believe him at first, but he was quite right. Also thanks to Antoine Amanieux for providing example files affected by this. * process_cabinet(): now extends multipart cabinet filenames to be in the same directory as the base cabinet. * cabinet_open(): now only lowercases the filename part of a cabinet name, not the path part. 2001-03-03 Stuart Caie * LZXdecompress(): fixed LZX bit buffer exhaustion in where READ_HUFFSYM() requests more bits than the buffer actually contains: top-of-loop overflow check now allows for the input pointer to be 16 bits past the end of the buffer, but checks to ensure none of those 16 bits are actually used. Also increased decomp_state.inbuf by two bytes and clear the two bytes after loaded block in decompress(). Thanks to Jae Jung for pointing out this bug, and for providing example files which exposed the bug. 2001-02-26 Stuart Caie * added configure script / makefile using automake. * file_close(): now sets the timestamp on extracted files. cabextract-1.9/INSTALL0000644000175000017500000003661413370076346011500 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. cabextract-1.9/config.h.in0000664000175000017500000001175213370076345012467 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if your system has a working POSIX `fnmatch' function. */ #undef HAVE_FNMATCH /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `mspack' library (-lmspack). */ #undef HAVE_LIBMSPACK /* Define to 1 if you have the `mbsrtowcs' function. */ #undef HAVE_MBSRTOWCS /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `towlower' function. */ #undef HAVE_TOWLOWER /* Define to 1 if you have the `umask' function. */ #undef HAVE_UMASK /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if you have the `wmempcpy' function. */ #undef HAVE_WMEMPCPY /* Define to 1 if you have the `_mkdir' function. */ #undef HAVE__MKDIR /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Define if mkdir takes only one argument. */ #undef MKDIR_TAKES_ONE_ARG /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_fnmatch if the replacement function should be used. */ #undef fnmatch /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to a type if does not define. */ #undef mbstate_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t