Browse Source

Import upstream version 5.21+15

Christoph Biedl 4 years ago
parent
commit
b2b0d4c4e6
100 changed files with 59181 additions and 857 deletions
  1. 24 0
      .cvsignore
  2. 13 0
      .travis.yml
  3. 1 1
      COPYING
  4. 70 0
      ChangeLog
  5. 1 1
      MAINT
  6. 5 4
      Makefile.in
  7. 1 1
      README
  8. 38 0
      README.DEVELOPER
  9. 27 0
      RELEASE-PROCEDURE
  10. 2 0
      TODO
  11. 9 9
      aclocal.m4
  12. 16853 0
      autom4te.cache/output.0
  13. 16853 0
      autom4te.cache/output.1
  14. 16853 0
      autom4te.cache/output.2
  15. 529 0
      autom4te.cache/requests
  16. 2851 0
      autom4te.cache/traces.0
  17. 1082 0
      autom4te.cache/traces.1
  18. 2851 0
      autom4te.cache/traces.2
  19. 118 228
      config.guess
  20. 6 0
      config.h.in
  21. 68 48
      config.sub
  22. 61 45
      configure
  23. 3 3
      configure.ac
  24. 7 0
      doc/.cvsignore
  25. 1 1
      doc/Makefile.in
  26. 13 2
      doc/file.man
  27. 50 2
      doc/libmagic.man
  28. 1 1
      doc/magic.man
  29. 488 262
      install-sh
  30. 22 25
      ltmain.sh
  31. 1 0
      m4/.cvsignore
  32. 47 32
      m4/libtool.m4
  33. 6 0
      magic/.cvsignore
  34. 1 1
      magic/Magdir/acorn
  35. 1 1
      magic/Magdir/adi
  36. 1 1
      magic/Magdir/adventure
  37. 1 1
      magic/Magdir/allegro
  38. 1 1
      magic/Magdir/alliant
  39. 32 0
      magic/Magdir/alpha
  40. 1 1
      magic/Magdir/amanda
  41. 1 1
      magic/Magdir/amigaos
  42. 1 44
      magic/Magdir/android
  43. 3 3
      magic/Magdir/animation
  44. 1 1
      magic/Magdir/aout
  45. 1 1
      magic/Magdir/apl
  46. 1 1
      magic/Magdir/apple
  47. 1 1
      magic/Magdir/applix
  48. 1 1
      magic/Magdir/archive
  49. 1 1
      magic/Magdir/assembler
  50. 1 1
      magic/Magdir/asterix
  51. 1 1
      magic/Magdir/att3b
  52. 1 1
      magic/Magdir/audio
  53. 1 1
      magic/Magdir/basis
  54. 1 1
      magic/Magdir/bflt
  55. 1 1
      magic/Magdir/blackberry
  56. 1 1
      magic/Magdir/blender
  57. 1 1
      magic/Magdir/blit
  58. 1 1
      magic/Magdir/bout
  59. 1 1
      magic/Magdir/bsdi
  60. 1 1
      magic/Magdir/btsnoop
  61. 1 1
      magic/Magdir/c-lang
  62. 1 1
      magic/Magdir/c64
  63. 1 1
      magic/Magdir/cad
  64. 1 1
      magic/Magdir/cafebabe
  65. 1 1
      magic/Magdir/cddb
  66. 1 1
      magic/Magdir/chord
  67. 1 1
      magic/Magdir/cisco
  68. 1 1
      magic/Magdir/citrus
  69. 1 1
      magic/Magdir/clarion
  70. 1 1
      magic/Magdir/claris
  71. 1 1
      magic/Magdir/clipper
  72. 1 1
      magic/Magdir/commands
  73. 1 1
      magic/Magdir/communications
  74. 1 1
      magic/Magdir/compress
  75. 1 1
      magic/Magdir/console
  76. 1 1
      magic/Magdir/convex
  77. 1 1
      magic/Magdir/cracklib
  78. 1 1
      magic/Magdir/ctags
  79. 1 1
      magic/Magdir/cubemap
  80. 1 1
      magic/Magdir/cups
  81. 1 1
      magic/Magdir/dact
  82. 107 64
      magic/Magdir/database
  83. 1 1
      magic/Magdir/diamond
  84. 1 1
      magic/Magdir/diff
  85. 1 1
      magic/Magdir/digital
  86. 1 1
      magic/Magdir/dolby
  87. 1 1
      magic/Magdir/dump
  88. 1 1
      magic/Magdir/dyadic
  89. 1 1
      magic/Magdir/ebml
  90. 1 1
      magic/Magdir/editors
  91. 1 1
      magic/Magdir/efi
  92. 1 1
      magic/Magdir/elf
  93. 1 1
      magic/Magdir/encore
  94. 1 1
      magic/Magdir/epoc
  95. 1 1
      magic/Magdir/erlang
  96. 1 1
      magic/Magdir/esri
  97. 1 1
      magic/Magdir/fcs
  98. 22 20
      magic/Magdir/filesystems
  99. 1 1
      magic/Magdir/flash
  100. 0 0
      magic/Magdir/fonts

+ 24 - 0
.cvsignore

@@ -0,0 +1,24 @@
+autom4te.cache
+Makefile
+Makefile.in
+aclocal.m4
+config.guess
+config.h.in
+config.sub
+config.*.lineno
+configure
+configure.lineno
+depcomp
+install-sh
+ltmain.sh
+missing
+config.h
+config.log
+config.status
+libtool
+stamp-h1
+file-*.tar.gz
+.libs
+compile
+.git
+.gitignore

+ 13 - 0
.travis.yml

@@ -0,0 +1,13 @@
+# $File$
+language: c
+compiler:
+ - gcc
+ - clang
+before_install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq automake libtool make python zlib1g-dev
+script:
+ - autoreconf -f -i
+ - ./configure --disable-silent-rules
+ - make -j4
+ - make -C tests check

+ 1 - 1
COPYING

@@ -1,4 +1,4 @@
-$File: COPYING,v 1.1 2008/02/05 19:08:11 christos Exp $
+$File: LEGAL.NOTICE,v 1.15 2006/05/03 18:48:33 christos Exp $
 Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.
 Software written by Ian F. Darwin and others;
 maintained 1994- Christos Zoulas.

+ 70 - 0
ChangeLog

@@ -1,3 +1,73 @@
+2014-12-16  18:10  Christos Zoulas <christos@zoulas.com>
+	
+	* restructure elf note printing to avoid repeated messages
+	* add note limit, suggested by Alexander Cherepanov
+
+2014-12-16  16:53  Christos Zoulas <christos@zoulas.com>
+	
+	* Bail out on partial pread()'s (Alexander Cherepanov)
+	* Fix incorrect bounds check in file_printable (Alexander Cherepanov)
+
+2014-12-11  20:01  Christos Zoulas <christos@zoulas.com>
+
+	* PR/405: ignore SIGPIPE from uncompress programs
+	* change printable -> file_printable and use it in
+	  more places for safety
+	* in ELF, instead of "(uses dynamic libraries)" when PT_INTERP
+	  is present print the interpreter name.
+	
+2014-12-10  20:01  Christos Zoulas <christos@zoulas.com>
+
+	* release 5.21
+
+2014-11-27  18:40  Christos Zoulas <christos@zoulas.com>
+
+	* Allow setting more parameters from the command line.
+	* Split name/use and indirect magic recursion limits.
+
+2014-11-27  11:12  Christos Zoulas <christos@zoulas.com>
+
+	* Adjust ELF parameters and the default recursion
+	  level.
+	* Allow setting the recursion level dynamically.
+
+2014-11-24   8:55  Christos Zoulas <christos@zoulas.com>
+
+	* The following fixes resulted from Thomas Jarosch's fuzzing
+	  tests that revealed severe performance issues on pathological
+	  input:
+	    - limit number of elf program and sections processing
+	    - abort elf note processing quickly
+	    - reduce the number of recursion levels from 20 to 10
+	    - preserve error messages in indirect magic handling
+
+	This is tracked as CVE-2014-8116 and CVE-2014-8117
+
+2014-11-12  10:30  Christos Zoulas <christos@zoulas.com>
+
+	* fix bogus free in the user buffer case.
+
+2014-11-11  12:35  Christos Zoulas <christos@zoulas.com>
+
+	* fix out of bounds read for pascal strings
+	* fix memory leak (not freeing the head of each mlist)
+
+2014-11-07  10:25  Christos Zoulas <christos@zoulas.com>
+
+	* When printing strings from a file, convert them to printable
+	  on a byte by byte basis, so that we don't get issues with
+	  locale's trying to interpret random byte streams as UTF-8 and
+	  having printf error out with EILSEQ.
+	  
+2014-10-17  11:48  Christos Zoulas <christos@zoulas.com>
+
+	* fix bounds in note reading (Francisco Alonso / Red Hat)
+
+2014-10-11  15:02  Christos Zoulas <christos@zoulas.com>
+
+	* fix autoconf glue for setlocale and locale_t; some OS's
+	  have locale_t in xlocale.h
+
 2014-10-10  15:01  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.20

+ 1 - 1
MAINT

@@ -1,4 +1,4 @@
-$File: MAINT,v 1.10 2008/02/05 19:08:11 christos Exp $
+$File: MAINT,v 1.9 2007/01/19 21:15:27 christos Exp $
 
 Maintenance notes:
 

+ 5 - 4
Makefile.in

@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -80,8 +80,8 @@ subdir = .
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) \
 	$(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \
-	README TODO compile config.guess config.sub depcomp install-sh \
-	missing ltmain.sh
+	README TODO compile config.guess config.sub install-sh missing \
+	ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -618,9 +618,10 @@ distcheck: dist
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && ../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \

+ 1 - 1
README

@@ -1,6 +1,6 @@
 ## README for file(1) Command ##
 
-    @(#) $File: README,v 1.48 2014/03/07 13:55:30 christos Exp $
+    @(#) $File: README,v 1.46 2013/03/25 14:33:10 christos Exp $
 
 Mailing List: file@mx.gw.com  
 Mailing List archives: http://mx.gw.com/pipermail/file/  

+ 38 - 0
README.DEVELOPER

@@ -0,0 +1,38 @@
+# How to get started developing
+
+@(#) $File: README.DEVELOPER,v 1.4 2014/03/10 12:35:59 kim Exp $
+
+## Auto files
+
+After checking out the source, run the following:
+
+	autoreconf -f -i
+	./configure --disable-silent-rules
+	make -j4
+	make -C tests check
+
+
+## Installing dependencies
+
+If your platform doesn't have the above tools, install the following
+packages first.
+
+### Debian
+
+	apt-get install \
+	    automake \
+	    gcc \
+	    libtool \
+	    make \
+	    python \
+	    zlib1g-dev \
+
+See also `.travis.yml`.
+
+### Mac OS X (MacPorts)
+
+	port install \
+	    autoconf \
+	    automake \
+	    libtool \
+

+ 27 - 0
RELEASE-PROCEDURE

@@ -0,0 +1,27 @@
+# HOW TO RELEASE FILE
+
+@(#) $File: RELEASE-PROCEDURE,v 1.2 2014/03/16 08:56:36 kim Exp $
+
+1)  Update version number in configure.ac
+2)  Note the new version in ChangeLog
+3)  Update README if applicable
+4)  Commit changes into CVS
+5)  Rebuild and run tests (see README.DEVELOPER)
+6)  Tag the release with FILEx_yy
+7)  Create the source tarball: make distcheck
+8)  Make the source tarball available on ftp
+9)  Add the new version to bugs.gw.com:
+    - Click: Manage > Manage Projects > file
+    - Scroll down to "Versions"
+    - Click on "Edit" next to the HEAD version
+    - Change the "Version" from HEAD to the newly released version
+    - Change the "Date Order" to the current time
+    - Check the "Released" box
+    - Click on "Update Version"
+    - Type HEAD into the box at the bottom of the version list and
+      click on "Add and Edit Version"
+    - Set the "Date Order" to 2030-01-01 (i.e. far in the future)
+    - Click on "Update Version"
+10) Mail an announcement to file@mx.gw.com containing a summary of the
+    ChangeLog changes. Historically we don't mention magic changes in the
+    ChangeLog or the mail message, only source changes.

+ 2 - 0
TODO

@@ -15,3 +15,5 @@ small amount of C is needed (because fast execution is typically only
 required for soft magic, not the more detailed information given by
 hard-wired routines). In this regard, note that hplip, which is
 BSD-licensed, has a magic reimplementation in Python.
+
+Read the kerberos magic entry for more ideas.

+ 9 - 9
aclocal.m4

@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.14 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
@@ -21,7 +21,7 @@ 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'.])])
 
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2014 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.
@@ -113,7 +113,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.14'
 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.14], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -129,7 +129,7 @@ m4_define([_AM_AUTOCONF_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.14])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -181,10 +181,9 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[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 -*-
@@ -651,7 +650,8 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+])
 
 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

File diff suppressed because it is too large
+ 16853 - 0
autom4te.cache/output.0


File diff suppressed because it is too large
+ 16853 - 0
autom4te.cache/output.1


