diff options
author | midipix <writeonce@midipix.org> | 2016-04-04 16:32:52 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-04 18:04:52 -0400 |
commit | d1091b4e9ef0ae62fe95189e49f08ba048544f27 (patch) | |
tree | d08303b11dff547891073f5f6c0c19351c30244c /src/logic/slbt_exec_link.c | |
parent | 93b62c7d9abbb324853cd0df1ff5aeda27e3b5aa (diff) | |
download | slibtool-d1091b4e9ef0ae62fe95189e49f08ba048544f27.tar.bz2 slibtool-d1091b4e9ef0ae62fe95189e49f08ba048544f27.tar.xz |
link mode: slbt_exec_link_create_symlink(): make the .la wrapper mode optional.
Diffstat (limited to 'src/logic/slbt_exec_link.c')
-rw-r--r-- | src/logic/slbt_exec_link.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index fe7b207..c025a97 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -186,10 +186,12 @@ static int slbt_exec_link_create_symlink( const struct slbt_driver_ctx * dctx, struct slbt_exec_ctx * ectx, const char * target, - char * lnkname) + char * lnkname, + bool flawrapper) { const char * slash; char * ln[5]; + char * dotdot; char atarget[PATH_MAX]; /* atarget */ @@ -198,8 +200,10 @@ static int slbt_exec_link_create_symlink( else slash = target; - if ((size_t)snprintf(atarget,sizeof(atarget),"../%s", - slash) >= sizeof(atarget)) + dotdot = flawrapper ? "../" : ""; + + if ((size_t)snprintf(atarget,sizeof(atarget),"%s%s", + dotdot,slash) >= sizeof(atarget)) return -1; /* ln argv (fake) */ @@ -292,7 +296,8 @@ int slbt_exec_link( if (slbt_exec_link_create_symlink( dctx,ectx, output, - ectx->lafilename)) { + ectx->lafilename, + true)) { slbt_free_exec_ctx(actx); return -1; } |