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