File diff suppressed because it is too large
+ 16853 - 0
autom4te.cache/output.2


+ 529 - 0
autom4te.cache/requests

@@ -0,0 +1,529 @@
+# This file was generated by Autom4te Sun Aug 31 17:43:43 UTC 2014.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+@request = (
+             bless( [
+                      '0',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        '-',
+                        '/usr/share/aclocal-1.14/internal/ac-config-macro-dirs.m4',
+                        '/usr/share/aclocal/argz.m4',
+                        '/usr/share/aclocal/libtool.m4',
+                        '/usr/share/aclocal/ltdl.m4',
+                        '/usr/share/aclocal/ltoptions.m4',
+                        '/usr/share/aclocal/ltsugar.m4',
+                        '/usr/share/aclocal/ltversion.m4',
+                        '/usr/share/aclocal/lt~obsolete.m4',
+                        '/usr/share/aclocal/visibility.m4',
+                        '/usr/share/aclocal-1.14/amversion.m4',
+                        '/usr/share/aclocal-1.14/auxdir.m4',
+                        '/usr/share/aclocal-1.14/cond.m4',
+                        '/usr/share/aclocal-1.14/depend.m4',
+                        '/usr/share/aclocal-1.14/depout.m4',
+                        '/usr/share/aclocal-1.14/init.m4',
+                        '/usr/share/aclocal-1.14/install-sh.m4',
+                        '/usr/share/aclocal-1.14/lead-dot.m4',
+                        '/usr/share/aclocal-1.14/make.m4',
+                        '/usr/share/aclocal-1.14/missing.m4',
+                        '/usr/share/aclocal-1.14/options.m4',
+                        '/usr/share/aclocal-1.14/prog-cc-c-o.m4',
+                        '/usr/share/aclocal-1.14/runlog.m4',
+                        '/usr/share/aclocal-1.14/sanity.m4',
+                        '/usr/share/aclocal-1.14/silent.m4',
+                        '/usr/share/aclocal-1.14/strip.m4',
+                        '/usr/share/aclocal-1.14/substnot.m4',
+                        '/usr/share/aclocal-1.14/tar.m4',
+                        'acinclude.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        '_LT_LINKER_OPTION' => 1,
+                        'AC_PROG_LD_RELOAD_FLAG' => 1,
+                        '_LT_CC_BASENAME' => 1,
+                        'AC_LIB_LTDL' => 1,
+                        'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
+                        '_LT_LIBOBJ' => 1,
+                        'AM_SILENT_RULES' => 1,
+                        'LT_OUTPUT' => 1,
+                        'gl_VISIBILITY' => 1,
+                        'AC_PROG_EGREP' => 1,
+                        'AM_DISABLE_SHARED' => 1,
+                        'gl_PREREQ_ARGZ' => 1,
+                        'AC_LTDL_DLLIB' => 1,
+                        'LT_LIB_DLLOAD' => 1,
+                        '_LT_AC_FILE_LTDLL_C' => 1,
+                        '_LT_REQUIRED_DARWIN_CHECKS' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'LT_PROG_GCJ' => 1,
+                        'AM_SUBST_NOTMAKE' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AC_DISABLE_FAST_INSTALL' => 1,
+                        '_LT_COMPILER_BOILERPLATE' => 1,
+                        'AC_LIBLTDL_INSTALLABLE' => 1,
+                        'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
+                        '_LT_PROG_CXX' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        'AC_PROG_NM' => 1,
+                        'LT_PATH_NM' => 1,
+                        'AC_LIBTOOL_SETUP' => 1,
+                        'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AC_DISABLE_STATIC' => 1,
+                        'AC_LTDL_ENABLE_INSTALL' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        '_LT_AC_LOCK' => 1,
+                        'AC_LIBTOOL_OBJDIR' => 1,
+                        'AC_ENABLE_SHARED' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
+                        'AC_STRUCT_TIMEZONE_DAYLIGHT' => 1,
+                        'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
+                        'AC_LIBTOOL_PICMODE' => 1,
+                        'LTDL_CONVENIENCE' => 1,
+                        '_LT_PREPARE_SED_QUOTE_VARS' => 1,
+                        'AC_LTDL_SYMBOL_USCORE' => 1,
+                        '_LT_AC_PROG_CXXCPP' => 1,
+                        'AC_STRUCT_OPTION_GETOPT_H' => 1,
+                        'AC_LIBTOOL_F77' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        '_LT_AC_LANG_F77_CONFIG' => 1,
+                        'AC_PROG_LD_GNU' => 1,
+                        '_LT_PATH_TOOL_PREFIX' => 1,
+                        'LT_AC_PROG_GCJ' => 1,
+                        'AC_LIBTOOL_DLOPEN_SELF' => 1,
+                        '_LT_PROG_FC' => 1,
+                        'LT_LANG' => 1,
+                        'AC_CHECK_LIBM' => 1,
+                        '_LT_AC_PROG_ECHO_BACKSLASH' => 1,
+                        'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
+                        'LTDL_INIT' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'LT_CMD_MAX_LEN' => 1,
+                        'AC_WITH_LTDL' => 1,
+                        'AU_DEFUN' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'AM_RUN_LOG' => 1,
+                        'AC_LTDL_SHLIBPATH' => 1,
+                        '_LT_AC_CHECK_DLFCN' => 1,
+                        'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
+                        'AC_LIBTOOL_LANG_C_CONFIG' => 1,
+                        'LT_INIT' => 1,
+                        'AC_PATH_TOOL_PREFIX' => 1,
+                        'gl_FUNC_ARGZ' => 1,
+                        'AC_LIBTOOL_PROG_CC_C_O' => 1,
+                        '_LT_COMPILER_OPTION' => 1,
+                        'AC_ENABLE_FAST_INSTALL' => 1,
+                        '_LT_AC_LANG_GCJ' => 1,
+                        '_LT_AC_SHELL_INIT' => 1,
+                        'LT_AC_PROG_RC' => 1,
+                        '_LT_LINKER_BOILERPLATE' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'LT_CONFIG_LTDL_DIR' => 1,
+                        'LT_WITH_LTDL' => 1,
+                        'LT_LIB_M' => 1,
+                        '_AM_CONFIG_MACRO_DIRS' => 1,
+                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
+                        'LTVERSION_VERSION' => 1,
+                        'AC_DEFUN' => 1,
+                        '_LT_PROG_LTMAIN' => 1,
+                        'LT_PROG_RC' => 1,
+                        '_LT_AC_SYS_COMPILER' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        '_LT_PROG_F77' => 1,
+                        'AC_PATH_MAGIC' => 1,
+                        '_LT_PROG_ECHO_BACKSLASH' => 1,
+                        'AC_LTDL_PREOPEN' => 1,
+                        '_LT_AC_TAGVAR' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        'm4_include' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'AC_LTDL_SHLIBEXT' => 1,
+                        'LT_SYS_DLOPEN_SELF' => 1,
+                        'AC_ENABLE_STATIC' => 1,
+                        '_LT_WITH_SYSROOT' => 1,
+                        'AM_MAKE_INCLUDE' => 1,
+                        'AC_LIBTOOL_CONFIG' => 1,
+                        'AM_ENABLE_SHARED' => 1,
+                        'AM_ENABLE_STATIC' => 1,
+                        'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
+                        'AC_LIBTOOL_GCJ' => 1,
+                        'LT_SYS_MODULE_EXT' => 1,
+                        'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
+                        'LT_AC_PROG_EGREP' => 1,
+                        'LT_SYS_DLOPEN_DEPLIBS' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'LTOBSOLETE_VERSION' => 1,
+                        'AM_DISABLE_STATIC' => 1,
+                        'AC_LIBLTDL_CONVENIENCE' => 1,
+                        'AC_LIBTOOL_WIN32_DLL' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'LT_SYS_SYMBOL_USCORE' => 1,
+                        'AC_CONFIG_MACRO_DIR_TRACE' => 1,
+                        '_AM_AUTOCONF_VERSION' => 1,
+                        'AC_DISABLE_SHARED' => 1,
+                        '_AM_PROG_CC_C_O' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
+                        'AC_LTDL_DLSYM_USCORE' => 1,
+                        'AM_PROG_NM' => 1,
+                        'LT_FUNC_DLSYM_USCORE' => 1,
+                        'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        'AC_LIBTOOL_FC' => 1,
+                        '_LT_AC_LANG_GCJ_CONFIG' => 1,
+                        'AC_DEPLIBS_CHECK_METHOD' => 1,
+                        'LT_SYS_DLSEARCH_PATH' => 1,
+                        '_LT_AC_LANG_C_CONFIG' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_LT_AC_SYS_LIBPATH_AIX' => 1,
+                        '_LT_AC_LANG_CXX' => 1,
+                        'LT_SYS_MODULE_PATH' => 1,
+                        '_LT_AC_LANG_RC_CONFIG' => 1,
+                        'include' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        '_m4_warn' => 1,
+                        'm4_pattern_allow' => 1,
+                        'LT_PROG_GO' => 1,
+                        'LTDL_INSTALLABLE' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'AC_CONFIG_MACRO_DIR' => 1,
+                        'AC_LIBTOOL_CXX' => 1,
+                        'LTSUGAR_VERSION' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'LT_PATH_LD' => 1,
+                        'AM_PROG_LD' => 1,
+                        '_LTDL_SETUP' => 1,
+                        'AC_LIBTOOL_RC' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_PROG_LD' => 1,
+                        'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_LIBTOOL_DLOPEN' => 1,
+                        'LTOPTIONS_VERSION' => 1,
+                        '_AC_PROG_LIBTOOL' => 1,
+                        'LT_AC_PROG_SED' => 1,
+                        '_LT_AC_LANG_CXX_CONFIG' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
+                        'AC_LTDL_SYSSEARCHPATH' => 1,
+                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AC_LTDL_OBJDIR' => 1,
+                        'AC_LIBTOOL_COMPILER_OPTION' => 1,
+                        '_LT_AC_LANG_F77' => 1,
+                        'AC_LIBTOOL_LINKER_OPTION' => 1,
+                        'AM_DEP_TRACK' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '1',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        'aclocal.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        '_AM_COND_IF' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'LT_INIT' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'm4_sinclude' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_FC_PP_SRCEXT' => 1,
+                        'AM_PROG_FC_C_O' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AC_FC_FREEFORM' => 1,
+                        'AM_NLS' => 1,
+                        'AC_FC_SRCEXT' => 1,
+                        'AM_POT_TOOLS' => 1,
+                        'AC_FC_PP_DEFINE' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        '_AM_COND_ELSE' => 1,
+                        'include' => 1,
+                        'AC_INIT' => 1,
+                        '_AM_MAKEFILE_INCLUDE' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AM_SILENT_RULES' => 1,
+                        'AM_EXTRA_RECURSIVE_TARGETS' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        '_m4_warn' => 1,
+                        'm4_include' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_SUBST' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AM_XGETTEXT_OPTION' => 1,
+                        'AC_REQUIRE_AUX_FILE' => 1,
+                        'AM_PROG_F77_C_O' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        'AC_SUBST_TRACE' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'AC_CANONICAL_TARGET' => 1,
+                        '_AM_COND_ENDIF' => 1,
+                        'AM_ENABLE_MULTILIB' => 1,
+                        'AM_PROG_MKDIR_P' => 1,
+                        'AC_CANONICAL_BUILD' => 1,
+                        'LT_CONFIG_LTDL_DIR' => 1,
+                        'AM_MAKEFILE_INCLUDE' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'AM_PROG_CXX_C_O' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AM_PATH_GUILE' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
+                        'AM_PROG_AR' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AM_PROG_MOC' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'sinclude' => 1,
+                        'AM_GNU_GETTEXT_INTL_SUBDIR' => 1
+                      }
+                    ], 'Autom4te::Request' ),
+             bless( [
+                      '2',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        '-',
+                        '/usr/share/aclocal-1.14/internal/ac-config-macro-dirs.m4',
+                        '/usr/share/aclocal/argz.m4',
+                        '/usr/share/aclocal/ltdl.m4',
+                        '/usr/share/aclocal/visibility.m4',
+                        '/usr/share/aclocal-1.14/amversion.m4',
+                        '/usr/share/aclocal-1.14/auxdir.m4',
+                        '/usr/share/aclocal-1.14/cond.m4',
+                        '/usr/share/aclocal-1.14/depend.m4',
+                        '/usr/share/aclocal-1.14/depout.m4',
+                        '/usr/share/aclocal-1.14/init.m4',
+                        '/usr/share/aclocal-1.14/install-sh.m4',
+                        '/usr/share/aclocal-1.14/lead-dot.m4',
+                        '/usr/share/aclocal-1.14/make.m4',
+                        '/usr/share/aclocal-1.14/missing.m4',
+                        '/usr/share/aclocal-1.14/options.m4',
+                        '/usr/share/aclocal-1.14/prog-cc-c-o.m4',
+                        '/usr/share/aclocal-1.14/runlog.m4',
+                        '/usr/share/aclocal-1.14/sanity.m4',
+                        '/usr/share/aclocal-1.14/silent.m4',
+                        '/usr/share/aclocal-1.14/strip.m4',
+                        '/usr/share/aclocal-1.14/substnot.m4',
+                        '/usr/share/aclocal-1.14/tar.m4',
+                        'm4/libtool.m4',
+                        'm4/ltoptions.m4',
+                        'm4/ltsugar.m4',
+                        'm4/ltversion.m4',
+                        'm4/lt~obsolete.m4',
+                        'acinclude.m4',
+                        'configure.ac'
+                      ],
+                      {
+                        'AM_SILENT_RULES' => 1,
+                        '_LT_LIBOBJ' => 1,
+                        'AC_LIB_LTDL' => 1,
+                        'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
+                        '_LT_CC_BASENAME' => 1,
+                        'AC_PROG_LD_RELOAD_FLAG' => 1,
+                        '_LT_LINKER_OPTION' => 1,
+                        'LT_OUTPUT' => 1,
+                        'LT_LIB_DLLOAD' => 1,
+                        'AC_LTDL_DLLIB' => 1,
+                        'AM_DISABLE_SHARED' => 1,
+                        'gl_PREREQ_ARGZ' => 1,
+                        'AC_PROG_EGREP' => 1,
+                        'gl_VISIBILITY' => 1,
+                        '_LT_COMPILER_BOILERPLATE' => 1,
+                        'AC_DISABLE_FAST_INSTALL' => 1,
+                        'AM_MISSING_HAS_RUN' => 1,
+                        'AM_SUBST_NOTMAKE' => 1,
+                        '_LT_AC_FILE_LTDLL_C' => 1,
+                        'LT_PROG_GCJ' => 1,
+                        '_LT_REQUIRED_DARWIN_CHECKS' => 1,
+                        'AC_DEFUN_ONCE' => 1,
+                        'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
+                        'AC_LIBTOOL_SETUP' => 1,
+                        'LT_PATH_NM' => 1,
+                        'AM_SET_DEPDIR' => 1,
+                        'AC_PROG_NM' => 1,
+                        'AC_LIBLTDL_INSTALLABLE' => 1,
+                        '_LT_PROG_CXX' => 1,
+                        'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_LTDL_ENABLE_INSTALL' => 1,
+                        'AC_DISABLE_STATIC' => 1,
+                        'AM_MISSING_PROG' => 1,
+                        'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
+                        'AC_ENABLE_SHARED' => 1,
+                        'AC_STRUCT_TIMEZONE_DAYLIGHT' => 1,
+                        'AC_LIBTOOL_OBJDIR' => 1,
+                        '_LT_AC_LOCK' => 1,
+                        'AM_SANITY_CHECK' => 1,
+                        '_LT_AC_TAGCONFIG' => 1,
+                        'AC_PROG_LD_GNU' => 1,
+                        '_LT_AC_LANG_F77_CONFIG' => 1,
+                        'AC_STRUCT_OPTION_GETOPT_H' => 1,
+                        'AC_LIBTOOL_F77' => 1,
+                        'AC_LTDL_SYMBOL_USCORE' => 1,
+                        '_LT_AC_PROG_CXXCPP' => 1,
+                        '_LT_PREPARE_SED_QUOTE_VARS' => 1,
+                        'LTDL_CONVENIENCE' => 1,
+                        'AC_LIBTOOL_PICMODE' => 1,
+                        'AC_CHECK_LIBM' => 1,
+                        'LT_LANG' => 1,
+                        'AC_LIBTOOL_DLOPEN_SELF' => 1,
+                        '_LT_PROG_FC' => 1,
+                        'LT_AC_PROG_GCJ' => 1,
+                        '_LT_PATH_TOOL_PREFIX' => 1,
+                        'AM_RUN_LOG' => 1,
+                        '_AM_PROG_TAR' => 1,
+                        'AU_DEFUN' => 1,
+                        'AC_WITH_LTDL' => 1,
+                        'LT_CMD_MAX_LEN' => 1,
+                        'AM_AUX_DIR_EXPAND' => 1,
+                        'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
+                        '_LT_AC_PROG_ECHO_BACKSLASH' => 1,
+                        'LTDL_INIT' => 1,
+                        'AC_LIBTOOL_LANG_C_CONFIG' => 1,
+                        'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
+                        '_LT_AC_CHECK_DLFCN' => 1,
+                        'AC_LTDL_SHLIBPATH' => 1,
+                        '_LT_AC_SHELL_INIT' => 1,
+                        '_LT_AC_LANG_GCJ' => 1,
+                        '_LT_COMPILER_OPTION' => 1,
+                        'AC_ENABLE_FAST_INSTALL' => 1,
+                        'AC_LIBTOOL_PROG_CC_C_O' => 1,
+                        'AC_PATH_TOOL_PREFIX' => 1,
+                        'gl_FUNC_ARGZ' => 1,
+                        'LT_INIT' => 1,
+                        'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
+                        '_LT_LINKER_BOILERPLATE' => 1,
+                        'LT_AC_PROG_RC' => 1,
+                        'LT_LIB_M' => 1,
+                        'LT_WITH_LTDL' => 1,
+                        'LT_CONFIG_LTDL_DIR' => 1,
+                        'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
+                        '_LT_AC_SYS_COMPILER' => 1,
+                        'LT_PROG_RC' => 1,
+                        '_LT_PROG_LTMAIN' => 1,
+                        'AC_DEFUN' => 1,
+                        'LTVERSION_VERSION' => 1,
+                        '_LT_AC_TRY_DLOPEN_SELF' => 1,
+                        '_AM_CONFIG_MACRO_DIRS' => 1,
+                        '_LT_PROG_ECHO_BACKSLASH' => 1,
+                        'AC_PATH_MAGIC' => 1,
+                        '_LT_PROG_F77' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AC_LTDL_SHLIBEXT' => 1,
+                        '_AM_SUBST_NOTMAKE' => 1,
+                        'm4_include' => 1,
+                        '_LT_AC_TAGVAR' => 1,
+                        'AC_LTDL_PREOPEN' => 1,
+                        'AM_PROG_INSTALL_SH' => 1,
+                        'AM_ENABLE_SHARED' => 1,
+                        'AC_LIBTOOL_CONFIG' => 1,
+                        'AM_MAKE_INCLUDE' => 1,
+                        'AC_ENABLE_STATIC' => 1,
+                        '_LT_WITH_SYSROOT' => 1,
+                        'LT_SYS_DLOPEN_SELF' => 1,
+                        'AC_LIBTOOL_GCJ' => 1,
+                        'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
+                        'AM_ENABLE_STATIC' => 1,
+                        'AC_LIBLTDL_CONVENIENCE' => 1,
+                        'AC_LIBTOOL_WIN32_DLL' => 1,
+                        'AM_DISABLE_STATIC' => 1,
+                        'LTOBSOLETE_VERSION' => 1,
+                        'LT_SUPPORTED_TAG' => 1,
+                        'LT_AC_PROG_EGREP' => 1,
+                        'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
+                        'LT_SYS_DLOPEN_DEPLIBS' => 1,
+                        'LT_SYS_MODULE_EXT' => 1,
+                        '_AM_AUTOCONF_VERSION' => 1,
+                        'AC_CONFIG_MACRO_DIR_TRACE' => 1,
+                        'LT_SYS_SYMBOL_USCORE' => 1,
+                        '_AC_AM_CONFIG_HEADER_HOOK' => 1,
+                        'AM_PROG_LIBTOOL' => 1,
+                        '_AM_PROG_CC_C_O' => 1,
+                        'AC_DISABLE_SHARED' => 1,
+                        '_LT_AC_LANG_C_CONFIG' => 1,
+                        'LT_SYS_DLSEARCH_PATH' => 1,
+                        'AC_LIBTOOL_FC' => 1,
+                        '_LT_AC_LANG_GCJ_CONFIG' => 1,
+                        'AC_DEPLIBS_CHECK_METHOD' => 1,
+                        'LT_FUNC_DLSYM_USCORE' => 1,
+                        '_AM_SET_OPTIONS' => 1,
+                        'AM_PROG_NM' => 1,
+                        'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
+                        'AC_LTDL_DLSYM_USCORE' => 1,
+                        '_LT_AC_LANG_CXX' => 1,
+                        '_LT_AC_SYS_LIBPATH_AIX' => 1,
+                        'AM_PROG_INSTALL_STRIP' => 1,
+                        '_AM_DEPENDENCIES' => 1,
+                        '_m4_warn' => 1,
+                        '_LT_AC_LANG_RC_CONFIG' => 1,
+                        'include' => 1,
+                        'LT_SYS_MODULE_PATH' => 1,
+                        'AC_CONFIG_MACRO_DIR' => 1,
+                        '_AM_SET_OPTION' => 1,
+                        'LTDL_INSTALLABLE' => 1,
+                        'LT_PROG_GO' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AM_PROG_LD' => 1,
+                        'LT_PATH_LD' => 1,
+                        'AM_SET_LEADING_DOT' => 1,
+                        'LTSUGAR_VERSION' => 1,
+                        'AC_LIBTOOL_CXX' => 1,
+                        '_AC_PROG_LIBTOOL' => 1,
+                        'LTOPTIONS_VERSION' => 1,
+                        'AC_LIBTOOL_DLOPEN' => 1,
+                        'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_PROG_LD' => 1,
+                        '_LTDL_SETUP' => 1,
+                        'AC_LIBTOOL_RC' => 1,
+                        '_AM_IF_OPTION' => 1,
+                        'AC_LTDL_SYSSEARCHPATH' => 1,
+                        'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
+                        'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
+                        '_LT_AC_LANG_CXX_CONFIG' => 1,
+                        'LT_AC_PROG_SED' => 1,
+                        'AC_LIBTOOL_COMPILER_OPTION' => 1,
+                        'AC_LTDL_OBJDIR' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AC_LIBTOOL_LINKER_OPTION' => 1,
+                        '_LT_AC_LANG_F77' => 1,
+                        'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
+                        '_AM_MANGLE_OPTION' => 1,
+                        '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
+                        'AM_DEP_TRACK' => 1
+                      }
+                    ], 'Autom4te::Request' )
+           );
+

