builder.git
17 months agoRead output from external task while waiting master
Mikko Rasa [Fri, 21 Jun 2019 17:59:15 +0000 (20:59 +0300)]
Read output from external task while waiting

Waiting for the process to finish first may lead to a deadlock if it
produces more output than can fit in the pipe's buffers.

17 months agoAdd a statement to specify multiple arguments at once for a generator
Mikko Rasa [Wed, 12 Jun 2019 17:08:03 +0000 (20:08 +0300)]
Add a statement to specify multiple arguments at once for a generator

17 months agoSupport generators that require a switch before output file name
Mikko Rasa [Wed, 12 Jun 2019 16:41:12 +0000 (19:41 +0300)]
Support generators that require a switch before output file name

17 months agoAllow generator commands to reside outside of the package
Mikko Rasa [Wed, 12 Jun 2019 16:40:01 +0000 (19:40 +0300)]
Allow generator commands to reside outside of the package

In particular, this lets system binaries to be used as generators.

18 months agoProvide a binary package for libmad
Mikko Rasa [Thu, 6 Jun 2019 13:08:38 +0000 (16:08 +0300)]
Provide a binary package for libmad

It does not provide a .pc file of its own.

18 months agoUse a more appropriate check for adding -m<bits> flag
Mikko Rasa [Mon, 3 Jun 2019 12:37:02 +0000 (15:37 +0300)]
Use a more appropriate check for adding -m<bits> flag

The bits check was redundant because it's already included in the native
flag.  On the other hand -m<bits> is not supported on all architectures,
in particular on ARM.

18 months agoUse a different cross-compile prefix for 64-bit Windows
Mikko Rasa [Mon, 3 Jun 2019 12:00:07 +0000 (15:00 +0300)]
Use a different cross-compile prefix for 64-bit Windows

The i686 version of MinGW won't compile 64-bit binaries even with -m64.

18 months agoFix check for appending pattern suffix
Mikko Rasa [Mon, 3 Jun 2019 11:59:04 +0000 (14:59 +0300)]
Fix check for appending pattern suffix

If the body is too short to already contain the suffix, it should be
added.

18 months agoUpdate deprecated things
Mikko Rasa [Mon, 3 Jun 2019 11:58:50 +0000 (14:58 +0300)]
Update deprecated things

23 months agoRemove the -lmingw32 hack
Mikko Rasa [Wed, 26 Dec 2018 22:41:03 +0000 (00:41 +0200)]
Remove the -lmingw32 hack

Libmspcore now implements main() on Windows so it isn't needed anymore.

23 months agoDon't apply parts of a pattern that are already present
Mikko Rasa [Tue, 25 Dec 2018 11:06:30 +0000 (13:06 +0200)]
Don't apply parts of a pattern that are already present

This allows naming a library component "libsomething" without the final
file name having a double lib prefix.

2 years agoSlight updates to Readme
Mikko Rasa [Thu, 30 Aug 2018 11:13:00 +0000 (14:13 +0300)]
Slight updates to Readme

2 years agoAdd support for statically linking the C++ standard library
Mikko Rasa [Thu, 30 Aug 2018 11:06:03 +0000 (14:06 +0300)]
Add support for statically linking the C++ standard library

It can be requested by setting the libmode for "stdc++" as STATIC.

2 years agoUse -rpath (or -rpath-link) when linking
Mikko Rasa [Thu, 30 Aug 2018 11:01:33 +0000 (14:01 +0300)]
Use -rpath (or -rpath-link) when linking

It avoids the need to use LD_LIBRARY_PATH when running programs linked
against custom libraries.  The default build types have been amended so
that debug builds use an absolute rpath.  This allows them to be run from
the source tree.  Release builds use a relative rpath to make them more
easily relocatable in the filesystem.

2 years agoUse const references in BuildInfo::Tracked operators
Mikko Rasa [Thu, 30 Aug 2018 10:41:06 +0000 (13:41 +0300)]
Use const references in BuildInfo::Tracked operators

2 years agoSilence the cast-function-type warning on GCC 8
Mikko Rasa [Thu, 30 Aug 2018 10:07:40 +0000 (13:07 +0300)]
Silence the cast-function-type warning on GCC 8

It causes problems when function type need to be explicitly converted,
like in sigc++.

