From 5ddaa2e4360f0e6d34def16fd90c8ee8bfad5040 Mon Sep 17 00:00:00 2001 From: Roberta Giordano Date: Sun, 4 Nov 2012 10:31:12 +0100 Subject: [PATCH] fixed go build in OSX --- plugins/go/uwsgiplugin.py | 7 ++++++- uwsgiconfig.py | 11 +++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/go/uwsgiplugin.py b/plugins/go/uwsgiplugin.py index 35d89fb3..4cb2be0c 100644 --- a/plugins/go/uwsgiplugin.py +++ b/plugins/go/uwsgiplugin.py @@ -8,10 +8,14 @@ GCC_LIST = ['go_plugin'] def post_build(config): os.environ['GOPATH'] = 'plugins/go' - cflags = ['-I'+os.getcwd(),'-Wno-implicit-function-declaration','-Wno-implicit-int','-Wno-unused-function'] + cflags = ['-I'+os.getcwd()] for c in config.cflags: if not c.startswith('-DUWSGI_BUILD_DATE') and not c.startswith('-DUWSGI_CFLAGS'): cflags.append(c) + + cflags.append('-Wno-implicit-function-declaration') + cflags.append('-Wno-implicit-int') + cflags.append('-Wno-unused-function') os.environ['CGO_CFLAGS'] = ' '.join(cflags).replace('\\"', '') base = os.path.dirname(config.get('bin_name')) @@ -20,3 +24,4 @@ def post_build(config): os.environ['CGO_LDFLAGS'] = '-L' + base + ' -L'+os.getcwd() + ' -luwsgi' if os.system("go install uwsgi") != 0: os._exit(1) + print("*** uwsgi go module available in $GOPATH %s/plugins/go ***" % os.getcwd()) diff --git a/uwsgiconfig.py b/uwsgiconfig.py index d1c88a7e..958b5ce5 100644 --- a/uwsgiconfig.py +++ b/uwsgiconfig.py @@ -272,6 +272,8 @@ def build_uwsgi(uc, print_only=False): cflags.append('-DUWSGI_CFLAGS=\\"%s\\"' % uwsgi_cflags) cflags.append('-DUWSGI_BUILD_DATE="\\"%s\\""' % time.strftime("%d %B %Y %H:%M:%S")) + post_build = [] + push_print("*** uWSGI compiling server core ***") for file in gcc_list: objfile = file @@ -331,9 +333,9 @@ def build_uwsgi(uc, print_only=False): except: pass - post_build = None try: - post_build = up.post_build + if up.post_build: + post_build.append(up.post_build) except: pass @@ -341,8 +343,6 @@ def build_uwsgi(uc, print_only=False): if not cfile.endswith('.a'): compile(' '.join(uniq_warnings(p_cflags)), last_cflags_ts, path + '/' + cfile + '.o', path + '/' + cfile + '.c') - if post_build: - post_build(uc) gcc_list.append('%s/%s' % (path, cfile)) else: gcc_list.append(cfile) @@ -417,6 +417,9 @@ def build_uwsgi(uc, print_only=False): else: print("*** uWSGI is ready, launch it with %s ***" % bin_name) + for pb in post_build: + pb(uc) + class uConf(object):