From 9cce846a4cc2b905f0f639e1b49fbe9301cf2294 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 24 Apr 2016 21:15:09 -0400 Subject: install mode: properly handle SRC and DEST being libfoo.la and /dest/libfoo.la. --- src/logic/slbt_exec_install.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/logic/slbt_exec_install.c b/src/logic/slbt_exec_install.c index 0eddd6d..c4fd40d 100644 --- a/src/logic/slbt_exec_install.c +++ b/src/logic/slbt_exec_install.c @@ -264,6 +264,12 @@ static int slbt_exec_install_entry( ? -1 : 0; } + /* *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; @@ -279,7 +285,6 @@ static int slbt_exec_install_entry( /* executable? */ if (fexe) { *src = srcfile; - *dst = dest ? 0 : (char *)last->arg; if (!(dctx->cctx->drvflags & SLBT_DRIVER_SILENT)) if (slbt_output_install(dctx,ectx)) @@ -295,7 +300,7 @@ static int slbt_exec_install_entry( if (slbt_copy_file(dctx,ectx, srcfile, - dest ? (char *)dest->arg : (char *)last->arg)) + dest ? (char *)dest->arg : *dst)) return -1; /* dot/suffix */ -- cgit v1.2.3