#!/bin/sh
# (C) Frank Lübeck     2018
# configure script for Browse with GAP > 4.11.0 

# some tools on OS X made locale related problems, so:
export LANG=C
export LC_ALL=C

# GAP path
if [ $# = 0 ]; then
  GAPPATH="../../"
else
  GAPPATH=$1
fi
echo "Using $GAPPATH as GAP build directory."

# set default values for GAP and GAC (may be overwritten by sysinfo.gap)
GAP='$(GAPPATH)/bin/gap.sh'
GAC='$(GAPPATH)/gac'

# Reading variables from GAP build directory
. "$GAPPATH/sysinfo.gap"

echo "Using bin path: $GAParch"

# Creating Makefile
sed -e "s|@GAPPATH@|$GAPPATH|g" \
    -e "s|@GAPARCH@|$GAParch|g" \
    -e "s|@GAP@|$GAP|g" \
    -e "s|@GAC@|$GAC|g" \
             < Makefile.in > Makefile