File diff suppressed because it is too large
+ 2851 - 0
autom4te.cache/traces.0


File diff suppressed because it is too large
+ 1082 - 0
autom4te.cache/traces.1


File diff suppressed because it is too large
+ 2851 - 0
autom4te.cache/traces.2


+ 118 - 228
config.guess

@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2014-03-23'
 
 # 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 2 of the License, or
+# 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
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # 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.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# 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").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -138,6 +132,27 @@ 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 <features.h>
+	#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'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	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}
@@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -801,10 +820,13 @@ EOF
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -852,21 +874,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	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 '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +901,54 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	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-gnu
+	    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-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -950,54 +967,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    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-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	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-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  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-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1227,9 @@ EOF
     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 ;;
@@ -1227,19 +1256,31 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		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
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	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
+	    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]*:*)
@@ -1256,7 +1297,7 @@ EOF
     NEO-?:NONSTOP_KERNEL:*:*)
 	echo neo-tandem-nsk${UNAME_RELEASE}
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,157 +1371,6 @@ EOF
 	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 

+ 6 - 0
config.h.in

@@ -104,6 +104,9 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
 /* Define to 1 if you have the <stddef.h> header file. */
 #undef HAVE_STDDEF_H
 
@@ -228,6 +231,9 @@
 /* Define to 1 if `vfork' works. */
 #undef HAVE_WORKING_VFORK
 
