Fix #includes and build a shared library.
authorCarl Hetherington <cth@carlh.net>
Tue, 18 Jun 2019 11:05:34 +0000 (12:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 18 Jun 2019 11:05:34 +0000 (12:05 +0100)
28 files changed:
Makefile
blockdev/CMakeLists.txt
blockdev/linux/file_dev.h
include/ext4.h
include/ext4_balloc.h
include/ext4_bcache.h
include/ext4_bitmap.h
include/ext4_block_group.h
include/ext4_blockdev.h
include/ext4_crc32.h
include/ext4_debug.h
include/ext4_dir.h
include/ext4_dir_idx.h
include/ext4_errno.h
include/ext4_extent.h
include/ext4_fs.h
include/ext4_hash.h
include/ext4_ialloc.h
include/ext4_inode.h
include/ext4_journal.h
include/ext4_mbr.h
include/ext4_mkfs.h
include/ext4_super.h
include/ext4_trans.h
include/ext4_types.h
include/ext4_xattr.h
toolchain/generic.cmake
toolchain/mingw.cmake

index 41ee486e133c175fb9e26a6db624c34ba54c1c6d..5cd1efb5d16a52cbf8dc97cf78c743d3fbe1fd03 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ COMMON_DEFINITIONS =                                      \
        -DVERSION_MINOR=$(VERSION_MINOR)                      \
        -DVERSION_PATCH=$(VERSION_PATCH)                      \
        -DVERSION=$(VERSION)                                  \
+       -DLWEXT4_BUILD_SHARED_LIB=ON                          \
 
 define generate_common
        rm -R -f build_$(1)
index a16e8102b630f100c3bbad9cb60222fb041d1be6..e79cbb4cd750e152759433a27741e02232f59a81 100644 (file)
@@ -9,5 +9,5 @@ else()
 endif()
 
 aux_source_directory(. BLOCKDEV_SRC)
-add_library(blockdev  ${BLOCKDEV_SRC})
+add_library(blockdev SHARED ${BLOCKDEV_SRC})
 
index ce4690d927911cce12e09300cf9a1db820963857..ade80fbc1e534213a2d6589905624801cd036362 100644 (file)
@@ -28,8 +28,8 @@
 #ifndef FILE_DEV_H_
 #define FILE_DEV_H_
 
-#include <ext4_config.h>
-#include <ext4_blockdev.h>
+#include "ext4_config.h"
+#include "ext4_blockdev.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index 516bbdd3905c533f915240da0401dece08f19cdc..e8db7aa1b2b95e1e501713fdfd2e53cdb830c999 100644 (file)
@@ -45,13 +45,13 @@ extern "C" {
 #include <stdint.h>
 #include <stddef.h>
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_errno.h>
-#include <ext4_oflags.h>
-#include <ext4_debug.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_errno.h"
+#include "ext4_oflags.h"
+#include "ext4_debug.h"
 
-#include <ext4_blockdev.h>
+#include "ext4_blockdev.h"
 
 /********************************OS LOCK INFERFACE***************************/
 
index ad481dceea1402d15ec8fbf424d10ec9a95b5bdc..4e2f2241bd328fb78880476e461cf8278d215a6d 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
-#include <ext4_fs.h>
+#include "ext4_fs.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index f8bec7ded155411bdb7b8ac971217413f668708f..b7ae43857c594de0525921b0294a002bf9666df3 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
+#include "ext4_config.h"
 
 #include <stdint.h>
 #include <stdbool.h>
-#include <misc/tree.h>
-#include <misc/queue.h>
+#include "misc/tree.h"
+#include "misc/queue.h"
 
 #define EXT4_BLOCK_ZERO()      \
        {.lb_id = 0, .data = 0}
index 6bcb100a22cca7bd86bc685121b994532d3cc29f..cb73b76a557a82cc1e27732ded2c537e4c7f41b9 100644 (file)
@@ -41,7 +41,7 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
+#include "ext4_config.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index 61fbc9800c469dd1f6caf8baa58727394b071476..88e00a1ea883c61564e495c09eaba1bc6bb00f69 100644 (file)
@@ -46,9 +46,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_super.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_super.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index 4efbb43c72ddf909e5585e4c6df682a73837fc4e..4673479bd6d2a3ffded0f1d69a54d5c8b21b9cde 100644 (file)
@@ -40,8 +40,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_bcache.h>
+#include "ext4_config.h"
+#include "ext4_bcache.h"
 
 #include <stdbool.h>
 #include <stdint.h>
index a9580c22784bc41516e8448f5be17e65526e6477..3dad1d1a7e9694ce6273b4cd50622057db5539c8 100644 (file)
@@ -43,7 +43,7 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
+#include "ext4_config.h"
 
 #include <stdint.h>
 
index 10c581e8402259b355e654beebe74d3e0d552784..6eb8aa16393d012afdd35e469208ccc1e4631478 100644 (file)
@@ -41,8 +41,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_errno.h>
+#include "ext4_config.h"
+#include "ext4_errno.h"
 
 #if !CONFIG_HAVE_OWN_ASSERT
 #include <assert.h>
index 0fa631f31ebf45954bf48bce3cc1add88cc6ee77..d3b1bf5d8633d305f64a7386aa9fdc69a62d58ad 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_misc.h>
-#include <ext4_blockdev.h>
-#include <ext4_super.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_misc.h"
+#include "ext4_blockdev.h"
+#include "ext4_super.h"
 
 #include <stdint.h>
 
index f1c5b26dec33c4906f69957ed3c13802814510f1..f3e83d68aa0c5ef1e5aab7347b5f8e492caaebdd 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
-#include <ext4_fs.h>
-#include <ext4_dir.h>
+#include "ext4_fs.h"
+#include "ext4_dir.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index 2d922804a588ecfc3efd0f56591f59bd539eedba..edf89a9b63d27375905e7ccdd9a4714934dff777 100644 (file)
@@ -40,7 +40,7 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
+#include "ext4_config.h"
 
 #if !CONFIG_HAVE_OWN_ERRNO
 #include <errno.h>
index fee09269eb2bc1a3d0e400a1766809a5a944b088..0d4e1e39c1c3f55004018dc3c29cd8d24cc90f0b 100644 (file)
@@ -44,9 +44,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_inode.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_inode.h"
 
 void ext4_extent_tree_init(struct ext4_inode_ref *inode_ref);
 
index c52032681816106d874161b07941debfb35c220e..9653f47878c514da1804088f3fb7d348d09851ce 100644 (file)
@@ -46,9 +46,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_misc.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_misc.h"
 
 #include <stdint.h>
 #include <stdbool.h>
index 43ecbabd4fda2eea1a852e059db88f8691c96ff8..17989a1f9c5219b81197dbcc2e928616d8dbb6a7 100644 (file)
@@ -41,7 +41,7 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
+#include "ext4_config.h"
 
 #include <stdint.h>
 
index e845c79f7e0d1a2cc15921f27282e508e7b6e06a..cea3fe6bb47f2bfdf7a9efc5860af325659fb589 100644 (file)
@@ -46,8 +46,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
 /**@brief Calculate and set checksum of inode bitmap.
  * @param sb superblock pointer.
index bee5b8a24941dc090b101926acdcb0e09caca9e4..e0ca6e38f81272b352e618990b89383a244f74fd 100644 (file)
@@ -46,8 +46,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
 #include <stdint.h>
 
index 415618bd1d7d43dc54d7a353de56186d50dbe62e..76a4a87bb36e464bbc2bf1d87e83628ccf232313 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <misc/queue.h>
-#include <misc/tree.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "misc/queue.h"
+#include "misc/tree.h"
 
 struct jbd_fs {
        struct ext4_blockdev *bdev;
index 97a445952210f339b95ec349708f255809040fec..858ab021b3438a4e393c0541ec09c19cfd731eb4 100644 (file)
@@ -41,8 +41,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_blockdev.h>
+#include "ext4_config.h"
+#include "ext4_blockdev.h"
 
 /**@brief Master boot record block devices descriptor*/
 struct ext4_mbr_bdevs {
index aadedb0d029310492fb55ba66776161c0ec314c4..16a05f8716f8e123e3373df7e3b6096ec47948d7 100644 (file)
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
-#include <ext4_blockdev.h>
-#include <ext4_fs.h>
+#include "ext4_blockdev.h"
+#include "ext4_fs.h"
 
 #include <stdbool.h>
 #include <stdint.h>
index 5afd18d5f0ba5f8614badbd8b026ed9cde2a3852..b420225a42f678a13a81306d068fcedb21e6d8a1 100644 (file)
@@ -46,9 +46,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_misc.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_misc.h"
 
 /**@brief   Blocks count get stored in superblock.
  * @param   s superblock descriptor
index b17373c9c1ddb1e98082604bdd5bff0dc8622ced..e3cb28ac8646c0c64ea1b1143d291ddbc5296563 100644 (file)
@@ -41,8 +41,8 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
 
 
 /**@brief   Mark a buffer dirty and add it to the current transaction.
index c9cdd344df5df2cc5ac2fab344c1bb79bd883336..2fd051e9a3038913589f8fd0e60903d09e82ba77 100644 (file)
@@ -46,9 +46,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_blockdev.h>
-#include <misc/tree.h>
+#include "ext4_config.h"
+#include "ext4_blockdev.h"
+#include "misc/tree.h"
 
 #include <stddef.h>
 #include <stdint.h>
index d79febc50be9fb7cef2ffdcccd74c2f4bf0656f2..227b3a616d69694455e0ce4a3fa81347d074745f 100644 (file)
@@ -41,9 +41,9 @@
 extern "C" {
 #endif
 
-#include <ext4_config.h>
-#include <ext4_types.h>
-#include <ext4_inode.h>
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_inode.h"
 
 struct ext4_xattr_info {
        uint8_t name_index;
index 4b5e329be3cf95532b7ad7e567436d965048e7dc..838a8bec8fa32c37d54c9af97975e9bc68271e27 100644 (file)
@@ -8,7 +8,7 @@ set(AS                  as)
 set(AR                  ar)
 set(OBJCOPY             objcopy)
 set(OBJDUMP             objdump)
-set(SIZE                size)
+set(SIZE                size)
 
 set(CMAKE_C_FLAGS   "-std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
 set(CMAKE_CXX_FLAGS "-fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")
index b251acb78b2a833bb44381da476fd34088feecab..9efd9334f4877cf12b8d90e559ea048e4961473b 100644 (file)
@@ -1,6 +1,6 @@
 # Name of the target
 set(CMAKE_SYSTEM_NAME Windows)
-set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
+set(TOOLCHAIN_PREFIX /opt/mxe/usr/bin/x86_64-w64-mingw32.shared)
 set(CMAKE_SYSTEM_PROCESSOR mingw)
 
 # Toolchain settings
@@ -12,7 +12,7 @@ set(OBJCOPY             objcopy)
 set(OBJDUMP             objdump)
 set(SIZE                size)
 
-set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
+set(CMAKE_FIND_ROOT_PATH /opt/mxe/usr/${TOOLCHAIN_PREFIX})
 
 set(CMAKE_C_FLAGS   "-std=gnu99 -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags")
 set(CMAKE_CXX_FLAGS "-fdata-sections -ffunction-sections" CACHE INTERNAL "cxx compiler flags")