d89592 driver: heuristics: added optional support for tool-specific argument vector.

Authored and Committed by midipix 11 months ago
    driver: heuristics: added optional support for tool-specific argument vector.
    
        
src/internal/slibtool_lconf_impl.c CHANGED
@@ -621,6 +621,7 @@ static int slbt_get_lconf_var(
621
621
void * addr,
622
622
const char * cap,
623
623
const char * var,
624
+ const char space,
624
625
char (*val)[PATH_MAX])
625
626
{
626
627
const char * mark;
@@ -697,6 +698,9 @@ static int slbt_get_lconf_var(
697
698
else if ((*mark == '.') || (*mark == '_'))
698
699
(void)0;
699
700
701
+ else if (*mark == space)
702
+ (void)0;
703
+
700
704
else
701
705
return -1;
702
706
}
@@ -749,7 +753,7 @@ int slbt_get_lconf_flags(
749
753
optstatic = 0;
750
754
751
755
/* shared libraries option */
752
- if (slbt_get_lconf_var(addr,cap,"build_libtool_libs=",&val) < 0)
756
+ if (slbt_get_lconf_var(addr,cap,"build_libtool_libs=",0,&val) < 0)
753
757
return SLBT_CUSTOM_ERROR(
754
758
dctx,SLBT_ERR_LCONF_PARSE);
755
759
@@ -762,7 +766,7 @@ int slbt_get_lconf_flags(
762
766
763
767
764
768
/* static libraries option */
765
- if (slbt_get_lconf_var(addr,cap,"build_old_libs=",&val) < 0)
769
+ if (slbt_get_lconf_var(addr,cap,"build_old_libs=",0,&val) < 0)
766
770
return SLBT_CUSTOM_ERROR(
767
771
dctx,SLBT_ERR_LCONF_PARSE);
768
772
@@ -782,7 +786,7 @@ int slbt_get_lconf_flags(
782
786
783
787
/* host */
784
788
if (!ctx->cctx.host.host) {
785
- if (slbt_get_lconf_var(addr,cap,"host=",&val) < 0)
789
+ if (slbt_get_lconf_var(addr,cap,"host=",0,&val) < 0)
786
790
return SLBT_CUSTOM_ERROR(
787
791
dctx,SLBT_ERR_LCONF_PARSE);
788
792
@@ -795,7 +799,7 @@ int slbt_get_lconf_flags(
795
799
796
800
/* ar tool */
797
801
if (!ctx->cctx.host.ar) {
798
- if (slbt_get_lconf_var(addr,cap,"AR=",&val) < 0)
802
+ if (slbt_get_lconf_var(addr,cap,"AR=",0,&val) < 0)
799
803
return SLBT_CUSTOM_ERROR(
800
804
dctx,SLBT_ERR_LCONF_PARSE);
801
805
@@ -808,7 +812,7 @@ int slbt_get_lconf_flags(
808
812
809
813
/* ranlib tool */
810
814
if (!ctx->cctx.host.ranlib) {
811
- if (slbt_get_lconf_var(addr,cap,"RANLIB=",&val) < 0)
815
+ if (slbt_get_lconf_var(addr,cap,"RANLIB=",0,&val) < 0)
812
816
return SLBT_CUSTOM_ERROR(
813
817
dctx,SLBT_ERR_LCONF_PARSE);
814
818
@@ -821,7 +825,7 @@ int slbt_get_lconf_flags(
821
825
822
826
/* as tool (optional) */
823
827
if (!ctx->cctx.host.as) {
824
- if (!slbt_get_lconf_var(addr,cap,"AS=",&val)) {
828
+ if (!slbt_get_lconf_var(addr,cap,"AS=",0,&val)) {
825
829
if (val[0] && !(ctx->host.as = strdup(val)))
826
830
return SLBT_SYSTEM_ERROR(dctx,0);
827
831
@@ -832,7 +836,7 @@ int slbt_get_lconf_flags(
832
836
833
837
/* dlltool tool (optional) */
834
838
if (!ctx->cctx.host.dlltool) {
835
- if (!slbt_get_lconf_var(addr,cap,"DLLTOOL=",&val)) {
839
+ if (!slbt_get_lconf_var(addr,cap,"DLLTOOL=",0,&val)) {
836
840
if (val[0] && !(ctx->host.dlltool = strdup(val)))
837
841
return SLBT_SYSTEM_ERROR(dctx,0);
838
842