+/* Define to 1 if you have the <xlocale.h> header file. */
+#undef HAVE_XLOCALE_H
+
 /* Define to 1 if you have the <zlib.h> header file. */
 #undef HAVE_ZLIB_H
 

+ 68 - 48
config.sub

@@ -1,24 +1,18 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2012-04-18'
+timestamp='2014-09-11'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# 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 2 of the License, or
+# 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.
+# 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 <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
 # 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.
+# 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 <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2014 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."
@@ -123,7 +116,7 @@ esac
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
@@ -156,7 +149,7 @@ case $os in
 	-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)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
@@ -259,10 +252,12 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| epiphany \
 	| fido | fr30 | frv \
@@ -270,10 +265,11 @@ case $basic_machine in
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -287,23 +283,26 @@ case $basic_machine in
 	| 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 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -328,7 +327,7 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -370,13 +369,13 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -385,11 +384,13 @@ case $basic_machine in
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -403,18 +404,22 @@ case $basic_machine in
 	| 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-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -788,11 +793,15 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-	microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -820,6 +829,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -828,7 +841,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1019,7 +1032,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1346,29 +1363,29 @@ case $os in
 	-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* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -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* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1492,9 +1509,6 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
@@ -1543,6 +1557,12 @@ case $basic_machine in
 	c4x-* | tic4x-*)
 		os=-coff
 		;;
