Fix compilation with solaris 11

Based on original patch from Nathan Tamblyn.

Fix #831
This commit is contained in:
Riccardo Magliocchetti
2015-09-09 18:28:58 +02:00
parent e55ac57e07
commit bbdf4bbab3
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -396,9 +396,10 @@ static int uwsgi_hook_chown2(char *arg) {
}
#ifdef __sun__
#if defined(UWSGI_SUNOS_EXTERN_SETHOSTNAME)
extern int sethostname(char *, int);
#endif
static int uwsgi_hook_hostname(char *arg) {
#ifdef __CYGWIN__
return -1;
+6 -1
View File
@@ -810,7 +810,12 @@ class uConf(object):
self.libs.append('-lsendfile')
self.libs.append('-lrt')
self.gcc_list.append('lib/sun_fixes')
self.ldflags.append('-L/lib')
sunos_major = int(uwsgi_os_k.split('.')[0])
sunos_minor = int(uwsgi_os_k.split('.')[1])
# solaris < 11 does not have sethostname declared in unistd
if not (sunos_major == 5 and sunos_minor > 10):
self.cflags.append('-DUWSGI_SUNOS_EXTERN_SETHOSTNAME')
self.ldflags.append('-L/lib')
if not uwsgi_os_v.startswith('Nexenta'):
self.libs.remove('-rdynamic')