]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix optional static code analysis using sparse
authorTheodore Ts'o <tytso@mit.edu>
Thu, 24 Oct 2013 00:09:12 +0000 (20:09 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 24 Oct 2013 00:09:12 +0000 (20:09 -0400)
Commit 832cb612: "e2fsprogs: add (optional) sparse checking to the
build" breaks systems that are not using GNU make.  In addition, it
breaks if the developer tries to build in a subdirectory (i.e., if he
or she tries running "make" in the misc or e2fsck or lib/ext2fs
directory), since CHECK_CMD is not set.

Fix this by moving the sparse setup to MCONFIG.

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
MCONFIG.in
Makefile.in

index fa2b03effd247d24a1ae376af2f3540629dfcf9c..557b37ab02e0ce554864fcf4f70231dbdc985b81 100644 (file)
@@ -50,6 +50,20 @@ datadir = @datadir@
 @ifNotGNUmake@ ES = @ES@
 @ifNotGNUmake@ Q = @Q@
 
+@ifGNUmake@ CHECK=sparse
+@ifGNUmake@ CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null
+@ifGNUmake@ ifeq ("$(C)", "2")
+@ifGNUmake@   CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__
+@ifGNUmake@ else
+@ifGNUmake@   ifeq ("$(C)", "1")
+@ifGNUmake@     CHECK_CMD=$(CHECK) $(CHECK_OPTS)
+@ifGNUmake@    else
+@ifGNUmake@     CHECK_CMD=@true
+@ifGNUmake@   endif
+@ifGNUmake@ endif
+
+@ifNotGNUmake@ CHECK_CMD=@true
+
 CC = @CC@
 BUILD_CC = @BUILD_CC@
 CFLAGS = @CFLAGS@
index ef794827e35b61e143033e0b7413ef864feae32a..f327d19d2a3c312b01caa0a8dab52635f3f018fe 100644 (file)
@@ -5,19 +5,6 @@ top_builddir = .
 my_dir = .
 INSTALL = @INSTALL@
 
-CHECK=sparse
-CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null
-ifeq ("$(C)", "2")
-  CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__
-else
-  ifeq ("$(C)", "1")
-    CHECK_CMD=$(CHECK) $(CHECK_OPTS)
-   else
-    CHECK_CMD=@true
-  endif
-endif
-export CHECK_CMD
-
 @MCONFIG@
 
 % : %.sh