annotate src/libsamplerate-0.1.8/Cfg/compile @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents 545efbb81310
children
rev   line source
cannam@85 1 #! /bin/sh
cannam@85 2 # Wrapper for compilers which do not understand `-c -o'.
cannam@85 3
cannam@85 4 scriptversion=2009-04-28.21; # UTC
cannam@85 5
cannam@85 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
cannam@85 7 # Foundation, Inc.
cannam@85 8 # Written by Tom Tromey <tromey@cygnus.com>.
cannam@85 9 #
cannam@85 10 # This program is free software; you can redistribute it and/or modify
cannam@85 11 # it under the terms of the GNU General Public License as published by
cannam@85 12 # the Free Software Foundation; either version 2, or (at your option)
cannam@85 13 # any later version.
cannam@85 14 #
cannam@85 15 # This program is distributed in the hope that it will be useful,
cannam@85 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@85 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@85 18 # GNU General Public License for more details.
cannam@85 19 #
cannam@85 20 # You should have received a copy of the GNU General Public License
cannam@85 21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
cannam@85 22
cannam@85 23 # As a special exception to the GNU General Public License, if you
cannam@85 24 # distribute this file as part of a program that contains a
cannam@85 25 # configuration script generated by Autoconf, you may include it under
cannam@85 26 # the same distribution terms that you use for the rest of that program.
cannam@85 27
cannam@85 28 # This file is maintained in Automake, please report
cannam@85 29 # bugs to <bug-automake@gnu.org> or send patches to
cannam@85 30 # <automake-patches@gnu.org>.
cannam@85 31
cannam@85 32 case $1 in
cannam@85 33 '')
cannam@85 34 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
cannam@85 35 exit 1;
cannam@85 36 ;;
cannam@85 37 -h | --h*)
cannam@85 38 cat <<\EOF
cannam@85 39 Usage: compile [--help] [--version] PROGRAM [ARGS]
cannam@85 40
cannam@85 41 Wrapper for compilers which do not understand `-c -o'.
cannam@85 42 Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
cannam@85 43 arguments, and rename the output as expected.
cannam@85 44
cannam@85 45 If you are trying to build a whole package this is not the
cannam@85 46 right script to run: please start by reading the file `INSTALL'.
cannam@85 47
cannam@85 48 Report bugs to <bug-automake@gnu.org>.
cannam@85 49 EOF
cannam@85 50 exit $?
cannam@85 51 ;;
cannam@85 52 -v | --v*)
cannam@85 53 echo "compile $scriptversion"
cannam@85 54 exit $?
cannam@85 55 ;;
cannam@85 56 esac
cannam@85 57
cannam@85 58 ofile=
cannam@85 59 cfile=
cannam@85 60 eat=
cannam@85 61
cannam@85 62 for arg
cannam@85 63 do
cannam@85 64 if test -n "$eat"; then
cannam@85 65 eat=
cannam@85 66 else
cannam@85 67 case $1 in
cannam@85 68 -o)
cannam@85 69 # configure might choose to run compile as `compile cc -o foo foo.c'.
cannam@85 70 # So we strip `-o arg' only if arg is an object.
cannam@85 71 eat=1
cannam@85 72 case $2 in
cannam@85 73 *.o | *.obj)
cannam@85 74 ofile=$2
cannam@85 75 ;;
cannam@85 76 *)
cannam@85 77 set x "$@" -o "$2"
cannam@85 78 shift
cannam@85 79 ;;
cannam@85 80 esac
cannam@85 81 ;;
cannam@85 82 *.c)
cannam@85 83 cfile=$1
cannam@85 84 set x "$@" "$1"
cannam@85 85 shift
cannam@85 86 ;;
cannam@85 87 *)
cannam@85 88 set x "$@" "$1"
cannam@85 89 shift
cannam@85 90 ;;
cannam@85 91 esac
cannam@85 92 fi
cannam@85 93 shift
cannam@85 94 done
cannam@85 95
cannam@85 96 if test -z "$ofile" || test -z "$cfile"; then
cannam@85 97 # If no `-o' option was seen then we might have been invoked from a
cannam@85 98 # pattern rule where we don't need one. That is ok -- this is a
cannam@85 99 # normal compilation that the losing compiler can handle. If no
cannam@85 100 # `.c' file was seen then we are probably linking. That is also
cannam@85 101 # ok.
cannam@85 102 exec "$@"
cannam@85 103 fi
cannam@85 104
cannam@85 105 # Name of file we expect compiler to create.
cannam@85 106 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
cannam@85 107
cannam@85 108 # Create the lock directory.
cannam@85 109 # Note: use `[/\\:.-]' here to ensure that we don't use the same name
cannam@85 110 # that we are using for the .o file. Also, base the name on the expected
cannam@85 111 # object file name, since that is what matters with a parallel build.
cannam@85 112 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
cannam@85 113 while true; do
cannam@85 114 if mkdir "$lockdir" >/dev/null 2>&1; then
cannam@85 115 break
cannam@85 116 fi
cannam@85 117 sleep 1
cannam@85 118 done
cannam@85 119 # FIXME: race condition here if user kills between mkdir and trap.
cannam@85 120 trap "rmdir '$lockdir'; exit 1" 1 2 15
cannam@85 121
cannam@85 122 # Run the compile.
cannam@85 123 "$@"
cannam@85 124 ret=$?
cannam@85 125
cannam@85 126 if test -f "$cofile"; then
cannam@85 127 mv "$cofile" "$ofile"
cannam@85 128 elif test -f "${cofile}bj"; then
cannam@85 129 mv "${cofile}bj" "$ofile"
cannam@85 130 fi
cannam@85 131
cannam@85 132 rmdir "$lockdir"
cannam@85 133 exit $ret
cannam@85 134
cannam@85 135 # Local Variables:
cannam@85 136 # mode: shell-script
cannam@85 137 # sh-indentation: 2
cannam@85 138 # eval: (add-hook 'write-file-hooks 'time-stamp)
cannam@85 139 # time-stamp-start: "scriptversion="
cannam@85 140 # time-stamp-format: "%:y-%02m-%02d.%02H"
cannam@85 141 # time-stamp-time-zone: "UTC"
cannam@85 142 # time-stamp-end: "; # UTC"
cannam@85 143 # End: