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",)
+ help="ppoll() is used by default on Linux, OpenBSD and Bitrig, but older versions might need to use pselect instead",)
(options, conf_args) = parser.parse_args()
# g++ call as well as in the later configure.py.
cflags = os.environ.get('CFLAGS', '').split()
ldflags = os.environ.get('LDFLAGS', '').split()
-if platform.is_freebsd() or platform.is_openbsd():
+if platform.is_freebsd() or platform.is_openbsd() or platform.is_bitrig():
cflags.append('-I/usr/local/include')
ldflags.append('-L/usr/local/lib')
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:
+if (platform.is_linux() or platform.is_openbsd() or platform.is_bitrig()) and not options.force_pselect:
cflags.append('-DUSE_PPOLL')
if options.force_pselect:
conf_args.append("--force-pselect")
help='use EXE as the Python interpreter',
default=os.path.basename(sys.executable))
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",)
+ help="ppoll() is used by default on Linux, OpenBSD and Bitrig, but older versions might need to use pselect instead",)
(options, args) = parser.parse_args()
if args:
print('ERROR: extra unparsed command-line arguments:', args)
cflags.append('-fno-omit-frame-pointer')
libs.extend(['-Wl,--no-as-needed', '-lprofiler'])
-if (platform.is_linux() or platform.is_openbsd()) and not options.force_pselect:
+if (platform.is_linux() or platform.is_openbsd() or platform.is_bitrig()) and not options.force_pselect:
cflags.append('-DUSE_PPOLL')
def shell_escape(str):
def platforms():
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
- 'mingw', 'msvc', 'gnukfreebsd8']
+ 'mingw', 'msvc', 'gnukfreebsd8', 'bitrig']
class Platform( object ):
def __init__( self, platform):
self._platform = 'mingw'
elif self._platform.startswith('win'):
self._platform = 'msvc'
+ elif self._platform.startswith('bitrig'):
+ self._platform = 'bitrig'
def platform(self):
def is_sunos5(self):
return self._platform == 'sunos5'
+
+ def is_bitrig(self):
+ return self._platform == 'bitrig'
Fatal("pipe: %s", strerror(errno));
fd_ = output_pipe[0];
#if !defined(USE_PPOLL)
- // On Linux and OpenBSD, we use ppoll in DoWork(); elsewhere we use pselect
+ // On Linux, OpenBSD and Bitrig, we use ppoll in DoWork(); elsewhere we use pselect
// and so must avoid overly-large FDs.
if (fd_ >= static_cast<int>(FD_SETSIZE))
Fatal("pipe: %s", strerror(EMFILE));
return interrupted_;
}
-#else // linux || __OpenBSD__
+#else // linux || __OpenBSD__ || __Bitrig__
bool SubprocessSet::DoWork() {
fd_set set;
int nfds = 0;
return interrupted_;
}
-#endif // linux || __OpenBSD__
+#endif // linux || __OpenBSD__ || __Bitrig__
Subprocess* SubprocessSet::NextFinished() {
if (finished_.empty())
// OS X's process limit is less than 1025 by default
// (|sysctl kern.maxprocperuid| is 709 on 10.7 and 10.8 and less prior to that).
-#if defined(linux) || defined(__OpenBSD__)
+#if defined(linux) || defined(__OpenBSD__) || defined(__Bitrig__)
TEST_F(SubprocessTest, SetWithLots) {
// Arbitrary big number; needs to be over 1024 to confirm we're no longer
// hostage to pselect.
}
ASSERT_EQ(kNumProcs, subprocs_.finished_.size());
}
-#endif // linux || __OpenBSD__
+#endif // linux || __OpenBSD__ || __Bitrig__
// TODO: this test could work on Windows, just not sure how to simply
// read stdin.