2 years agoMove version discovery back to GnuCompiler
Mikko Rasa [Thu, 30 Aug 2018 10:05:24 +0000 (13:05 +0300)]
Move version discovery back to GnuCompiler

It's needed to determine whether some options are supported

2 years agoAlso store library path in static libraries
Mikko Rasa [Sun, 8 Jul 2018 15:25:19 +0000 (18:25 +0300)]
Also store library path in static libraries

2 years agoUse build info to store static library dependencies
Mikko Rasa [Sun, 8 Jul 2018 14:47:49 +0000 (17:47 +0300)]
Use build info to store static library dependencies

In some cases it's desirable to link a particular library statically but
use dynamic linking for its dependencies.  In particular, libpng and
libvorbis depend on libm, which is considered a part of libc and must be
linked in the same way.  Now all libraries are looked up according to
libmode, making such linking possible.

2 years agoDon't crash if the executable of a GnuCompiler is not found
Mikko Rasa [Mon, 25 Jun 2018 21:15:36 +0000 (00:15 +0300)]
Don't crash if the executable of a GnuCompiler is not found

3 years agoUse $sdk_root/ndk-bundle as default path for Android NDK
Mikko Rasa [Mon, 4 Dec 2017 08:15:24 +0000 (10:15 +0200)]
Use $sdk_root/ndk-bundle as default path for Android NDK

It's now available for download through the SDK manager, which installs it
in this location.

3 years agoRecognize and use the common sysroot in newer Android NDKs
Mikko Rasa [Mon, 4 Dec 2017 08:06:41 +0000 (10:06 +0200)]
Recognize and use the common sysroot in newer Android NDKs

3 years agoClean up compiler and linker constructors
Mikko Rasa [Sun, 3 Dec 2017 15:05:28 +0000 (17:05 +0200)]
Clean up compiler and linker constructors

Now that the system path is populated in do_prepare, it's no longer
necessary to pass the sysroot as a constructor parameter.

3 years agoAlso get the linker system path from the actual linker program
Mikko Rasa [Sun, 3 Dec 2017 11:08:24 +0000 (13:08 +0200)]
Also get the linker system path from the actual linker program

3 years agoRevert to default system path for GnuCompiler is autodetection fails
Mikko Rasa [Sun, 3 Dec 2017 09:13:29 +0000 (11:13 +0200)]
Revert to default system path for GnuCompiler is autodetection fails

3 years agoImprove problem reporting for the Android toolchain
Mikko Rasa [Sat, 2 Dec 2017 21:31:24 +0000 (23:31 +0200)]
Improve problem reporting for the Android toolchain

Rather than throwing exceptions with cryptic messages, add the problems
to the tools' problem lists.

3 years agoMake AndroidCompiler more robust about detecting the cxx-stl location
Mikko Rasa [Fri, 1 Dec 2017 13:27:47 +0000 (15:27 +0200)]
Make AndroidCompiler more robust about detecting the cxx-stl location

On recent NDK versions the toolchain reports its version as 4.9.x but the
cxx-stl directory is still 4.9.

3 years agoHave SubTool automatically pass calls to the parent tool
Mikko Rasa [Fri, 1 Dec 2017 11:09:22 +0000 (13:09 +0200)]
Have SubTool automatically pass calls to the parent tool

3 years agoInterrogate the compiler for the system path
Mikko Rasa [Fri, 1 Dec 2017 11:08:09 +0000 (13:08 +0200)]
Interrogate the compiler for the system path

Rather than trying to guesstimate it from the compiler version.

3 years agoImprove ExternalTask::run_and_capture_output
Mikko Rasa [Fri, 1 Dec 2017 11:03:46 +0000 (13:03 +0200)]
Improve ExternalTask::run_and_capture_output

Redirect input from /dev/null and allow stderr to be captured as well.

3 years agoPrepare tools before querying their system path in the VFS
Mikko Rasa [Fri, 1 Dec 2017 09:18:24 +0000 (11:18 +0200)]
Prepare tools before querying their system path in the VFS

3 years agoCollapse the language-specific compilers into a single class
Mikko Rasa [Fri, 1 Dec 2017 07:48:37 +0000 (09:48 +0200)]
Collapse the language-specific compilers into a single class

