summaryrefslogtreecommitdiffstats
path: root/bootstrap.py
diff options
context:
space:
mode:
authorTobias Hieta <tobias@plexapp.com>2013-05-23 13:12:53 (GMT)
committerTobias Hieta <tobias@plexapp.com>2013-05-23 13:12:53 (GMT)
commit4db8e5ddf0c941616842d2a6e947477145f84783 (patch)
tree14ec736f29c8565cd2218ea48f40cb1b35d73f0e /bootstrap.py
parent082d0bebf627331d618ec712f1aa131f76a3722a (diff)
downloadNinja-4db8e5ddf0c941616842d2a6e947477145f84783.zip
Ninja-4db8e5ddf0c941616842d2a6e947477145f84783.tar.gz
Ninja-4db8e5ddf0c941616842d2a6e947477145f84783.tar.bz2
Added bootstrap/configure option to force pselect
All modern Linux kernels have ppoll() but sometimes you might want to compile on something ancient. This patch adds the possibility to force the use of pselect() instead by passing --force-pselect to bootstrap/configure. The use of ppoll() is still default for Linux and OpenBSD
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-xbootstrap.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bootstrap.py b/bootstrap.py
index cff10ba..5682bf1 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -36,6 +36,8 @@ parser.add_option('--x64', action='store_true',
parser.add_option('--platform',
help='target platform (' + '/'.join(platform_helper.platforms()) + ')',
choices=platform_helper.platforms())
+parser.add_option('--force-pselect', action='store_true',
+ help="ppoll() is used by default on Linux and OpenBSD, but older versions might need to use pselect instead",)
(options, conf_args) = parser.parse_args()
@@ -107,6 +109,10 @@ else:
cflags.append('-D_WIN32_WINNT=0x0501')
if options.x64:
cflags.append('-m64')
+if (platform.is_linux() or platform.is_openbsd()) and not options.force_pselect:
+ cflags.append('-DUSE_PPOLL')
+if options.force_pselect:
+ conf_args.append("--force-pselect")
args.extend(cflags)
args.extend(ldflags)
binary = 'ninja.bootstrap'