Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sage
Path: blob/develop/configure_wrapper
7332 views
#! /bin/sh

# Note: ./configure will remove all conftest* files, including the
# pytest conftest.py. We work around this by making a copy and
# restoring when we are done, regardless of whether configure succeeds
# or fails.

set -e

trap 'mv bak_conftest.py conftest.py; trap - EXIT; exit' EXIT INT HUP TERM

cp conftest.py bak_conftest.py
./real_configure "$@"

# Fix config.status to call ./configure instead of ./real_configure
# so that --recheck also protects conftest.py
sed -i.old "s|'./real_configure'|'./configure'|g" config.status
rm -f config.status.old