Skip to content

Fixes to LALSUITE_CHECK_PYTHON() Autoconf macro

Karl Wette requested to merge ANU-CGA/lalsuite:fix_LALSUITE_CHECK_PYTHON into master

Description

While debugging !2334 (merged) I was looking at these lines in the LALSUITE_CHECK_PYTHON() Autoconf macro:

AM_PATH_PYTHON([${lalsuite_pyvers}],[
  AC_SUBST([python_prefix], [`${PYTHON} -c 'import sys; print(sys.prefix)' 2>/dev/null`])
  AC_SUBST([python_exec_prefix], [`${PYTHON} -c 'import sys; print(sys.exec_prefix)' 2>/dev/null`])
],[
  ...
])

It seems that the python_prefix/python_exec_prefix no longer do anything; the versions of AM_PATH_PYTHON() on el8/bookworm do not reference these variables. They do however use uppercase versions, PYTHON_PREFIX/PYTHON_EXEC_PREFIX. These should always be set to the Autoconf-defined ${prefix} and ${exec_prefix} respectively, so that Python code is installed in the same locations as the rest of LALSuite.

The code now looks like

AM_PATH_PYTHON([${lalsuite_pyvers}],[
   # nothing here
],[
  ...
])
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])

The reason for setting PYTHON_PREFIX/PYTHON_EXEC_PREFIX after AM_PATH_PYTHON(), rather than in its 2nd argument (the ACTION-IF-FOUND argument) is to prevent AM_PATH_PYTHON() modifying PYTHON_PREFIX/PYTHON_EXEC_PREFIX after ACTION-IF-FOUND is processed.

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

n/a

Review Status

n/a

Edited by Karl Wette

Merge request reports

Loading