[Botan-devel] configure.py with Python 3

Jack Lloyd lloyd at randombit.net
Fri Jul 9 13:08:22 EDT 2010


On Fri, Jul 09, 2010 at 05:40:03PM +0100, Paul Johnson wrote:

> configure.py seems to be working now, or at least its running. I have an
> error which could be related to the script, or it could be something
> else:
> 
>     Unknown compiler "gcc"; available options:
> 
> I thought it might be because gcc isn't on the path but I added it and
> it still doesn't work. I wonder if the script may be failing to build
> the list of compilers (it's the only compiler I'd expect it to find)?

The empty 'available options:' suggests that for some reason it's not
able to find/load the files that describe how to run each compiler.
These files live in src/build-data/cc - you should check that these
are actually there as a first step.

Are you running configure from a MinGW shell, or a Windows command
shell?  Also, did you install a MinGW python, or the Win32 python? My
guess here is that something is getting confused between Unix-style
and Windows-style paths, and for that reason it's not finding anything
at all.

I've attached a patch that will make configure dump more data about what
files it actually finds/reads - this may help give a hint.

> I'm working on windows 7, using Qt Creator gui, which installs mingw,
> but in a non-standard location.

This shouldn't matter; configure.py doesn't try to run anything,
especially if you tell it explicitly to use something specific.

> Would it make sense for me to try using the configure.py script from
> 1.9, or do the scripts differ in other ways? Any suggestions would be
> appreciated.

I don't think there is anything changed in 1.9 that would make a
difference here, and in 1.9.4 the description language for source
directories changed to allow for creating internal-only header files,
so it would fail on a 1.8 source tree anyway.

-Jack
-------------- next part --------------
#
# old_revision [8829d8b20c1b0ad55048c36958ef71343f8042e5]
#
# patch "configure.py"
#  from [75825751e22de8acc97e31129716251222db97e1]
#    to [0ca206a39fc239aa8961c88fa8d4a26b391cabd0]
#
============================================================
--- configure.py	75825751e22de8acc97e31129716251222db97e1
+++ configure.py	0ca206a39fc239aa8961c88fa8d4a26b391cabd0
@@ -384,6 +384,9 @@ class ArchInfo(object):
 
 class ArchInfo(object):
     def __init__(self, infofile):
+
+        logging.debug('Reading CPU info file %s' % (infofile))
+
         lex_me_harder(infofile, self,
                       ['aliases', 'submodels', 'submodel_aliases'],
                       { 'realname': '<UNKNOWN>',
@@ -425,6 +428,9 @@ class CompilerInfo(object):
 
 class CompilerInfo(object):
     def __init__(self, infofile):
+
+        logging.debug('Reading compiler info file %s' % (infofile))
+
         lex_me_harder(infofile, self,
                       ['so_link_flags', 'mach_opt', 'mach_abi_linking'],
                       { 'realname': '<UNKNOWN>',
@@ -513,6 +519,9 @@ class OsInfo(object):
 
 class OsInfo(object):
     def __init__(self, infofile):
+
+        logging.debug('Reading OS info file %s' % (infofile))
+
         lex_me_harder(infofile, self,
                       ['aliases', 'target_features', 'supports_shared'],
                       { 'realname': '<UNKNOWN>',
@@ -903,6 +912,10 @@ def load_info_files(options):
     ccinfo = dict([(form_name(info), CompilerInfo(info))
                     for info in list_files_in_build_data('cc')])
 
+    logging.debug('Loaded %d CPU info files' % (len(archinfo)))
+    logging.debug('Loaded %d OS info files' % (len(osinfo)))
+    logging.debug('Loaded %d compiler info files' % (len(ccinfo)))
+
     if 'defaults' in osinfo:
         del osinfo['defaults'] # FIXME (remove the file)
 
@@ -1016,7 +1029,7 @@ def main(argv = None):
 
     logging.basicConfig(stream = sys.stdout,
                         format = '%(levelname) 7s: %(message)s',
-                        level = logging.INFO)
+                        level = logging.DEBUG)
 
     logging.debug('%s invoked with options "%s"' % (
         argv[0], ' '.join(argv[1:])))


More information about the botan-devel mailing list