mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-01 23:30:40 -08:00
65 lines
2.3 KiB
Bash
Executable file
65 lines
2.3 KiB
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# This is just a driver for configure, the real configure is in src.
|
|
# This script identifies the machine, and creates a directory for
|
|
# the installation, where it runs ${srcdir}/configure.
|
|
|
|
if uname -a | grep -i 'mingw32' > /dev/null; then
|
|
srcdir=`pwd -W`/src;
|
|
else
|
|
srcdir=`pwd`/src
|
|
fi
|
|
buildir=build
|
|
|
|
if [ ! -d ${buildir} ] ; then
|
|
echo Creating directory "\`${buildir}'"
|
|
mkdir ${buildir}
|
|
fi
|
|
|
|
echo Switching to directory "\`${buildir}'" to continue configuration.
|
|
|
|
#
|
|
# There are two ways to configure ECL. If we use our own version of GMP,
|
|
# we let it configure itself and later on retrieve the appropiate flags
|
|
#
|
|
if ( echo $* | grep enable-local-gmp ); then
|
|
cd ${buildir}
|
|
${srcdir}/configure --srcdir=${srcdir} $*
|
|
else
|
|
#
|
|
# In some architectures/OS, a flag is required to select the ABI. GMP
|
|
# guesses these flags, and stores them in CFLAGS and GMP_LDFLAGS.
|
|
#
|
|
echo ====
|
|
echo ==== Using the configuration process of GMP to retrieve the best
|
|
echo ==== flags and a precise host type.
|
|
echo ====
|
|
cd ${buildir}
|
|
rm -rf tmp; mkdir tmp; cd tmp;
|
|
${srcdir}/gmp/configure --srcdir=${srcdir}/gmp --prefix=${builddir}
|
|
CFLAGS=`grep '^s,@CFLAGS@' config.status| sed 's&s,@CFLAGS@,\(.*\),;t t&\1&'`
|
|
GMP_LDFLAGS=`grep '^s,@GMP_LDFLAGS@' config.status| sed 's&s,@GMP_LDFLAGS@,\(.*\),;t t&\1&'`;
|
|
# Notice that GMP_LDFLAGS is designed to be passed to libtool, and therefore
|
|
# some options could be prefixed by -Wc, which means "flag for the compiler".
|
|
LDFLAGS=`grep '^s,@LDFLAGS@' config.status| sed 's&s,@LDFLAGS@,\(.*\),;t t&\1&'`;
|
|
LDFLAGS=`echo ${LDFLAGS} ${GMP_LDFLAGS} | sed 's%-Wc,%%'`
|
|
host=`grep '^s,@host@' config.status | sed 's&s,@host@,\(.*\),;t t&\1&'`
|
|
echo Guessed values:
|
|
echo CFLAGS: ${CFLAGS}
|
|
echo LDFLAGS: ${LDFLAGS}
|
|
echo host: ${host}
|
|
cd .. && rm -rf tmp
|
|
echo ====
|
|
echo ==== Configuring ECL
|
|
echo ====
|
|
# GMP knows more chiptset names than usual FSF configuration tools. We
|
|
# therefore need to use its config* files when configuring either ECL
|
|
# or the Boehm-Weiser garbage collector.
|
|
for i in config.sub configfsf.sub config.guess configfsf.guess; do
|
|
cp ${srcdir}/gmp/$i ${srcdir}/
|
|
cp ${srcdir}/gmp/$i ${srcdir}/gc/
|
|
done;
|
|
LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS}" \
|
|
${srcdir}/configure --srcdir=${srcdir} $* --host=${host}
|
|
fi
|
|
echo Configuration complete. To build ECL, issue 'make' in this directory.
|