Commit Graph

61 Commits

Author SHA1 Message Date
Franck LeCodeur
88d0e51d38 jam: Fix warning. Argument has type long int but indicated format was int.
Cc bin.linuxx86/variable.o
variable.c: In function ‘var_defines’:
variable.c:121:46: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
  121 |    printf("MAXSYM is too low, need at least %d\n", val - *e);
      |                                             ~^     ~~~~~~~~
      |                                              |         |
      |                                              int       long int
      |                                             %ld

Change-Id: I389577a71416029fdff0f486af745ea482b14ddd
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4397
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-08-30 16:34:35 +00:00
Franck LeCodeur
dcd0415ded jam: Fix warning. Include missing header file.
Include header file for function prototypes hcache_init, hcache_done.
Note that include order is important, i.e. include has to be placed after the lists.h and rules.h includes.

Change-Id: Ic8a286662c8267bdfd19011b5ed8e825ee16d7ee
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4396
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-08-28 06:25:13 +00:00
Franck LeCodeur
1456812988 buildtools: Remove build warnings which are caused by missing return type declarations.
Change-Id: I3cba648f45e9eb537eb43ee2345c59fc33976dc7
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4376
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-08-27 13:29:07 +00:00
Adrien Destugues
c8ecfce34c jam: add an option to generate compile_commands.json
Based on Boost Jam patch: https://github.com/boostorg/build/pull/133
retrofitted to our version. Only the rules whose name contains Cc or C++
are stored there. This can be improved if it's not good enough.

The commands are generated only as they are run. Unfortunately I think
with Jam there isn't really a way to do otherwise.

Change-Id: Ic5d44dc27baa2a2e4157324f6c5a228ab0366afe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3260
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-28 07:08:15 +00:00
Puck Meerburg
51dc302367 jam/Jambase: split AR into ARFLAGS
This brings Jam's usage of AR to be more conventional: the flags for AR
are moved to a separate variable, called ARFLAGS, ensuring that any
environment that overrides the AR variable will still end up using the
correct flags to create the archve.

Change-Id: I00449b284fab132d5fc9239017d742480fb51820
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/3226
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-16 19:16:28 +00:00
Augustin Cavalier
c473a032a0 jam: Use posix_spawn on Haiku. 2020-05-30 00:01:23 -04:00
Simon South
18e01e2af6 jam: jcache: Accept empty input files
Make new_string_list() initialize the buffer it creates to hold a file's
contents, preventing a segfault later on should jam attempt to parse the
contents of an empty file.

Fixes #15250.

Change-Id: I907dccd26e1ca35fbe07ed6d624b0144487134fe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/1716
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-08-13 20:22:35 +00:00
Augustin Cavalier
b3407e33b3 Jambase: Restore old ar flags to fix GCC2. 2018-11-25 11:08:39 -05:00
Augustin Cavalier
6ce894a916 jam: Bump Jambase version, fix typo, and regenerate jambase.c. 2018-11-21 19:07:39 -05:00
Augustin Cavalier
2671c4b959 Jambase: Change default ARFLAGS and enable NOARSCAN by default.
On most systems, "D" (deterministic) is now the default archiving mode,
and so specifying "u" will throw a warning that "D" is being used anyway.
Jam previously assumed, as it was passing "u", that the timestamps inside
.a's were valid when they were actually 0, which was leading to spurious
rebuilds of .as.

After this change, we assume archives cannot be scanned for timestamps,
which should stop the spurious rebuilds of targets on most systems.
2018-11-21 18:46:31 -05:00
Augustin Cavalier
1d198a6bf6 Jambase: Update some rules from Haiku's overridden set.
These are the simple ones that were just overridden to handle spaces
in file names properly.
2018-11-21 18:44:04 -05:00
Augustin Cavalier
35013601f4 Jambase: Remove crelib.
Not needed anymore as I've just removed the platforms that used it.
2018-11-21 18:35:02 -05:00
Augustin Cavalier
8f66ea4bf2 Jambase: Remove old UNIXes. 2018-11-21 18:27:25 -05:00
Augustin Cavalier
b47cc04d00 Jambase: Add a blanket disclaimer about modifications.
Hopefully this is enough to satisfy the license requirements.
Remove some of the "LOCAL CHANGE" comments as a result (ones about
the HeaderCache remain.)
2018-11-21 15:00:12 -05:00
Augustin Cavalier
4d114c95a7 Jambase: Remove Mac OS 9 support.
macOS support is provided via the "MACOSX" case under "UNIX"
and is unaffected by this.

Also remove the Win98 (!) cruft while we're at it.
2018-11-21 14:57:36 -05:00
Augustin Cavalier
531869677c Jambase: Remove RELOCATE.
We don't need to support these ancient compliers anymore, so this
hack can go away.
2018-11-21 14:53:20 -05:00
Augustin Cavalier
161fe1206c Jambase: Remove OS/2, VMS, and Borland support. 2018-11-21 14:51:27 -05:00
Augustin Cavalier
7d73e6afae Jambase: Cleanup formatting and inline LICENSE.
No functional change intended.

We have been putting off refactoring this for too long. It's time to
change that.
2018-11-21 14:48:04 -05:00
Jérôme Duval
923a34a14b jam: use posix_spawnp() instead of fork() on linux.
the gain is about 10% on a 8-job kernel full build.
2018-01-06 16:48:36 +01:00
Adrien Destugues
259af3cf06 Increase MAXSYM and add sanity checks.
I had jam crash in strange ways because a stack-allocatted aray was
overflowing. Double the limit, and add sanity checks with exit and clear
error messages in case it happens again.
2017-07-16 19:40:50 +02:00
Jérôme Duval
f625dd9f94 Revert "jam: Fix build/run on Windows."
This reverts commit 148cc99040.
It broke the build on Linux.
2015-08-07 17:22:50 +02:00
Augustin Cavalier
148cc99040 jam: Fix build/run on Windows.
Only works when compiled in 32-bit mode, as there's a whole bunch
of pointer arithmetic that depends on "int" being 32bit, not 64bit.
2015-07-23 16:45:11 -04:00
Jessica Hamilton
c2607d0bbd jam: add internal dependencies for multi-file generating actions
* Based on https://svn.boost.org/trac/boost/changeset/39341
2014-10-21 20:57:59 +13:00
Paweł Dziepak
862b5480a9 jam: do not set OPTIM by default
If setting OPTIM by jam basically makes it impossible for the project that
is using jam to set its own optimization level while still allowing user
to override that in command line. For example in Haiku jam files there is
line like this: "OPTIM ?= -O2", which obviously is meant to set optimization
level to O2 unless user overwrites it. Unfortunately, because Jam have already
set OPTIM to -O this line never had an intended effect.

After this Jam no longer thinks it knows best what is good for projects
that are using it and Haiku is by default compiled with -O2.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2014-08-25 22:58:39 +02:00
Oliver Tappe
bc712e7525 Fix format-related warnings during build of jam. 2014-08-10 17:16:21 +02:00
Oliver Tappe
6c03949644 Fix warnings when building jam.
Sorry for the included whitespace cleanup.
2014-05-12 23:18:24 +02:00
François Revol
abc7211782 jam: Bump MAXLINE to 120000
It was still too low for another case.
Now it seems to work fine here, including for jam clean.
2013-09-30 04:00:50 +02:00
François Revol
a87e28a706 jam: Lower MAXLINE down to 100k
even 140k was too large here for jam clean to work.
2013-09-30 03:27:33 +02:00
François Revol
d9e13d3607 jam: update MAXLINE to fix build issues for ARM
Looks like it wasn't enough yet after the PM merge.

