Commit Graph

80 Commits

Author SHA1 Message Date
Lucas De Marchi
a5f799af98 build: pass --no-undefined to linker
Do not allow undefined symbols.
2015-01-25 23:29:50 -02:00
Lucas De Marchi
27bcc9111b build: enable LTO and _FORTIFY_SOURCE with optimization
If building with optimization enabled, enable LTO.
2015-01-25 23:28:46 -02:00
Lucas De Marchi
e9b0d1b40e build-sys: integrate coverage report
Just pass --enable-coverage to configure and then "make coverage" to
have the coverage report at coverage dir.
2015-01-07 23:02:34 -02:00
Lucas De Marchi
84aaaedfa6 build-sys: rename cflags/ldflags variable
Not all of them are for warnings or gc.
2015-01-02 16:32:03 -02:00
Mike Auty
fd56638aed build: Do not force diagnostics-color flag
The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache).  Instead, since -fdiagnostic-color=auto
by default  in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.

Based mostly on the systemd commit f44541bc by Michal Schmidt.
2014-12-17 00:41:01 -02:00
Lucas De Marchi
f9e2167b10 kmod 19 2014-11-16 10:24:50 -02:00
Randy MacLeod
9b34db1ae6 Add back-up implementation of be32toh()
Older systems may not have the be32toh function defined. Check for this
and fall back to checking the endianness and calling bswap_32 directly
if needed.  This works on both old and new systems.

[Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>:
address comments raised by Lucas De Marchi [1], update commit message]
[1] http://www.spinics.net/lists/linux-modules/msg01129.html
2014-09-29 17:13:26 -03:00
Lucas De Marchi
ae58de0fcb kmod 18 2014-06-14 12:46:38 -03:00
Lucas De Marchi
04c0956e20 Add strndupa to missing.h 2014-04-07 11:00:24 -03:00
Lucas De Marchi
49d8e0b590 kmod 17 2014-04-06 17:52:44 -03:00
Lucas De Marchi
3a33a7a566 build-sys: add hooks to build python bindings
Add --enable-python configure switch so we build the python bindings. We
also pass version.py through SED_PROCESS macro, so the version is kept
in sync with kmod.

Acked-by: Andy Grover <agrover@redhat.com>
2014-03-26 22:30:56 -03:00
Lucas De Marchi
db62153ea0 build-sys: try harder to shut up compiler wrt strict-aliasing
With -Wstrict-aliasing=2 we get the following warning:

	libkmod/libkmod-signature.c:124:20: note: in expansion of macro 'get_unaligned'
	  sig_len = be32toh(get_unaligned(&modsig->sig_len));

However there's nothing wrong with it. modsig->sig_len is uint32_t and
get_unaligned in this case returns uint32_t. There's notstrict aliasing
violation.
2014-03-24 23:50:24 -03:00
Lucas De Marchi
aa72284f83 build-sys: Remove bogus line causing warning
./configure: line 14316: xyes: command not found

We are not using have_manpages, so remove it.
2014-03-24 14:53:56 -03:00
Lucas De Marchi
bccb4b2545 build-sys: Do not require xsltproc for installation of man pages
Same reason as found in this commit to systemd:

	commit 4ca39b280fce3c60d2fdecbd478fd9bf7f9d3e64
	Author: Mike Gilbert <floppym@gentoo.org>
	Date:   Sun Feb 23 11:21:13 2014 -0500

	    configure: Do not require xsltproc for installation of man pages

	    The release tarballs ship with pre-generated man pages, so we do not
	    need xsltproc for a typical end-user build.

	    Developers will probably have xsltproc anyway, but if not they will now
	    encounter a build-time failure instead of an error in configure.
2014-03-06 02:07:20 -03:00
Lucas De Marchi
36c4bb928a kmod 16 2013-12-22 19:45:19 -02:00
Anders Olofsson
f5cc26c77d build: Allow disabling maintainer mode
This allows make rules for generated build files (i.e.  configure,
Makefile.in, ... ) to be skipped.  This is useful when
the source is stored without timestamps (for example in CVS or GIT).

When the build rules trigger to regenerate the build files, it tries to
use the same autotools version (currently 1.14) as was originally used
for the release.  Since many of our build machines run Debian Squeeze,
they only have autotools 1.11 available and the build fails.

Currently, we have to work around this by touching all the generated
files before building to avoid triggering the make rule. With this
patch, we would be able to just run configure with
--disable-maintainer-mode instead.  The patch sets the default to enable
to not change the default behavior.
2013-11-10 23:41:32 -02:00
Lucas De Marchi
b3e0a07566 build-sys: enable colored diagnostics if available 2013-10-26 02:54:21 -02:00
Lucas De Marchi
4c2dc16a2e build: remove check for typeof
It's used in so many places without checking, that's really pointless to
check for it in macro.h.

Also remove AC_C_TYPEOF from configure.ac since we don't use -ansi.
2013-09-06 11:31:35 -03:00
Thomas Petazzoni
dc8ed09f8f Add configure check for _Static_assert()
Commit 8efede20ef ("Use _Static_assert") introduced the usage of
_Static_assert(). However, _Static_assert() is a fairly new thing,
since it was introduced only in gcc 4.6. In order to support older
compilers, this patch adds a configure.in test that checks whether
_Static_assert() is usable or not, and adjust the behavior of the
assert_cc() macro accordingly.
2013-09-06 11:06:19 -03:00
Lucas De Marchi
18811d22e9 kmod 15 2013-08-22 10:44:08 -03:00
Lucas De Marchi
80cf2c8f05 build: Install bash completion data 2013-07-30 14:45:21 -03:00
Lucas De Marchi
3b38c7fcb5 kmod 14 2013-07-03 12:42:04 -03:00
Lucas De Marchi
b7016153ec build-sys: do not allow --enable static
Do the same as done in systemd by Cristian Rodríguez
<crrodriguez@opensuse.org>. We use private symbols, not namespaced. So
don't pretend we support static linking.
2013-06-06 11:48:38 -03:00
Lucas De Marchi
abb910eb9d kmod 13 2013-04-09 19:35:32 -03:00
Lucas De Marchi
8edd5bb292 build-sys: Always enable parallel tests
Automake < 1.13 doesn't enable parallel tests by default, so add it to our
automake options.
2013-04-09 12:02:37 -03:00
Lucas De Marchi
55112d19f7 libkmod: Move finit_module() definition to missing.h
Check for finit_module() and don't use our own static inline function if
there's such function in libc (or another lib).

In testsuite we need to unconditionally define HAVE_FINIT_MODULE because
we want to override this function, and never use the static inline one
in missing.h
2013-04-09 04:38:27 -03:00
Cristian Rodríguez
41a51c2af9 libkmod: Use secure_getenv if available
"The secure_getenv() function is intended for use in general-purpose
libraries to avoid vulnerabilities that could occur if set-user-ID or
set-group-ID programs accidentally trusted the environment."
2013-04-04 15:58:29 -03:00
Kees Cook
144d1826f1 libkmod: add finit_module logic
When a module is being loaded directly from disk (no compression, etc),
pass the file descriptor to the new finit_module() syscall. If the
finit_module syscall is exported by the kernel syscall headers, use it.
Additionally, if the kernel's module.h file is available, map kmod flags
to finit_module flags.
2013-02-19 19:19:51 -03:00
Lucas De Marchi
6feba02878 kmod 12 2012-12-05 01:39:17 -02:00
Lucas De Marchi
c599606f75 kmod 11 2012-11-08 02:30:21 -02:00
Lucas De Marchi
caaf438cb6 build-sys: use AS_IF autoconf macro
Just for consistency with the rest.
2012-10-23 10:45:10 -02:00
Sami Kerola
5c61b1491e build-sys: require xsltproc when manpages are enabled
Before this commit the build system failed at late state with
non-helpful message when xsltproc was not available.

Making all in man
  GEN      depmod.d.5
/bin/sh: --nonet: command not found
make[2]: *** [depmod.d.5] Error 127
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
2012-10-22 16:06:04 -02:00
Dave Reisner
c5b37dba89 build-sys: Remove --with-rootprefix option
This is a broken option that only leads to misery and incompatabilities
with other systems. Kbuild doesn't come close to supporting directories
other than /lib/modules with several targets simply failing without
hacky fixes. Simply remove the option and all traces of it, as it
doesn't make sense in today's world.
2012-10-02 00:27:31 -03:00
Lucas De Marchi
4075860264 kmod 10 2012-09-06 16:26:53 -03:00
Lucas De Marchi
382de85c94 build-sys: add 'man' entry in summary 2012-07-31 09:51:48 -03:00
Colin Walters
8631552d3d build-sys: Add --disable-manpages option
1) Embedded systems often don't want man pages on the
   target; rather than pointlessly building them, then ignoring
   the result, allow just not building them at all
2) When bootstrapping an operating systems, documentation is the
   source of many cyclical dependencies, and allowing it to
   be explicitly disabled is useful for earlier build passes.
2012-07-31 09:45:59 -03:00
Lucas De Marchi
62081c0f68 kmod 9 2012-06-19 19:46:53 -03:00
Lucas De Marchi
46684bc2d9 kmod 8 2012-04-19 11:21:00 -03:00
Lucas De Marchi
8885ced062 kmod 7 2012-03-19 08:23:14 -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
Lucas De Marchi
3ef7208ecf build-sys: re-organize configure.ac 2012-03-17 11:07:10 -03:00
Randy Witt
1701b1b46f configure.ac: Move link only flags out of CFLAGS and into LDFLAGS.
On the ARM gcc 4.2.2 I'm using I get many
"--as-needed: linker input file unused because linking not done"
style errors when libtool is using compile mode.

In order to silence these warnings and be "correct", the flags that
only make sense for linking were moved into LDFLAGS.
2012-03-17 03:34:08 -03:00
Lucas De Marchi
26906fe73e kmod 6 2012-03-02 22:34:36 -03:00
Lucas De Marchi
bb05bc8ac1 Move repository to kernel.org 2012-02-24 01:58:20 -02:00
Lucas De Marchi
d005aeb752 Check if libc has __xstat
uClibc doesn't use __xstat. Check if it exists, otherwise don't export
the override function.
2012-02-08 20:29:52 -02:00
Lucas De Marchi
e479598b7d kmod 5 2012-02-06 20:34:33 -02:00
Lucas De Marchi
80f9e02382 testsuite: add skeleton 2012-01-26 16:05:04 -02:00
Lucas De Marchi
6068aaaea8 Check if struct stat has mtim member
Not all libc's have a mtim member in struct stat (dietlibc doesn't).
Change ts_usec() to receive a struct stat as parameter and implement it
accordingly for both cases.
2012-01-17 12:22:55 -02:00
Lucas De Marchi
b53b7e3282 kmod 4 2012-01-16 16:53:04 -02:00
Lucas De Marchi
904b57d022 build-sys: build man pages 2012-01-12 14:21:22 -02:00