+	c8051-*)
+		os=-elf
+		;;
+	hexagon-*)
+		os=-elf
+		;;
 	tic54x-*)
 		os=-coff
 		;;

+ 61 - 45
configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for file 5.20.
+# Generated by GNU Autoconf 2.69 for file 5.21.
 #
 # Report bugs to <christos@astron.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='file'
 PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.20'
-PACKAGE_STRING='file 5.20'
+PACKAGE_VERSION='5.21'
+PACKAGE_STRING='file 5.21'
 PACKAGE_BUGREPORT='christos@astron.com'
 PACKAGE_URL=''
 
@@ -1327,7 +1327,7 @@ 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 file 5.20 to adapt to many kinds of systems.
+\`configure' configures file 5.21 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1397,7 +1397,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of file 5.20:";;
+     short | recursive ) echo "Configuration of file 5.21:";;
    esac
   cat <<\_ACEOF
 
@@ -1507,7 +1507,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-file configure 5.20
+file configure 5.21
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2163,7 +2163,7 @@ 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 file $as_me 5.20, which was
+It was created by file $as_me 5.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2715,8 +2715,8 @@ test "$program_suffix" != NONE &&
 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`
+# 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
@@ -3029,7 +3029,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='file'
- VERSION='5.20'
+ VERSION='5.21'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3121,6 +3121,7 @@ END
     as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
   fi
 fi
