+2024-03-26 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Allow the use of both configure.ac and configure.in.
+ * pygnulib/GLImport.py (GLImport.__init__): Remove redundant checks for
+ configure.ac and configure.in.
+ * pygnulib/main.py (main): Check for configure.ac and configure.in
+ before reading it. Pass it to GLImport using the GLConfig object.
+
2024-03-26 Bruno Haible <bruno@clisp.org>
gettime-res: Fix test failure on Solaris 11.4/SPARC.
# Get cached auxdir and libtool from configure.ac/in.
self.cache.setAuxDir('.')
- path = joinpath(self.config['destdir'], 'configure.ac')
- if not isfile(path):
- path = joinpath(self.config['destdir'], 'configure.in')
- if not isfile(path):
- raise GLError(3, path)
- self.config.setAutoconfFile(path)
- with codecs.open(path, 'rb', 'UTF-8') as file:
+ with codecs.open(self.config.getAutoconfFile(), 'rb', 'UTF-8') as file:
data = file.read()
pattern = re.compile(r'^AC_CONFIG_AUX_DIR\((.*)\)$', re.M)
match = pattern.findall(data)
destdir = '.'
config.setDestDir(destdir)
+ # Prefer configure.ac but also look for configure.in.
+ if isfile(joinpath(destdir, 'configure.ac')):
+ configure_ac = joinpath(destdir, 'configure.ac')
+ elif isfile(joinpath(destdir, 'configure.in')):
+ configure_ac = joinpath(destdir, 'configure.in')
+ else:
+ raise classes.GLError(3, joinpath(destdir, 'configure.ac'))
+
+ # Save the Autoconf file path for the rest of the import.
+ config.setAutoconfFile(configure_ac)
+
# Analyze configure.ac.
- with open(joinpath(destdir, 'configure.ac'), 'r', encoding='utf-8') as file:
+ with open(configure_ac, 'r', encoding='utf-8') as file:
configure_ac_data = file.read()
guessed_m4dirs = []