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

Commit 7364e2a

Browse files
author
Matthias Koeppe
committed
Clean up src/bin/sage-env-config.in: Move logic to src/bin/sage-env, move non-environment configuration variables to sage_conf.py
1 parent 6a45805 commit 7364e2a

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

build/pkgs/sage_conf/src/sage_conf.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ MAXIMA = "@prefix@/bin/maxima"
66

77
ARB_LIBRARY = "@SAGE_ARB_LIBRARY@"
88

9+
SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@"
10+
911
# The following must not be used during build to determine source or installation
1012
# location of sagelib. See comments in SAGE_ROOT/src/Makefile.in
1113
SAGE_LOCAL = "@prefix@"

src/bin/sage-env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ if [ "$UNAME" = "Darwin" ]; then
227227
export OBJC OBJCXX
228228
fi
229229

230+
if [ "$SAGE_PYTHON_VERSION" = 3 ]; then
231+
export SAGE_PYTHON3=yes
232+
fi
233+
230234
# Set other Fortran-related compiler variables
231235
export F77="$FC"
232236
export F90="$FC" # Needed for SciPy
@@ -291,6 +295,12 @@ export SAGE_SRC="$SAGE_ROOT/src"
291295
export SAGE_DOC_SRC="$SAGE_SRC/doc"
292296
export SAGE_DOC="$SAGE_SHARE/doc/sage"
293297

298+
if [ -n "$SAGE_PKG_CONFIG_PATH" ]; then
299+
# set up external pkg-config to look into SAGE_LOCAL/lib/pkgconfig/
300+
# (Sage's pkgconf spkg takes care of this, if installed)
301+
export PKG_CONFIG_PATH="$SAGE_PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
302+
fi
303+
294304
if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
295305
SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH
296306
SAGE_ORIG_PATH_SET=True && export SAGE_ORIG_PATH_SET

src/bin/sage-env-config.in

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# -*- shell-script -*-
1+
# -*- shell-script -*- @configure_input@
22

33
###########################################################################
44
#
5-
# Set some environment variables for Sage.
6-
# This file is generated from sage-env-config.in by configure.
5+
# Set some environment variables that are needed at the runtime of Sage
6+
# and by its child processes.
77
#
88
# NOTES:
99
# - You must *source* this script instead of executing.
@@ -12,6 +12,15 @@
1212
# which is probably not intended.
1313
# - All environment variables set here should be *exported*, otherwise
1414
# they won't be available in child programs.
15+
# - This file is only for setting immediate values. Any kind of conditionals
16+
# or computed values are to be set by src/bin/sage-env after sourcing this
17+
# file.
18+
# - Environment variables that are only needed at the time of building
19+
# SPKGs or sagelib should be set in build/bin/sage-build-env-config
20+
# instead.
21+
# - Configuration variables that are only needed by the Sage runtime,
22+
# but not as environment variables, should instead be set in
23+
# build/pkgs/sage_conf/src/sage_conf.py
1524
#
1625
##########################################################################
1726

@@ -32,17 +41,5 @@ export CONFIGURED_OBJCXX="@OBJCXX@"
3241
# Other configuration
3342
#######################################
3443
export SAGE_PYTHON_VERSION=@SAGE_PYTHON_VERSION@
35-
if [ "$SAGE_PYTHON_VERSION" = 3 ]; then
36-
export SAGE_PYTHON3=yes
37-
fi
38-
3944
export PYTHON_FOR_VENV="@PYTHON_FOR_VENV@"
40-
4145
export SAGE_PKG_CONFIG_PATH="@SAGE_PKG_CONFIG_PATH@"
42-
if [ -n "$SAGE_PKG_CONFIG_PATH" ]; then
43-
# set up external pkg-config to look into SAGE_LOCAL/lib/pkgconfig/
44-
# (Sage's pkgconf spkg takes care of this, if installed)
45-
export PKG_CONFIG_PATH="$SAGE_PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
46-
fi
47-
48-
export SAGE_NAUTY_BINS_PREFIX="@SAGE_NAUTY_BINS_PREFIX@"

0 commit comments

Comments
 (0)