There's very little differences between languages of the C family, but on
the other hand different platform SDKs need their own tweaks.  It makes
more sense to abstract by platform rather than by language here.

3 years agoCombine the gnu and clang toolchains into SystemToolchain
Mikko Rasa [Fri, 1 Dec 2017 07:12:13 +0000 (09:12 +0200)]
Combine the gnu and clang toolchains into SystemToolchain

3 years agoAdd FPU specification to Architecture and GnuCompiler
Mikko Rasa [Thu, 16 Nov 2017 12:28:28 +0000 (14:28 +0200)]
Add FPU specification to Architecture and GnuCompiler

3 years agoDon't treat using deprecated declarations as errors
Mikko Rasa [Fri, 6 Jan 2017 02:49:43 +0000 (04:49 +0200)]
Don't treat using deprecated declarations as errors

They can be impossible to avoid sometimes if a non-deprecated replacement
is not available.

3 years agoAttach component information to data source files
Mikko Rasa [Fri, 6 Jan 2017 02:46:48 +0000 (04:46 +0200)]
Attach component information to data source files

3 years agoCompilation fix
Mikko Rasa [Fri, 6 Jan 2017 02:36:15 +0000 (04:36 +0200)]
Compilation fix

Erase with const_iterator is allowed in C++11 so I didn't notice this
before.

3 years agoOnly use source files that are actually files
Mikko Rasa [Thu, 5 Jan 2017 23:02:52 +0000 (01:02 +0200)]
Only use source files that are actually files

And not, say, directories.

4 years agoSupport source generators that combine multiple files into one
Mikko Rasa [Fri, 18 Nov 2016 21:06:20 +0000 (23:06 +0200)]
Support source generators that combine multiple files into one

Some existing tools have processing unit annotations too, but for some of
them it's not clear what the unit should be.

4 years agoCheck for some errors in SourceGenerator
Mikko Rasa [Fri, 18 Nov 2016 20:29:49 +0000 (22:29 +0200)]
Check for some errors in SourceGenerator

4 years agoChange the suffix of modules
Mikko Rasa [Sat, 29 Oct 2016 16:44:24 +0000 (19:44 +0300)]
Change the suffix of modules

.m is already used by Objective-C.  It seems there's some precedent of
.dlm as Dynamic Link Module.

4 years agoUse correct library path for libraries from the containing package
Mikko Rasa [Sun, 9 Oct 2016 12:08:52 +0000 (15:08 +0300)]
Use correct library path for libraries from the containing package

4 years agoCheck DataTransform's directory mtime against cache mtime
Mikko Rasa [Tue, 4 Oct 2016 14:42:18 +0000 (17:42 +0300)]
Check DataTransform's directory mtime against cache mtime

Transforms commonly contain wildcard patterns, so the set of source files
may change without the transform itself changing.

4 years agoAdd .lib as a static library suffix for Windows
Mikko Rasa [Tue, 4 Oct 2016 14:41:50 +0000 (17:41 +0300)]
Add .lib as a static library suffix for Windows

4 years agoExplicitly add -lmingw32 before any other libraries
Mikko Rasa [Fri, 16 Sep 2016 22:32:45 +0000 (01:32 +0300)]
Explicitly add -lmingw32 before any other libraries

This fixes linking when WinMain() is in a library (such as libmspcore)
and shouldn't be harmful when it isn't.

4 years agoUpdate cross prefix for windows architecture
Mikko Rasa [Fri, 16 Sep 2016 22:31:24 +0000 (01:31 +0300)]
Update cross prefix for windows architecture

4 years agoAdjust the find command line
Mikko Rasa [Sun, 31 Jan 2016 15:12:22 +0000 (17:12 +0200)]
Adjust the find command line

The list syntax is a GNU extension, so use -false and -o to achieve the
same effect.

5 years agoSet the debuggable flag in Android manifest if debug is set in build info
Mikko Rasa [Thu, 19 Nov 2015 09:01:24 +0000 (11:01 +0200)]
Set the debuggable flag in Android manifest if debug is set in build info

5 years agoAllow Android application permissions to be set in Build file
Mikko Rasa [Thu, 19 Nov 2015 08:57:02 +0000 (10:57 +0200)]
Allow Android application permissions to be set in Build file

