]> Kevux Git Server - fll/commitdiff
Feature: add support for defining the linker program via build_linker= setting
authorKevin Day <thekevinday@gmail.com>
Thu, 9 Oct 2014 03:15:01 +0000 (22:15 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 9 Oct 2014 03:15:01 +0000 (22:15 -0500)
34 files changed:
build/scripts/generate.sh
level_0/f_colors/data/build/settings
level_0/f_console/data/build/settings
level_0/f_conversion/data/build/settings
level_0/f_errors/data/build/settings
level_0/f_file/data/build/settings
level_0/f_fss/data/build/settings
level_0/f_memory/data/build/settings
level_0/f_paths/data/build/settings
level_0/f_pipe/data/build/settings
level_0/f_print/data/build/settings
level_0/f_serialized/data/build/settings
level_0/f_strings/data/build/settings
level_0/f_types/data/build/settings
level_1/fl_colors/data/build/settings
level_1/fl_console/data/build/settings
level_1/fl_directory/data/build/settings
level_1/fl_errors/data/build/settings
level_1/fl_file/data/build/settings
level_1/fl_fss/data/build/settings
level_1/fl_serialized/data/build/settings
level_1/fl_strings/data/build/settings
level_2/fll_colors/data/build/settings
level_2/fll_execute/data/build/settings
level_2/fll_fss/data/build/settings
level_3/firewall/data/build/settings
level_3/fss_basic_list_read/data/build/settings
level_3/fss_basic_list_write/data/build/settings
level_3/fss_basic_read/data/build/settings
level_3/fss_basic_write/data/build/settings
level_3/fss_extended_read/data/build/settings
level_3/fss_extended_write/data/build/settings
level_3/fss_return_code/data/build/settings
level_3/return_code/data/build/settings

index 66be6805426eb97235da28d52d29b6b00e7b5b3f..00a7ec58a49076b97a112c365edc52db61f66072 100644 (file)
@@ -198,9 +198,10 @@ generate_id(){
     "version_minor") echo -n 3;;
     "version_micro") echo -n 4;;
     "build_compiler") echo -n 5;;
-    "build_libraries") echo -n 6;;
-    "build_sources_library") echo -n 7;;
-    "build_sources_program") echo -n 8;;
+    "build_linker") echo -n 6;;
+    "build_libraries") echo -n 7;;
+    "build_sources_library") echo -n 8;;
+    "build_sources_program") echo -n 9;;
     "build_sources_headers") echo -n 10;;
     "build_sources_settings") echo -n 11;;
     "build_shared") echo -n 12;;
@@ -229,7 +230,7 @@ generate_load_settings(){
     exit $failure
   fi
 
-  for i in project_name project_level version_major version_minor version_micro build_compiler build_libraries build_sources_library build_sources_program build_sources_headers build_sources_settings build_shared flags_all flags_shared flags_static flags_library flags_program ; do
+  for i in project_name project_level version_major version_minor version_micro build_compiler build_linker build_libraries build_sources_library build_sources_program build_sources_headers build_sources_settings build_shared flags_all flags_shared flags_static flags_library flags_program ; do
     variables[$(generate_id $i)]=$(grep -s -o "^[[:space:]]*$i\>.*$" $settings_file | sed -e "s|^[[:space:]]*$i\>||" -e 's|^[[:space:]]*||')
   done
 }
