annotate src/fftw-3.3.3/tools/fftw-wisdom-to-conf.in @ 105:c83a7e2af39c

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