5 years agoMinor cleanup to the BuildInfo class
Mikko Rasa [Sat, 31 Oct 2015 15:27:31 +0000 (17:27 +0200)]
Minor cleanup to the BuildInfo class

5 years agoPass language standards throuhg ALL dependencies
Mikko Rasa [Sat, 31 Oct 2015 15:25:45 +0000 (17:25 +0200)]
Pass language standards throuhg ALL dependencies

Not just direct ones.  I really don't know why I put it in the !=CHAINED
block.

5 years agoAllow features to be exported
Mikko Rasa [Tue, 13 Oct 2015 19:55:10 +0000 (22:55 +0300)]
Allow features to be exported

While overlay directories are generally preferred, sometimes it's not
worth the effort for a small feature.  In those cases the -D switch needs
to be applied to any package that might use the library's headers.

5 years agoRecent versions of sigc++ require C++11
Mikko Rasa [Tue, 13 Oct 2015 19:52:18 +0000 (22:52 +0300)]
Recent versions of sigc++ require C++11

5 years agoPass language standards through dependencies
Mikko Rasa [Tue, 13 Oct 2015 19:32:20 +0000 (22:32 +0300)]
Pass language standards through dependencies

If a library uses a particular standard in its headers, all packages that
depend on it should use that standard as well (unless overridden at the
package).

5 years agoFix bootstrap to handle overlays in a more generic way
Mikko Rasa [Mon, 9 Mar 2015 16:58:40 +0000 (18:58 +0200)]
Fix bootstrap to handle overlays in a more generic way

6 years agoInclude the threads flag if a static library needs it
Mikko Rasa [Tue, 11 Nov 2014 07:16:15 +0000 (09:16 +0200)]
Include the threads flag if a static library needs it

6 years agoDeal with static build flags for binary packages
Mikko Rasa [Mon, 10 Nov 2014 18:50:35 +0000 (20:50 +0200)]
Deal with static build flags for binary packages

Some libraries have internal dependencies to other libraries, which are
automatically pulled in with dynamic linking, but need to be manually
specified to the linker when linking statically.

6 years agoFix DataCollection dependencies
Mikko Rasa [Mon, 10 Nov 2014 17:51:44 +0000 (19:51 +0200)]
Fix DataCollection dependencies

Since DataTransform is not buildable, it won't get a rebuild flag even if
its dependencies change.  Thus the dependencies must also be added to
DataCollection.

6 years agoUse parameterless system path accessors
Mikko Rasa [Mon, 10 Nov 2014 17:49:30 +0000 (19:49 +0200)]
Use parameterless system path accessors

Since the -C option causes a chdir early in the initialization, an argv[0]
of "./builder" could break things.

6 years agoRemove some unused #includes
Mikko Rasa [Wed, 15 Oct 2014 18:28:59 +0000 (21:28 +0300)]
Remove some unused #includes

6 years agoAllow specifying fixed arguments for source generators
Mikko Rasa [Wed, 15 Oct 2014 18:28:12 +0000 (21:28 +0300)]
Allow specifying fixed arguments for source generators

Currently, the fixed arguments are placed at the front of the command
line, with the template file coming last.

6 years agoSupport conditionals inside source generator definitions
Mikko Rasa [Wed, 15 Oct 2014 18:27:45 +0000 (21:27 +0300)]
Support conditionals inside source generator definitions

6 years agoMove conditionals into helper classes
Mikko Rasa [Wed, 15 Oct 2014 18:23:22 +0000 (21:23 +0300)]
Move conditionals into helper classes

6 years agoAdd a list of symbols to keep in the binary to BuildInfo
Mikko Rasa [Sat, 11 Oct 2014 06:35:21 +0000 (09:35 +0300)]
Add a list of symbols to keep in the binary to BuildInfo

The linker normally does not pull unnecessary symbols from static
libraries, which can cause problems if those symbols are meant to be
referenced externally.

6 years agoBetter algorithm for ordering static libraries
Mikko Rasa [Sat, 11 Oct 2014 04:36:01 +0000 (07:36 +0300)]
Better algorithm for ordering static libraries

Put each static library dependency immediately after the library that
required it.  This way, if a tool includes a static library in its own
build_info (such as gnustl_static for AndroidCxxCompiler), it will be
placed last and be available for all other static libraries.

