Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Remove --buildbase code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 16, 2016
1 parent e5f9065 commit 7791cd9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/.cython_version
/build
/Makefile
/build-sagelib
14 changes: 8 additions & 6 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
3 changes: 1 addition & 2 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
17 changes: 5 additions & 12 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
###
Expand Down

0 comments on commit 7791cd9

Please sign in to comment.