misc/libfreetype/builds/atari/gen-purec-patch.sh
author koda
Mon, 01 Jul 2013 22:49:28 +0200
changeset 9307 a0fef7134ade
parent 5172 88f2e05288ba
permissions -rw-r--r--
tell ya what, let's just disable these tests on some platform for now

#!/bin/sh

TOP_DIR=.
OBJ_DIR=.

for x in "$@"
do
  case x"$x" in
  x--srcdir=* | x--topdir=* )
    TOP_DIR=`echo $x | sed 's/^--[a-z]*dir=//'`
    ;;
  x--builddir=* | x--objdir=* )
    OBJ_DIR=`echo $x | sed 's/^--[a-z]*dir=//'`
    ;;
  esac
done

mkdir -p ${OBJ_DIR}/builds/atari/tmp/orig

( cd ${TOP_DIR} && find . -name '*.[CHch]' -type f | fgrep -v builds/atari/tmp | cpio -o ) | \
( cd ${OBJ_DIR}/builds/atari/tmp/orig && cpio -idum )
cp ${TOP_DIR}/builds/atari/deflinejoiner.awk ${OBJ_DIR}/builds/atari/tmp

pushd ${OBJ_DIR}/builds/atari/tmp

  cp -pr orig purec
  for f in `cd orig && find . -type f`
  do
    echo filter $f
    env LANG=C awk -f deflinejoiner.awk < orig/$f > purec/$f
  done

  echo '#define FT2_BUILD_LIBRARY'  >  purec/include/ft2build.h
  echo '#include "ATARI.H"'         >> purec/include/ft2build.h
  env LANG=C awk -f deflinejoiner.awk < orig/include/ft2build.h >> purec/include/ft2build.h

  env LANG=C diff -ur orig purec > ../purec.diff

popd
rm -rf ${OBJ_DIR}/builds/atari/tmp