#!/bin/sh
HDR=/usr/local/include
SRC=/Development/Source/dev/Library/org/open-mpi/openmpi-1.3/ompi
SDK=/Developer/SDKs/MacOSX10.4u.sdk
if [ $# -eq 1 ]
then
HDR=$1
fi 
# remove -O
# remove -I
# remove -M
# remove -c, -o
# add -I for specific directory
CFLAGS="-I/usr/local/include/ -DHAVE_CONFIG_H  -DOMPI_BUILDING=1  -D_REENTRANT   -DNDEBUG -finline-functions -fno-strict-aliasing  -DHAVE_ROMIOCONF_H -DHAVE_ROMIOCONF_H";export CFLAGS
rm -rf usr
h-to-ffi.sh ${HDR}/mpi.h


CFLAGS="-DHAVE_CONFIG_H -I ${SDK}/usr/lib/gcc/i686-apple-darwin8/4.0.0/include/ -I${SRC} -I${SRC}/../opal/include -I${SRC}/../orte/include -I${SRC}/../ompi/include -I${SRC}/../opal/mca/paffinity/linux/plpa/src/libplpa   -I${SRC}/..  -D_REENTRANT -DNDEBUG -finline-functions -fno-strict-aliasing  -fvisibility=hidden"; export CFLAGS
# h-to-ffi.sh /Development/Source/dev/Library/org/open-mpi/openmpi-1.3/ompi/communicator/mpi_wrapper.h 
h-to-ffi.sh `pwd`/mpi_wrapper.h 