annotate fft/fftw/fftw-3.3.4/tools/fftw-wisdom-to-conf.in @ 40:223f770b5341 kissfft-double tip

Try a double-precision kissfft
author Chris Cannam
date Wed, 07 Sep 2016 10:40:32 +0100
parents 26056e866c29
children
rev   line source
Chris@19 1 #! /bin/sh
Chris@19 2
Chris@19 3 if test "x$1" = "x--help" || test "x$1" = "x-h"; then
Chris@19 4 cat <<EOF
Chris@19 5 Usage: fftw-wisdom-to-conf [OPTIONS] [< INPUT] [> OUTPUT]
Chris@19 6 Convert wisdom (stdin) to C configuration routine (stdout).
Chris@19 7
Chris@19 8 Options:
Chris@19 9 -h, --help: print this help
Chris@19 10 -V, --version: print version/copyright info
Chris@19 11 EOF
Chris@19 12 exit 0
Chris@19 13 fi
Chris@19 14
Chris@19 15 if test "x$1" = "x--version" || test "x$1" = "x-V"; then
Chris@19 16 cat <<EOF
Chris@19 17 fftw-wisdom-to-conf from FFTW version @VERSION@
Chris@19 18
Chris@19 19 Copyright (c) 2003, 2007-14 Matteo Frigo
Chris@19 20 Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
Chris@19 21
Chris@19 22 This program is free software; you can redistribute it and/or modify
Chris@19 23 it under the terms of the GNU General Public License as published by
Chris@19 24 the Free Software Foundation; either version 2 of the License, or
Chris@19 25 (at your option) any later version.
Chris@19 26
Chris@19 27 This program is distributed in the hope that it will be useful,
Chris@19 28 but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@19 29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@19 30 GNU General Public License for more details.
Chris@19 31
Chris@19 32 You should have received a copy of the GNU General Public License
Chris@19 33 along with this program; if not, write to the Free Software
Chris@19 34 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Chris@19 35 EOF
Chris@19 36 exit 0
Chris@19 37 fi
Chris@19 38
Chris@19 39 read preamble fftw_wisdom
Chris@19 40
Chris@19 41 case "$preamble $fftw_wisdom" in
Chris@19 42 \(@PACKAGE@-@VERSION@\ *_wisdom*)
Chris@19 43 prefix=`echo $fftw_wisdom | cut -d_ -f1`_
Chris@19 44 ;;
Chris@19 45 *)
Chris@19 46 echo "fftw-wisdom-to-conf: invalid wisdom" 1>&2
Chris@19 47 exit 1
Chris@19 48 ;;
Chris@19 49 esac
Chris@19 50
Chris@19 51 cat <<EOF
Chris@19 52 /* Automatically generated by fftw-wisdom-to-conf from @PACKAGE@ @VERSION@.
Chris@19 53 DO NOT EDIT! (Unless you really, really want to. Then it's okay.) */
Chris@19 54 void ${prefix}configure_planner(void *plnr)
Chris@19 55 {
Chris@19 56 struct solvtab_s { void (*reg)(void *); const char *reg_nam; };
Chris@19 57 extern void ${prefix}solvtab_exec(const struct solvtab_s s[], void *);
Chris@19 58
Chris@19 59 #define DECLARE(name) extern void name(void *);
Chris@19 60 #define STRINGIZEx(x) #x
Chris@19 61 #define STRINGIZE(x) STRINGIZEx(x)
Chris@19 62 #define SOLVTAB(s) { s, STRINGIZE(s) },
Chris@19 63 #define DO(X) \\
Chris@19 64 EOF
Chris@19 65
Chris@19 66 sed 's/ *(//' | cut -d" " -f1 | grep -v -- - | egrep -v '^ *\)*$' | sort | uniq | while read reg_nam; do
Chris@19 67 printf ' X(%s)\\\n' "$reg_nam"
Chris@19 68 done
Chris@19 69
Chris@19 70 cat <<EOF
Chris@19 71 /* end DO(X) */
Chris@19 72
Chris@19 73 DO(DECLARE)
Chris@19 74
Chris@19 75 const struct solvtab_s s[] = {
Chris@19 76 DO(SOLVTAB)
Chris@19 77 { 0, 0 }
Chris@19 78 };
Chris@19 79
Chris@19 80 ${prefix}solvtab_exec(s, plnr);
Chris@19 81 }
Chris@19 82 EOF