From 7791cd987347dfe253e3ed3ce74214f4527485d8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 16 Sep 2016 16:36:24 -0700 Subject: [PATCH] Remove --buildbase code --- src/.gitignore | 1 - src/Makefile.in | 14 ++++++++------ src/sage/env.py | 3 +-- src/setup.py | 17 +++++------------ 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/.gitignore b/src/.gitignore index 57e9515edfa..2400779a55c 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,3 @@ /.cython_version /build /Makefile -/build-sagelib diff --git a/src/Makefile.in b/src/Makefile.in index db445cfdca9..ca6fbe8c8a0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -15,8 +15,10 @@ all: sage ## We poison all environment variables that have paths to the sage source and build directories, ## but keep the directories below SAGE_LOCAL intact. -## In this way we make sure that all of the sagelib build's source/build paths are communicated through -## the current directory (for the source tree) and --build-base. +## In this way we make sure that all of the sagelib build's source paths are communicated through +## the current directory (for the source tree). +## Building takes places in the build/ subdirectory. +## The environment variable SAGE_CYTHONIZED needs to point to build/cythonized. ## ## As a special exception, we feed SAGE_PKGS. This is needed by src/sage_setup/optional_extension.py ## via src/sage/misc/package.py. Hoping that #20382 will make this unnecessary. @@ -36,14 +38,14 @@ sage: SAGE_DOC_SRC=/doesnotexist \ SAGE_SCRIPTS_DIR=/doesnotexist \ SAGE_BUILD_DIR=/doesnotexist \ - SAGE_CYTHONIZED=/doesnotexist \ SAGE_PKGS=$(abs_top_srcdir)/build/pkgs \ - && python -u setup.py build --build-base=$(abs_builddir)/build-sagelib install) + SAGE_CYTHONIZED=$(abs_builddir)/build/cythonized \ + && python -u setup.py build install) clean: @echo "Deleting Sage library build artifacts..." - rm -rf c_lib build .cython_version # from old sage versions - rm -rf build-sagelib + rm -rf c_lib .cython_version # from old sage versions + rm -rf build find . -name '*.pyc' | xargs rm -f rm -f sage/libs/pari/auto_* rm -rf sage/ext/interpreters diff --git a/src/sage/env.py b/src/sage/env.py index b347085ce6a..1ccd8116443 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -106,8 +106,7 @@ def _add_variable_or_fallback(key, fallback, force=False): _add_variable_or_fallback('SAGE_LIB', SITE_PACKAGES[0]) -# SAGE_CYTHONIZED is only (to be) used in doctests of sage_setup/ -_add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build-sagelib', 'cythonized')) +_add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build', 'cythonized')) # Used by sage/misc/package.py. Should be SAGE_SRC_ROOT in VPATH. _add_variable_or_fallback('SAGE_PKGS', opj('$SAGE_ROOT', 'build', 'pkgs')) diff --git a/src/setup.py b/src/setup.py index de83160f487..27c885fd973 100755 --- a/src/setup.py +++ b/src/setup.py @@ -40,22 +40,15 @@ def excepthook(*exc): ### Check build-base ######################################################### -build_base = 'build' # the distutils default -cmd = None -for i, arg in enumerate(sys.argv[1:]): - if not arg or not arg.startswith("-"): - cmd = arg - elif cmd == 'build' and (arg.startswith("--build-base") or arg == '-b'): - if arg.startswith("--build-base="): - build_base = arg[len("--build-base="):] - else: - build_base = arg[i+1] +build_base = 'build' # the distutils default. Changing it is not supported by this setup.sh. + +######################################################### +### Set source directory +######################################################### import sage.env -sage.env.SAGE_CYTHONIZED = os.path.abspath(os.path.join(build_base, 'cythonized')) sage.env.SAGE_SRC = os.getcwd() - ######################################################### ### List of Extensions ###