fixed go build in OSX

This commit is contained in:
Roberta Giordano
2012-11-04 10:31:12 +01:00
parent f9d0e75056
commit 5ddaa2e436
2 changed files with 13 additions and 5 deletions
+6 -1
View File
@@ -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())
+7 -4
View File
@@ -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):