@@ -272,6 +273,7 @@ generate_operation_build(){
   local minor=${variables[$(generate_id version_minor)]}
   local micro=${variables[$(generate_id version_micro)]}
   local compiler=${variables[$(generate_id build_compiler)]}
+  local linker=${variables[$(generate_id build_linker)]}
   local arguments="-I${path_build}includes -L${path_build}libraries ${variables[$(generate_id flags_all)]} ${variables[$(generate_id build_libraries)]}"
   local shared=${variables[$(generate_id build_shared)]}
   local sources_library=${variables[$(generate_id build_sources_library)]}
@@ -322,10 +324,22 @@ generate_operation_build(){
       sources=
       sources_alt=
       if [[ $alt == "alt" ]] ; then
+        if [[ $sources_library != "" ]] ; then
+          for i in $sources_library ; do
+            sources_alt="$sources_alt$path_c$i "
+          done
+        fi
+
         for i in $sources_program ; do
           sources_alt="$sources_alt$path_c$i "
         done
       else
+        if [[ $sources_library != "" ]] ; then
+          for i in $sources_library ; do
+            sources="$sources$path_c$i "
+          done
+        fi
+
         for i in $sources_program ; do
           sources="$sources$path_c$i "
         done
@@ -340,27 +354,57 @@ generate_operation_build(){
     if [[ $sources_library != "" ]] ; then
       if [[ $alt == "alt" ]] ; then
         for i in $sources_library ; do
-          sources_alt="$sources_alt$path_c$i "
+          sources="$sources${path_build}libraries/$i.o "
+          sources_alt="$sources_alt$sources "
+
+          echo $compiler $path_c$i $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} -c -static -o ${path_build}libraries/$i.o
+          $compiler $path_c$i $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} -c -static -o ${path_build}libraries/$i.o || failure=1
+
+          if [[ $failure == "1" ]] ; then
+            break;
+          fi
         done
       else
         for i in $sources_library ; do
-          sources="$sources$path_c$i "
+          sources="$sources${path_build}libraries/$i.o "
+          sources_alt="$sources_alt$sources "
+
+          echo $compiler $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} $path_c$i -c -static -o ${path_build}libraries/$i.o
+          $compiler $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} $path_c$i -c -static -o ${path_build}libraries/$i.o || failure=1
+
+          if [[ $failure == "1" ]] ; then
+            break;
+          fi
         done
       fi
 
-      echo $compiler $sources_alt $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} $sources -static -o ${path_build}libraries/lib$name.a
-      $compiler $sources_alt $arguments ${variables[$(generate_id flags_static)]} ${variables[$(generate_id flags_library)]} $sources -static -o ${path_build}libraries/lib$name.a || failure=1
+      if [[ $failure == "" ]] ; then
+        echo $linker rcs ${path_build}libraries/lib$name.a $sources_alt
+        $linker rcs ${path_build}libraries/lib$name.a $sources_alt || failure=1
+      fi
     fi
 
     if [[ $failure == "" && $sources_program != "" ]] ; then
       sources=
       sources_alt=
       if [[ $alt == "alt" ]] ; then
+        if [[ $sources_library != "" ]] ; then
+          for i in $sources_library ; do
+            sources_alt="$sources_alt$path_c$i "
+          done
+        fi
+
         for i in $sources_program ; do
           sources_alt="$sources_alt$path_c$i "
         done
       else
-        for i in $sources_library ; do
+        if [[ $sources_library != "" ]] ; then
+          for i in $sources_library ; do
+            sources="$sources$path_c$i "
+          done
+        fi
+
+        for i in $sources_program ; do
           sources="$sources$path_c$i "
         done
       fi
index eea76357a01bac5fe27693a760f0aef1690212b4..199bfed4ff2c3ba36ea9b30907e5f3f865ff0789 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library 
 build_sources_program 
index 6effd4b4b099e30a3e65b94c58d09c5917b6e3f5..f12247e7bf3961e043050e816604fe4b47d2e465 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library console.c
 build_sources_program 
index 79c2da3829ef49ef242c2afd364030f2fb2f04e8..a3feb362a1917142bc4be36fa66bb671b89d31b3 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library conversion.c
 build_sources_program 
index f8af285adc93c151cae5112670c2a64064097430..cd8bbf934d9853b52780eb8ecc9a0832111456f8 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library 
 build_sources_program 
index 7eb32bfea98ce1dd559787f929f5c01854ef4ed3..6c3d5043a9062f5efa65f3a121d7c7148cbc683e 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library file.c
 build_sources_program 