+
 # Check whether --enable-silent-rules was given.
 if test "${enable_silent_rules+set}" = set; then :
   enableval=$enable_silent_rules;
@@ -6043,7 +6044,8 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -6444,10 +6446,6 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -6486,11 +6484,11 @@ irix5* | irix6* | nonstopux*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
@@ -7567,7 +7565,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -7583,9 +7581,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
+	    ;;
+	  powerpc64le-*)
+	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -7604,7 +7612,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -9143,7 +9154,7 @@ lt_prog_compiler_static=
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -9621,6 +9632,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -9842,7 +9856,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
@@ -10019,6 +10033,7 @@ _LT_EOF
 	if test "$aix_use_runtimelinking" = yes; then
 	  shared_flag="$shared_flag "'${wl}-G'
 	fi
+	link_all_deplibs=no
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
@@ -10472,7 +10487,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       link_all_deplibs=yes
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
@@ -11309,17 +11324,6 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -11436,7 +11440,7 @@ linux*oldld* | linux*aout* | linux*coff*)
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -11500,6 +11504,18 @@ fi
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -12785,7 +12801,7 @@ fi
 
 done
 
-for ac_header in getopt.h err.h
+for ac_header in getopt.h err.h xlocale.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"
@@ -13236,7 +13252,7 @@ else
     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 << 62) - 1 + ((off_t) 1 << 62))
+#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];
@@ -13282,7 +13298,7 @@ else
     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 << 62) - 1 + ((off_t) 1 << 62))
+#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];
@@ -13306,7 +13322,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     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 << 62) - 1 + ((off_t) 1 << 62))
+#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];
@@ -13351,7 +13367,7 @@ else
     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 << 62) - 1 + ((off_t) 1 << 62))
+#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];
@@ -13375,7 +13391,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     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 << 62) - 1 + ((off_t) 1 << 62))
+#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];
@@ -14191,7 +14207,7 @@ fi
 fi
 
 
-for ac_func in strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale
+for ac_func in strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale
 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"
@@ -14998,7 +15014,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by file $as_me 5.20, which was
+This file was extended by file $as_me 5.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15064,7 +15080,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-file config.status 5.20
+file config.status 5.21
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

+ 3 - 3
configure.ac

@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.20],[christos@astron.com])
+AC_INIT([file],[5.21],[christos@astron.com])
 AM_INIT_AUTOMAKE([subdir-objects foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
@@ -82,7 +82,7 @@ AC_HEADER_MAJOR
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
 AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
-AC_CHECK_HEADERS(getopt.h err.h)
+AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
 AC_CHECK_HEADERS(zlib.h)
 
@@ -138,7 +138,7 @@ else
 fi])
 
 dnl Checks for functions
-AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale)
+AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
 
 dnl Provide implementation of some required functions if necessary
 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)

+ 7 - 0
doc/.cvsignore

@@ -0,0 +1,7 @@
+Makefile
+Makefile.in
+*.1
+*.3
+*.4
+*.5
+.gitignore

+ 1 - 1
doc/Makefile.in

@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.

+ 13 - 2
doc/file.man

@@ -1,5 +1,5 @@
-.\" $File: file.man,v 1.106 2014/03/07 23:11:51 christos Exp $
-.Dd January 30, 2014
+.\" $File: file.man,v 1.110 2014/11/28 02:46:39 christos Exp $
+.Dd December 16, 2014
 .Dt FILE __CSECTION__
 .Os
 .Sh NAME
@@ -16,6 +16,7 @@
 .Op Fl F Ar separator
 .Op Fl f Ar namefile
 .Op Fl m Ar magicfiles
+.Op Fl P Ar name=value
 .Ar
 .Ek
 .Nm
@@ -303,6 +304,16 @@ or
 attempt to preserve the access time of files analyzed, to pretend that
 .Nm
 never read them.
+.It Fl P , Fl Fl parameter Ar name=value
+Set various parameter limits.
+.Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
+.It Sy "Name" Ta Sy "Default" Ta Sy "Explanation"
+.It Li indir Ta 15 Ta recursion limit for indirect magic
+.It Li name Ta 30 Ta use count limit for name/use magic
+.It Li elf_notes Ta 256 Ta max ELF notes processed
+.It Li elf_phnum Ta 128 Ta max ELF program sections processed
+.It Li elf_shnum Ta 32768 Ta max ELF sections processed
+.El
 .It Fl r , Fl Fl raw
 Don't translate unprintable characters to \eooo.
 Normally

+ 50 - 2
doc/libmagic.man

@@ -1,4 +1,4 @@
-.\" $File: libmagic.man,v 1.29 2014/08/04 06:19:44 christos Exp $
+.\" $File: libmagic.man,v 1.33 2014/11/28 02:46:39 christos Exp $
 .\"
 .\" Copyright (c) Christos Zoulas 2003.
 .\" All Rights Reserved.
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 4, 2014
+.Dd December 16, 2014
 .Dt LIBMAGIC 3
 .Os
 .Sh NAME
@@ -40,6 +40,9 @@
 .Nm magic_compile ,
 .Nm magic_list ,
 .Nm magic_load ,
+.Nm magic_load_buffers ,
+.Nm magic_setparam ,
+.Nm magic_getparam ,
 .Nm magic_version
 .Nd Magic number recognition library
 .Sh LIBRARY
@@ -73,6 +76,10 @@
 .Ft int
 .Fn magic_load_buffers "magic_t cookie" "void **buffers" "size_t *sizes" "size_t nbuffers"
 .Ft int
+.Fn magic_getparam "magic_t cookie" "int param" "void *value"
+.Ft int
+.Fn magic_setparam "magic_t cookie" "int param" "const void *value"
+.Ft int
 .Fn magic_version "void"
 .Sh DESCRIPTION
 These functions
