summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-08-10 10:43:47 -0400
committermidipix <writeonce@midipix.org>2017-08-10 10:57:45 -0400
commitfb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c (patch)
tree37e6b6b0965aa5de85c0149e720bb1393c62dcc0 /src/helper
parent347e756f91e3f46a0e0713846326dbbf4056cbff (diff)
downloadslibtool-fb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c.tar.bz2
slibtool-fb50c9c53f08e4b6ef1bdec3ee56d6b7f138b04c.tar.xz
slibtool-shared: properly handle .la arguments when creating an archive.
tool ==== slibtool-shared (or slibtool with -disable-static). scenario ======== - create libfoo.so (via libfoo.la). - create libbar.a (via libbar.la), with libfoo.la as an input argument. Before this fix, slibtool failed since it could not find libfoo.a.slibtool.deps. After this fix, slibtool properly handles this scenario, first by detecting that there is no archive for which secondary dependencies need to be processed, and then by detecting that libfoo.a is a symlink to /dev/null.
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/slbt_archive_import.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c
index 1c15614..d9dee0e 100644
--- a/src/helper/slbt_archive_import.c
+++ b/src/helper/slbt_archive_import.c
@@ -14,6 +14,7 @@
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
+#include "slibtool_readlink_impl.h"
#include "slibtool_errinfo_impl.h"
static char * slbt_mri_argument(
@@ -89,6 +90,10 @@ int slbt_archive_import(
char mrisrc [L_tmpnam];
char program[PATH_MAX];
+ if (!slbt_readlink(srcarchive,program,sizeof(program)))
+ if (!(strcmp(program,"/dev/null")))
+ return 0;
+
if ((size_t)snprintf(program,sizeof(program),"%s",
dctx->cctx->host.ar) >= sizeof(program))
return SLBT_BUFFER_ERROR(dctx);