The R Project SVN R

Rev

Rev 4945 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#!/bin/sh
#
# ${RHOME}/tools/GETSYMBOLS

# This code assembles the table of statically loaded C and Fortran
# code which is to be accessed via .C and .Fortran calls.

TOOLS_DIR=`echo $0 | sed 's%/[^/][^/]*$%%'`
ROUTINES=${TOOLS_DIR}/../src/appl/ROUTINES
tmpROUT=/tmp/ROUTINES$$

##-- Allow "#" comments in ../src/appl/ROUTINES :
sed '
/^#/d
/#/s/#.*//
' ${ROUTINES} > ${tmpROUT}

sed '
s/F77_SUBROUTINE(\(.*\))/int F77_SYMBOL(\1)();/
s/C_FUNCTION(\(.*\))/int \1();/
' ${tmpROUT} > /tmp/FFDecl.h

${TOOLS_DIR}/move-if-change /tmp/FFDecl.h FFDecl.h

sed '
s/F77_SUBROUTINE(\(.*\))/   { F77_QSYMBOL(\1),  F77_SYMBOL(\1)},/
s/C_FUNCTION(\(.*\))/   { "\1", \1 },/
' ${tmpROUT} > /tmp/FFTab.h

${TOOLS_DIR}/move-if-change /tmp/FFTab.h  FFTab.h

rm -f ${tmpROUT}