head	1.13;
access;
symbols
	netbsd-11-0-RC4:1.13
	netbsd-11-0-RC3:1.13
	netbsd-11-0-RC2:1.13
	netbsd-11-0-RC1:1.13
	perseant-exfatfs-base-20250801:1.13
	netbsd-11:1.13.0.6
	netbsd-11-base:1.13
	netbsd-10-1-RELEASE:1.13
	perseant-exfatfs-base-20240630:1.13
	perseant-exfatfs:1.13.0.4
	perseant-exfatfs-base:1.13
	netbsd-8-3-RELEASE:1.8
	netbsd-9-4-RELEASE:1.10
	netbsd-10-0-RELEASE:1.13
	netbsd-10-0-RC6:1.13
	netbsd-10-0-RC5:1.13
	netbsd-10-0-RC4:1.13
	netbsd-10-0-RC3:1.13
	netbsd-10-0-RC2:1.13
	netbsd-10-0-RC1:1.13
	FILE5_45:1.1.1.10
	netbsd-10:1.13.0.2
	netbsd-10-base:1.13
	netbsd-9-3-RELEASE:1.10
	cjep_sun2x-base1:1.11
	cjep_sun2x:1.11.0.6
	cjep_sun2x-base:1.11
	cjep_staticlib_x-base1:1.11
	netbsd-9-2-RELEASE:1.10
	cjep_staticlib_x:1.11.0.4
	cjep_staticlib_x-base:1.11
	FILE5_40:1.1.1.9
	netbsd-9-1-RELEASE:1.10
	FILE5_39:1.1.1.9
	phil-wifi-20200421:1.11
	phil-wifi-20200411:1.11
	is-mlppp:1.11.0.2
	is-mlppp-base:1.11
	phil-wifi-20200406:1.11
	netbsd-8-2-RELEASE:1.8
	netbsd-9-0-RELEASE:1.10
	netbsd-9-0-RC2:1.10
	FILE5_38:1.1.1.9
	netbsd-9-0-RC1:1.10
	phil-wifi-20191119:1.10
	netbsd-9:1.10.0.2
	netbsd-9-base:1.10
	phil-wifi-20190609:1.10
	netbsd-8-1-RELEASE:1.8
	FILE5_37:1.1.1.8
	netbsd-8-1-RC1:1.8
	pgoyette-compat-merge-20190127:1.8.10.2
	pgoyette-compat-20190127:1.10
	pgoyette-compat-20190118:1.10
	pgoyette-compat-1226:1.10
	pgoyette-compat-1126:1.10
	pgoyette-compat-1020:1.10
	FILE5_35:1.1.1.8
	pgoyette-compat-0930:1.9
	pgoyette-compat-0906:1.9
	netbsd-7-2-RELEASE:1.7
	pgoyette-compat-0728:1.9
	netbsd-8-0-RELEASE:1.8
	phil-wifi:1.9.0.2
	phil-wifi-base:1.9
	pgoyette-compat-0625:1.9
	netbsd-8-0-RC2:1.8
	pgoyette-compat-0521:1.9
	pgoyette-compat-0502:1.9
	pgoyette-compat-0422:1.9
	netbsd-8-0-RC1:1.8
	FILE5_33:1.1.1.7
	pgoyette-compat-0415:1.8
	pgoyette-compat-0407:1.8
	pgoyette-compat-0330:1.8
	pgoyette-compat-0322:1.8
	pgoyette-compat-0315:1.8
	netbsd-7-1-2-RELEASE:1.7
	pgoyette-compat:1.8.0.10
	pgoyette-compat-base:1.8
	netbsd-7-1-1-RELEASE:1.7
	matt-nb8-mediatek:1.8.0.8
	matt-nb8-mediatek-base:1.8
	FILE5_32:1.1.1.6
	perseant-stdc-iso10646:1.8.0.6
	perseant-stdc-iso10646-base:1.8
	netbsd-8:1.8.0.4
	netbsd-8-base:1.8
	FILE5_31:1.1.1.6
	prg-localcount2-base3:1.8
	prg-localcount2-base2:1.8
	prg-localcount2-base1:1.8
	prg-localcount2:1.8.0.2
	prg-localcount2-base:1.8
	pgoyette-localcount-20170426:1.8
	bouyer-socketcan-base1:1.8
	pgoyette-localcount-20170320:1.8
	netbsd-7-1:1.7.0.12
	netbsd-7-1-RELEASE:1.7
	netbsd-7-1-RC2:1.7
	FILE5_30:1.1.1.6
	netbsd-7-nhusb-base-20170116:1.7
	bouyer-socketcan:1.7.0.10
	bouyer-socketcan-base:1.7
	pgoyette-localcount-20170107:1.7
	netbsd-7-1-RC1:1.7
	pgoyette-localcount-20161104:1.7
	netbsd-7-0-2-RELEASE:1.7
	localcount-20160914:1.7
	netbsd-7-nhusb:1.7.0.8
	netbsd-7-nhusb-base:1.7
	pgoyette-localcount-20160806:1.7
	pgoyette-localcount-20160726:1.7
	pgoyette-localcount:1.7.0.6
	pgoyette-localcount-base:1.7
	netbsd-7-0-1-RELEASE:1.7
	netbsd-7-0:1.7.0.4
	netbsd-7-0-RELEASE:1.7
	netbsd-7-0-RC3:1.7
	netbsd-7-0-RC2:1.7
	netbsd-7-0-RC1:1.7
	FILE5_22:1.1.1.5
	FILE5_20:1.1.1.5
	netbsd-6-0-6-RELEASE:1.4
	netbsd-6-1-5-RELEASE:1.4
	netbsd-7:1.7.0.2
	netbsd-7-base:1.7
	FILE5_19:1.1.1.5
	yamt-pagecache-base9:1.6
	yamt-pagecache-tag8:1.4.2.1
	netbsd-6-1-4-RELEASE:1.4
	netbsd-6-0-5-RELEASE:1.4
	tls-earlyentropy:1.6.0.2
	tls-earlyentropy-base:1.7
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.6
	riastradh-drm2-base3:1.6
	netbsd-6-1-3-RELEASE:1.4
	netbsd-6-0-4-RELEASE:1.4
	FILE5_16:1.1.1.4
	netbsd-6-1-2-RELEASE:1.4
	netbsd-6-0-3-RELEASE:1.4
	netbsd-6-1-1-RELEASE:1.4
	riastradh-drm2-base2:1.5
	riastradh-drm2-base1:1.5
	riastradh-drm2:1.5.0.2
	riastradh-drm2-base:1.5
	netbsd-6-1:1.4.0.12
	netbsd-6-0-2-RELEASE:1.4
	netbsd-6-1-RELEASE:1.4
	khorben-n900:1.5.0.6
	netbsd-6-1-RC4:1.4
	netbsd-6-1-RC3:1.4
	agc-symver:1.5.0.4
	agc-symver-base:1.5
	FILE5_14:1.1.1.3
	netbsd-6-1-RC2:1.4
	netbsd-6-1-RC1:1.4
	yamt-pagecache-base8:1.5
	FILE_5_12:1.1.1.2
	netbsd-6-0-1-RELEASE:1.4
	yamt-pagecache-base7:1.4
	matt-nb6-plus-nbase:1.4
	yamt-pagecache-base6:1.4
	netbsd-6-0:1.4.0.10
	netbsd-6-0-RELEASE:1.4
	netbsd-6-0-RC2:1.4
	tls-maxphys:1.4.0.8
	tls-maxphys-base:1.7
	matt-nb6-plus:1.4.0.6
	matt-nb6-plus-base:1.4
	netbsd-6-0-RC1:1.4
	yamt-pagecache-base5:1.4
	yamt-pagecache-base4:1.4
	FILE5_11:1.1.1.2
	netbsd-6:1.4.0.4
	netbsd-6-base:1.4
	yamt-pagecache-base3:1.4
	yamt-pagecache-base2:1.4
	yamt-pagecache:1.4.0.2
	yamt-pagecache-base:1.4
	FILE5_09:1.1.1.2
	cherry-xenmp:1.2.0.2
	cherry-xenmp-base:1.2
	FILE5_07:1.1.1.1
	bouyer-quota2-nbase:1.1.1.1
	bouyer-quota2:1.1.1.1.0.4
	bouyer-quota2-base:1.1.1.1
	matt-mips64-premerge-20101231:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	jym-xensuspend-base:1.1.1.1
	jym-xensuspend:1.1.1.1.0.2
	jym-xensuspend-nbase:1.1.1.1
	FILE5_03:1.1.1.1
	CHRISTOS:1.1.1;
