petsc/no-parse_makefile.patch
2024-08-06 11:55:12 +02:00

30 lines
1.0 KiB
Diff

diff --git a/config/gmakegen.py b/config/gmakegen.py
index c9c476822c5..f58caab4d71 100644
--- a/config/gmakegen.py
+++ b/config/gmakegen.py
@@ -1,7 +1,6 @@
#! /usr/bin/python3 -sP
import os
-from sysconfig import _parse_makefile as parse_makefile
import sys
import logging
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
@@ -36,6 +35,16 @@ def getlangsplit(name):
def stripsplit(line):
return line[len('#requires'):].replace("'","").split()
+def parse_makefile(fn):
+ out = {}
+ with open(fn) as f:
+ for l in f:
+ print(l[:-1])
+ if "=" in l:
+ a,b = l.split("=", 1)
+ out[a.strip()] = b.strip()
+ return out
+
PetscPKGS = 'sys vec mat dm ksp snes ts tao'.split()
# the key is actually the language suffix, it won't work for suffixes such as 'kokkos.cxx' so use an _ and replace the _ as needed with .
LANGS = dict(kokkos_cxx='KOKKOS', hip_cpp='HIP', sycl_cxx='SYCL', raja_cxx='RAJA', c='C', cxx='CXX', cpp='CPP', cu='CU', F='F', F90='F90')