#!/usr/bin/env tcsh 
# Copyright 2005, 2006 University of Leiden.
#
# This file is part of MIA+EWS.
#
# MIA+EWS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# MIA+EWS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MIA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#!/usr/bin/env tcsh
cd cfitsio
make clean
./configure

if ($1 == "32" || `uname -p` == "x86_64") then
    echo "Compiling for a 64-bit machine"
    mv Makefile Makefile.orig
    sed -e 's/^\(CFLAGS.*=.*\)$/\1 -m32/' Makefile.orig > Makefile
else
    echo "No 64-bit machine, good."
endif

make all
cd ..
