2
0
ruki 2 жил өмнө
parent
commit
417486789a
1 өөрчлөгдсөн 29 нэмэгдсэн , 0 устгасан
  1. 29 0
      configure

+ 29 - 0
configure

@@ -669,6 +669,9 @@ fi
 # set the default target mode
 # set the default target mode
 _target_mode_default="release"
 _target_mode_default="release"
 
 
+# set the default target kind
+_target_kind_default="static"
+
 # set the default project generator and build program
 # set the default project generator and build program
 if is_host "freebsd" "bsd"; then
 if is_host "freebsd" "bsd"; then
     _project_generator="gmake"
     _project_generator="gmake"
@@ -739,6 +742,21 @@ is_mode() {
     return 1
     return 1
 }
 }
 
 
+# determining target kind
+# e.g.
+# if is_kind "release"; then
+#     ...
+# fi
+is_kind() {
+    local kind=""
+    for kind in $@; do
+        if test_eq "${_target_kind}" "${kind}"; then
+            return 0
+        fi
+    done
+    return 1
+}
+
 # determining target toolchain
 # determining target toolchain
 # e.g.
 # e.g.
 # if is_toolchain "clang"; then
 # if is_toolchain "clang"; then
@@ -2616,6 +2634,10 @@ Common options:
   --mode=MODE             Set the given compilation mode. (default: '"${_target_mode_default}"')
   --mode=MODE             Set the given compilation mode. (default: '"${_target_mode_default}"')
                             - release
                             - release
                             - debug
                             - debug
+  --kind=KIND             Set the given target kind. (default: '"${_target_kind_default}"')
+                            - static
+                            - shared
+                            - binary
   --toolchain=TOOLCHAIN   Set toolchain name.
   --toolchain=TOOLCHAIN   Set toolchain name.
                             - clang
                             - clang
                             - gcc
                             - gcc
@@ -2688,6 +2710,9 @@ _handle_option() {
     elif test_eq "${name}" "mode"; then
     elif test_eq "${name}" "mode"; then
         _target_mode=${value}
         _target_mode=${value}
         return 0
         return 0
+    elif test_eq "${name}" "kind"; then
+        _target_kind=${value}
+        return 0
     elif test_eq "${name}" "toolchain"; then
     elif test_eq "${name}" "toolchain"; then
         _target_toolchain=${value}
         _target_toolchain=${value}
         return 0
         return 0
@@ -2918,6 +2943,9 @@ _check_platform() {
     if test "x${_target_mode}" = "x"; then
     if test "x${_target_mode}" = "x"; then
         _target_mode=${_target_mode_default}
         _target_mode=${_target_mode_default}
     fi
     fi
+    if test "x${_target_kind}" = "x"; then
+        _target_kind=${_target_kind_default}
+    fi
     echo "checking for platform ... ${_target_plat}"
     echo "checking for platform ... ${_target_plat}"
     echo "checking for architecture ... ${_target_arch}"
     echo "checking for architecture ... ${_target_arch}"
 }
 }
@@ -3547,6 +3575,7 @@ fi
 plat="${_target_plat}"
 plat="${_target_plat}"
 arch="${_target_arch}"
 arch="${_target_arch}"
 mode="${_target_mode}"
 mode="${_target_mode}"
+kind="${_target_kind}"
 
 
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # load project targets
 # load project targets