view src/find-defun-files.sh @ 14025:9867be070ee1

use pcre/pcre.h if it is present * configure.ac: Check for pcre/pcre.h. * liboctave/regexp.cc: Include either pcre.h or pcre/pcre.h depending on which is available.
author John W. Eaton <jwe@octave.org>
date Sun, 11 Dec 2011 22:35:13 -0500
parents 4cf7356a99d0
children e753177cde93
line wrap: on
line source

#! /bin/sh

set -e
SED=${SED:-sed}
EGREP=${EGREP:-egrep}

# Some stupid egreps don't like empty elements in alternation patterns,
# so we have to repeat ourselves because some stupid egreps don't like
# empty elements in alternation patterns.

DEFUN_PATTERN="^[ \t]*DEF(CONSTFUN|CMD|UN|UN_DLD|UNX_DLD|UN_TEXT)[ \t]*\\("

srcdir="$1"
shift

for arg
do
  if [ -f "$arg" ]; then
    file="$arg"
  else
    file="$srcdir/$arg"
  fi
  if [ "`$EGREP -l "$DEFUN_PATTERN" $file`" ]; then
    echo "$file" | $SED 's,.*/,,; s/\.cc$/.df/; s/\.ll$/.df/; s/\.yy$/.df/';
  fi
done