[source] e2fsprogs: fix build on OS X systems

LEDE Commits lede-commits at lists.infradead.org
Mon Jul 4 07:26:58 PDT 2016


jow pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=70b4e4680461b08e58e1b6d54ebf6980fbb2c61a

commit 70b4e4680461b08e58e1b6d54ebf6980fbb2c61a
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Jul 1 16:41:46 2016 +0200

    e2fsprogs: fix build on OS X systems
    
    On OS X systems, the compilation of e2fsprogs fails at subst.c due to a
    missing sys/stat.h include:
    
        subst.c:333:14: error: variable has incomplete type 'struct stat'
                struct stat stbuf;
                            ^
        subst.c:333:9: note: forward declaration of 'struct stat'
                struct stat stbuf;
                       ^
        subst.c:392:8: warning: implicit declaration of function 'fstat' is invalid in C99
              [-Wimplicit-function-declaration]
                                if (fstat(fd, &stbuf) == 0) {
                                    ^
        subst.c:438:12: warning: implicit declaration of function 'fchmod' is invalid in C99
              [-Wimplicit-function-declaration]
                                        (void) fchmod(ofd, 0444);
                                               ^
        2 warnings and 1 error generated.
        make[3]: *** [subst.o] Error 1
    
    Declare the nescessary HAVE_SYS_STAT_H macro to include the required header in
    order to avoid the undeclared stat structure.
    
    Tested-By: David Thornley <david.thornley at touchstargroup.com>
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/utils/e2fsprogs/Makefile                               |  2 +-
 package/utils/e2fsprogs/patches/002-fix-subst-host-build.patch | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 9da52d8..247b5ed 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=e2fsprogs
 PKG_VERSION:=1.43.1
 PKG_MD5SUM:=1775f3f0eed9dee1c5f39e08d1964a97
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/e2fsprogs
diff --git a/package/utils/e2fsprogs/patches/002-fix-subst-host-build.patch b/package/utils/e2fsprogs/patches/002-fix-subst-host-build.patch
new file mode 100644
index 0000000..c92e228
--- /dev/null
+++ b/package/utils/e2fsprogs/patches/002-fix-subst-host-build.patch
@@ -0,0 +1,10 @@
+--- a/util/subst.c
++++ b/util/subst.c
+@@ -9,6 +9,7 @@
+ #include "config.h"
+ #else
+ #define HAVE_SYS_TIME_H
++#define HAVE_SYS_STAT_H
+ #endif
+ #include <stdio.h>
+ #include <errno.h>



More information about the lede-commits mailing list