Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoconf configuration of Python #326

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ac/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

FC = @FC@
LD = @FC@
PYTHON = @PYTHON@
MAKEDEP = @MAKEDEP@

DEFS = @DEFS@
Expand All @@ -32,7 +33,7 @@ rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(su
.PHONY: depend
depend: Makefile.dep
Makefile.dep: $(MAKEDEP) $(call rwildcard,$(SRC_DIRS),*.h *.c *.inc *.F90)
$(MAKEDEP) -o Makefile.dep -e $(SRC_DIRS)
$(PYTHON) $(MAKEDEP) -o Makefile.dep -e $(SRC_DIRS)


# Delete any files associated with configuration (including the Makefile).
Expand Down
7 changes: 7 additions & 0 deletions ac/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ AC_COMPILE_IFELSE(
)


# Verify that Python is available
AC_PATH_PROGS([PYTHON], [python python3 python2], [
AC_MSG_ERROR([Could not find python.])
])
AC_ARG_VAR([PYTHON], [Python interpreter command])


# Verify that makedep is available
AC_PATH_PROG([MAKEDEP], [makedep], [${srcdir}/ac/makedep])
AC_SUBST([MAKEDEP])
Expand Down
3 changes: 2 additions & 1 deletion ac/deps/Makefile.fms.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CC = @CC@
FC = @FC@
LD = @FC@
AR = @AR@
PYTHON = @PYTHON@
MAKEDEP = @MAKEDEP@

DEFS = @DEFS@
Expand All @@ -22,4 +23,4 @@ ARFLAGS = @ARFLAGS@
.PHONY: depend
depend: Makefile.dep
Makefile.dep:
$(MAKEDEP) -o Makefile.dep -e -x libFMS.a @srcdir@
$(PYTHON) $(MAKEDEP) -o Makefile.dep -e -x libFMS.a @srcdir@
9 changes: 8 additions & 1 deletion ac/deps/configure.fms.ac
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,14 @@ AX_FC_ALLOW_ARG_MISMATCH
FCFLAGS="$FCFLAGS $ALLOW_ARG_MISMATCH_FCFLAGS"


# Verify makedep
# Verify that Python is available
AC_PATH_PROGS([PYTHON], [python python3 python2], [
AC_MSG_ERROR([Could not find python.])
])
AC_ARG_VAR([PYTHON], [Python interpreter command])


# Verify that makedep is available
AC_PATH_PROGS([MAKEDEP], [makedep], [], ["${PATH}:${srcdir}/../../.."])
AS_IF([test -n "${MAKEDEP}"], [
AC_SUBST([MAKEDEP])
Expand Down