diff options
author | Christos Zoulas <christos@zoulas.com> | 2001-10-20 17:44:52 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2001-10-20 17:44:52 +0000 |
commit | fe352afcfae45f3d4eb3963ba559d9397e37ee48 (patch) | |
tree | 6921540304b71881305a318ba0b79f328af5c18a | |
parent | a37fbafcd289b3ed36a02931259e28bf8e064003 (diff) | |
download | file-git-fe352afcfae45f3d4eb3963ba559d9397e37ee48.tar.gz |
- fix compilation problem when QUICK is not defined.
- zlib support Nicolas Lichtmaier <nick@debian.org>
- largefile support Nicolas Lichtmaier <nick@debian.org>
- support seeking on pipes Nicolas Lichtmaier <nick@debian.org>
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | acinclude.m4 | 97 | ||||
-rw-r--r-- | aclocal.m4 | 97 | ||||
-rw-r--r-- | config.h.in | 21 | ||||
-rwxr-xr-x | configure | 533 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | magic/Magdir/amigaos | 29 | ||||
-rw-r--r-- | magic/Magdir/editors | 4 | ||||
-rw-r--r-- | magic/Magdir/hitachi-sh | 8 | ||||
-rw-r--r-- | magic/Magdir/mcrypt | 61 | ||||
-rw-r--r-- | src/acconfig.h | 3 | ||||
-rw-r--r-- | src/compress.c | 175 | ||||
-rw-r--r-- | src/file.c | 4 | ||||
-rw-r--r-- | src/file.h | 6 | ||||
-rw-r--r-- | src/readelf.c | 8 |
15 files changed, 895 insertions, 159 deletions
diff --git a/Makefile.in b/Makefile.in index b7395a58..3a266cdf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -122,7 +122,7 @@ missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(file_SOURCES) OBJECTS = $(file_OBJECTS) diff --git a/acinclude.m4 b/acinclude.m4 index 95990e52..0b1b0a53 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -122,3 +122,100 @@ AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS, #endif ]) ]) + + +#serial 19 + +dnl By default, many hosts won't let programs access large files; +dnl one must use special compiler options to get large-file access to work. +dnl For more details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +dnl Written by Paul Eggert <eggert@twinsun.com>. + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_TEST_INCLUDES +AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES, + [[#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + ]]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLU= +DES, FUNCTION-BODY) +AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, + [AC_CACHE_CHECK([for $1 value needed for large files], $3, + [$3=no + AC_TRY_COMPILE([$5], + [$6], + , + [AC_TRY_COMPILE([#define $1 $2] +[$5] + , + [$6], + [$3=$2])])]) + if test "[$]$3" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) + fi]) + +AC_DEFUN(AC_SYS_LARGEFILE, + [AC_REQUIRE([AC_PROG_CC]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + + AC_CACHE_CHECK([for special C compiler options needed for large files= +], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , + [ac_save_CC="$CC" + CC="$CC -n32" + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , + ac_cv_sys_largefile_CC=' -n32') + CC="$ac_save_CC"]) + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC="$CC$ac_cv_sys_largefile_CC" + fi + + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + fi + ]) + +AC_DEFUN(AC_FUNC_FSEEKO, + [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, + ac_cv_sys_largefile_source, + [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], + [#include <stdio.h>], [return !fseeko;]) + # 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. + + AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, + [ac_cv_func_fseeko=no + AC_TRY_LINK([#include <stdio.h>], + [return fseeko && fseeko (stdin, 0, 0);], + [ac_cv_func_fseeko=yes])]) + if test $ac_cv_func_fseeko != no; then + AC_DEFINE(HAVE_FSEEKO, 1, + [Define if fseeko (and presumably ftello) exists and is declared.]) + fi]) + @@ -135,6 +135,103 @@ AC_DEFUN(AC_CHECK_SIZEOF_STDC_HEADERS, ]) ]) + +#serial 19 + +dnl By default, many hosts won't let programs access large files; +dnl one must use special compiler options to get large-file access to work. +dnl For more details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +dnl Written by Paul Eggert <eggert@twinsun.com>. + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_TEST_INCLUDES +AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES, + [[#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + ]]) + +dnl Internal subroutine of AC_SYS_LARGEFILE. +dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLU= +DES, FUNCTION-BODY) +AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, + [AC_CACHE_CHECK([for $1 value needed for large files], $3, + [$3=no + AC_TRY_COMPILE([$5], + [$6], + , + [AC_TRY_COMPILE([#define $1 $2] +[$5] + , + [$6], + [$3=$2])])]) + if test "[$]$3" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) + fi]) + +AC_DEFUN(AC_SYS_LARGEFILE, + [AC_REQUIRE([AC_PROG_CC]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + + AC_CACHE_CHECK([for special C compiler options needed for large files= +], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , + [ac_save_CC="$CC" + CC="$CC -n32" + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , + ac_cv_sys_largefile_CC=' -n32') + CC="$ac_save_CC"]) + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC="$CC$ac_cv_sys_largefile_CC" + fi + + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + fi + ]) + +AC_DEFUN(AC_FUNC_FSEEKO, + [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, + ac_cv_sys_largefile_source, + [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], + [#include <stdio.h>], [return !fseeko;]) + # 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. + + AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, + [ac_cv_func_fseeko=no + AC_TRY_LINK([#include <stdio.h>], + [return fseeko && fseeko (stdin, 0, 0);], + [ac_cv_func_fseeko=yes])]) + if test $ac_cv_func_fseeko != no; then + AC_DEFINE(HAVE_FSEEKO, 1, + [Define if fseeko (and presumably ftello) exists and is declared.]) + fi]) + + # Do all the work for Automake. 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. diff --git a/config.h.in b/config.h.in index a1b6f374..8765ba6f 100644 --- a/config.h.in +++ b/config.h.in @@ -74,6 +74,9 @@ /* The number of bytes in a uint64_t. */ #define SIZEOF_UINT64_T 0 +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + /* Define if you have the mmap function. */ #undef HAVE_MMAP @@ -83,18 +86,36 @@ /* Define if you have the strtoul function. */ #undef HAVE_STRTOUL +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + /* Define if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H /* Define if you have the <sys/mman.h> header file. */ #undef HAVE_SYS_MMAN_H +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + /* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define if you have the z library (-lz). */ +#undef HAVE_LIBZ + /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + @@ -17,6 +17,8 @@ ac_help="$ac_help --disable-elf-core disable ELF core file support" ac_help="$ac_help --enable-fsect-man5 enable file formats in man section 5" +ac_help="$ac_help + --disable-largefile omit support for large files" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -558,7 +560,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:562: checking for a BSD compatible install" >&5 +echo "configure:564: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -611,7 +613,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:615: checking whether build environment is sane" >&5 +echo "configure:617: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -668,7 +670,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:674: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -714,7 +716,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:718: checking for working aclocal" >&5 +echo "configure:720: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -727,7 +729,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:731: checking for working autoconf" >&5 +echo "configure:733: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -740,7 +742,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:744: checking for working automake" >&5 +echo "configure:746: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -753,7 +755,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:757: checking for working autoheader" >&5 +echo "configure:759: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -766,7 +768,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:770: checking for working makeinfo" >&5 +echo "configure:772: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -784,7 +786,7 @@ fi echo $ac_n "checking for builtin ELF support""... $ac_c" 1>&6 -echo "configure:788: checking for builtin ELF support" >&5 +echo "configure:790: checking for builtin ELF support" >&5 # Check whether --enable-elf or --disable-elf was given. if test "${enable_elf+set}" = set; then enableval="$enable_elf" @@ -810,7 +812,7 @@ fi echo $ac_n "checking for ELF core file support""... $ac_c" 1>&6 -echo "configure:814: checking for ELF core file support" >&5 +echo "configure:816: checking for ELF core file support" >&5 # Check whether --enable-elf-core or --disable-elf-core was given. if test "${enable_elf_core+set}" = set; then enableval="$enable_elf_core" @@ -836,7 +838,7 @@ fi echo $ac_n "checking for file formats in man section 5""... $ac_c" 1>&6 -echo "configure:840: checking for file formats in man section 5" >&5 +echo "configure:842: checking for file formats in man section 5" >&5 # Check whether --enable-fsect-man5 or --disable-fsect-man5 was given. if test "${enable_fsect_man5+set}" = set; then enableval="$enable_fsect_man5" @@ -869,7 +871,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:873: checking for $ac_word" >&5 +echo "configure:875: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -899,7 +901,7 @@ 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 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:903: checking for $ac_word" >&5 +echo "configure:905: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -950,7 +952,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:954: checking for $ac_word" >&5 +echo "configure:956: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -982,7 +984,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:986: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:988: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -993,12 +995,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 997 "configure" +#line 999 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1024,12 +1026,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1028: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1030: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1033: checking whether we are using GNU C" >&5 +echo "configure:1035: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1038,7 +1040,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1057,7 +1059,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1063: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1100,7 +1102,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1104: checking for a BSD compatible install" >&5 +echo "configure:1106: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1153,7 +1155,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1157: checking whether ln -s works" >&5 +echo "configure:1159: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1175,7 +1177,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1179: checking how to run the C preprocessor" >&5 +echo "configure:1181: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1190,13 +1192,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1194 "configure" +#line 1196 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1207,13 +1209,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1211 "configure" +#line 1213 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1224,13 +1226,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1228 "configure" +#line 1230 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1255,12 +1257,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1259: checking for ANSI C header files" >&5 +echo "configure:1261: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1264 "configure" +#line 1266 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1268,7 +1270,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1285,7 +1287,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1289 "configure" +#line 1291 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1303,7 +1305,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1307 "configure" +#line 1309 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1324,7 +1326,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1328 "configure" +#line 1330 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1335,7 +1337,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1359,19 +1361,19 @@ EOF fi echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6 -echo "configure:1363: checking whether sys/types.h defines makedev" >&5 +echo "configure:1365: checking whether sys/types.h defines makedev" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1368 "configure" +#line 1370 "configure" #include "confdefs.h" #include <sys/types.h> int main() { return makedev(0, 0); ; return 0; } EOF -if { (eval echo configure:1375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_sys_types_h_makedev=yes else @@ -1389,17 +1391,17 @@ echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6 if test $ac_cv_header_sys_types_h_makedev = no; then ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6 -echo "configure:1393: checking for sys/mkdev.h" >&5 +echo "configure:1395: checking for sys/mkdev.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1398 "configure" +#line 1400 "configure" #include "confdefs.h" #include <sys/mkdev.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1427,17 +1429,17 @@ fi if test $ac_cv_header_sys_mkdev_h = no; then ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6 -echo "configure:1431: checking for sys/sysmacros.h" >&5 +echo "configure:1433: checking for sys/sysmacros.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1436 "configure" +#line 1438 "configure" #include "confdefs.h" #include <sys/sysmacros.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1465,12 +1467,12 @@ fi fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1469: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:1471: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1474 "configure" +#line 1476 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -1486,7 +1488,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1506,21 +1508,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in fcntl.h locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1514: checking for $ac_hdr" >&5 +echo "configure:1516: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1519 "configure" +#line 1521 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1546,21 +1548,61 @@ else fi done -for ac_hdr in locale.h +for ac_hdr in sys/mman.h sys/stat.h sys/types.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1556: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1561 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1554: checking for $ac_hdr" >&5 +echo "configure:1596: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1559 "configure" +#line 1601 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1586,21 +1628,21 @@ else fi done -for ac_hdr in sys/mman.h +for ac_hdr in locale.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1594: checking for $ac_hdr" >&5 +echo "configure:1636: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1599 "configure" +#line 1641 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1628,12 +1670,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1632: checking for working const" >&5 +echo "configure:1674: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1637 "configure" +#line 1679 "configure" #include "confdefs.h" int main() { @@ -1682,7 +1724,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1703,12 +1745,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1707: checking for off_t" >&5 +echo "configure:1749: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1712 "configure" +#line 1754 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1736,12 +1778,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1740: checking for size_t" >&5 +echo "configure:1782: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1745 "configure" +#line 1787 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -1769,12 +1811,12 @@ EOF fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:1773: checking for st_rdev in struct stat" >&5 +echo "configure:1815: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1778 "configure" +#line 1820 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -1782,7 +1824,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -1803,12 +1845,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1807: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:1849: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1812 "configure" +#line 1854 "configure" #include "confdefs.h" #include <sys/types.h> #include <time.h> @@ -1816,7 +1858,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1837,12 +1879,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:1841: checking for tm_zone in struct tm" >&5 +echo "configure:1883: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1846 "configure" +#line 1888 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -1850,7 +1892,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:1854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -1870,12 +1912,12 @@ EOF fi echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:1874: checking for tzname" >&5 +echo "configure:1916: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1879 "configure" +#line 1921 "configure" #include "confdefs.h" #include <time.h> #ifndef tzname /* For SGI. */ @@ -1885,7 +1927,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -1906,12 +1948,12 @@ EOF fi echo $ac_n "checking for tm_isdst in struct tm""... $ac_c" 1>&6 -echo "configure:1910: checking for tm_isdst in struct tm" >&5 +echo "configure:1952: checking for tm_isdst in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_isdst'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1915 "configure" +#line 1957 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_cv_struct_tm> @@ -1919,7 +1961,7 @@ int main() { struct tm tm; tm.tm_isdst; ; return 0; } EOF -if { (eval echo configure:1923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_isdst=yes else @@ -1939,12 +1981,12 @@ EOF fi echo $ac_n "checking for daylight""... $ac_c" 1>&6 -echo "configure:1943: checking for daylight" >&5 +echo "configure:1985: checking for daylight" >&5 if eval "test \"`echo '$''{'ac_cv_var_daylight'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1948 "configure" +#line 1990 "configure" #include "confdefs.h" #include <time.h> #ifndef daylight /* In case IRIX #defines this, too */ @@ -1954,7 +1996,7 @@ int main() { atoi(daylight); ; return 0; } EOF -if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_daylight=yes else @@ -1975,13 +2017,230 @@ EOF fi + # Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" + : +fi + + if test "$enable_largefile" != no; then + + echo $ac_n "checking for special C compiler options needed for large files= +""... $ac_c" 1>&6 +echo "configure:2031: checking for special C compiler options needed for large files= +" >&5 +if eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat > conftest.$ac_ext <<EOF +#line 2041 "configure" +#include "confdefs.h" +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_save_CC="$CC" + CC="$CC -n32" + cat > conftest.$ac_ext <<EOF +#line 2066 "configure" +#include "confdefs.h" +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_largefile_CC=' -n32' +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + CC="$ac_save_CC" +fi +rm -f conftest* + fi +fi + +echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6 + if test "$ac_cv_sys_largefile_CC" != no; then + CC="$CC$ac_cv_sys_largefile_CC" + fi + + echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6 +echo "configure:2102: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_sys_file_offset_bits=no + cat > conftest.$ac_ext <<EOF +#line 2108 "configure" +#include "confdefs.h" +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext <<EOF +#line 2131 "configure" +#include "confdefs.h" +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_file_offset_bits=64 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6 + if test "$ac_cv_sys_file_offset_bits" != no; then + cat >> confdefs.h <<EOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +EOF + + fi + echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6 +echo "configure:2169: checking for _LARGE_FILES value needed for large files" >&5 +if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_sys_large_files=no + cat > conftest.$ac_ext <<EOF +#line 2175 "configure" +#include "confdefs.h" +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext <<EOF +#line 2198 "configure" +#include "confdefs.h" +#define _LARGE_FILES 1 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_large_files=1 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_sys_large_files" 1>&6 + if test "$ac_cv_sys_large_files" != no; then + cat >> confdefs.h <<EOF +#define _LARGE_FILES $ac_cv_sys_large_files +EOF + + fi + fi + + echo $ac_n "checking for uint8_t""... $ac_c" 1>&6 -echo "configure:1980: checking for uint8_t" >&5 +echo "configure:2239: checking for uint8_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1985 "configure" +#line 2244 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2009,12 +2268,12 @@ EOF fi echo $ac_n "checking for uint16_t""... $ac_c" 1>&6 -echo "configure:2013: checking for uint16_t" >&5 +echo "configure:2272: checking for uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2018 "configure" +#line 2277 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2042,12 +2301,12 @@ EOF fi echo $ac_n "checking for uint32_t""... $ac_c" 1>&6 -echo "configure:2046: checking for uint32_t" >&5 +echo "configure:2305: checking for uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2051 "configure" +#line 2310 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2076,7 +2335,7 @@ fi echo $ac_n "checking for long long""... $ac_c" 1>&6 -echo "configure:2080: checking for long long" >&5 +echo "configure:2339: checking for long long" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2087,13 +2346,13 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2091 "configure" +#line 2350 "configure" #include "confdefs.h" int main() { long long foo = 0; exit(sizeof(long long) < sizeof(long)); } EOF -if { (eval echo configure:2097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_long_long=yes else @@ -2122,12 +2381,12 @@ else long64='unsigned long'; fi echo $ac_n "checking for uint64_t""... $ac_c" 1>&6 -echo "configure:2126: checking for uint64_t" >&5 +echo "configure:2385: checking for uint64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_uint64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2131 "configure" +#line 2390 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2158,7 +2417,7 @@ fi echo $ac_n "checking size of uint8_t""... $ac_c" 1>&6 -echo "configure:2162: checking size of uint8_t" >&5 +echo "configure:2421: checking size of uint8_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint8_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2166,7 +2425,7 @@ else ac_cv_sizeof_uint8_t=0 else cat > conftest.$ac_ext <<EOF -#line 2170 "configure" +#line 2429 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef STDC_HEADERS @@ -2182,7 +2441,7 @@ main() exit(0); } EOF -if { (eval echo configure:2186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint8_t=`cat conftestval` else @@ -2203,7 +2462,7 @@ EOF echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6 -echo "configure:2207: checking size of uint16_t" >&5 +echo "configure:2466: checking size of uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2211,7 +2470,7 @@ else ac_cv_sizeof_uint16_t=0 else cat > conftest.$ac_ext <<EOF -#line 2215 "configure" +#line 2474 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef STDC_HEADERS @@ -2227,7 +2486,7 @@ main() exit(0); } EOF -if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint16_t=`cat conftestval` else @@ -2248,7 +2507,7 @@ EOF echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6 -echo "configure:2252: checking size of uint32_t" >&5 +echo "configure:2511: checking size of uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2256,7 +2515,7 @@ else ac_cv_sizeof_uint32_t=0 else cat > conftest.$ac_ext <<EOF -#line 2260 "configure" +#line 2519 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef STDC_HEADERS @@ -2272,7 +2531,7 @@ main() exit(0); } EOF -if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint32_t=`cat conftestval` else @@ -2293,7 +2552,7 @@ EOF echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6 -echo "configure:2297: checking size of uint64_t" >&5 +echo "configure:2556: checking size of uint64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2301,7 +2560,7 @@ else ac_cv_sizeof_uint64_t=0 else cat > conftest.$ac_ext <<EOF -#line 2305 "configure" +#line 2564 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef STDC_HEADERS @@ -2317,7 +2576,7 @@ main() exit(0); } EOF -if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint64_t=`cat conftestval` else @@ -2338,15 +2597,15 @@ EOF -for ac_func in mmap strerror strtoul +for ac_func in mmap strerror strtoul mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2345: checking for $ac_func" >&5 +echo "configure:2604: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2350 "configure" +#line 2609 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2369,7 +2628,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2394,6 +2653,54 @@ fi done +echo $ac_n "checking for gzopen in -lz""... $ac_c" 1>&6 +echo "configure:2658: checking for gzopen in -lz" >&5 +ac_lib_var=`echo z'_'gzopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lz $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2666 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gzopen(); + +int main() { +gzopen() +; return 0; } +EOF +if { (eval echo configure:2677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF + + LIBS="-lz $LIBS" + +else + echo "$ac_t""no" 1>&6 +fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure diff --git a/configure.in b/configure.in index e88aebe9..31f4018b 100644 --- a/configure.in +++ b/configure.in @@ -68,6 +68,7 @@ AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_STRUCT_ST_RDEV AC_STRUCT_TIMEZONE_DAYLIGHT +AC_SYS_LARGEFILE dnl FIXME: only found in standard headers! AC_CHECK_TYPE(uint8_t, unsigned char) @@ -89,6 +90,9 @@ AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0) AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0) dnl Checks for functions -AC_CHECK_FUNCS(mmap strerror strtoul) +AC_CHECK_FUNCS(mmap strerror strtoul mkstemp) + +dnl Checks for libraries +AC_CHECK_LIB(z,gzopen) AC_OUTPUT(Makefile) diff --git a/magic/Magdir/amigaos b/magic/Magdir/amigaos index a4c3e829..a1be6138 100644 --- a/magic/Magdir/amigaos +++ b/magic/Magdir/amigaos @@ -8,3 +8,32 @@ # 0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary 0 belong 0x000003e7 AmigaOS object/library data +# +0 beshort 0xe310 Amiga Workbench +>2 beshort 1 +>>48 byte 1 disk icon +>>48 byte 2 drawer icon +>>48 byte 3 tool icon +>>48 byte 4 project icon +>>48 byte 5 garbage icon +>>48 byte 6 device icon +>>48 byte 7 kickstart icon +>>48 byte 8 workbench application icon +>2 beshort >1 icon, vers. %d +# +# various sound formats from the Amiga +# G=F6tz Waschk <waschk@informatik.uni-rostock.de> +# +0 string FC14 Future Composer 1.4 Module sound file +0 string SMOD Future Composer 1.3 Module sound file +0 string AON4artofnoise Art Of Noise Module sound file +1 string MUGICIAN/SOFTEYES Mugician Module sound file +58 string SIDMON\ II\ -\ THE Sidmon 2.0 Module sound file +0 string Synth4.0 Synthesis Module sound file +0 string ARP. The Holy Noise Module sound file +0 string BeEp\0 JamCracker Module sound file +0 string COSO\0 Hippel-COSO Module sound file +26 string V.3 Brian Postma's Soundmon Module sound file v3 +26 string BPSM Brian Postma's Soundmon Module sound file v3 +26 string V.2 Brian Postma's Soundmon Module sound file v2 + diff --git a/magic/Magdir/editors b/magic/Magdir/editors index c529d0df..7edbe8bc 100644 --- a/magic/Magdir/editors +++ b/magic/Magdir/editors @@ -7,3 +7,7 @@ >4 string 1 CP 852 >4 string 2 KOI8-CS >4 string >2 unknown encoding + +# Vi IMproved Encrypted file +# by David Necas <yeti@physics.muni.cz> +0 string VimCrypt~ Vim encrypted file data diff --git a/magic/Magdir/hitachi-sh b/magic/Magdir/hitachi-sh index 136c0383..a096eebf 100644 --- a/magic/Magdir/hitachi-sh +++ b/magic/Magdir/hitachi-sh @@ -7,12 +7,12 @@ 0 beshort 0x0500 Hitachi SH big-endian COFF >18 beshort&0x0002 =0x0000 object >18 beshort&0x0002 =0x0002 executable ->18 beshort&0x0008 =0x0000 \b, stripped ->18 beshort&0x0008 =0x0008 \b, not stripped +>18 beshort&0x0008 =0x0008 \b, stripped +>18 beshort&0x0008 =0x0000 \b, not stripped # 0 leshort 0x0550 Hitachi SH little-endian COFF >18 leshort&0x0002 =0x0000 object >18 leshort&0x0002 =0x0002 executable ->18 leshort&0x0008 =0x0000 \b, stripped ->18 leshort&0x0008 =0x0008 \b, not stripped +>18 leshort&0x0008 =0x0008 \b, stripped +>18 leshort&0x0008 =0x0000 \b, not stripped diff --git a/magic/Magdir/mcrypt b/magic/Magdir/mcrypt index 6416104d..e862f59d 100644 --- a/magic/Magdir/mcrypt +++ b/magic/Magdir/mcrypt @@ -1,31 +1,36 @@ #------------------------------------------------------------------------------ # Mavroyanopoulos Nikos <nmav@hellug.gr> # mcrypt: file(1) magic for mcrypt 2.2.x; -0 string \0m\2 mcrypt 2.2 encrypted data, ->3 byte 0 algorithm: blowfish-448, ->3 byte 1 algorithm: DES, ->3 byte 2 algorithm: 3DES, ->3 byte 3 algorithm: 3-WAY, ->3 byte 4 algorithm: GOST, ->3 byte 6 algorithm: SAFER-SK64, ->3 byte 7 algorithm: SAFER-SK128, ->3 byte 8 algorithm: CAST-128, ->3 byte 9 algorithm: xTEA, ->3 byte 10 algorithm: TWOFISH-128, ->3 byte 11 algorithm: RC2, ->3 byte 12 algorithm: TWOFISH-192, ->3 byte 13 algorithm: TWOFISH-256, ->3 byte 14 algorithm: blowfish-128, ->3 byte 15 algorithm: blowfish-192, ->3 byte 16 algorithm: blowfish-256, ->3 byte 100 algorithm: RC6, ->3 byte 101 algorithm: IDEA, ->4 byte 0 mode: CBC, ->4 byte 1 mode: ECB, ->4 byte 2 mode: CFB, ->4 byte 3 mode: OFB, ->4 byte 4 mode: nOFB, ->5 byte 0 keymode: 8bit ->5 byte 1 keymode: 4bit ->5 byte 2 keymode: SHA-1 hash ->5 byte 3 keymode: MD5 hash +0 string \0m\3 mcrypt 2.5 encrypted data, +>4 string >\0 algorithm: %s, +>>&1 leshort >0 keysize: %d bytes, +>>>&0 string >\0 mode: %s, + +0 string \0m\2 mcrypt 2.2 encrypted data, +>3 byte 0 algorithm: blowfish-448, +>3 byte 1 algorithm: DES, +>3 byte 2 algorithm: 3DES, +>3 byte 3 algorithm: 3-WAY, +>3 byte 4 algorithm: GOST, +>3 byte 6 algorithm: SAFER-SK64, +>3 byte 7 algorithm: SAFER-SK128, +>3 byte 8 algorithm: CAST-128, +>3 byte 9 algorithm: xTEA, +>3 byte 10 algorithm: TWOFISH-128, +>3 byte 11 algorithm: RC2, +>3 byte 12 algorithm: TWOFISH-192, +>3 byte 13 algorithm: TWOFISH-256, +>3 byte 14 algorithm: blowfish-128, +>3 byte 15 algorithm: blowfish-192, +>3 byte 16 algorithm: blowfish-256, +>3 byte 100 algorithm: RC6, +>3 byte 101 algorithm: IDEA, +>4 byte 0 mode: CBC, +>4 byte 1 mode: ECB, +>4 byte 2 mode: CFB, +>4 byte 3 mode: OFB, +>4 byte 4 mode: nOFB, +>5 byte 0 keymode: 8bit +>5 byte 1 keymode: 4bit +>5 byte 2 keymode: SHA-1 hash +>5 byte 3 keymode: MD5 hash diff --git a/src/acconfig.h b/src/acconfig.h index b2d201df..3423ecab 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -19,6 +19,9 @@ /* Define if we have a global "int" variable "daylight". */ #undef HAVE_DAYLIGHT +/* Define if we have a mkstemp */ +#undef HAVE_MKSTEMP + /* Define to `unsigned char' if standard headers don't define. */ #undef uint8_t diff --git a/src/compress.c b/src/compress.c index 80d24e01..19f6e2b7 100644 --- a/src/compress.c +++ b/src/compress.c @@ -12,11 +12,17 @@ #include <unistd.h> #endif #include <string.h> +#include <errno.h> +#include <sys/types.h> #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> #endif +#ifdef HAVE_LIBZ +#include <zlib.h> +#endif + #ifndef lint -FILE_RCSID("@(#)$Id: compress.c,v 1.20 2001/07/22 21:04:15 christos Exp $") +FILE_RCSID("@(#)$Id: compress.c,v 1.21 2001/10/20 17:44:52 christos Exp $") #endif @@ -41,9 +47,14 @@ static struct { static int ncompr = sizeof(compr) / sizeof(compr[0]); -static int uncompress __P((int, const unsigned char *, unsigned char **, int)); -static int swrite __P((int, const void *, size_t)); -static int sread __P((int, void *, size_t)); +static int swrite __P((int, const void *, size_t)); +static int sread __P((int, void *, size_t)); +static int uncompressbuf __P((int, const unsigned char *, unsigned char **, + int)); +#ifdef HAVE_LIBZ +static int uncompressgzipped __P((const unsigned char *, unsigned char **, + int)); +#endif int zmagic(buf, nbytes) @@ -58,7 +69,7 @@ zmagic(buf, nbytes) if (nbytes < compr[i].maglen) continue; if (memcmp(buf, compr[i].magic, compr[i].maglen) == 0 && - (newsize = uncompress(i, buf, &newbuf, nbytes)) != 0) { + (newsize = uncompressbuf(i, buf, &newbuf, nbytes)) != 0) { tryit(newbuf, newsize, 1); free(newbuf); printf(" ("); @@ -120,6 +131,8 @@ sread(fd, buf, n) if (errno == EINTR) continue; return -1; + case 0: + return rn - n; default: n -= rv; buf = ((char *)buf) + rv; @@ -129,8 +142,144 @@ sread(fd, buf, n) return rn; } +int +pipe2file(fd, startbuf, nbytes) + int fd; + void *startbuf; + size_t nbytes; +{ + char buf[4096]; + int r, tfd; + + (void)strcpy(buf, "/tmp/file.XXXXXX"); +#ifndef HAVE_MKSTEMP + { + char *ptr = mktemp(buf); + tfd = open(ptr, O_RDWR|O_TRUNC|O_EXCL|O_CREAT, 0600); + r = errno; + (void)unlink(ptr); + errno = r; + } +#else + tfd = mkstemp(buf); + r = errno; + (void)unlink(buf); + errno = r; +#endif + if (tfd == -1) { + error("Can't create temporary file for pipe copy (%s)\n", + strerror(errno)); + /*NOTREACHED*/ + } + + if (swrite(tfd, startbuf, nbytes) != nbytes) + r = 1; + else { + while ((r = sread(fd, buf, sizeof(buf))) > 0) + if (swrite(tfd, buf, r) != r) + break; + } + + switch (r) { + case -1: + error("Error copying from pipe to temp file (%s)\n", + strerror(errno)); + /*NOTREACHED*/ + case 0: + break; + default: + error("Error while writing to temp file (%s)\n", + strerror(errno)); + /*NOTREACHED*/ + } + + /* + * We duplicate the file descriptor, because fclose on a + * tmpfile will delete the file, but any open descriptors + * can still access the phantom inode. + */ + if ((fd = dup2(tfd, fd)) == -1) { + error("Couldn't dup destcriptor for temp file(%s)\n", + strerror(errno)); + /*NOTREACHED*/ + } + (void)close(tfd); + if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) { + error("Couldn't seek on temp file (%s)\n", strerror(errno)); + /*NOTREACHED*/ + } + return fd; +} + +#ifdef HAVE_LIBZ + +#define FHCRC (1 << 1) +#define FEXTRA (1 << 2) +#define FNAME (1 << 3) +#define FCOMMENT (1 << 4) + static int -uncompress(method, old, newch, n) +uncompressgzipped(old, newch, n) + const unsigned char *old; + unsigned char **newch; + int n; +{ + unsigned char flg = old[3]; + int data_start = 10; + z_stream z; + int rc; + + if (flg & FEXTRA) + data_start += 2 + old[data_start] + old[data_start + 1] * 256; + if (flg & FNAME) { + while(old[data_start]) + data_start++; + data_start++; + } + if(flg & FCOMMENT) { + while(old[data_start]) + data_start++; + data_start++; + } + if(flg & FHCRC) + data_start += 2; + + if ((*newch = (unsigned char *)malloc(HOWMANY + 1)) == NULL) { + return 0; + } + + z.next_in = (Bytef *)(old + data_start); + z.avail_in = n - data_start; + z.next_out = *newch; + z.avail_out = HOWMANY; + z.zalloc = Z_NULL; + z.zfree = Z_NULL; + z.opaque = Z_NULL; + + rc = inflateInit2(&z, -15); + if (rc != Z_OK) { + (void) fprintf(stderr,"%s: zlib: %s\n", progname, z.msg); + return 0; + } + + rc = inflate(&z, Z_SYNC_FLUSH); + if (rc != Z_OK && rc != Z_STREAM_END) { + fprintf(stderr,"%s: zlib: %s\n", progname, z.msg); + return 0; + } + + n = z.total_out; + inflateEnd(&z); + + /* let's keep the nul-terminate tradition */ + (*newch)[n++] = '\0'; + + return n; +} +#endif + +static int +uncompressbuf(method, old, newch, n) int method; const unsigned char *old; unsigned char **newch; @@ -138,6 +287,14 @@ uncompress(method, old, newch, n) { int fdin[2], fdout[2]; + /* The buffer is NUL terminated, and we don't need that. */ + n--; + +#ifdef HAVE_LIBZ + if (method == 2) + return uncompressgzipped(old,newch,n); +#endif + if (pipe(fdin) == -1 || pipe(fdout) == -1) { error("cannot create pipe (%s).\n", strerror(errno)); /*NOTREACHED*/ @@ -173,15 +330,17 @@ uncompress(method, old, newch, n) } (void) close(fdin[1]); fdin[1] = -1; - if ((*newch = (unsigned char *) malloc(n)) == NULL) { + if ((*newch = (unsigned char *) malloc(HOWMANY + 1)) == NULL) { n = 0; goto err; } - if ((n = sread(fdout[0], *newch, n)) <= 0) { + if ((n = sread(fdout[0], *newch, HOWMANY)) <= 0) { free(*newch); n = 0; goto err; } + /* NUL terminate, as every buffer is handled here. */ + (*newch)[n++] = '\0'; err: if (fdin[1] != -1) (void) close(fdin[1]); @@ -56,7 +56,7 @@ #include "patchlevel.h" #ifndef lint -FILE_RCSID("@(#)$Id: file.c,v 1.59 2001/07/23 00:02:32 christos Exp $") +FILE_RCSID("@(#)$Id: file.c,v 1.60 2001/10/20 17:44:53 christos Exp $") #endif /* lint */ @@ -142,7 +142,7 @@ main(argc, argv) } } - while ((c = getopt(argc, argv, "bcdf:ikm:nsvzCL")) != EOF) + while ((c = getopt(argc, argv, "bcdf:ikm:nsvzCL")) != -1) switch (c) { case 'b': ++bflag; @@ -1,6 +1,6 @@ /* * file.h - definitions for file(1) program - * @(#)$Id: file.h,v 1.37 2001/07/22 21:04:15 christos Exp $ + * @(#)$Id: file.h,v 1.38 2001/10/20 17:44:53 christos Exp $ * * Copyright (c) Ian F. Darwin, 1987. * Written by Ian F. Darwin. @@ -151,6 +151,8 @@ extern int zmagic __P((unsigned char *, int)); extern void ckfprintf __P((FILE *, const char *, ...)); extern uint32 signextend __P((struct magic *, unsigned int32)); extern void tryelf __P((int, unsigned char *, int)); +extern int pipe2file __P((int, void *, size_t)); + extern char *progname; /* the program name */ extern const char *magicfile; /* name of the magic file */ @@ -164,8 +166,10 @@ extern int lflag; /* follow symbolic links? */ extern int sflag; /* read/analyze block special files? */ extern int iflag; /* Output types as mime-types */ +#ifdef NEED_GETOPT extern int optind; /* From getopt(3) */ extern char *optarg; +#endif #ifndef HAVE_STRERROR extern int sys_nerr; diff --git a/src/readelf.c b/src/readelf.c index 3c5c4143..ccce5992 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -14,7 +14,7 @@ #include "readelf.h" #ifndef lint -FILE_RCSID("@(#)$Id: readelf.c,v 1.17 2000/08/05 19:00:12 christos Exp $") +FILE_RCSID("@(#)$Id: readelf.c,v 1.18 2001/10/20 17:44:53 christos Exp $") #endif #ifdef ELFCORE @@ -412,6 +412,12 @@ tryelf(fd, buf, nbytes) int swap; /* + * If we can't seek, it must be a pipe, socket or fifo. + */ + if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE)) + fd = pipe2file(fd, buf, nbytes); + + /* * ELF executables have multiple section headers in arbitrary * file locations and thus file(1) cannot determine it from easily. * Instead we traverse thru all section headers until a symbol table |