Skip to content

Commit

Permalink
m4/sage_spkg_collect.m4: Handle 'dependencies_build' files, generate …
Browse files Browse the repository at this point in the history
…Makefile variables build_deps_...
  • Loading branch information
Matthias Koeppe committed Dec 14, 2023
1 parent d1ecc5c commit 91cda4d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ debug-check:
# $(1): package name
pkg_deps = \
$(if $(filter gcc,$(1)),,$$(GCC_DEP))\
$(foreach dep,$(deps_$(1)),\
$(foreach dep,$(build_deps_$(1)),\
$(if $(value inst_$(dep)),$$(inst_$(dep)),$(dep)))

# ============================= normal packages ==============================
Expand Down
19 changes: 13 additions & 6 deletions m4/sage_spkg_collect.m4
Original file line number Diff line number Diff line change
Expand Up @@ -352,24 +352,31 @@ AC_DEFUN([SAGE_SPKG_FINALIZE], [dnl
], [dnl
AS_VAR_SET([DEPS], [])
])
AS_IF([test -f "$DIR/dependencies_build"], [dnl
dnl - the # symbol is treated as comment which is removed
AS_VAR_SET([BUILD_DEPS], [`sed 's/^ *//; s/ *#.*//; q' $DIR/dependencies_build`])
], [dnl
dnl No 'dependencies_build' file, so reuse 'dependencies' for that
AS_VAR_COPY([BUILD_DEPS], [DEPS])
])
AS_IF([test -f "$DIR/dependencies_optional"], [dnl
for a in $(sed 's/^ *//; s/ *#.*//; q' "$DIR/dependencies_optional"); do
AS_VAR_APPEND([DEPS], [' $(findstring '$a',$(OPTIONAL_INSTALLED_PACKAGES)) '])
AS_VAR_APPEND([BUILD_DEPS], [' $(findstring '$a',$(OPTIONAL_INSTALLED_PACKAGES)) '])
done
])
AS_CASE(["$DEPS"], [*\|*], [], [AS_VAR_APPEND([DEPS], [" |"])])
AS_CASE(["$BUILD_DEPS"], [*\|*], [], [AS_VAR_APPEND([BUILD_DEPS], [" |"])])
AS_IF([test -f "$DIR/dependencies_order_only"], [dnl
ADD_DEPS=$(echo $(sed 's/^ *//; s/ *#.*//; q' $DIR/dependencies_order_only))
AS_VAR_APPEND([DEPS], [" $ADD_DEPS"])
AS_VAR_APPEND([BUILD_DEPS], [" $ADD_DEPS"])
], [dnl
m4_case(SPKG_SOURCE, [pip], [AS_VAR_APPEND([DEPS], [' pip'])], [:])dnl
m4_case(SPKG_SOURCE, [pip], [AS_VAR_APPEND([BUILD_DEPS], [' pip'])], [:])dnl
])
AS_IF([test -f "$DIR/dependencies_check"], [dnl
ADD_DEPS=$(echo $(sed 's/^ *//; s/ *#.*//; q' $DIR/dependencies_check))
AS_VAR_APPEND([DEPS], [' $(and $(filter-out no,$(SAGE_CHECK_]SPKG_NAME[)), '"$ADD_DEPS"')'])dnl
AS_VAR_APPEND([BUILD_DEPS], [' $(and $(filter-out no,$(SAGE_CHECK_]SPKG_NAME[)), '"$ADD_DEPS"')'])dnl
])
dnl
SAGE_PACKAGE_DEPENDENCIES="${SAGE_PACKAGE_DEPENDENCIES}$(printf '\ndeps_')SPKG_NAME = ${DEPS}"
SAGE_PACKAGE_DEPENDENCIES="${SAGE_PACKAGE_DEPENDENCIES}$(printf '\ndeps_')SPKG_NAME = ${DEPS}$(printf '\nbuild_deps_')SPKG_NAME = ${BUILD_DEPS}"
dnl
dnl Determine package build rules
m4_case(SPKG_SOURCE,
Expand Down

0 comments on commit 91cda4d

Please sign in to comment.