aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-10 22:45:17 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-07-22 18:46:34 +0200
commite4840993bbc77d640cb2d4c866e8e60e2deb27a9 (patch)
treede10681e3e7c3bd1d152d00fe428071065a5187c /scripts
parent217209ce8f494788d03fe8dc4d28c07d47eaeffd (diff)
downloadhardware_replicant_libsamsung-ipc-e4840993bbc77d640cb2d4c866e8e60e2deb27a9.tar.gz
hardware_replicant_libsamsung-ipc-e4840993bbc77d640cb2d4c866e8e60e2deb27a9.tar.bz2
hardware_replicant_libsamsung-ipc-e4840993bbc77d640cb2d4c866e8e60e2deb27a9.zip
configure.ac: Add an option to use scripts/guix.scm's strict CFLAGS
The CFLAGS that are in the %common-strict-cflags in scripts/guix.scm have been validated with both GCC and CLANG and they are useful to find potential issues in the code or code that won't compile on Android. However while the scripts/guix.scm script is really useful to test commits once they are ready, it is less convenient to use it when fixing issues in commits that are still being worked on. This is because it is not as fast as building libsamsung-ipc directly because: - it requires a clean source directory to work (this can be done with make distclean) so we can't reuse the current build output - libsamsung-ipc source code is copied and built 5 times (in different configurations) As for the implementation, AM_CFLAGS was used instead of appending to the default CFLAGS as CFLAGS is meant to be a variable for users. The effect is that both are independent, so if users don't want strict CFLAGS, they would need to not use --enable-strict-cflags. And it was implemented as a shell script to at the same time: - Enable to have comments, and good formating of the flags. - Enable to share the cflags between guix.scm and the autotools. - Keep the complexity low to keep it working in most situations. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/guix.scm19
1 files changed, 5 insertions, 14 deletions
diff --git a/scripts/guix.scm b/scripts/guix.scm
index 4a772a9..19d6221 100644
--- a/scripts/guix.scm
+++ b/scripts/guix.scm
@@ -65,20 +65,11 @@
(gnu packages valgrind))
(define %common-strict-cflags
- (string-append
- " CFLAGS="
- " -W"
- " -Wall"
- " -Werror"
- " -Werror=address"
- " -Werror=return-type"
- " -Werror=sequence-point"
- " -Winit-self"
- " -Wno-unused"
- " -Wpedantic"
- " -Wpointer-arith"
- " -Wunused"
- " -Wunused-function"))
+ (let* ((port (open-input-pipe
+ "./strict-cflags.sh"))
+ (str (read-line port)))
+ (close-pipe port)
+ (string-append "CFLAGS=" str)))
(define %clang-strict-cflags
(string-append