#!/bin/sh

# Wrapper for swipl that tries to guess where it might be installed
# Download SWI-Prolog from here: http://www.swi-prolog.org/

SWIPL=swipl
if [ -z `which swipl` ]; then
    # default locations on OS X
    SWIPL=/Applications/SWI-Prolog.app/Contents/MacOS/swipl;
    if [ ! -e $SWIPL ]; then
	SWIPL=/opt/local/bin/swipl;
    fi
    if [ ! -e $SWIPL ]; then
	echo Biomake requires SWI-Prolog. Please download from http://www.swi-prolog.org/
	exit 1
    fi
fi

$SWIPL "$@"