index f7167745607dc0744d10291e6e3552173e891f3c..cac2f911e57ea795effc2ffc24ee10e4d40e50e4 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library 
 build_sources_program 
index 0334d4acffa2cc00c5909f49ee14f358144aaa5f..2cb0cd7c697bf46c0a492a0797f9acccf52cef05 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library memory.c
 build_sources_program 
index 43194c10c06d1cd909c779e478600cbd9334db73..5f97222345e7d3bf139fcc9f127318dff3cdedf4 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries 
 build_sources_library 
 build_sources_program 
index ed8806dfd64239c1639bf33b253a9cca1303aa52..69820eb9b5cbd6055f979013ab0b168a0e9eee11 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library pipe.c
 build_sources_program 
index ccaed244fd2d8e3003271fc029e7349e8373cbce..84fd450eca8ee1a2b48774fc90f8d75cdf225d08 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc
 build_sources_library print.c
 build_sources_program
index 718dfbfff9f058a99c6a5ccf3ae147f99f90e314..70ecd90c9dd3a9bfc1ac9b45f9888298ed5b4185 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library
 build_sources_program 
index fb068f65fa7f85f2ec2e3ef12dbe05e170b41ced..1d2823d8f79704d543e500ee94b2caca95b539c7 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library 
 build_sources_program 
index 601bbd678ed9252319f9c6a238f871b869cc2401..a2fd3dc495d28e91c6ddb6960d55ace1fbee8b84 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc
 build_sources_library
 build_sources_program
index 7d71e0e705e7ba472dc7c0e81976c7562197ec76..9593b42898fe517a509b5f15eeac1e465b42ad46 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_file -lf_memory
 build_sources_library colors.c
 build_sources_program 
index 228786cef5ee19be0ddc63225be21c2503dd9438..b4e5413a36d5aa716cac25c357da88b4b200d7d5 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_console -lf_memory
 build_sources_library console.c
 build_sources_program 
index 37bf7d440735979f48c5fbade233372a52d233d4..acbe9d1731ca294c4ec1bc7fd7c2aca29f6539c4 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory
 build_sources_library directory.c
 build_sources_program 
index 8deffc0567e91602ab4e5b039868d6925842eaa9..451ec8919d9297b269e9b39745f16178b6d39457 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc 
 build_sources_library errors.c
 build_sources_program 
index 84f4e2a962b9ac364008d1b89ab72386760a1e3e..6d3f91c6565ca3572cd91dce8a2cf7535d4837f0 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_file -lf_memory
 build_sources_library file.c
 build_sources_program 
index bc7b47f3bd8853e9504e965a5d08b3d2c6b5a94f..cdf00394463ae72a2d4ad3c91dafe994c563e841 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_file -lf_conversion
 build_sources_library fss.c fss_basic.c fss_basic_list.c fss_extended.c
 build_sources_program 
index 5411ece931061f7d1cb17cdbbb9031c6d37cb145..b0a08bd0ca1c59f3658992d9870272156115c785 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory
 build_sources_library serialized.c
 build_sources_program 
index 8ca4cb397f2834089ae9c94f509005d76623b694..e8b69916a823c151448f8af8450070982e55e973 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory
 build_sources_library strings.c
 build_sources_program 
index d8ac962120bb5c7d5c79acd26b2b20afcf30dde1..46e16ee73f2c886970ddfebf0f0000571e77449a 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lfl_colors
 build_sources_library colors.c
 build_sources_program 
index 0ee02fe017128177c89126373595c4f63c9b24fd..450bfd3b3eda945d6fb1658c6ec48a4ee18d4d1c 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory
 build_sources_library execute.c
 build_sources_program 
index c2800a53fa3e19aac140357cd27964dc6e3c7c68..854f8b3b5256e3c98c04fb5a0ccc0fc13dc8ced3 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_file -lf_conversion -lfl_fss -lfl_errors
 build_sources_library fss_basic.c fss_basic_list.c fss_extended.c fss_errors.c
 build_sources_program
