~ubuntu-branches/ubuntu/saucy/uwsgi/saucy

« back to all changes in this revision

Viewing changes to uwsgiconfig.py

  • Committer: Package Import Robot
  • Author(s): Janos Guljas
  • Date: 2012-04-30 17:35:22 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120430173522-qucwu1au3s9bflhb
Tags: 1.2+dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# uWSGI build system
2
2
 
3
 
uwsgi_version = '1.1.2'
 
3
uwsgi_version = '1.2'
4
4
 
5
5
import os
6
6
import re
306
306
                raise 
307
307
        except:
308
308
            self.include_path = ['/usr/include', '/usr/local/include']
 
309
 
 
310
        additional_include_paths = self.get('additional_include_paths')
 
311
        if additional_include_paths:
 
312
            for ipath in additional_include_paths.split():
 
313
                self.include_path.append(ipath)
309
314
            
310
315
        if not mute:
311
316
            print("detected include path: %s" % self.include_path)
383
388
        if self.has_include('ifaddrs.h'):
384
389
            self.cflags.append('-DUWSGI_HAS_IFADDRS')
385
390
 
 
391
        if uwsgi_os in ('FreeBSD', 'OpenBSD'):
 
392
            if self.has_include('execinfo.h') or os.path.exists('/usr/local/include/execinfo.h'):
 
393
                if os.path.exists('/usr/local/include/execinfo.h'):
 
394
                    self.cflags.append('-I/usr/local/include')
 
395
                    self.ldflags.append('-L/usr/local/lib')
 
396
                self.cflags.append('-DUWSGI_HAS_EXECINFO')
 
397
                self.libs.append('-lexecinfo')
 
398
 
 
399
        if uwsgi_os == 'OpenBSD':
 
400
            try:
 
401
                obsd_major = int(uwsgi_os_k.split('.')[0])
 
402
                obsd_minor = int(uwsgi_os_k.split('.')[1])
 
403
                if obsd_major >= 5 and obsd_minor > 0:
 
404
                    self.cflags.append('-DUWSGI_NEW_OPENBSD')
 
405
            except:
 
406
                pass
 
407
 
386
408
        if uwsgi_os == 'SunOS':
387
409
            self.libs.append('-lsendfile')
388
410
            self.gcc_list.append('lib/sun_fixes')
415
437
            if uwsgi_os == 'Linux' or uwsgi_os == 'SunOS':
416
438
                locking_mode = 'pthread_mutex'
417
439
            # FreeBSD umtx is still not ready for process shared locking
418
 
            #elif uwsgi_os == 'FreeBSD':
419
 
            #    locking_mode = 'umtx'
 
440
            # starting from FreeBSD 9 posix semaphores can be shared between processes
 
441
            elif uwsgi_os == 'FreeBSD':
 
442
                 try:
 
443
                     fbsd_major = int(uwsgi_os_k.split('.')[0])
 
444
                     if fbsd_major >= 9:
 
445
                         locking_mode = 'posix_sem'
 
446
                 except:
 
447
                     pass
420
448
            elif uwsgi_os == 'Darwin':
421
449
                locking_mode = 'osx_spinlock'
422
450
 
423
451
        if locking_mode == 'pthread_mutex':
424
452
            self.cflags.append('-DUWSGI_LOCK_USE_MUTEX')
425
453
        # FreeBSD umtx is still not ready for process shared locking
426
 
        #elif locking_mode == 'umtx':
427
 
        #    self.cflags.append('-DUWSGI_LOCK_USE_UMTX')
 
454
        elif locking_mode == 'posix_sem':
 
455
            self.cflags.append('-DUWSGI_LOCK_USE_POSIX_SEM')
428
456
        elif locking_mode == 'osx_spinlock':
429
457
            self.cflags.append('-DUWSGI_LOCK_USE_OSX_SPINLOCK')
430
458