Hi,

I'd like to compile uWsgi on AIX 5.3 with the native xlc_r compiler.
Python2.7 compiles well (ok, mostly).

Below is a patch which fixes the xlc_r quirks (-v prints the man page,
waits for user input forever), but I cannot get around the missing
getopt.

Any ideas?

Thanks,
Tamás Gulácsi

diff -r 94c4492b4ae8 uwsgiconfig.py
--- a/uwsgiconfig.py    Mon Oct 25 20:11:40 2010 +0200
+++ b/uwsgiconfig.py    Tue Oct 26 22:43:13 2010 +0200
@@ -138,14 +138,21 @@
                 self.config = ConfigParser.ConfigParser()
                 self.config.read(filename)
                 self.gcc_list = ['utils', 'protocol', 'socket',
'logging', 'master', 'plugins', 'loop', 'uwsgi']
-                self.cflags = ['-O2', '-Wall', '-Werror',
'-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] +
os.environ.get("CFLAGS", "").split()
-                gcc_version = str(spcall2("%s -v" %
GCC)).split('\n')[-1].split()[2]
+                self.cflags = ['-O2', '-D_LARGEFILE_SOURCE',
'-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
+                if 'xlc_r' == GCC:
+                    (ver_flag, ver_word) = ('-qversion 1>&2', 1)
+                else:
+                    (ver_flag, ver_word) = ('-v', 2)
+                    self.cflags[1:1] = ['-Wall', '-Werror',]
+                print 'xlc_r' == GCC, self.cflags
+                gcc_version = str([x for x in spcall2("%s %s" % (GCC,
ver_flag)).splitlines()
+                    if 'ersion' in x][-1]).split()[ver_word]
                 gcc_major = int(gcc_version.split('.')[0])
                 gcc_minor = int(gcc_version.split('.')[1])
                 if (sys.version_info[0] == 2) or (gcc_major < 4) or
(gcc_major == 4 and gcc_minor < 3):
                         self.cflags = self.cflags + ['-fno-strict-aliasing']
                 # add -fno-strict-aliasing only on python2 and gcc < 4.3
-                if gcc_major >= 4:
+                if gcc_major >= 4 and 'xlc_r' != GCC:
                         self.cflags = self.cflags + [ '-Wextra',
'-Wno-unused-parameter', '-Wno-missing-field-initializers' ]

                 self.ldflags = os.environ.get("LDFLAGS", "").split()
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to