index 9c7219f5c8d6b702d74f560e3928de2557c8ba50..a6dc751e623bd5a40051c94f610ed7697f0329a5 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lf_conversion -lf_print -lf_file -lfl_fss -lfl_console -lfl_file -lfl_strings -lfl_colors -lfl_directory -lfll_execute -lfll_fss -lfll_colors -lf_pipe
 build_sources_library firewall.c private-firewall.c
 build_sources_program main.c
index 490787dcfc7b1bdaf4366ec9c8c58a067296bf4b..4b5c6b1942b8142845ad5fecc1cf74f998942a22 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lf_conversion -lf_print -lf_file -lfl_fss -lfl_console -lfl_file -lfl_strings -lfl_colors -lfl_directory -lfll_execute -lfll_fss -lfll_colors -lf_pipe
 build_sources_library fss_basic_list_read.c
 build_sources_program main.c
index 90e37ae586bf38022358aed4d1352724ccc4b825..d6563b4064257af1813824a7003c9642d849f728 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lfl_console -lf_conversion -lf_pipe -lf_print -lf_file -lfl_colors -lfll_colors -lfl_errors -lfl_fss -lfll_fss -lfl_file
 build_sources_library fss_basic_list_write.c
 build_sources_program main.c
index 6e333ee4612219fae00cb728ddcccb70a89590c3..275ac10b8a58d2fc884920092386f78977c0da6e 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lf_conversion -lf_print -lf_file -lfl_fss -lfl_console -lfl_file -lfl_strings -lfl_colors -lfl_directory -lfll_execute -lfll_fss -lfll_colors -lf_pipe
 build_sources_library fss_basic_read.c
 build_sources_program main.c
index 093ab89a4543996cbacc7f087741b3851b7849af..6a03cb3b6e40b94ed8008c3985b735bfb83de695 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lfl_console -lf_conversion -lf_pipe -lf_print -lf_file -lfl_colors -lfll_colors -lfl_errors -lfl_fss -lfll_fss -lfl_file
 build_sources_library fss_basic_write.c
 build_sources_program main.c
index db7d2da2c7c4763a1cd69fba83d2877cdfbefd35..a88b021f037edbe8b49db3f795368c87a40788ee 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lf_conversion -lf_print -lf_file -lfl_fss -lfl_console -lfl_file -lfl_strings -lfl_colors -lfl_directory -lfll_execute -lfll_fss -lfll_colors -lf_pipe
 build_sources_library fss_extended_read.c
 build_sources_program main.c
index 500940c9efa5621a899506e5d07e11f446963506..14d0d4ad6575461632e859e8360775b4f20a1804 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lfl_console -lf_conversion -lf_pipe -lf_print -lf_file -lfl_colors -lfll_colors -lfl_errors -lfl_fss -lfll_fss -lfl_file
 build_sources_library fss_extended_write.c
 build_sources_program main.c
index 481a8752c57fc4f90b34cc00ce74189b7bf2bb62..9b3b627fec378b68d8c744ae71084fa4aa36fe33 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc -lf_memory -lf_console -lfl_console -lf_conversion -lf_pipe -lf_print -lfl_colors -lfll_colors -lfl_errors -lfl_fss -lfll_fss
 build_sources_library fss_return_code.c
 build_sources_program main.c
index ccfc7818a1e98334dce5ad97f9c6171cc03d01bd..f3c27c92dc322eacab2d2f9c6161aa3244f1d6b5 100644 (file)
@@ -8,6 +8,7 @@ version_minor 4
 version_micro 2
 
 build_compiler gcc
+build_linker ar
 build_libraries -lc  -lf_memory -lf_console -lfl_console -lf_conversion -lf_pipe -lf_print -lfl_colors -lfll_colors -lfl_errors
 build_sources_library return_code.c
 build_sources_program main.c