Skip to content

Commit

Permalink
Reduce some unnecessary text duplication in the Makefile.
Browse files Browse the repository at this point in the history
Instead of duplicating the value of 'GCC_DEP' in every package's deps_
variable, just set it once as a variabele in the Makefile itself, and then
include it in the output of the pkg_deps helper function.
  • Loading branch information
embray committed Sep 3, 2018
1 parent 8a808db commit 4e28d39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 9 additions & 0 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ BLAS = @SAGE_BLAS@
BUILT_PACKAGES = @SAGE_BUILT_PACKAGES@
DUMMY_PACKAGES = @SAGE_DUMMY_PACKAGES@

# Set to the path to Sage's GCC (if GCC is installed) to force rebuilds
# of packages if GCC changed.
# See m4/sage_spkg_collect.m4 and https://trac.sagemath.org/ticket/24703
GCC_DEP = @SAGE_GCC_DEP@

# Versions of all the packages, in the format
#
# vers_<pkgname> = <pkgvers>
Expand Down Expand Up @@ -128,9 +133,13 @@ $(INST)/.dummy:
# the name of some arbitrary file, or it is the '|' symbol) then it is just
# used verbatim.
#
# As a special case, also adds a special variable GCC_DEP for all packages
# except for gcc itself. See the definition of GCC_DEP above
#
# Positional arguments:
# $(1): package name
pkg_deps = \
$(if $(filter gcc,$(1)),,$$(GCC_DEP))\
$(foreach dep,$(deps_$(1)),\
$(if $(value inst_$(dep)),$$(inst_$(dep)),$(dep)))

Expand Down
8 changes: 3 additions & 5 deletions m4/sage_spkg_collect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ AC_DEFUN_ONCE([SAGE_SPKG_COLLECT], [
# (except gcc) should depend on gcc if gcc is already installed.
# See https://trac.sagemath.org/ticket/24703
if test x$SAGE_INSTALL_GCC = xexists; then
GCC_DEP='$(SAGE_LOCAL)/bin/gcc'
SAGE_GCC_DEP='$(SAGE_LOCAL)/bin/gcc'
else
GCC_DEP=''
SAGE_GCC_DEP=''
fi
AC_SUBST([SAGE_GCC_DEP])
AC_MSG_CHECKING([package versions])
AC_MSG_RESULT([])
Expand Down Expand Up @@ -192,9 +193,6 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do
esac
fi
# Special case for GCC; see definition of GCC_DEP above
test "$PKG_NAME" = gcc || DEPS="$GCC_DEP $DEPS"
SAGE_PACKAGE_DEPENDENCIES+="deps_$PKG_NAME = $DEPS"$'\n'
# Determine package build rules
Expand Down

0 comments on commit 4e28d39

Please sign in to comment.