#!/bin/bash

#Some cleanup
rm -rf install
rm -rf swig-2.0.4
mkdir install

#Untar and move python into install directory
tar -zxvf  swig-2.0.4.tar.gz
mv swig-2.0.4/* install
rm -rf swig-2.0.4

#Copy pcre prototype in include directory
cd install 
#cp $ISSM_DIR/externalpackages/pcre/install/pcre.h  ./Source/Include/
#cp $ISSM_DIR/externalpackages/pcre/install/.libs/*  ./Source/Include/
export CFLAGS="$CFLAGS -I$ISSM_DIR/externalpackages/pcre/install"
export LDFLAGS="-L$ISSM_DIR/externalpackages/pcre/install/.libs/"
export LIBS="-lpcre"
#Configure doxygen
./configure \
 --prefix="$ISSM_DIR/externalpackages/python/install" \
 --with-pcre-prefix="$ISSM_DIR/externalpackages/pcre/install" \
 --with-pcre-exec-prefix="$ISSM_DIR/externalpackages/pcre/install"
make 
make install
