Build static on Linux.
authorCarl Hetherington <cth@carlh.net>
Fri, 24 Apr 2020 19:12:10 +0000 (21:12 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 24 Apr 2020 19:13:34 +0000 (21:13 +0200)
Makefile
cscript

index 076a0219ca289bbe690e12ce32bb559137ef73b9..8125659259261b17779cd8729b9164075ddd19a1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,19 +19,29 @@ 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)
        mkdir build_$(1)
        cd build_$(1) && cmake -G"Unix Makefiles"           \
        $(COMMON_DEFINITIONS)                               \
+       -DLWEXT4_BUILD_SHARED_LIB=ON                        \
+       $(2)                                                \
+       -DCMAKE_TOOLCHAIN_FILE=../toolchain/$(1).cmake ..
+endef
+
+define generate_common_static
+       rm -R -f build_$(1)
+       mkdir build_$(1)
+       cd build_$(1) && cmake -G"Unix Makefiles"           \
+       $(COMMON_DEFINITIONS)                               \
+       -DLWEXT4_BUILD_SHARED_LIB=OFF                       \
        $(2)                                                \
        -DCMAKE_TOOLCHAIN_FILE=../toolchain/$(1).cmake ..
 endef
 
 generic:
-       $(call generate_common,$@)
+       $(call generate_common_static,$@)
 
 osx:
        $(call generate_common,$@)
diff --git a/cscript b/cscript
index 57e7e885d9bd414b84f6127e90d7d17390519993..e118e158719dd507abb586262f272b17f200be7b 100644 (file)
--- a/cscript
+++ b/cscript
@@ -21,7 +21,7 @@ def build(target, options):
     if target.platform == 'linux':
         type = 'generic'
         blockdev = 'linux'
-        ext = 'so'
+        ext = 'a'
         device = 'dev'
     elif target.platform == 'osx':
         if target.bits == 64: