summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2019-07-23 13:48:29 -0700
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-24 09:16:16 +0200
commit05a30292f9d2be63af3b4c27d5ae89801da602a2 (patch)
treef9f596d38b05889dbcb83f9df5c9bcda7dbe48c5
parentd6f15cb9b054ed76b5bee2e6924d4b0b2a5e52ae (diff)
Enable largefile support
Requires that config.h be included before other headers, since the macro _FILE_OFFSET_BITS changes the definitions of things like 'struct stat'. I chose to simply include it at the top of every C file and at immediately after the double-inclusion guards of every header. Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--configure.ac1
-rw-r--r--include/compress.h2
-rw-r--r--include/data_reader.h2
-rw-r--r--include/data_writer.h2
-rw-r--r--include/frag_reader.h2
-rw-r--r--include/fstree.h2
-rw-r--r--include/highlevel.h2
-rw-r--r--include/id_table.h2
-rw-r--r--include/meta_reader.h2
-rw-r--r--include/meta_writer.h2
-rw-r--r--include/squashfs.h2
-rw-r--r--include/tar.h2
-rw-r--r--include/util.h2
-rw-r--r--lib/comp/compressor.c2
-rw-r--r--lib/comp/gzip.c2
-rw-r--r--lib/comp/internal.h2
-rw-r--r--lib/comp/lz4.c2
-rw-r--r--lib/comp/lzo.c2
-rw-r--r--lib/comp/xz.c2
-rw-r--r--lib/comp/zstd.c2
-rw-r--r--lib/fstree/add_by_path.c2
-rw-r--r--lib/fstree/fstree.c2
-rw-r--r--lib/fstree/fstree_from_dir.c2
-rw-r--r--lib/fstree/fstree_from_file.c2
-rw-r--r--lib/fstree/fstree_sort.c2
-rw-r--r--lib/fstree/gen_inode_table.c2
-rw-r--r--lib/fstree/get_path.c2
-rw-r--r--lib/fstree/mknode.c2
-rw-r--r--lib/fstree/node_from_path.c2
-rw-r--r--lib/fstree/node_stat.c2
-rw-r--r--lib/fstree/selinux.c2
-rw-r--r--lib/fstree/xattr.c2
-rw-r--r--lib/sqfs/data_reader.c2
-rw-r--r--lib/sqfs/data_writer.c2
-rw-r--r--lib/sqfs/deserialize_fstree.c2
-rw-r--r--lib/sqfs/frag_reader.c2
-rw-r--r--lib/sqfs/id_table.c2
-rw-r--r--lib/sqfs/id_table_read.c2
-rw-r--r--lib/sqfs/id_table_write.c2
-rw-r--r--lib/sqfs/meta_reader.c2
-rw-r--r--lib/sqfs/meta_writer.c2
-rw-r--r--lib/sqfs/read_inode.c2
-rw-r--r--lib/sqfs/read_super.c2
-rw-r--r--lib/sqfs/readdir.c2
-rw-r--r--lib/sqfs/serialize_fstree.c2
-rw-r--r--lib/sqfs/super.c2
-rw-r--r--lib/sqfs/table.c2
-rw-r--r--lib/sqfs/tree_node_from_inode.c2
-rw-r--r--lib/sqfs/write_dir.c2
-rw-r--r--lib/sqfs/write_export_table.c2
-rw-r--r--lib/sqfs/write_inode.c2
-rw-r--r--lib/sqfs/write_xattr.c2
-rw-r--r--lib/tar/base64.c2
-rw-r--r--lib/tar/checksum.c2
-rw-r--r--lib/tar/cleanup.c2
-rw-r--r--lib/tar/internal.h2
-rw-r--r--lib/tar/number.c2
-rw-r--r--lib/tar/read_header.c2
-rw-r--r--lib/tar/read_sparse_map.c2
-rw-r--r--lib/tar/read_sparse_map_old.c2
-rw-r--r--lib/tar/skip.c2
-rw-r--r--lib/tar/urldecode.c2
-rw-r--r--lib/tar/write_header.c2
-rw-r--r--lib/util/canonicalize_name.c2
-rw-r--r--lib/util/dirstack.c2
-rw-r--r--lib/util/mkdir_p.c2
-rw-r--r--lib/util/padd_file.c2
-rw-r--r--lib/util/print_version.c1
-rw-r--r--lib/util/read_data.c2
-rw-r--r--lib/util/str_table.c2
-rw-r--r--lib/util/write_data.c2
-rw-r--r--mkfs/mkfs.c2
-rw-r--r--mkfs/mkfs.h3
-rw-r--r--mkfs/options.c2
-rw-r--r--tar/sqfs2tar.c2
-rw-r--r--tar/tar2sqfs.c2
-rw-r--r--tests/add_by_path.c2
-rw-r--r--tests/canonicalize_name.c2
-rw-r--r--tests/fstree_from_file.c2
-rw-r--r--tests/fstree_init.c2
-rw-r--r--tests/fstree_sort.c2
-rw-r--r--tests/fstree_xattr.c2
-rw-r--r--tests/gen_inode_table.c2
-rw-r--r--tests/get_path.c2
-rw-r--r--tests/mknode_dir.c2
-rw-r--r--tests/mknode_reg.c2
-rw-r--r--tests/mknode_simple.c2
-rw-r--r--tests/mknode_slink.c2
-rw-r--r--tests/str_table.c2
-rw-r--r--tests/tar_gnu.c2
-rw-r--r--tests/tar_pax.c2
-rw-r--r--tests/tar_sparse_gnu.c2
-rw-r--r--tests/tar_sparse_gnu1.c2
-rw-r--r--tests/tar_sparse_gnu2.c2
-rw-r--r--tests/tar_ustar.c2
-rw-r--r--tests/tar_xattr_bsd.c2
-rw-r--r--tests/tar_xattr_schily.c2
-rw-r--r--unpack/describe.c2
-rw-r--r--unpack/list_files.c2
-rw-r--r--unpack/options.c2
-rw-r--r--unpack/rdsquashfs.c2
-rw-r--r--unpack/rdsquashfs.h3
-rw-r--r--unpack/restore_fstree.c2
103 files changed, 204 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9bcf886..1141236 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,7 @@ AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_RANLIB
AC_PROG_INSTALL
+AC_SYS_LARGEFILE
m4_ifndef([PKG_PROG_PKG_CONFIG],
[m4_fatal([Could not locate the pkg-config autoconf
diff --git a/include/compress.h b/include/compress.h
index 7937646..33488ad 100644
--- a/include/compress.h
+++ b/include/compress.h
@@ -2,6 +2,8 @@
#ifndef COMPRESS_H
#define COMPRESS_H
+#include "config.h"
+
#include <sys/types.h>
#include <stdbool.h>
#include <stddef.h>
diff --git a/include/data_reader.h b/include/data_reader.h
index a4964ee..e37584e 100644
--- a/include/data_reader.h
+++ b/include/data_reader.h
@@ -2,6 +2,8 @@
#ifndef DATA_READER_H
#define DATA_READER_H
+#include "config.h"
+
#include "frag_reader.h"
#include "squashfs.h"
#include "compress.h"
diff --git a/include/data_writer.h b/include/data_writer.h
index a52b37f..7107868 100644
--- a/include/data_writer.h
+++ b/include/data_writer.h
@@ -2,6 +2,8 @@
#ifndef DATA_WRITER_H
#define DATA_WRITER_H
+#include "config.h"
+
#include "squashfs.h"
#include "compress.h"
#include "fstree.h"
diff --git a/include/frag_reader.h b/include/frag_reader.h
index cf16153..1f4f271 100644
--- a/include/frag_reader.h
+++ b/include/frag_reader.h
@@ -2,6 +2,8 @@
#ifndef FRAG_READER_H
#define FRAG_READER_H
+#include "config.h"
+
#include "squashfs.h"
#include "compress.h"
diff --git a/include/fstree.h b/include/fstree.h
index 1b25363..2ba2b80 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -2,6 +2,8 @@
#ifndef FSTREE_H
#define FSTREE_H
+#include "config.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <stdbool.h>
diff --git a/include/highlevel.h b/include/highlevel.h
index 12884a0..23f5b68 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -2,6 +2,8 @@
#ifndef HIGHLEVEL_H
#define HIGHLEVEL_H
+#include "config.h"
+
#include "squashfs.h"
#include "compress.h"
#include "id_table.h"
diff --git a/include/id_table.h b/include/id_table.h
index 911c829..7aef468 100644
--- a/include/id_table.h
+++ b/include/id_table.h
@@ -2,6 +2,8 @@
#ifndef ID_TABLE_H
#define ID_TABLE_H
+#include "config.h"
+
#include <stdint.h>
#include <stddef.h>
diff --git a/include/meta_reader.h b/include/meta_reader.h
index 16003f6..d0c9670 100644
--- a/include/meta_reader.h
+++ b/include/meta_reader.h
@@ -2,6 +2,8 @@
#ifndef META_READER_H
#define META_READER_H
+#include "config.h"
+
#include "compress.h"
#include "squashfs.h"
diff --git a/include/meta_writer.h b/include/meta_writer.h
index 09d7456..0d7dfdf 100644
--- a/include/meta_writer.h
+++ b/include/meta_writer.h
@@ -2,6 +2,8 @@
#ifndef META_WRITER_H
#define META_WRITER_H
+#include "config.h"
+
#include "compress.h"
#include "squashfs.h"
#include "id_table.h"
diff --git a/include/squashfs.h b/include/squashfs.h
index 545756c..bb5b855 100644
--- a/include/squashfs.h
+++ b/include/squashfs.h
@@ -2,6 +2,8 @@
#ifndef SQUASHFS_H
#define SQUASHFS_H
+#include "config.h"
+
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
diff --git a/include/tar.h b/include/tar.h
index 424be80..5ac0763 100644
--- a/include/tar.h
+++ b/include/tar.h
@@ -2,6 +2,8 @@
#ifndef TAR_H
#define TAR_H
+#include "config.h"
+
#include <sys/stat.h>
#include <stdbool.h>
#include <stdint.h>
diff --git a/include/util.h b/include/util.h
index 1503fb8..8b79c30 100644
--- a/include/util.h
+++ b/include/util.h
@@ -2,6 +2,8 @@
#ifndef UTIL_H
#define UTIL_H
+#include "config.h"
+
#include <sys/types.h>
#include <stdint.h>
diff --git a/lib/comp/compressor.c b/lib/comp/compressor.c
index b92462e..ce88bdd 100644
--- a/lib/comp/compressor.c
+++ b/lib/comp/compressor.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/comp/gzip.c b/lib/comp/gzip.c
index 379a231..f974341 100644
--- a/lib/comp/gzip.c
+++ b/lib/comp/gzip.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/comp/internal.h b/lib/comp/internal.h
index 0185f4d..f5bf956 100644
--- a/lib/comp/internal.h
+++ b/lib/comp/internal.h
@@ -2,6 +2,8 @@
#ifndef INTERNAL_H
#define INTERNAL_H
+#include "config.h"
+
#include "compress.h"
int generic_write_options(int fd, const void *data, size_t size);
diff --git a/lib/comp/lz4.c b/lib/comp/lz4.c
index e0bba9c..2dafea3 100644
--- a/lib/comp/lz4.c
+++ b/lib/comp/lz4.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/comp/lzo.c b/lib/comp/lzo.c
index 09d05ea..5443d7d 100644
--- a/lib/comp/lzo.c
+++ b/lib/comp/lzo.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/comp/xz.c b/lib/comp/xz.c
index b0a07ab..330441c 100644
--- a/lib/comp/xz.c
+++ b/lib/comp/xz.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/comp/zstd.c b/lib/comp/zstd.c
index 2868cbf..bc94b2d 100644
--- a/lib/comp/zstd.c
+++ b/lib/comp/zstd.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/fstree/add_by_path.c b/lib/fstree/add_by_path.c
index 7e0a4ce..8983722 100644
--- a/lib/fstree/add_by_path.c
+++ b/lib/fstree/add_by_path.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/fstree.c b/lib/fstree/fstree.c
index 29dd66b..11a1dd1 100644
--- a/lib/fstree/fstree.c
+++ b/lib/fstree/fstree.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c
index ad75006..2343fef 100644
--- a/lib/fstree/fstree_from_dir.c
+++ b/lib/fstree/fstree_from_dir.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include "util.h"
diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c
index 91a922b..74d79ae 100644
--- a/lib/fstree/fstree_from_file.c
+++ b/lib/fstree/fstree_from_file.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include "util.h"
diff --git a/lib/fstree/fstree_sort.c b/lib/fstree/fstree_sort.c
index cd01235..a38e2a6 100644
--- a/lib/fstree/fstree_sort.c
+++ b/lib/fstree/fstree_sort.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/gen_inode_table.c b/lib/fstree/gen_inode_table.c
index 2782c6d..15ef577 100644
--- a/lib/fstree/gen_inode_table.c
+++ b/lib/fstree/gen_inode_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/lib/fstree/get_path.c b/lib/fstree/get_path.c
index 4b6f61e..e11af3d 100644
--- a/lib/fstree/get_path.c
+++ b/lib/fstree/get_path.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/mknode.c b/lib/fstree/mknode.c
index 7d09fbd..ea0d0aa 100644
--- a/lib/fstree/mknode.c
+++ b/lib/fstree/mknode.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/node_from_path.c b/lib/fstree/node_from_path.c
index e617059..122e106 100644
--- a/lib/fstree/node_from_path.c
+++ b/lib/fstree/node_from_path.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/node_stat.c b/lib/fstree/node_stat.c
index a28cae8..4c3afe6 100644
--- a/lib/fstree/node_stat.c
+++ b/lib/fstree/node_stat.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <string.h>
diff --git a/lib/fstree/selinux.c b/lib/fstree/selinux.c
index ceaac06..23ce828 100644
--- a/lib/fstree/selinux.c
+++ b/lib/fstree/selinux.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <selinux/selinux.h>
diff --git a/lib/fstree/xattr.c b/lib/fstree/xattr.c
index 2ce39f4..35517de 100644
--- a/lib/fstree/xattr.c
+++ b/lib/fstree/xattr.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c
index 7136425..4fbd97a 100644
--- a/lib/sqfs/data_reader.c
+++ b/lib/sqfs/data_reader.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "data_reader.h"
#include "frag_reader.h"
#include "util.h"
diff --git a/lib/sqfs/data_writer.c b/lib/sqfs/data_writer.c
index 64e27fa..74701fd 100644
--- a/lib/sqfs/data_writer.c
+++ b/lib/sqfs/data_writer.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "data_writer.h"
#include "highlevel.h"
#include "util.h"
diff --git a/lib/sqfs/deserialize_fstree.c b/lib/sqfs/deserialize_fstree.c
index bc1d6e4..98444ac 100644
--- a/lib/sqfs/deserialize_fstree.c
+++ b/lib/sqfs/deserialize_fstree.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include "highlevel.h"
diff --git a/lib/sqfs/frag_reader.c b/lib/sqfs/frag_reader.c
index b8991b3..87e4c35 100644
--- a/lib/sqfs/frag_reader.c
+++ b/lib/sqfs/frag_reader.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include "frag_reader.h"
#include "util.h"
diff --git a/lib/sqfs/id_table.c b/lib/sqfs/id_table.c
index cd31360..b4abd0c 100644
--- a/lib/sqfs/id_table.c
+++ b/lib/sqfs/id_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "id_table.h"
#include <stdlib.h>
diff --git a/lib/sqfs/id_table_read.c b/lib/sqfs/id_table_read.c
index e13f3b1..7147f2e 100644
--- a/lib/sqfs/id_table_read.c
+++ b/lib/sqfs/id_table_read.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include "highlevel.h"
#include "util.h"
diff --git a/lib/sqfs/id_table_write.c b/lib/sqfs/id_table_write.c
index c11895d..c2ed353 100644
--- a/lib/sqfs/id_table_write.c
+++ b/lib/sqfs/id_table_write.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "highlevel.h"
int id_table_write(id_table_t *tbl, int outfd, sqfs_super_t *super,
diff --git a/lib/sqfs/meta_reader.c b/lib/sqfs/meta_reader.c
index c85d063..96b59fd 100644
--- a/lib/sqfs/meta_reader.c
+++ b/lib/sqfs/meta_reader.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include "util.h"
diff --git a/lib/sqfs/meta_writer.c b/lib/sqfs/meta_writer.c
index d55af3d..7b7ee84 100644
--- a/lib/sqfs/meta_writer.c
+++ b/lib/sqfs/meta_writer.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "squashfs.h"
#include "util.h"
diff --git a/lib/sqfs/read_inode.c b/lib/sqfs/read_inode.c
index 8230138..22eaa0b 100644
--- a/lib/sqfs/read_inode.c
+++ b/lib/sqfs/read_inode.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include <sys/stat.h>
diff --git a/lib/sqfs/read_super.c b/lib/sqfs/read_super.c
index 8c43fe0..1a84ff9 100644
--- a/lib/sqfs/read_super.c
+++ b/lib/sqfs/read_super.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "squashfs.h"
#include "util.h"
diff --git a/lib/sqfs/readdir.c b/lib/sqfs/readdir.c
index 71beedc..d078719 100644
--- a/lib/sqfs/readdir.c
+++ b/lib/sqfs/readdir.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include <stdlib.h>
diff --git a/lib/sqfs/serialize_fstree.c b/lib/sqfs/serialize_fstree.c
index d786244..bd889a5 100644
--- a/lib/sqfs/serialize_fstree.c
+++ b/lib/sqfs/serialize_fstree.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "highlevel.h"
#include "util.h"
diff --git a/lib/sqfs/super.c b/lib/sqfs/super.c
index 59eb366..d90e6ea 100644
--- a/lib/sqfs/super.c
+++ b/lib/sqfs/super.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "squashfs.h"
#include "util.h"
diff --git a/lib/sqfs/table.c b/lib/sqfs/table.c
index 81e7691..fc90a3f 100644
--- a/lib/sqfs/table.c
+++ b/lib/sqfs/table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "highlevel.h"
#include "util.h"
diff --git a/lib/sqfs/tree_node_from_inode.c b/lib/sqfs/tree_node_from_inode.c
index 1ee85e5..f35c046 100644
--- a/lib/sqfs/tree_node_from_inode.c
+++ b/lib/sqfs/tree_node_from_inode.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "highlevel.h"
#include <stdlib.h>
diff --git a/lib/sqfs/write_dir.c b/lib/sqfs/write_dir.c
index 909e0bb..8015f31 100644
--- a/lib/sqfs/write_dir.c
+++ b/lib/sqfs/write_dir.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "util.h"
diff --git a/lib/sqfs/write_export_table.c b/lib/sqfs/write_export_table.c
index 2815cc2..a0d81eb 100644
--- a/lib/sqfs/write_export_table.c
+++ b/lib/sqfs/write_export_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "highlevel.h"
#include <stdlib.h>
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 6e11277..7cef7a7 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "util.h"
diff --git a/lib/sqfs/write_xattr.c b/lib/sqfs/write_xattr.c
index 33b0521..4cc3eea 100644
--- a/lib/sqfs/write_xattr.c
+++ b/lib/sqfs/write_xattr.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_writer.h"
#include "highlevel.h"
#include "util.h"
diff --git a/lib/tar/base64.c b/lib/tar/base64.c
index 313e9f4..89b7afa 100644
--- a/lib/tar/base64.c
+++ b/lib/tar/base64.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
static uint8_t convert(char in)
diff --git a/lib/tar/checksum.c b/lib/tar/checksum.c
index af94ab4..b3cef88 100644
--- a/lib/tar/checksum.c
+++ b/lib/tar/checksum.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
static unsigned int get_checksum(const tar_header_t *hdr)
diff --git a/lib/tar/cleanup.c b/lib/tar/cleanup.c
index a34c28b..ed62c0a 100644
--- a/lib/tar/cleanup.c
+++ b/lib/tar/cleanup.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
void free_sparse_list(sparse_map_t *sparse)
diff --git a/lib/tar/internal.h b/lib/tar/internal.h
index 04a97d3..8a3a9c5 100644
--- a/lib/tar/internal.h
+++ b/lib/tar/internal.h
@@ -2,6 +2,8 @@
#ifndef INTERNAL_H
#define INTERNAL_H
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/lib/tar/number.c b/lib/tar/number.c
index 009a4de..f80532b 100644
--- a/lib/tar/number.c
+++ b/lib/tar/number.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
int read_octal(const char *str, int digits, uint64_t *out)
diff --git a/lib/tar/read_header.c b/lib/tar/read_header.c
index 1769e0a..4843bb5 100644
--- a/lib/tar/read_header.c
+++ b/lib/tar/read_header.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
static bool is_zero_block(const tar_header_t *hdr)
diff --git a/lib/tar/read_sparse_map.c b/lib/tar/read_sparse_map.c
index 77876f5..a1526c4 100644
--- a/lib/tar/read_sparse_map.c
+++ b/lib/tar/read_sparse_map.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
sparse_map_t *read_sparse_map(const char *line)
diff --git a/lib/tar/read_sparse_map_old.c b/lib/tar/read_sparse_map_old.c
index 41d309a..2784640 100644
--- a/lib/tar/read_sparse_map_old.c
+++ b/lib/tar/read_sparse_map_old.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
sparse_map_t *read_gnu_old_sparse(int fd, tar_header_t *hdr)
diff --git a/lib/tar/skip.c b/lib/tar/skip.c
index 28c02be..94d3e5d 100644
--- a/lib/tar/skip.c
+++ b/lib/tar/skip.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/lib/tar/urldecode.c b/lib/tar/urldecode.c
index ac03f10..6bbecec 100644
--- a/lib/tar/urldecode.c
+++ b/lib/tar/urldecode.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
static int xdigit(int x)
diff --git a/lib/tar/write_header.c b/lib/tar/write_header.c
index caddc97..19b00bd 100644
--- a/lib/tar/write_header.c
+++ b/lib/tar/write_header.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "internal.h"
static void write_binary(char *dst, uint64_t value, int digits)
diff --git a/lib/util/canonicalize_name.c b/lib/util/canonicalize_name.c
index 57e4d66..f696432 100644
--- a/lib/util/canonicalize_name.c
+++ b/lib/util/canonicalize_name.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
static void normalize_slashes(char *filename)
diff --git a/lib/util/dirstack.c b/lib/util/dirstack.c
index 7bfd1a2..6949749 100644
--- a/lib/util/dirstack.c
+++ b/lib/util/dirstack.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
diff --git a/lib/util/mkdir_p.c b/lib/util/mkdir_p.c
index 7d1e052..867933b 100644
--- a/lib/util/mkdir_p.c
+++ b/lib/util/mkdir_p.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
diff --git a/lib/util/padd_file.c b/lib/util/padd_file.c
index 2f1ea9a..0ac19a9 100644
--- a/lib/util/padd_file.c
+++ b/lib/util/padd_file.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include <stdlib.h>
diff --git a/lib/util/print_version.c b/lib/util/print_version.c
index 7d1b91a..7b0965b 100644
--- a/lib/util/print_version.c
+++ b/lib/util/print_version.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
#include "config.h"
+
#include "util.h"
#include <stdio.h>
diff --git a/lib/util/read_data.c b/lib/util/read_data.c
index 43f8da8..802baf4 100644
--- a/lib/util/read_data.c
+++ b/lib/util/read_data.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
diff --git a/lib/util/str_table.c b/lib/util/str_table.c
index 72579ce..b6eb27c 100644
--- a/lib/util/str_table.c
+++ b/lib/util/str_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
diff --git a/lib/util/write_data.c b/lib/util/write_data.c
index 82f3aca..4396138 100644
--- a/lib/util/write_data.c
+++ b/lib/util/write_data.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
index 654534d..1d061b4 100644
--- a/mkfs/mkfs.c
+++ b/mkfs/mkfs.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "mkfs.h"
static int process_file(data_writer_t *data, tree_node_t *n, bool quiet)
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h
index 21a308b..3576c12 100644
--- a/mkfs/mkfs.h
+++ b/mkfs/mkfs.h
@@ -2,6 +2,8 @@
#ifndef MKFS_H
#define MKFS_H
+#include "config.h"
+
#include "meta_writer.h"
#include "data_writer.h"
#include "highlevel.h"
@@ -9,7 +11,6 @@
#include "compress.h"
#include "id_table.h"
#include "fstree.h"
-#include "config.h"
#include "util.h"
#include <getopt.h>
diff --git a/mkfs/options.c b/mkfs/options.c
index f14e6ef..56de813 100644
--- a/mkfs/options.c
+++ b/mkfs/options.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "mkfs.h"
static struct option long_opts[] = {
diff --git a/tar/sqfs2tar.c b/tar/sqfs2tar.c
index 15c0363..32d155e 100644
--- a/tar/sqfs2tar.c
+++ b/tar/sqfs2tar.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "meta_reader.h"
#include "data_reader.h"
#include "highlevel.h"
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index 2493c3b..03ae811 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "data_writer.h"
#include "highlevel.h"
#include "squashfs.h"
diff --git a/tests/add_by_path.c b/tests/add_by_path.c
index 740e732..e9e2546 100644
--- a/tests/add_by_path.c
+++ b/tests/add_by_path.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/canonicalize_name.c b/tests/canonicalize_name.c
index ad12752..08c6d84 100644
--- a/tests/canonicalize_name.c
+++ b/tests/canonicalize_name.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include <string.h>
diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c
index f4fc345..86c1824 100644
--- a/tests/fstree_from_file.c
+++ b/tests/fstree_from_file.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <sys/sysmacros.h>
diff --git a/tests/fstree_init.c b/tests/fstree_init.c
index ea89633..79033e0 100644
--- a/tests/fstree_init.c
+++ b/tests/fstree_init.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/fstree_sort.c b/tests/fstree_sort.c
index 8faa514..28aa74e 100644
--- a/tests/fstree_sort.c
+++ b/tests/fstree_sort.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/fstree_xattr.c b/tests/fstree_xattr.c
index 36b90ec..fabc9b4 100644
--- a/tests/fstree_xattr.c
+++ b/tests/fstree_xattr.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/gen_inode_table.c b/tests/gen_inode_table.c
index d2c694c..f1e1f16 100644
--- a/tests/gen_inode_table.c
+++ b/tests/gen_inode_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/get_path.c b/tests/get_path.c
index 5d2027a..5118876 100644
--- a/tests/get_path.c
+++ b/tests/get_path.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/mknode_dir.c b/tests/mknode_dir.c
index 5efe7a8..a14f3fe 100644
--- a/tests/mknode_dir.c
+++ b/tests/mknode_dir.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/mknode_reg.c b/tests/mknode_reg.c
index f614b2e..b6b1a0b 100644
--- a/tests/mknode_reg.c
+++ b/tests/mknode_reg.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/mknode_simple.c b/tests/mknode_simple.c
index 24b0c5e..1cac860 100644
--- a/tests/mknode_simple.c
+++ b/tests/mknode_simple.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/mknode_slink.c b/tests/mknode_slink.c
index 6dbccc8..d28f929 100644
--- a/tests/mknode_slink.c
+++ b/tests/mknode_slink.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "fstree.h"
#include <stdlib.h>
diff --git a/tests/str_table.c b/tests/str_table.c
index fad21b7..b9da577 100644
--- a/tests/str_table.c
+++ b/tests/str_table.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
diff --git a/tests/tar_gnu.c b/tests/tar_gnu.c
index 74e376b..3f57cee 100644
--- a/tests/tar_gnu.c
+++ b/tests/tar_gnu.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_pax.c b/tests/tar_pax.c
index 800e9f1..f0f664b 100644
--- a/tests/tar_pax.c
+++ b/tests/tar_pax.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_sparse_gnu.c b/tests/tar_sparse_gnu.c
index 4c3ee31..2aff2af 100644
--- a/tests/tar_sparse_gnu.c
+++ b/tests/tar_sparse_gnu.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_sparse_gnu1.c b/tests/tar_sparse_gnu1.c
index fac23f1..b92427e 100644
--- a/tests/tar_sparse_gnu1.c
+++ b/tests/tar_sparse_gnu1.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_sparse_gnu2.c b/tests/tar_sparse_gnu2.c
index edf1fb5..14c2b07 100644
--- a/tests/tar_sparse_gnu2.c
+++ b/tests/tar_sparse_gnu2.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_ustar.c b/tests/tar_ustar.c
index 0395642..187128a 100644
--- a/tests/tar_ustar.c
+++ b/tests/tar_ustar.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_xattr_bsd.c b/tests/tar_xattr_bsd.c
index e324b4c..9bb6d85 100644
--- a/tests/tar_xattr_bsd.c
+++ b/tests/tar_xattr_bsd.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/tests/tar_xattr_schily.c b/tests/tar_xattr_schily.c
index 4dca88e..c8b85c8 100644
--- a/tests/tar_xattr_schily.c
+++ b/tests/tar_xattr_schily.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "util.h"
#include "tar.h"
diff --git a/unpack/describe.c b/unpack/describe.c
index 94e7d22..cf5befd 100644
--- a/unpack/describe.c
+++ b/unpack/describe.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "rdsquashfs.h"
#include <sys/sysmacros.h>
diff --git a/unpack/list_files.c b/unpack/list_files.c
index b9bb161..4038684 100644
--- a/unpack/list_files.c
+++ b/unpack/list_files.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "rdsquashfs.h"
#include <sys/sysmacros.h>
diff --git a/unpack/options.c b/unpack/options.c
index c42f16a..0f0660e 100644
--- a/unpack/options.c
+++ b/unpack/options.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "rdsquashfs.h"
static struct option long_opts[] = {
diff --git a/unpack/rdsquashfs.c b/unpack/rdsquashfs.c
index 4a0f12b..2996668 100644
--- a/unpack/rdsquashfs.c
+++ b/unpack/rdsquashfs.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "rdsquashfs.h"
int main(int argc, char **argv)
diff --git a/unpack/rdsquashfs.h b/unpack/rdsquashfs.h
index 0ee48fa..aa051a2 100644
--- a/unpack/rdsquashfs.h
+++ b/unpack/rdsquashfs.h
@@ -2,6 +2,8 @@
#ifndef RDSQUASHFS_H
#define RDSQUASHFS_H
+#include "config.h"
+
#include "meta_reader.h"
#include "data_reader.h"
#include "highlevel.h"
@@ -9,7 +11,6 @@
#include "compress.h"
#include "id_table.h"
#include "fstree.h"
-#include "config.h"
#include "util.h"
#include <string.h>
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index 455e604..8fb04d7 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -1,4 +1,6 @@
/* SPDX-License-Identifier: GPL-3.0-or-later */
+#include "config.h"
+
#include "rdsquashfs.h"
static int create_node(tree_node_t *n, data_reader_t *data, int flags)