annotate src/fftw-3.3.8/compile @ 84:08ae793730bd

Add null config files
author Chris Cannam
date Mon, 02 Mar 2020 14:03:47 +0000
parents d0c2a83c1364
children
rev   line source
Chris@82 1 #! /bin/sh
Chris@82 2 # Wrapper for compilers which do not understand '-c -o'.
Chris@82 3
Chris@82 4 scriptversion=2012-10-14.11; # UTC
Chris@82 5
Chris@82 6 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
Chris@82 7 # Written by Tom Tromey <tromey@cygnus.com>.
Chris@82 8 #
Chris@82 9 # This program is free software; you can redistribute it and/or modify
Chris@82 10 # it under the terms of the GNU General Public License as published by
Chris@82 11 # the Free Software Foundation; either version 2, or (at your option)
Chris@82 12 # any later version.
Chris@82 13 #
Chris@82 14 # This program is distributed in the hope that it will be useful,
Chris@82 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@82 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@82 17 # GNU General Public License for more details.
Chris@82 18 #
Chris@82 19 # You should have received a copy of the GNU General Public License
Chris@82 20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
Chris@82 21
Chris@82 22 # As a special exception to the GNU General Public License, if you
Chris@82 23 # distribute this file as part of a program that contains a
Chris@82 24 # configuration script generated by Autoconf, you may include it under
Chris@82 25 # the same distribution terms that you use for the rest of that program.
Chris@82 26
Chris@82 27 # This file is maintained in Automake, please report
Chris@82 28 # bugs to <bug-automake@gnu.org> or send patches to
Chris@82 29 # <automake-patches@gnu.org>.
Chris@82 30
Chris@82 31 nl='
Chris@82 32 '
Chris@82 33
Chris@82 34 # We need space, tab and new line, in precisely that order. Quoting is
Chris@82 35 # there to prevent tools from complaining about whitespace usage.
Chris@82 36 IFS=" "" $nl"
Chris@82 37
Chris@82 38 file_conv=
Chris@82 39
Chris@82 40 # func_file_conv build_file lazy
Chris@82 41 # Convert a $build file to $host form and store it in $file
Chris@82 42 # Currently only supports Windows hosts. If the determined conversion
Chris@82 43 # type is listed in (the comma separated) LAZY, no conversion will
Chris@82 44 # take place.
Chris@82 45 func_file_conv ()
Chris@82 46 {
Chris@82 47 file=$1
Chris@82 48 case $file in
Chris@82 49 / | /[!/]*) # absolute file, and not a UNC file
Chris@82 50 if test -z "$file_conv"; then
Chris@82 51 # lazily determine how to convert abs files
Chris@82 52 case `uname -s` in
Chris@82 53 MINGW*)
Chris@82 54 file_conv=mingw
Chris@82 55 ;;
Chris@82 56 CYGWIN*)
Chris@82 57 file_conv=cygwin
Chris@82 58 ;;
Chris@82 59 *)
Chris@82 60 file_conv=wine
Chris@82 61 ;;
Chris@82 62 esac
Chris@82 63 fi
Chris@82 64 case $file_conv/,$2, in
Chris@82 65 *,$file_conv,*)
Chris@82 66 ;;
Chris@82 67 mingw/*)
Chris@82 68 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
Chris@82 69 ;;
Chris@82 70 cygwin/*)
Chris@82 71 file=`cygpath -m "$file" || echo "$file"`
Chris@82 72 ;;
Chris@82 73 wine/*)
Chris@82 74 file=`winepath -w "$file" || echo "$file"`
Chris@82 75 ;;
Chris@82 76 esac
Chris@82 77 ;;
Chris@82 78 esac
Chris@82 79 }
Chris@82 80
Chris@82 81 # func_cl_dashL linkdir
Chris@82 82 # Make cl look for libraries in LINKDIR
Chris@82 83 func_cl_dashL ()
Chris@82 84 {
Chris@82 85 func_file_conv "$1"
Chris@82 86 if test -z "$lib_path"; then
Chris@82 87 lib_path=$file
Chris@82 88 else
Chris@82 89 lib_path="$lib_path;$file"
Chris@82 90 fi
Chris@82 91 linker_opts="$linker_opts -LIBPATH:$file"
Chris@82 92 }
Chris@82 93
Chris@82 94 # func_cl_dashl library
Chris@82 95 # Do a library search-path lookup for cl
Chris@82 96 func_cl_dashl ()
Chris@82 97 {
Chris@82 98 lib=$1
Chris@82 99 found=no
Chris@82 100 save_IFS=$IFS
Chris@82 101 IFS=';'
Chris@82 102 for dir in $lib_path $LIB
Chris@82 103 do
Chris@82 104 IFS=$save_IFS
Chris@82 105 if $shared && test -f "$dir/$lib.dll.lib"; then
Chris@82 106 found=yes
Chris@82 107 lib=$dir/$lib.dll.lib
Chris@82 108 break
Chris@82 109 fi
Chris@82 110 if test -f "$dir/$lib.lib"; then
Chris@82 111 found=yes
Chris@82 112 lib=$dir/$lib.lib
Chris@82 113 break
Chris@82 114 fi
Chris@82 115 if test -f "$dir/lib$lib.a"; then
Chris@82 116 found=yes
Chris@82 117 lib=$dir/lib$lib.a
Chris@82 118 break
Chris@82 119 fi
Chris@82 120 done
Chris@82 121 IFS=$save_IFS
Chris@82 122
Chris@82 123 if test "$found" != yes; then
Chris@82 124 lib=$lib.lib
Chris@82 125 fi
Chris@82 126 }
Chris@82 127
Chris@82 128 # func_cl_wrapper cl arg...
Chris@82 129 # Adjust compile command to suit cl
Chris@82 130 func_cl_wrapper ()
Chris@82 131 {
Chris@82 132 # Assume a capable shell
Chris@82 133 lib_path=
Chris@82 134 shared=:
Chris@82 135 linker_opts=
Chris@82 136 for arg
Chris@82 137 do
Chris@82 138 if test -n "$eat"; then
Chris@82 139 eat=
Chris@82 140 else
Chris@82 141 case $1 in
Chris@82 142 -o)
Chris@82 143 # configure might choose to run compile as 'compile cc -o foo foo.c'.
Chris@82 144 eat=1
Chris@82 145 case $2 in
Chris@82 146 *.o | *.[oO][bB][jJ])
Chris@82 147 func_file_conv "$2"
Chris@82 148 set x "$@" -Fo"$file"
Chris@82 149 shift
Chris@82 150 ;;
Chris@82 151 *)
Chris@82 152 func_file_conv "$2"
Chris@82 153 set x "$@" -Fe"$file"
Chris@82 154 shift
Chris@82 155 ;;
Chris@82 156 esac
Chris@82 157 ;;
Chris@82 158 -I)
Chris@82 159 eat=1
Chris@82 160 func_file_conv "$2" mingw
Chris@82 161 set x "$@" -I"$file"
Chris@82 162 shift
Chris@82 163 ;;
Chris@82 164 -I*)
Chris@82 165 func_file_conv "${1#-I}" mingw
Chris@82 166 set x "$@" -I"$file"
Chris@82 167 shift
Chris@82 168 ;;
Chris@82 169 -l)
Chris@82 170 eat=1
Chris@82 171 func_cl_dashl "$2"
Chris@82 172 set x "$@" "$lib"
Chris@82 173 shift
Chris@82 174 ;;
Chris@82 175 -l*)
Chris@82 176 func_cl_dashl "${1#-l}"
Chris@82 177 set x "$@" "$lib"
Chris@82 178 shift
Chris@82 179 ;;
Chris@82 180 -L)
Chris@82 181 eat=1
Chris@82 182 func_cl_dashL "$2"
Chris@82 183 ;;
Chris@82 184 -L*)
Chris@82 185 func_cl_dashL "${1#-L}"
Chris@82 186 ;;
Chris@82 187 -static)
Chris@82 188 shared=false
Chris@82 189 ;;
Chris@82 190 -Wl,*)
Chris@82 191 arg=${1#-Wl,}
Chris@82 192 save_ifs="$IFS"; IFS=','
Chris@82 193 for flag in $arg; do
Chris@82 194 IFS="$save_ifs"
Chris@82 195 linker_opts="$linker_opts $flag"
Chris@82 196 done
Chris@82 197 IFS="$save_ifs"
Chris@82 198 ;;
Chris@82 199 -Xlinker)
Chris@82 200 eat=1
Chris@82 201 linker_opts="$linker_opts $2"
Chris@82 202 ;;
Chris@82 203 -*)
Chris@82 204 set x "$@" "$1"
Chris@82 205 shift
Chris@82 206 ;;
Chris@82 207 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
Chris@82 208 func_file_conv "$1"
Chris@82 209 set x "$@" -Tp"$file"
Chris@82 210 shift
Chris@82 211 ;;
Chris@82 212 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
Chris@82 213 func_file_conv "$1" mingw
Chris@82 214 set x "$@" "$file"
Chris@82 215 shift
Chris@82 216 ;;
Chris@82 217 *)
Chris@82 218 set x "$@" "$1"
Chris@82 219 shift
Chris@82 220 ;;
Chris@82 221 esac
Chris@82 222 fi
Chris@82 223 shift
Chris@82 224 done
Chris@82 225 if test -n "$linker_opts"; then
Chris@82 226 linker_opts="-link$linker_opts"
Chris@82 227 fi
Chris@82 228 exec "$@" $linker_opts
Chris@82 229 exit 1
Chris@82 230 }
Chris@82 231
Chris@82 232 eat=
Chris@82 233
Chris@82 234 case $1 in
Chris@82 235 '')
Chris@82 236 echo "$0: No command. Try '$0 --help' for more information." 1>&2
Chris@82 237 exit 1;
Chris@82 238 ;;
Chris@82 239 -h | --h*)
Chris@82 240 cat <<\EOF
Chris@82 241 Usage: compile [--help] [--version] PROGRAM [ARGS]
Chris@82 242
Chris@82 243 Wrapper for compilers which do not understand '-c -o'.
Chris@82 244 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
Chris@82 245 arguments, and rename the output as expected.
Chris@82 246
Chris@82 247 If you are trying to build a whole package this is not the
Chris@82 248 right script to run: please start by reading the file 'INSTALL'.
Chris@82 249
Chris@82 250 Report bugs to <bug-automake@gnu.org>.
Chris@82 251 EOF
Chris@82 252 exit $?
Chris@82 253 ;;
Chris@82 254 -v | --v*)
Chris@82 255 echo "compile $scriptversion"
Chris@82 256 exit $?
Chris@82 257 ;;
Chris@82 258 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
Chris@82 259 func_cl_wrapper "$@" # Doesn't return...
Chris@82 260 ;;
Chris@82 261 esac
Chris@82 262
Chris@82 263 ofile=
Chris@82 264 cfile=
Chris@82 265
Chris@82 266 for arg
Chris@82 267 do
Chris@82 268 if test -n "$eat"; then
Chris@82 269 eat=
Chris@82 270 else
Chris@82 271 case $1 in
Chris@82 272 -o)
Chris@82 273 # configure might choose to run compile as 'compile cc -o foo foo.c'.
Chris@82 274 # So we strip '-o arg' only if arg is an object.
Chris@82 275 eat=1
Chris@82 276 case $2 in
Chris@82 277 *.o | *.obj)
Chris@82 278 ofile=$2
Chris@82 279 ;;
Chris@82 280 *)
Chris@82 281 set x "$@" -o "$2"
Chris@82 282 shift
Chris@82 283 ;;
Chris@82 284 esac
Chris@82 285 ;;
Chris@82 286 *.c)
Chris@82 287 cfile=$1
Chris@82 288 set x "$@" "$1"
Chris@82 289 shift
Chris@82 290 ;;
Chris@82 291 *)
Chris@82 292 set x "$@" "$1"
Chris@82 293 shift
Chris@82 294 ;;
Chris@82 295 esac
Chris@82 296 fi
Chris@82 297 shift
Chris@82 298 done
Chris@82 299
Chris@82 300 if test -z "$ofile" || test -z "$cfile"; then
Chris@82 301 # If no '-o' option was seen then we might have been invoked from a
Chris@82 302 # pattern rule where we don't need one. That is ok -- this is a
Chris@82 303 # normal compilation that the losing compiler can handle. If no
Chris@82 304 # '.c' file was seen then we are probably linking. That is also
Chris@82 305 # ok.
Chris@82 306 exec "$@"
Chris@82 307 fi
Chris@82 308
Chris@82 309 # Name of file we expect compiler to create.
Chris@82 310 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
Chris@82 311
Chris@82 312 # Create the lock directory.
Chris@82 313 # Note: use '[/\\:.-]' here to ensure that we don't use the same name
Chris@82 314 # that we are using for the .o file. Also, base the name on the expected
Chris@82 315 # object file name, since that is what matters with a parallel build.
Chris@82 316 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
Chris@82 317 while true; do
Chris@82 318 if mkdir "$lockdir" >/dev/null 2>&1; then
Chris@82 319 break
Chris@82 320 fi
Chris@82 321 sleep 1
Chris@82 322 done
Chris@82 323 # FIXME: race condition here if user kills between mkdir and trap.
Chris@82 324 trap "rmdir '$lockdir'; exit 1" 1 2 15
Chris@82 325
Chris@82 326 # Run the compile.
Chris@82 327 "$@"
Chris@82 328 ret=$?
Chris@82 329
Chris@82 330 if test -f "$cofile"; then
Chris@82 331 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
Chris@82 332 elif test -f "${cofile}bj"; then
Chris@82 333 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
Chris@82 334 fi
Chris@82 335
Chris@82 336 rmdir "$lockdir"
Chris@82 337 exit $ret
Chris@82 338
Chris@82 339 # Local Variables:
Chris@82 340 # mode: shell-script
Chris@82 341 # sh-indentation: 2
Chris@82 342 # eval: (add-hook 'write-file-hooks 'time-stamp)
Chris@82 343 # time-stamp-start: "scriptversion="
Chris@82 344 # time-stamp-format: "%:y-%02m-%02d.%02H"
Chris@82 345 # time-stamp-time-zone: "UTC"
Chris@82 346 # time-stamp-end: "; # UTC"
Chris@82 347 # End: