Commit Graph

18 Commits

Author SHA1 Message Date
Adrian Bunk f8b8d7b330 build: Stop using dolt
This does regress "make -12" from 0.7s to 0.9s on my
Coffee Lake machine, but even on slower hardware this
will not amount to a noticable slowdown.

On the other hand using dolt can create problems for
people doing cross-compilation, e.g. Yocto has two
hacks just for dolt in kmod:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/kmod/kmod.inc?id=a17abae00785c76cfffe5381a22fb2c86b982e82

(Lucas: remove leftover entry in Makefile and reformat commit message)
2019-02-20 10:38:56 -08:00
Lucas De Marchi a968aa64dd build: add function to build string of features
Add a CC_FEATURE_APPEND function that we can use to append the features
that are enabled/disabled. This will generate a single string in the
form "+FEATURE1 +FEATURE2 -FEATURE3".

Reviewed-by: Andreas Mohr <andim2@users.sf.net>
2015-06-08 22:37:10 -03:00
Lucas De Marchi 9cc8a20d34 build: sync dolt with upstream 2015-03-10 15:17:03 -03:00
Lucas De Marchi da6c0d2f52 build: use dolt
Drop-in replacement to libtool: http://dolt.freedesktop.org/. More
details: http://marc.info/?l=freedesktop-xorg&m=120791871615872&w=3

kmod is relatively fast to compile, so it doesn't matter much.
Nonetheless, less forks the better.

Compilation time using ./bootstrap-configure --disable-manpages and
make -j4

libtool
real    0m6.453s
user    0m21.067s
sys     0m0.773s

dolt
real    0m4.792s
user    0m15.920s
sys     0m0.637s
2015-03-05 13:14:36 -03:00
David Herrmann 29ad07504b from systemd: build: make sure to test for -Wflag instead of -Wno-flag
gcc does not support testing for negated warnings. See here for details:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63499

This patch changes CC_CHECK_FLAG_APPEND to always test for the non-negated
warnings.
2015-02-24 22:45:17 -03:00
Zbigniew Jędrzejewski-Szmek a8f3aaebbe from systemd: build-sys: fix conftest.c to work on arm
All tests for compiler support were failing with:

/usr/bin/ld: /tmp/ccwnVc2A.o: relocation R_ARM_MOVW_ABS_NC against `a' can not be used when making a shared object; recompile with -fPIC
2015-02-24 22:42:06 -03:00
David Herrmann 779729cf53 from systemd: build: check for build/link flags harder
Use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE to test for flags that
might succeed during compilation but not during linking. An example is gcc
compiled with libssp support but gnu-ld without it. In this case
-fstack-protector works fine during compilation but fails during linking
as several internal helpers are missing.
2015-02-24 22:41:30 -03:00
Lucas De Marchi c619d89208 from systemd: build: merge trivial changes back
These were trivial changes applied to systemd tree since the files were
synchronized:

  - change some comments
  - replace tab with space
  - fix typo
2015-02-24 22:37:27 -03:00
Lucas De Marchi aac5f4514f shared: add helper function to add and check for overflow
Use _builtin_uaddll_overflow/_builtin_uaddl_overflow when available,
abstracting the type to use it with uint64_t.

Otherwise fallback to the implementation as added in 67466f2 ("Prevent
offset + size overflow.").

This also adds the tests for this new helper in the testsuite.
2015-02-10 10:43:44 -02:00
Lucas De Marchi 14c3244f04 build: define to 0 if builtin is not available
In order to let us use "#if HAVE__BUILTIN_*" without checking if it's
actually define, make sure we define it to 0 in config.h when the
function is not available.
2015-02-10 10:32:10 -02:00
Lucas De Marchi e6307200af build: check for required builtin functions
These builtins are implemented by both gcc and clang since a long time
and we don't provide fallback for them. Let the configure phase check
for them.
2015-02-10 00:45:42 -02:00
Lucas De Marchi ba52c77e04 build: add better check for builtin function
It's not used right now in kmod, but may be used in future for other
builtins, so let the macro generic.
2015-02-10 00:31:25 -02:00
Lucas De Marchi 7812d88c95 build-sys: Append -Werror when testing flags
Clang doesn't treat unknown warnings flags as an error, but rather as a
warning. The result is that the detection for whic CFLAGS are supported
by this compiler will not work, since the compilation will succeed.

With this patch we now successfully detect clang doesn't support
-Wlogical-op, as opposed to previous behavior:

	checking if clang supports flag -Wlogical-op in envvar CFLAGS... no

We use this macro only for LDFLAGS and CFLAGS, so it's safe to stash
-Werror there.
2012-09-14 11:37:29 -03:00
Lucas De Marchi e48f37657d build-sys: don't set CFLAGS and LDFLAGS
These variables are supposed to be set by user. What we can do in
configure is to set another variable and AC_SUBST() it. Then in
Makefile.am we assign it to AM_{CFLAGS,LDFLAGS}. This way user can
always override their values, in configure or make phase.

Reference: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
2012-03-19 01:17:05 -03:00
Randy Witt 00ff57663d Add CC_CHECK_LDFLAGS_APPEND m4 macro.
This is mostly just preparation for the next patch. But this macro is
used for flags that are only needed during linking but that don't
make sense for normal compilation.

I saw this exact type of patch online for systemd, but it never seems to
have actually been incorporated into their attributes.m4.
2012-03-17 03:34:08 -03:00
Lucas De Marchi 646b83b841 doc: add gtk-doc to generate documentation
Current limitation is horrible no support to sections: we have to to
have separate header files or to maintain the libkmod-sections.txt file.
We are doing the latter.
2012-01-09 05:28:57 -02:00
Gustavo Sverzut Barbieri 822ce2344d beef compile flags.
Beef the compile flags by using the same set recommended by systemd,
it uses attribute.m4 from the xine project to check supported flags.
2011-12-11 20:58:22 -02:00
Lucas De Marchi ecd40ee499 Import skeleton from libabc 2011-11-21 12:35:15 -02:00