math.sh revision da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1982-2007 AT&T Knowledge Ventures #
# and is licensed under the #
# Common Public License, Version 1.0 #
# by AT&T Knowledge Ventures #
# #
# A copy of the License is available at #
# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# David Korn <dgk@research.att.com> #
# #
########################################################################
# @(#)math.sh (AT&T Research) 2007-02-02
command=$0
iffeflags="-n -v -F ast_standards.h"
iffelibs="-lm"
eval $1
shift
table=$1
exec < $table
;;
esac
done
lib=
case $x in
esac
case $y in
1) case $x in
esac
;;
esac
done
cat <<!
#pragma prototyped
!
echo "#include <ast_standards.h>"
echo "#include <math.h>"
case $_hdr_ieeefp in
1) echo "#include <ieeefp.h>"
echo
;;
esac
nl='
'
ht=' '
tab=
case $x:$y in
1:*) f=${name}l
local=
;;
*:1) f=${name}
t=double
local=$_typ_long_double
;;
*) continue
;;
esac
case $r in
i) L=int r=int R=1 ;;
*) L=Sfdouble_t r=$t R=0 ;;
esac
case $d:$m:$n in
1:*:*|*:1:*)
;;
sep=
case $a in
$p) break ;;
esac
sep=","
done
echo "$code"
;;
esac
1:*:*:*|*:1:*:*|*:*::)
args=
code="static $L local_$f("
sep=
case $a in
$p) break ;;
esac
sep=","
done
echo "$code"
f=local_$f
;;
esac
done
done
cat <<!
/*
*/
const struct mathtab shtab_math[] =
{$tab
};
!