locks; strict;
comment	@# @;


1.13
date	2022.09.25.00.47.27;	author christos;	state Exp;
branches;
next	1.12;
commitid	AIow45FqGYDQabVD;

1.12
date	2022.09.24.20.21.45;	author christos;	state dead;
branches;
next	1.11;
commitid	zJ5LoIcubBSIH9VD;

1.11
date	2019.12.17.02.31.05;	author christos;	state Exp;
branches;
next	1.10;
commitid	T4BTFY7rQ43kj0PB;

1.10
date	2018.10.19.00.11.48;	author christos;	state Exp;
branches;
next	1.9;
commitid	rS69r6X9WBZwavWA;

1.9
date	2018.04.15.19.45.31;	author christos;	state Exp;
branches
	1.9.2.1;
next	1.8;
commitid	PISTUVsbDjqSFzyA;

1.8
date	2017.02.10.17.53.24;	author christos;	state Exp;
branches
	1.8.10.1;
next	1.7;
commitid	bl2PZy94aycnQqFz;

1.7
date	2014.06.13.02.08.06;	author christos;	state Exp;
branches
	1.7.6.1
	1.7.10.1;
next	1.6;
commitid	4S2W0uH1Gw96TiEx;

1.6
date	2013.12.01.19.32.14;	author christos;	state Exp;
branches
	1.6.2.1;
next	1.5;
commitid	gZ22t2PQqTQYTsfx;

1.5
date	2013.01.03.23.05.35;	author christos;	state Exp;
branches;
next	1.4;

1.4
date	2011.09.25.18.18.43;	author christos;	state Exp;
branches
	1.4.2.1
	1.4.8.1;
next	1.3;

1.3
date	2011.09.16.21.06.21;	author christos;	state Exp;
branches;
next	1.2;

1.2
date	2011.05.16.00.23.20;	author christos;	state Exp;
branches;
next	1.1;