6 years agoProvide the AR tool on Android
Mikko Rasa [Fri, 10 Oct 2014 21:44:37 +0000 (00:44 +0300)]
Provide the AR tool on Android

6 years agoForce shared linking on Android
Mikko Rasa [Fri, 10 Oct 2014 21:43:05 +0000 (00:43 +0300)]
Force shared linking on Android

Android applications are not run as standalone programs, but instead
loaded as native libraries into the Java VM.

6 years agoOnly use files from the first overlay that has them
Mikko Rasa [Fri, 10 Oct 2014 19:08:45 +0000 (22:08 +0300)]
Only use files from the first overlay that has them

This allows special-casing pieces of code for some platforms without
fragmenting the directory structure too badly.

6 years agoMake use of Task's file affinity and unlinking capabilities in Copy
Mikko Rasa [Fri, 10 Oct 2014 16:41:59 +0000 (19:41 +0300)]
Make use of Task's file affinity and unlinking capabilities in Copy

6 years agoA bunch of new tools and targets to build Android packages
Mikko Rasa [Fri, 10 Oct 2014 16:35:44 +0000 (19:35 +0300)]
A bunch of new tools and targets to build Android packages

Currently can only build apks using NativeActivity and debug key, and
will probably break if the package has a version.  Still, it's useful
in certain configurations so I'll commit this version now and continue
improving it.

6 years agoAdd some logging to AndroidTools
Mikko Rasa [Fri, 10 Oct 2014 11:12:50 +0000 (14:12 +0300)]
Add some logging to AndroidTools

6 years agoOnly get DataTransform directory contents when needed
Mikko Rasa [Fri, 10 Oct 2014 10:25:31 +0000 (13:25 +0300)]
Only get DataTransform directory contents when needed

6 years agoBetter incpath logic in AndroidCxxCompiler
Mikko Rasa [Fri, 10 Oct 2014 10:07:56 +0000 (13:07 +0300)]
Better incpath logic in AndroidCxxCompiler

Don't expose the private directory through system_path, since programs
are not suppose to #include those files directly.  Also use architecture
to determine which subdir to pick.

6 years agoIntroduce a helper function in Architecture to pick the best matching name
Mikko Rasa [Fri, 10 Oct 2014 09:59:58 +0000 (12:59 +0300)]
Introduce a helper function in Architecture to pick the best matching name

6 years agoDon't generate filenames with double dash for versionless packages
Mikko Rasa [Thu, 9 Oct 2014 22:18:58 +0000 (01:18 +0300)]
Don't generate filenames with double dash for versionless packages

6 years agoAdd a field for a human-readable name for packages
Mikko Rasa [Thu, 9 Oct 2014 22:14:57 +0000 (01:14 +0300)]
Add a field for a human-readable name for packages

6 years agoNot all devices have libgnustl_shared.so, so better link the static one
Mikko Rasa [Thu, 9 Oct 2014 22:11:51 +0000 (01:11 +0300)]
Not all devices have libgnustl_shared.so, so better link the static one

6 years agoSupport "installing" files to a private staging area
Mikko Rasa [Thu, 9 Oct 2014 22:07:05 +0000 (01:07 +0300)]
Support "installing" files to a private staging area

6 years agoUse C++ include path from sysroot
Mikko Rasa [Thu, 9 Oct 2014 21:02:02 +0000 (00:02 +0300)]
Use C++ include path from sysroot

6 years agoAdd utility class for executing chains of tasks
Mikko Rasa [Thu, 9 Oct 2014 17:46:37 +0000 (20:46 +0300)]
Add utility class for executing chains of tasks

6 years agoSupport redirecting ExternalTask's stdin/stdout from/to a file
Mikko Rasa [Thu, 9 Oct 2014 17:42:57 +0000 (20:42 +0300)]
Support redirecting ExternalTask's stdin/stdout from/to a file

6 years agoA bunch of minor cleanups
Mikko Rasa [Wed, 8 Oct 2014 22:42:04 +0000 (01:42 +0300)]
A bunch of minor cleanups

6 years agoRewrite ExternalTask to use Msp::Process
Mikko Rasa [Wed, 8 Oct 2014 20:08:16 +0000 (23:08 +0300)]
Rewrite ExternalTask to use Msp::Process

