1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#!/bin/sh
# (C) Frank Lübeck 2011
# configure script for Browse, EDIM and other packages
# usage: ./configure [GAPPATH] [CONFIGNAME=myconf]
# this script creates a "Makefile-myconf" from "Makefile.in" with
# a link to "Makefile"
# read arguments
while [ x"$1" != "x" ]; do
if [ ${1#CONFIGNAME=} = ${1} ]; then
GAPPATH=$1
else
eval $1
fi
shift
done
if [ x"$GAPPATH" = "x" ]; then
GAPPATH=../..
echo "Using ../.. as default GAPPATH"
fi
if [ x"$CONFIGNAME" = "x" ]; then
CONFIGNAME="default64"
if [ ! -e $GAPPATH/sysinfo.gap-$CONFIGNAME ]; then
CONFIGNAME="default32"
if [ ! -e $GAPPATH/sysinfo.gap-$CONFIGNAME ]; then
CONFIGNAME="UNKNOWN"
fi
fi
fi
if [ x"$CONFIGNAME" != "xUNKNOWN" ]; then
CONFIGSUFFIX="-$CONFIGNAME"
else
CONFIGSUFFIX=""
fi
if [ ! -e $GAPPATH/sysinfo.gap$CONFIGSUFFIX ]; then
echo
echo "No file $GAPPATH/sysinfo.gap$CONFIGSUFFIX found."
echo
echo "Usage: ./configure [GAPPATH] [CONFIGNAME=confnam]"
echo " where GAPPATH is a path to your GAP installation"
echo " and confnam is the name of the GAP configuration to use."
echo " (The default for GAPPATH is \"../..\" and default confignam"
echo " is \"default64\" if it exists, otherwise \"default32\".)"
echo
echo "Either your GAPPATH is incorrect or the GAP it is pointing to"
echo "is not properly compiled (do \"./configure ; make\" there first)."
echo
echo Aborting... No Makefile is generated.
echo
exit 1
fi
echo "Using config in $GAPPATH/sysinfo.gap$CONFIGSUFFIX"
rm -f Makefile Makefile$CONFIGSUFFIX
. $GAPPATH/sysinfo.gap$CONFIGSUFFIX
sed \
-e 's/@DEB_BUILD_MULTIARCH@/'$(dpkg-architecture -qDEB_BUILD_MULTIARCH)'/g' \
-e 's|@GAPPATH@|'$GAPPATH'|g' \
-e 's/@GAPARCH@/'$GAParch'/g' \
Makefile.in > Makefile$CONFIGSUFFIX
if [ x"$CONFIGNAME" != "xUNKNOWN" ]; then
ln -s Makefile$CONFIGSUFFIX Makefile
echo "Created ./Makefile$CONFIGSUFFIX with link from ./Makefile"
fi
|