@@ -268,6 +275,47 @@ not have direct access to the filesystem, but can access the magic
 database via shared memory or other IPC means.
 .Pp
 The
+.Fn magic_getparam
+and
+.Fn magic_setparam
+allow getting and setting various limits related to the the magic
+library.
+.Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent
+.It Sy "Parameter" Ta Sy "Type" Ta Sy "Default"
+.It Li MAGIC_PARAM_INDIR_MAX Ta size_t Ta 15
+.It Li MAGIC_PARAM_NAME_MAX Ta size_t Ta 30
+.It Li MAGIC_PARAM_ELF_NOTES_MAX Ta size_t Ta 256
+.It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128
+.It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768
+.El
+.Pp
+The
+.Dv MAGIC_PARAM_INDIR_RECURSION
+parameter controls how many levels of recursion will be followed for
+indirect magic entries.
+.Pp
+The
+.Dv MAGIC_PARAM_NAME_RECURSION
+parameter controls how many levels of recursion will be followed for
+for name/use calls.
+.Pp
+The
+.Dv MAGIC_PARAM_NAME_MAX
+parameter controls the maximum number of calls for name/use.
+.Pp
+The
+.Dv MAGIC_PARAM_NOTES_MAX
+parameter controls how many ELF notes will be processed.
+.Pp
+The
+.Dv MAGIC_PARAM_PHNUM_MAX
+parameter controls how many ELF program sections will be processed.
+.Pp
+The
+.Dv MAGIC_PARAM_SHNUM_MAX
+parameter controls how many ELF sections will be processed.
+.Pp
+The
 .Fn magic_version
 command returns the version number of this library which is compiled into
 the shared library using the constant

+ 1 - 1
doc/magic.man

@@ -1,4 +1,4 @@
-.\" $File: magic.man,v 1.84 2014/06/03 19:01:34 christos Exp $
+.\" $File: magic.man,v 1.83 2014/06/03 17:36:13 christos Exp $
 .Dd June 3, 2014
 .Dt MAGIC __FSECTION__
 .Os

+ 488 - 262
install-sh

@@ -1,301 +1,527 @@
 #!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # 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.
 #
-# $NetBSD: install-sh.in,v 1.6 2012/01/11 13:07:31 hans Exp $
-# This script now also installs multiple files, but might choke on installing
-# multiple files with spaces in the file names.
+# Copyright (C) 1994 X Consortium
 #
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
+# 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.
 #
-# Copyright 1991 by the Massachusetts Institute of Technology
 #
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
+# 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
+# '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.
 
+nl='
+'
+IFS=" ""	$nl"
+
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-awkprog="${AWKPROG-awk}"
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-instcmd="$cpprog"
-instflags=""
-pathcompchmodcmd="$chmodprog 755"
-chmodcmd="$chmodprog 755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-stripflags=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-msrc=""
-dst=""
-dir_arg=""
-suffix=""
-suffixfmt=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-b) suffix=".old"
-	    shift
-	    continue;;
-
-	-B) suffixfmt="$2"
-	    shift
-	    shift
-	    continue;;
-
-	-c) instcmd="$cpprog"
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-m*)
-	    chmodcmd="$chmodprog ${1#-m}"
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd="$stripprog"
-	    shift
-	    continue;;
-
-	-S) stripcmd="$stripprog"
-	    stripflags="-S $2 $stripflags"
-	    shift
-	    shift
-	    continue;;
-
-	-p) instflags="-p"
-	    shift
-	    continue;;
-
-	*)  if [ x"$msrc" = x ]
-	    then
-		msrc="$dst"
-	    else
-		msrc="$msrc $dst"
-	    fi
-	    src="$dst"
-	    dst="$1"
-	    shift
-	    continue;;
-    esac
-done
-
-if [ x"$dir_arg" = x ]
-then
-	dstisfile=""
-	if [ ! -d "$dst" ]
-	then
-		if [ x"$msrc" = x"$src" ]
-		then
-			dstisfile=true
-		else
-			echo "install: destination is not a directory"
-			exit 1
-		fi
-	fi
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
 else
-	msrc="$msrc $dst"
+  doit_exec=$doit
 fi
 
-if [ x"$msrc" = x ]
-then
-	echo "install: no destination specified"
-	exit 1
-fi      
+# 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_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-for srcarg in $msrc; do
+posix_mkdir=
 
-if [ x"$dir_arg" != x ]; then
+# Desired mode of installed file.
+mode=0755
 
-	dstarg="$srcarg"
-else
-	dstarg="$dst"
-
-# Waiting for this to be detected by the "$instcmd $srcarg $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-	if [ -f "$srcarg" ]
-	then
-		doinst="$instcmd $instflags"
-	elif [ -d "$srcarg" ]
-	then
-		echo "install: $srcarg: not a regular file"
-		exit 1
-	elif [ "$srcarg" = "/dev/null" ]
-	then
-		doinst="$cpprog"
-	else
-		echo "install:  $srcarg does not exist"
-		exit 1
-	fi
-	
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
 
-	if [ -d "$dstarg" ]
-	then
-		dstarg="$dstarg"/`basename "$srcarg"`
-	fi
-fi
+src=
+dst=
+dir_arg=
+dst_arg=
 
-## this sed command emulates the dirname command
-dstdir=`echo "$dstarg" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+copy_on_change=false
+no_target_directory=
 
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
 
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='	
-'
-IFS="${IFS-${defaultIFS}}"
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
 
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
 
-pathcomp=''
+  -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.
 
-while [ $# -ne 0 ] ; do
-	pathcomp="${pathcomp}${1}"
-	shift
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
 
-	if [ ! -d "${pathcomp}" ] ;
-        then
-		$doit $mkdirprog "${pathcomp}"
-        	if [ x"$chowncmd" != x ]; then $doit $chowncmd "${pathcomp}"; else true ; fi &&
-        	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "${pathcomp}"; else true ; fi &&
-        	if [ x"$pathcompchmodcmd" != x ]; then $doit $pathcompchmodcmd "${pathcomp}"; else true ; fi
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
 
-	else
-		true
-	fi
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
 
-	pathcomp="${pathcomp}/"
+    -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
 done
+
+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 [ x"$dir_arg" != x ]
-	then
-		if [ -d "$dstarg" ]; then
-			true
-		else
-			$doit $mkdirprog "$dstarg" &&
-
-			if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dstarg"; else true ; fi &&
-			if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dstarg"; else true ; fi &&
-			if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dstarg"; else true ; fi
-		fi
-	else
+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
+  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