6 years agoUse qualified name in base class initializer
Mikko Rasa [Mon, 6 Oct 2014 23:02:48 +0000 (02:02 +0300)]
Use qualified name in base class initializer

6 years agoAlso default to clang on FreeBSD
Mikko Rasa [Mon, 6 Oct 2014 21:55:42 +0000 (00:55 +0300)]
Also default to clang on FreeBSD

6 years agoAdd more recognized architectures
Mikko Rasa [Mon, 6 Oct 2014 21:47:21 +0000 (00:47 +0300)]
Add more recognized architectures

Aliases can now resolve to multiple parts, so words like x86_64 or win32
can do the right thing.

The pc type was changed to x86, because that more accurately describes
the processor archetype.

6 years agoAdd a binary package for zlib
Mikko Rasa [Mon, 6 Oct 2014 21:00:48 +0000 (00:00 +0300)]
Add a binary package for zlib

Not all systems ship it with a .pc file

6 years agoMove the bpk files into a subdirectory and install them
Mikko Rasa [Mon, 6 Oct 2014 20:58:30 +0000 (23:58 +0300)]
Move the bpk files into a subdirectory and install them

6 years agoUse frameworks instead of raw libraries for OpenGL and OpenAL on OS X
Mikko Rasa [Mon, 6 Oct 2014 20:54:15 +0000 (23:54 +0300)]
Use frameworks instead of raw libraries for OpenGL and OpenAL on OS X

6 years agoAdd support for specifying the language standard to use
Mikko Rasa [Mon, 6 Oct 2014 20:49:40 +0000 (23:49 +0300)]
Add support for specifying the language standard to use

6 years agoDrop support for generic tarball components
Mikko Rasa [Mon, 6 Oct 2014 20:43:34 +0000 (23:43 +0300)]
Drop support for generic tarball components

I originally envisioned using them for creating binary release tarballs,
but that turns out to be a less than spectacular idea.  Tarballs only
really work as a distribution format on Linux.  Other platforms either
use a different archive format or require more complicated preparations.

6 years agoSplit Component into several subclasses
Mikko Rasa [Mon, 6 Oct 2014 00:13:37 +0000 (03:13 +0300)]
Split Component into several subclasses

The create_targets function in particular was rather unwieldy and
contained four completely separate branches.  Having distinct component
types in different classes will also enhance modularity.

6 years agoDon't use soname for modules
Mikko Rasa [Sun, 5 Oct 2014 23:59:28 +0000 (02:59 +0300)]
Don't use soname for modules

6 years agoDon't rely on component type in determining whether to use -fPIC
Mikko Rasa [Sun, 5 Oct 2014 23:49:06 +0000 (02:49 +0300)]
Don't rely on component type in determining whether to use -fPIC

Instead let SharedLibrary set a flag in ObjectFiles and use that.

6 years agoCollect libpath for static library dependencies from the libs themselves
Mikko Rasa [Sun, 5 Oct 2014 23:41:14 +0000 (02:41 +0300)]
Collect libpath for static library dependencies from the libs themselves

Also fixes Binary::find_dependencies which broke in 3f0f721.

6 years agoAdd options for custom compiler and debug build to bootstrap.sh
Mikko Rasa [Sun, 5 Oct 2014 21:53:02 +0000 (00:53 +0300)]
Add options for custom compiler and debug build to bootstrap.sh

These are not expected to be used normally, but may help in an initial
port to a new platform.

6 years agoRecognize PowerPC architecture
Mikko Rasa [Sun, 5 Oct 2014 11:47:24 +0000 (14:47 +0300)]
Recognize PowerPC architecture

6 years agoOlder versions of OS X don't have clang
Mikko Rasa [Sun, 5 Oct 2014 11:46:54 +0000 (14:46 +0300)]
Older versions of OS X don't have clang

6 years agoAllow overriding tool commands on the command line
Mikko Rasa [Sun, 5 Oct 2014 11:46:28 +0000 (14:46 +0300)]
Allow overriding tool commands on the command line

6 years agoVarious cleanups
Mikko Rasa [Sun, 5 Oct 2014 00:47:08 +0000 (03:47 +0300)]
Various cleanups