From e13a5c1d69f1c25133d9bb610be2abd82515504b Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 5 May 2016 06:46:05 -0400 Subject: install mode: fix and simplify logic related to installation of executables. --- src/logic/slbt_exec_install.c | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index f192053..322fd8c 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -346,30 +346,6 @@ static int slbt_exec_install_entry( if (!fexe && dot && !strcmp(dot,".lai")) dot[3] = 0; - /* .la ? */ - if (!fexe && (!dot || strcmp(dot,".la"))) { - *src = (char *)entry->arg; - *dst = dest ? 0 : (char *)last->arg; - - if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) - if (slbt_output_install(dctx,ectx)) - return -1; - - return (((ret = slbt_spawn(ectx,true)) < 0) || ectx->exitcode) - ? -1 : 0; - } - - /* legabits? */ - if (dctx->cctx->drvflags & SLBT_DRIVER_LEGABITS) - if (slbt_exec_install_library_wrapper(dctx,ectx,entry,dstdir)) - return -1; - - /* *dst: consider: cp libfoo.la /dest/dir/libfoo.la */ - if ((*dst = dest ? 0 : (char *)last->arg)) - if ((dot = strrchr(last->arg,'.'))) - if (!(strcmp(dot,".la"))) - *dst = dstdir; - /* srcfile */ if (strlen(entry->arg) + strlen(".libs/") >= (PATH_MAX-1)) return -1; @@ -382,9 +358,10 @@ static int slbt_exec_install_entry( } else sprintf(srcfile,".libs/%s",lasource); - /* executable? */ - if (fexe) { - *src = srcfile; + /* executable? ordinary file? */ + if (fexe || !dot || strcmp(dot,".la")) { + *src = fexe ? srcfile : (char *)entry->arg; + *dst = dest ? 0 : (char *)last->arg; if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) if (slbt_output_install(dctx,ectx)) @@ -394,6 +371,17 @@ static int slbt_exec_install_entry( ? -1 : 0; } + /* legabits? */ + if (dctx->cctx->drvflags & SLBT_DRIVER_LEGABITS) + if (slbt_exec_install_library_wrapper(dctx,ectx,entry,dstdir)) + return -1; + + /* *dst: consider: cp libfoo.la /dest/dir/libfoo.la */ + if ((*dst = dest ? 0 : (char *)last->arg)) + if ((dot = strrchr(last->arg,'.'))) + if (!(strcmp(dot,".la"))) + *dst = dstdir; + /* libfoo.a */ dot = strrchr(srcfile,'.'); strcpy(dot,dctx->cctx->settings.arsuffix); -- cgit v1.2.3