However we still have an issue with a silently failed Link action
which actually is smaller than the max line size...
2013-09-29 22:37:07 +02:00
Ingo Weinhold
6d82b40597 Merge branch 'package-management' 2013-09-27 01:54:26 +02:00
Ithamar R. Adema
a1d1cf45a5 jam: update MAXLINE to fix build issues for ARM
Jam is reporting "Link actions too long" so increase it.
2013-09-15 05:05:51 +02:00
Ingo Weinhold
531916daa2 jam: jcache: read_file(): fail when encountering too long lines
For its input files jam uses a buffer of 512 chars for fgets(). Lines
would therefore be split silently after that length, which could lead to
"interesting" issues. Now we fail to prevent the situation from going
unnoticed.
2013-07-25 23:00:31 +02:00
Ingo Weinhold
502f1ff979 jam: get_jcache(): clean up when reading the cache failed
When reading the cache file failed we have to assume it is corrupt and
we should use any entries read from it. So now we remove the ones we
read again.
2013-07-25 22:55:11 +02:00
Ingo Weinhold
bbab887c2f jam: delete_jamfile_cache(): don't free cache_file
The value is initialized from a static variable returned by
jcache_name().
2013-07-25 22:52:30 +02:00
Ingo Weinhold
a9f1022a2a jam: jcache: typo in comment 2013-07-25 22:50:34 +02:00
Joseph R. Prostko
e2c280b8f7 Lower optimization level for building jam
* This changes the optimization level from -O3 to -O
* This will prevent segfaults when creating jam via the Makefile on FreeBSD
* Benchmarking was done, and there seems to be no negative performance impact
* Another option would be -O3 -fno-strict-aliasing, but this has no noticeable benefit over -O
2012-10-12 20:40:25 -04:00
Matt Madia
18f073d8bf Bumped up the VERSION and made JAMVERSYM identical to it. 2011-12-22 21:55:54 +00:00
Matt Madia
9ceedecc39 Created new jam variable JAMJOBS, which is set by the -jx flag. 2011-12-22 21:54:22 +00:00
Matt Madia
ed5b974772 Automatic whitespace cleanup. No functional change. 2011-12-22 21:51:29 +00:00
Fredrik Holmqvist
96ef6353b0 Make the ..patience.. count comparison postinc so it shows one at the start and use every 10k target instead.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@41296 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-01 12:18:17 +00:00
Fredrik Holmqvist
7982f87b1e Only write "...patience..." every 5000th target instead of 1000th.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@41295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-01 12:09:05 +00:00
Fredrik Holmqvist
7a4d04f795 Disabled the "..skipped x for lack of y..." message as it is not very useful information and hides the interesting info in noise (why it failed).
It should probably be a command line option as it might be interesting in some cases.
Also added a "Build Failure" at the end if there were failed targets.


git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@41294 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-05-01 11:34:52 +00:00
Fredrik Holmqvist
d1a8102665 Enable O3 optimization for Jam.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@39056 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-23 07:31:08 +00:00
François Revol
5e6384156e I now get Archive actions too long (max 40960)! on OSX, so enlarge it a little.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@38590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-09-08 22:15:37 +00:00
Ingo Weinhold
a676a7f33a Don't use unknown strings as fprintf() format.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@35719 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-02 13:30:31 +00:00
François Revol
1c3ec1efb7 Fix for #4885 (jam crashing in OSX 64bit). The prototype for getcwd() was missing, so defaulting to int as return type, cutting the address to 32bit. We probably want to include unistd.h for other OSes too...
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@34515 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-05 21:01:40 +00:00
Stephan Aßmus
15d161b97e Patch by scottmc:
* On Haiku, the jam install folder should be /boot/common.


git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@32875 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-31 20:39:54 +00:00
Axel Dörfler
04bfbdfd8f * Applied patch by Christian: build fix for Cygwin.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@31258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-26 16:26:50 +00:00
Ingo Weinhold
6835558076 Generated files.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@24624 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-28 14:15:10 +00:00
Ingo Weinhold
7b6de8037d Ported to Haiku.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@24623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-28 14:14:44 +00:00