diff options
author | midipix <writeonce@midipix.org> | 2016-04-13 17:29:57 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-13 23:45:16 -0400 |
commit | 14d60ab4516b19ff7858242b458d5d0894627f15 (patch) | |
tree | aa31cfc84478a21cd9ba95135218938d5b8f662f /src | |
parent | 4a01cf4327621ff989dc8aacce246b7f758e5572 (diff) | |
download | slibtool-14d60ab4516b19ff7858242b458d5d0894627f15.tar.bz2 slibtool-14d60ab4516b19ff7858242b458d5d0894627f15.tar.xz |
link mode: slbt_adjust_input_argument(): original/argument suffix support.
Diffstat (limited to 'src')
-rw-r--r-- | src/logic/slbt_exec_link.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index 0e31524..3c82e46 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -56,7 +56,11 @@ /* */ /*******************************************************************/ -static bool slbt_adjust_input_argument(char * arg, bool fpic) +static bool slbt_adjust_input_argument( + char * arg, + const char * osuffix, + const char * asuffix, + bool fpic) { char * slash; char * dot; @@ -68,7 +72,7 @@ static bool slbt_adjust_input_argument(char * arg, bool fpic) if (!(dot = strrchr(arg,'.'))) return false; - if (strcmp(dot,".lo")) + if (strcmp(dot,osuffix)) return false; if (fpic) { @@ -85,8 +89,7 @@ static bool slbt_adjust_input_argument(char * arg, bool fpic) dot = strrchr(arg,'.'); } - dot[1] = 'o'; - dot[2] = '\0'; + strcpy(dot,asuffix); return true; } @@ -280,7 +283,7 @@ static int slbt_exec_link_create_archive( /* input argument adjustment */ for (parg=ectx->cargv; *parg; parg++) - if (slbt_adjust_input_argument(*parg,fpic)) + if (slbt_adjust_input_argument(*parg,".lo",".o",fpic)) *aarg++ = *parg; *aarg = 0; @@ -339,7 +342,7 @@ static int slbt_exec_link_create_library( /* input argument adjustment */ for (parg=ectx->cargv; *parg; parg++) - slbt_adjust_input_argument(*parg,true); + slbt_adjust_input_argument(*parg,".lo",".o",true); /* linker argument adjustment */ for (parg=ectx->cargv; *parg; parg++) @@ -430,7 +433,7 @@ static int slbt_exec_link_create_executable( /* input argument adjustment */ for (parg=ectx->cargv; *parg; parg++) - slbt_adjust_input_argument(*parg,true); + slbt_adjust_input_argument(*parg,".lo",".o",true); /* linker argument adjustment */ for (parg=ectx->cargv; *parg; parg++) |