#!/bin/bash
#
# cc - wrapper script for compiler to add command line options for thread wrapper support
#
# Copyright (C) 2007 Christian Bienia

prefix=/mnt/sdb1/build/pthreadw/pthreadw/TMP
header_path=${prefix}/include

# The absolute path to the directory with the compiler to use
if [ -z "${CC_PATH}" ]; then
  CC_PATH=/usr/bin
fi
me=$(basename $0)

prog=${CC_PATH}/${me}
if [ ! -x ${prog} ]; then
  echo Error: ${prog} does not exist or is not usable.
  exit 1
fi

# Invoke the real compiler (unfortunately we cannot inform the user of this wrapper without breaking the transparency, some tools parse the compiler output and wouldn't work anymore)
${prog} -I${header_path} -D_GNU_SOURCE $*
exit $?