1.1
date	2009.05.08.16.35.03;	author christos;	state Exp;
branches
	1.1.1.1;
next	;

1.9.2.1
date	2019.06.10.21.44.45;	author christos;	state Exp;
branches;
next	1.9.2.2;
commitid	jtc8rnCzWiEEHGqB;

1.9.2.2
date	2020.04.08.14.04.03;	author martin;	state Exp;
branches;
next	;
commitid	Qli2aW9E74UFuA3C;

1.8.10.1
date	2018.04.22.07.20.08;	author pgoyette;	state Exp;
branches;
next	1.8.10.2;
commitid	W6xykws0Zbl4kpzA;

1.8.10.2
date	2018.10.20.06.58.19;	author pgoyette;	state Exp;
branches;
next	;
commitid	mTSoqZEZ4arHnFWA;

1.7.6.1
date	2017.03.20.06.52.19;	author pgoyette;	state Exp;
branches;
next	;
commitid	jjw7cAwgyKq7RfKz;

1.7.10.1
date	2017.04.21.16.51.23;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.6.2.1
date	2014.08.10.07.07.10;	author tls;	state Exp;
branches;
next	;
commitid	b1wUlsZGswrdGMLx;

1.4.2.1
date	2013.01.23.00.04.32;	author yamt;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	2014.05.22.15.44.59;	author yamt;	state Exp;
branches;
next	;
commitid	tYJXbWAuFvTh7yBx;

1.4.8.1
date	2013.02.25.00.26.04;	author tls;	state Exp;
branches;
next	1.4.8.2;

1.4.8.2
date	2014.08.19.23.46.46;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.1
date	2009.05.08.16.35.03;	author christos;	state Exp;
branches
	1.1.1.1.2.1;
next	1.1.1.2;

1.1.1.2
date	2011.09.16.20.37.23;	author christos;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2013.03.23.15.49.11;	author christos;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2013.12.01.19.28.13;	author christos;	state Exp;
branches;
next	1.1.1.5;
commitid	RVQIxe3FpM3lSsfx;

1.1.1.5
date	2014.06.13.01.48.19;	author christos;	state Exp;
branches;
next	1.1.1.6;
commitid	jtTYsE5FmJU6MiEx;

1.1.1.6
date	2017.02.10.17.42.56;	author christos;	state Exp;
branches;
next	1.1.1.7;
commitid	HAP3kn9Hn6ovMqFz;

1.1.1.7
date	2018.04.15.19.32.47;	author christos;	state Exp;
branches;
next	1.1.1.8;
commitid	unKSwpX2g9VqBzyA;

1.1.1.8
date	2018.10.18.23.54.09;	author christos;	state Exp;
branches;
next	1.1.1.9;
commitid	e8WctwerBeEm4vWA;

1.1.1.9
date	2019.12.17.02.23.53;	author christos;	state Exp;
branches;
next	1.1.1.10;
commitid	vqYTz60fS9PNg0PB;

1.1.1.10
date	2023.08.18.18.36.49;	author christos;	state Exp;
branches;
next	;
commitid	IX26ghc1E2S0AiBE;

1.1.1.1.2.1
date	2009.05.08.16.35.03;	author jym;	state dead;
branches;
next	1.1.1.1.2.2;

1.1.1.1.2.2
date	2009.05.13.18.51.53;	author jym;	state Exp;
branches;
next	;


desc
@@


1.13
log
@compile is needed too
@
text
@#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.

scriptversion=2018-03-07.03; # UTC

# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# This file is maintained in Automake, please report
# bugs to <bug-automake@@gnu.org> or send patches to
# <automake-patches@@gnu.org>.

nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN* | MSYS*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/* | msys/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
    if test -f "$dir/lib$lib.a"; then
      found=yes
      lib=$dir/lib$lib.a
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

case $1 in
  '')
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
     exit 1;
     ;;
  -h | --h*)
    cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]

Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.

If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.

Report bugs to <bug-automake@@gnu.org>.
EOF
    exit $?
    ;;
  -v | --v*)
    echo "compile $scriptversion"
    exit $?
    ;;
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
esac

ofile=
cfile=

for arg
do
  if test -n "$eat"; then
    eat=
  else
    case $1 in
      -o)
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
	eat=1
	case $2 in
	  *.o | *.obj)
	    ofile=$2
	    ;;
	  *)
	    set x "$@@" -o "$2"
	    shift
	    ;;
	esac
	;;
      *.c)
	cfile=$1
	set x "$@@" "$1"
	shift
	;;
      *)
	set x "$@@" "$1"
	shift
	;;
    esac
  fi
  shift
done

if test -z "$ofile" || test -z "$cfile"; then
  # If no '-o' option was seen then we might have been invoked from a
  # pattern rule where we don't need one.  That is ok -- this is a
  # normal compilation that the losing compiler can handle.  If no
  # '.c' file was seen then we are probably linking.  That is also
  # ok.
  exec "$@@"
fi

# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`

# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file.  Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
  if mkdir "$lockdir" >/dev/null 2>&1; then
    break
  fi
  sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15

# Run the compile.
"$@@"
ret=$?

if test -f "$cofile"; then
  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi

rmdir "$lockdir"
exit $ret

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
@


1.12
log
@merge changes between 5.40 and 5.43
@
text
@d6 1
a6 1
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
d56 1
a56 1
	  CYGWIN*)
d70 1
a70 1
	cygwin/*)
@


1.11
log
@merge conflicts
@
text
@@


1.10
log
@Merge conflicts
@
text
@d4 1
a4 1
scriptversion=2012-10-14.11; # UTC
d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
d20 1
a20 1
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
d258 2
a259 1
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
d343 1
a343 1
# eval: (add-hook 'write-file-hooks 'time-stamp)
d346 1
a346 1
# time-stamp-time-zone: "UTC"
@


1.9
log
@merge conflicts for file-5.33
@
text
@d6 1
a6 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
@


1.9.2.1
log
@Sync with HEAD
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.9.2.2
log
@Merge changes from current as of 20200406
@
text
@d4 1
a4 1
scriptversion=2018-03-07.03; # UTC
d6 1
a6 1
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
d20 1
a20 1
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
d258 1
a258 2
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
d342 1
a342 1
# eval: (add-hook 'before-save-hook 'time-stamp)
d345 1
a345 1
# time-stamp-time-zone: "UTC0"
@


1.8
log
@merge conflicts
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.8.10.1
log
@Sync with HEAD
@
text
@d6 1
a6 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
@


1.8.10.2
log
@Sync with head
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.7
log
@merge conflicts
@
text
@d6 1
a6 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
@


1.7.10.1
log
@Sync with HEAD
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.7.6.1
log
@Sync with HEAD
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.6
log
@merge conflicts
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand `-c -o'.
d4 1
a4 1
scriptversion=2009-10-06.20; # UTC
d6 1
a6 2
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
# Foundation, Inc.
d31 203
d236 1
a236 1
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
d243 2
a244 2
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
d248 1
a248 1
right script to run: please start by reading the file `INSTALL'.
d258 3
a264 1
eat=
d273 2
a274 2
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
d301 1
a301 1
  # If no `-o' option was seen then we might have been invoked from a
d304 1
a304 1
  # `.c' file was seen then we are probably linking.  That is also
d313 1
a313 1
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
@


1.6.2.1
log
@Rebase.
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-10-14.11; # UTC
d6 2
a7 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
a31 203
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
    if test -f "$dir/lib$lib.a"; then
      found=yes
      lib=$dir/lib$lib.a
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
@


1.5
log
@merge changes
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-03-05.13; # UTC
d6 2
a7 1
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
a31 198
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
@


1.4
log
@run autoreconf -f -i to disable maintainer mode.
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand `-c -o'.
d4 1
a4 1
scriptversion=2009-04-28.21; # UTC
d6 1
a6 2
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
# Foundation, Inc.
d31 198
d231 1
a231 1
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
d238 2
a239 2
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
d243 1
a243 1
right script to run: please start by reading the file `INSTALL'.
d253 3
a259 1
eat=
d268 2
a269 2
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
d296 1
a296 1
  # If no `-o' option was seen then we might have been invoked from a
d299 1
a299 1
  # `.c' file was seen then we are probably linking.  That is also
d308 1
a308 1
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
d326 1
a326 1
  mv "$cofile" "$ofile"
d328 1
a328 1
  mv "${cofile}bj" "$ofile"
@


1.4.8.1
log
@resync with head
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-03-05.13; # UTC
d6 2
a7 1
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
a31 198
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
d127 1
a127 1
  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
d129 1
a129 1
  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
@


1.4.8.2
log
@Rebase to HEAD as of a few days ago.
@
text
@d4 1
a4 1
scriptversion=2012-10-14.11; # UTC
d6 1
a6 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
a114 5
    if test -f "$dir/lib$lib.a"; then
      found=yes
      lib=$dir/lib$lib.a
      break
    fi
@


1.4.2.1
log
@sync with head
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-03-05.13; # UTC
d6 2
a7 1
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
a31 198
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
d127 1
a127 1
  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
d129 1
a129 1
  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
@


1.4.2.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand `-c -o'.
d4 1
a4 1
scriptversion=2009-10-06.20; # UTC
d6 1
a6 2
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
# Foundation, Inc.
d31 198
d231 1
a231 1
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
d238 2
a239 2
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
d243 1
a243 1
right script to run: please start by reading the file `INSTALL'.
d253 3
a259 1
eat=
d268 2
a269 2
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
d296 1
a296 1
  # If no `-o' option was seen then we might have been invoked from a
d299 1
a299 1
  # `.c' file was seen then we are probably linking.  That is also
d308 1
a308 1
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
@


1.3
log
@merge changes
@
text
@d4 1
a4 1
scriptversion=2009-10-06.20; # UTC
d127 1
a127 1
  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
d129 1
a129 1
  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
@


1.2
log
@- turn on maintainer mode
- disable rules on doc
- regen
@
text
@d4 1
a4 1
scriptversion=2009-04-28.21; # UTC
d127 1
a127 1
  mv "$cofile" "$ofile"
d129 1
a129 1
  mv "${cofile}bj" "$ofile"
@


1.1
log
@Initial revision
@
text
@d4 1
a4 1
scriptversion=2005-05-14.22
d6 2
a7 1
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
d21 1
a21 2
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
d106 1
a106 1
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
d109 1
a109 1
# Note: use `[/.-]' here to ensure that we don't use the same name
d112 1
a112 1
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
d141 2
a142 1
# time-stamp-end: "$"
@


1.1.1.1
log
@from ftp.astron.com
@
text
@@


1.1.1.2
log
@from ftp.astron.com:
- elf seeking fixes
- improvements in cdf parsing
- waitpid only for our child
- magic fixes and additions
@
text
@d4 1
a4 1
scriptversion=2009-10-06.20; # UTC
d6 1
a6 2
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
# Foundation, Inc.
d20 2
a21 1
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
d106 1
a106 1
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
d109 1
a109 1
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
d112 1
a112 1
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
d127 1
a127 1
  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
d129 1
a129 1
  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
d141 1
a141 2
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
@


1.1.1.3
log
@import file-5.14
changes are "name" + "use" keyword features, bug fixes
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-03-05.13; # UTC
d6 2
a7 1
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
a31 198
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
@


1.1.1.4
log
@from ftp.astron.com, this is a bug fix release:
       * always leave magic file loaded, don't unload for magic_check, etc.
       * fix default encoding to binary instead of unknown which broke recently
       * handle empty and one byte files, less specially so that
         --mime-encoding does not break completely.
       * fix erroneous non-zero exit code from non-existant file and message
       * add CDF MSI file detection (Guy Helmer)
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand `-c -o'.
d4 1
a4 1
scriptversion=2009-10-06.20; # UTC
d6 1
a6 2
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
# Foundation, Inc.
d31 198
d231 1
a231 1
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
d238 2
a239 2
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
d243 1
a243 1
right script to run: please start by reading the file `INSTALL'.
d253 3
a259 1
eat=
d268 2
a269 2
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
d296 1
a296 1
  # If no `-o' option was seen then we might have been invoked from a
d299 1
a299 1
  # `.c' file was seen then we are probably linking.  That is also
d308 1
a308 1
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
@


1.1.1.5
log
@import file-5.19

2014-06-09   9:04  Christos Zoulas <christos@@zoulas.com>

	* Misc buffer overruns and missing buffer size tests in cdf parsing
	  (Francisco Alonso, Jan Kaluza)

2014-06-02  14:50  Christos Zoulas <christos@@zoulas.com>

	* Enforce limit of 8K on regex searches that have no limits
	* Allow the l modifier for regex to mean line count. Default
	  to byte count. If line count is specified, assume a max
	  of 80 characters per line to limit the byte count.
	* Don't allow conversions to be used for dates, allowing
	  the mask field to be used as an offset.

2014-05-30  12:51  Christos Zoulas <christos@@zoulas.com>

	* Make the range operator limit the length of the
	  regex search.

2014-05-14  19:23  Christos Zoulas <christos@@zoulas.com>

	* PR/347: Windows fixes
	* PR/352: Hangul word processor recognition
	* PR/354: Encoding irregularities in text files

2014-05-06  6:12  Christos Zoulas <christos@@zoulas.com>

	* Fix uninitialized title in CDF files (Jan Kaluza)

2014-05-04  14:55  Christos Zoulas <christos@@zoulas.com>

	* PR/351: Fix compilation of empty files

2014-04-30  17:39  Christos Zoulas <christos@@zoulas.com>

	* Fix integer formats: We don't specify 'l' or
	  'h' and 'hh' specifiers anymore, only 'll' for
	  quads and nothing for the rest. This is so that
	  magic writing is simpler.

2014-04-01  15:25  Christos Zoulas <christos@@zoulas.com>

	* PR/341: Jan Kaluza, fix memory leak
	* PR/342: Jan Kaluza, fix out of bounds read

2014-03-28  15:25  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with long formats not matching fmtcheck
@
text
@d2 1
a2 1
# Wrapper for compilers which do not understand '-c -o'.
d4 1
a4 1
scriptversion=2012-10-14.11; # UTC
d6 2
a7 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
a31 203
nl='
'

# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" ""	$nl"

file_conv=

# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
  file=$1
  case $file in
    / | /[!/]*) # absolute file, and not a UNC file
      if test -z "$file_conv"; then
	# lazily determine how to convert abs files
	case `uname -s` in
	  MINGW*)
	    file_conv=mingw
	    ;;
	  CYGWIN*)
	    file_conv=cygwin
	    ;;
	  *)
	    file_conv=wine
	    ;;
	esac
      fi
      case $file_conv/,$2, in
	*,$file_conv,*)
	  ;;
	mingw/*)
	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
	  ;;
	cygwin/*)
	  file=`cygpath -m "$file" || echo "$file"`
	  ;;
	wine/*)
	  file=`winepath -w "$file" || echo "$file"`
	  ;;
      esac
      ;;
  esac
}

# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
  func_file_conv "$1"
  if test -z "$lib_path"; then
    lib_path=$file
  else
    lib_path="$lib_path;$file"
  fi
  linker_opts="$linker_opts -LIBPATH:$file"
}

# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
  lib=$1
  found=no
  save_IFS=$IFS
  IFS=';'
  for dir in $lib_path $LIB
  do
    IFS=$save_IFS
    if $shared && test -f "$dir/$lib.dll.lib"; then
      found=yes
      lib=$dir/$lib.dll.lib
      break
    fi
    if test -f "$dir/$lib.lib"; then
      found=yes
      lib=$dir/$lib.lib
      break
    fi
    if test -f "$dir/lib$lib.a"; then
      found=yes
      lib=$dir/lib$lib.a
      break
    fi
  done
  IFS=$save_IFS

  if test "$found" != yes; then
    lib=$lib.lib
  fi
}

# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
  # Assume a capable shell
  lib_path=
  shared=:
  linker_opts=
  for arg
  do
    if test -n "$eat"; then
      eat=
    else
      case $1 in
	-o)
	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
	  eat=1
	  case $2 in
	    *.o | *.[oO][bB][jJ])
	      func_file_conv "$2"
	      set x "$@@" -Fo"$file"
	      shift
	      ;;
	    *)
	      func_file_conv "$2"
	      set x "$@@" -Fe"$file"
	      shift
	      ;;
	  esac
	  ;;
	-I)
	  eat=1
	  func_file_conv "$2" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-I*)
	  func_file_conv "${1#-I}" mingw
	  set x "$@@" -I"$file"
	  shift
	  ;;
	-l)
	  eat=1
	  func_cl_dashl "$2"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-l*)
	  func_cl_dashl "${1#-l}"
	  set x "$@@" "$lib"
	  shift
	  ;;
	-L)
	  eat=1
	  func_cl_dashL "$2"
	  ;;
	-L*)
	  func_cl_dashL "${1#-L}"
	  ;;
	-static)
	  shared=false
	  ;;
	-Wl,*)
	  arg=${1#-Wl,}
	  save_ifs="$IFS"; IFS=','
	  for flag in $arg; do
	    IFS="$save_ifs"
	    linker_opts="$linker_opts $flag"
	  done
	  IFS="$save_ifs"
	  ;;
	-Xlinker)
	  eat=1
	  linker_opts="$linker_opts $2"
	  ;;
	-*)
	  set x "$@@" "$1"
	  shift
	  ;;
	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
	  func_file_conv "$1"
	  set x "$@@" -Tp"$file"
	  shift
	  ;;
	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
	  func_file_conv "$1" mingw
	  set x "$@@" "$file"
	  shift
	  ;;
	*)
	  set x "$@@" "$1"
	  shift
	  ;;
      esac
    fi
    shift
  done
  if test -n "$linker_opts"; then
    linker_opts="-link$linker_opts"
  fi
  exec "$@@" $linker_opts
  exit 1
}

eat=

d34 1
a34 1
     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
d41 2
a42 2
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
d46 1
a46 1
right script to run: please start by reading the file 'INSTALL'.
a55 3
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
    func_cl_wrapper "$@@"      # Doesn't return...
    ;;
d60 1
d69 2
a70 2
	# configure might choose to run compile as 'compile cc -o foo foo.c'.
	# So we strip '-o arg' only if arg is an object.
d97 1
a97 1
  # If no '-o' option was seen then we might have been invoked from a
d100 1
a100 1
  # '.c' file was seen then we are probably linking.  That is also
d109 1
a109 1
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
@


1.1.1.6
log
@2017-02-10  12:24  Christos Zoulas <christos@@zoulas.com>

	* release 5.30

2017-02-07  23:27  Christos Zoulas <christos@@zoulas.com>

	* If we exceeded the offset in a search return no match
	  (Christoph Biedl)
	* Be more lenient on corrupt CDF files (Christoph Biedl)

2017-02-04  16:46  Christos Zoulas <christos@@zoulas.com>

	* pacify ubsan sign extension (oss-fuzz/524)

2017-02-01  12:42  Christos Zoulas <christos@@zoulas.com>

	* off by one in cdf parsing (PR/593)
	* report debugging sections in elf (PR/591)

2016-11-06  10:52  Christos Zoulas <christos@@zoulas.com>

	* Allow @@@@@@ in extensions
	* Add missing overflow check in der magic (Jonas Wagner)

2016-10-25  10:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.29

2016-10-24  11:20  Christos Zoulas <christos@@zoulas.com>

	* der getlength overflow (Jonas Wagner)
	* multiple magic file load failure (Christoph Biedl)

2016-10-17  11:26  Christos Zoulas <christos@@zoulas.com>

	* CDF parsing improvements (Guy Helmer)

2016-07-20   7:26  Christos Zoulas <christos@@zoulas.com>

	* Add support for signed indirect offsets

2016-07-18   7:41  Christos Zoulas <christos@@zoulas.com>

	* cat /dev/null | file - should print empty (Christoph Biedl)

2016-07-05  15:20  Christos Zoulas <christos@@zoulas.com>

	* Bump string size from 64 to 96.

2016-06-13  20:20  Christos Zoulas <christos@@zoulas.com>

	* PR/556: Fix separators on annotations.

2016-06-13  19:40  Christos Zoulas <christos@@zoulas.com>

	* release 5.28
	* fix leak on allocation failure

2016-06-01   1:20  Christos Zoulas <christos@@zoulas.com>

	* PR/555: Avoid overflow for offset > nbytes
	* PR/550: Segv on DER parsing:
	    - use the correct variable for length
	    - set offset to 0 on failure.

2016-05-13  12:00  Christos Zoulas <christos@@zoulas.com>

	* release 5.27

2016-04-18   9:35  Christos Zoulas <christos@@zoulas.com>

	* Errors comparing DER entries or computing offsets
	  are just indications of malformed non-DER files.
	  Don't print them.
	* Offset comparison was off-by-one.
	* Fix compression code (Werner Fink)
	* Put new bytes constant in the right file (not the generated one)

2016-04-16  18:34  Christos Zoulas <christos@@zoulas.com>

	* release 5.26

2016-03-31  13:50  Christos Zoulas <christos@@zoulas.com>

	* make the number of bytes read from files configurable.

2016-03-21  13:40  Christos Zoulas <christos@@zoulas.com>

	* Add bounds checks for DER code (discovered by Thomas Jarosch)
	* Change indirect recursion limit to indirect use count and
	  bump from 15 to 50 to prevent abuse.

2016-03-13  20:39  Christos Zoulas <christos@@zoulas.com>

	* Add -00 which prints filename\0description\0

2016-03-01  13:28  Christos Zoulas <christos@@zoulas.com>

	* Fix ID3 indirect parsing

2016-01-19  10:18  Christos Zoulas <christos@@zoulas.com>

	* add DER parsing capability

2015-11-13  10:35  Christos Zoulas <christos@@zoulas.com>

	* provide dprintf(3) for the OS's that don't have it.

2015-11-11  16:25  Christos Zoulas <christos@@zoulas.com>

	* redo the compression code report decompression errors

2015-11-10  23:25  Christos Zoulas <christos@@zoulas.com>

	* REG_STARTEND code is not working as expected, delete it.

2015-11-09  16:05  Christos Zoulas <christos@@zoulas.com>

	* Add zlib support if we have it.

2015-11-05  11:22  Christos Zoulas <christos@@zoulas.com>

	* PR/492: compression forking was broken with magic_buffer.

2015-09-16   9:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.25

2015-09-11  13:25  Christos Zoulas <christos@@zoulas.com>

	* add a limit to the length of regex searches

2015-09-08   9:50  Christos Zoulas <christos@@zoulas.com>

	* fix problems with --parameter (Christoph Biedl)

2015-07-11  10:35  Christos Zoulas <christos@@zoulas.com>

	* Windows fixes PR/466 (Jason Hood)

2015-07-09  10:35  Christos Zoulas <christos@@zoulas.com>

	* release 5.24

2015-06-11   8:52  Christos Zoulas <christos@@zoulas.com>

	* redo long option encoding to fix off-by-one in 5.23

2015-06-10  13:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.23

2015-06-09  16:10  Christos Zoulas <christos@@zoulas.com>

	* Fix issue with regex range for magic with offset
	* Always return true from mget with USE (success to mget not match
	  indication). Fixes mime evaluation after USE magic
	* PR/459: Don't insert magic entries to the list if there are parsing
	  errors for them.

2015-06-03  16:00  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Add utf-7 encoding

2015-06-03  14:30  Christos Zoulas <christos@@zoulas.com>

	* PR/455: Implement -Z, look inside, but don't report on compression
	* PR/454: Fix allocation error on bad magic.

2015-05-29  10:30  Christos Zoulas <christos@@zoulas.com>

	* handle MAGIC_CONTINUE everywhere, not just in softmagic

2015-05-21  14:30  Christos Zoulas <christos@@zoulas.com>

	* don't print descriptions for NAME types when mime.

2015-04-09  15:59  Christos Zoulas <christos@@zoulas.com>

	* Add --extension to list the known extensions for this file type
	  Idea by Andrew J Roazen

2015-02-14  12:23  Christos Zoulas <christos@@zoulas.com>

	* Bump file search buffer size to 1M.

2015-01-09  14:35  Christos Zoulas <christos@@zoulas.com>

	* Fix multiple issues with date formats reported by Christoph Biedl:
		- T_LOCAL meaning was reversed
		- Arithmetic did not work
	  Also stop adjusting daylight savings for gmt printing.

2015-01-05  13:00  Christos Zoulas <christos@@zoulas.com>

	* PR/411: Fix memory corruption from corrupt cdf file.
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.1.1.7
log
@2018-04-15  14:52  Christos Zoulas <christos@@zoulas.com>

	* release 5.33

2018-02-24  14:50  Christos Zoulas <christos@@zoulas.com>

	* extend the support for ${x?:} expansions for magic descriptions

2018-02-21  16:25  Christos Zoulas <christos@@zoulas.com>

	* add support for ${x?:} in mime types to handle
	  pie binaries.

2017-11-03   9:23  Christos Zoulas <christos@@zoulas.com>

	* add support for negative offsets (offsets from the end of file)

2017-09-26   8:22  Christos Zoulas <christos@@zoulas.com>

	* close the file on error when writing magic (Steve Grubb)

2017-09-24  12:02  Christos Zoulas <christos@@zoulas.com>

	* seccomp support (Paul Moore)

2017-09-02  11:53  Christos Zoulas <christos@@zoulas.com>

	* release 5.32

2017-08-28  16:37  Christos Zoulas <christos@@zoulas.com>

	* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)

2017-08-27  03:55  Christos Zoulas <christos@@zoulas.com>

	* Fix always true condition (Thomas Jarosch)

2017-05-24  17:30  Christos Zoulas <christos@@zoulas.com>

	* pickier parsing of numeric values in magic files.

2017-05-23  17:55  Christos Zoulas <christos@@zoulas.com>

	* PR/615 add magic_getflags()
@
text
@d6 1
a6 1
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
@


1.1.1.8
log
@2018-10-18  19:32  Christos Zoulas <christos@@zoulas.com>

	* release 5.35

2018-09-10  20:38  Christos Zoulas <christos@@zoulas.com>

	* Add FreeBSD ELF core file support (John Baldwin)

2018-08-20  18:40  Christos Zoulas <christos@@zoulas.com>

	* PR/30: Allow all parameter values to be set (don't treat 0 specially)
	* handle default annotations on the softmagic match instead at the
	  end.

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/23: Recognize JSON files

2018-07-25  10:17  Christos Zoulas <christos@@zoulas.com>

	* PR/18: file --mime-encoding should not print mime-type

2018-07-25   8:50  Christos Zoulas <christos@@zoulas.com>

	* release 5.34

2018-06-22  16:38  Christos Zoulas <christos@@zoulas.com>

	* Add Quad indirect offsets

2018-05-24  14:10  Christos Zoulas <christos@@zoulas.com>

	* Enable parsing of ELF dynamic sections to handle PIE better
@
text
@d6 1
a6 1
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
@


1.1.1.9
log
@Import 5.38:
	- Always accept -S (no sandbox) even if we don't support sandboxing
	- More syscalls elided for sandboxiing
	- For ELF dynamic means having an interpreter not just PT_DYNAMIC
	- Check for large ELF session header offset
	- When saving and restoring a locale, keep the locale name in our
	  own storage.
	- Add a flag to disable CSV file detection.
	- Don't pass NULL/0 to memset to appease sanitizers.
	- Avoid spurious prints when looks for extensions or apple strings
	  in fsmagic.
	- Add builtin decompressors for xz and and bzip.
	- Add a limit for the number of CDF elements.
	- More checks for overflow in CDF.
@
text
@d4 1
a4 1
scriptversion=2018-03-07.03; # UTC
d6 1
a6 1
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
d20 1
a20 1
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
d258 1
a258 2
  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
d342 1
a342 1
# eval: (add-hook 'before-save-hook 'time-stamp)
d345 1
a345 1
# time-stamp-time-zone: "UTC0"
@


1.1.1.10
log
@Update to file-5.45 (Last was file-5.44)

2023-07-27  15:45  Christos Zoulas <christos@@zoulas.com>

	* release 5.45

2023-07-17  11:53  Christos Zoulas <christos@@zoulas.com>

	* PR/465: psrok1: Avoid muslc asctime_r crash

2023-05-21  13:05  Christos Zoulas <christos@@zoulas.com>

	* add SIMH tape format support

2023-02-09  12:50  Christos Zoulas <christos@@zoulas.com>

	* bump the max size of the elf section notes to be read to 128K
	  and make it configurable

2023-01-08   1:08  Christos Zoulas <christos@@zoulas.com>

	* PR/415: Fix decompression with program returning empty

2022-12-26   1:47  Christos Zoulas <christos@@zoulas.com>

	* PR/408: fix -p with seccomp
	* PR/412: fix MinGW compilation
@
text
@d6 1
a6 1
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
d56 1
a56 1
	  CYGWIN* | MSYS*)
d70 1
a70 1
	cygwin/* | msys/*)
@


1.1.1.1.2.1
log
@file compile was added on branch jym-xensuspend on 2009-05-13 18:51:53 +0000
@
text
@d1 142
@


1.1.1.1.2.2
log
@Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@a0 142
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.

scriptversion=2005-05-14.22

# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# This file is maintained in Automake, please report
# bugs to <bug-automake@@gnu.org> or send patches to
# <automake-patches@@gnu.org>.

case $1 in
  '')
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     exit 1;
     ;;
  -h | --h*)
    cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]

Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.

If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.

Report bugs to <bug-automake@@gnu.org>.
EOF
    exit $?
    ;;
  -v | --v*)
    echo "compile $scriptversion"
    exit $?
    ;;
esac

ofile=
cfile=
eat=

for arg
do
  if test -n "$eat"; then
    eat=
  else
    case $1 in
      -o)
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
	eat=1
	case $2 in
	  *.o | *.obj)
	    ofile=$2
	    ;;
	  *)
	    set x "$@@" -o "$2"
	    shift
	    ;;
	esac
	;;
      *.c)
	cfile=$1
	set x "$@@" "$1"
	shift
	;;
      *)
	set x "$@@" "$1"
	shift
	;;
    esac
  fi
  shift
done

if test -z "$ofile" || test -z "$cfile"; then
  # If no `-o' option was seen then we might have been invoked from a
  # pattern rule where we don't need one.  That is ok -- this is a
  # normal compilation that the losing compiler can handle.  If no
  # `.c' file was seen then we are probably linking.  That is also
  # ok.
  exec "$@@"
fi

# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`

# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file.  Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
  if mkdir "$lockdir" >/dev/null 2>&1; then
    break
  fi
  sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15

# Run the compile.
"$@@"
ret=$?

if test -f "$cofile"; then
  mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
  mv "${cofile}bj" "$ofile"
fi

rmdir "$lockdir"
exit $ret

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
@


