Lines Matching +full:ninja +full:- +full:linux
9 # http://www.apache.org/licenses/LICENSE-2.0
17 """Script that generates the build.ninja for ninja itself.
19 Projects that use ninja themselves should either write a similar script
20 or use a meta-build system that supports Ninja output."""
40 if self._platform.startswith('linux'):
41 self._platform = 'linux'
67 return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
75 return self._platform == 'linux'
106 return self._platform in ('freebsd', 'linux', 'openbsd', 'bitrig',
120 Used to bootstrap Ninja from scratch. In --bootstrap mode this
123 behave like non-bootstrap mode.
142 # In bootstrap mode, we have no ninja process to catch /showIncludes
157 # Implement just enough of Ninja variable expansion etc. to
199 parser.add_option('--bootstrap', action='store_true',
200 help='bootstrap a ninja binary from nothing')
201 parser.add_option('--verbose', action='store_true',
203 parser.add_option('--platform',
207 parser.add_option('--host',
211 parser.add_option('--debug', action='store_true',
213 parser.add_option('--profile', metavar='TYPE',
216 parser.add_option('--with-gtest', metavar='PATH', help='ignored')
217 parser.add_option('--with-python', metavar='EXE',
220 parser.add_option('--force-pselect', action='store_true',
225 print('ERROR: extra unparsed command-line arguments:', args)
234 BUILD_FILENAME = 'build.ninja'
246 print('bootstrapping ninja...')
249 n.comment('This file is used to build ninja itself.')
258 if '--bootstrap' in configure_args:
259 configure_args.remove('--bootstrap')
295 # tree, simplify all the paths to just be cwd-relative.
330 '/GR-', # Disable RTTI.
332 # Disable size_t -> int truncation warning.
345 cflags = ['-g', '-Wall', '-Wextra',
346 '-Wno-deprecated',
347 '-Wno-missing-field-initializers',
348 '-Wno-unused-parameter',
349 '-fno-rtti',
350 '-fno-exceptions',
351 '-std=c++11',
352 '-fvisibility=hidden', '-pipe',
353 '-DNINJA_PYTHON="%s"' % options.with_python]
355 cflags += ['-D_GLIBCXX_DEBUG', '-D_GLIBCXX_DEBUG_PEDANTIC']
356 cflags.remove('-fno-rtti') # Needed for above pedanticness.
358 cflags += ['-O2', '-DNDEBUG']
361 [CXX, '-fdiagnostics-color', '-c', '-x', 'c++', '/dev/null',
362 '-o', '/dev/null'],
365 cflags += ['-fdiagnostics-color']
369 cflags += ['-D_WIN32_WINNT=0x0601', '-D__USE_MINGW_ANSI_STDIO=1']
370 ldflags = ['-L$builddir']
372 cflags.append('-I/usr/local/include')
373 ldflags.append('-L/usr/local/lib')
376 cflags.append('-D__STDC_FORMAT_MACROS')
377 cflags.append('-D_LARGE_FILES')
383 cflags.remove('-fvisibility=hidden');
384 ldflags.append('-static')
386 cflags.remove('-fvisibility=hidden')
388 cflags.remove('-fvisibility=hidden')
393 cflags.append('-pg')
394 ldflags.append('-pg')
396 cflags.append('-fno-omit-frame-pointer')
397 libs.extend(['-Wl,--no-as-needed', '-lprofiler'])
400 cflags.append('-DUSE_PPOLL')
402 cflags.append('-DNINJA_HAVE_BROWSE')
405 cflags.append('-I.')
432 command='$cxx $cflags -c $in /Fo$out /Fd' + built('$pdb'),
438 command='$cxx -MMD -MT $out -MF $out.d $cflags -c $in -o $out',
454 command='rm -f $out && $ar crs $out $in',
464 command='$cxx $ldflags -o $out $in $libs',
483 n.comment('the depfile parser and ninja lexers are generated using re2c.')
486 proc = subprocess.Popen(['re2c', '-V'], stdout=subprocess.PIPE)
492 command='re2c -b -i --no-generation-date --no-version -o $out $in',
504 cxxvariables = [('pdb', 'ninja.pdb')]
506 n.comment('Generate a library for `ninja-re2c`.')
511 n.build(built('ninja-re2c.lib'), 'ar', re2c_objs)
513 n.build(built('libninja-re2c.a'), 'ar', re2c_objs)
516 n.comment('Core source files all build into ninja library.')
544 for name in ['subprocess-win32',
545 'includes_normalize-win32',
546 'msvc_helper-win32',
547 'msvc_helper_main-win32']:
550 objs += cxx('minidump-win32', variables=cxxvariables)
553 objs += cxx('subprocess-posix')
557 ninja_lib = n.build(built('ninja.lib'), 'ar', objs)
563 libs.append('ninja.lib')
565 libs.append('-lninja')
568 libs.append('-lperfstat')
573 objs = cxx('ninja', variables=cxxvariables)
574 ninja = n.build(binary('ninja'), 'link', objs, implicit=ninja_lib, variable
577 all_targets += ninja
580 # We've built the ninja binary. Don't run any more commands
582 # build.ninja file.
587 if platform.is_aix() and '-maix64' not in ldflags:
589 # memory than will fit in the standard 32-bit AIX shared stack/heap (256M)
590 libs.append('-Wl,-bmaxdata:0x80000000')
608 command='./ninja -t graph all > $out')
610 command='dot -Tpng $in > $out')
611 dot = n.build(built('graph.dot'), 'gendot', ['ninja', 'build.ninja'])
617 command='asciidoc -b docbook -d book -o $out $in',
620 command='xsltproc --nonet doc/docbook.xsl $in > $out',
630 command='dblatex -q -o $out -p doc/dblatex.xsl $in',
657 n.build('build.ninja', 'configure',
662 n.default(ninja)
684 rebuild_args.append('./ninja')
687 bootstrap_exe = 'ninja.bootstrap.exe'
688 final_exe = 'ninja.exe'
690 bootstrap_exe = './ninja.bootstrap'
691 final_exe = './ninja'
700 rebuild_args.append('-v')