diff options
author | midipix <writeonce@midipix.org> | 2024-02-14 04:44:03 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-14 04:44:53 +0000 |
commit | 5d0af4bacc8f8ec740f829df045dedeedf13cf13 (patch) | |
tree | 7584a99bd0996d081c1e721801ec4d08c542c526 /src | |
parent | 816e2809f45c52162aa68281f61450cfbb38d8d0 (diff) | |
download | slibtool-5d0af4bacc8f8ec740f829df045dedeedf13cf13.tar.bz2 slibtool-5d0af4bacc8f8ec740f829df045dedeedf13cf13.tar.xz |
link mode: support the darwin syntax for the -soname switch.
Diffstat (limited to 'src')
-rw-r--r-- | src/logic/linkcmd/slbt_linkcmd_dsolib.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_dsolib.c b/src/logic/linkcmd/slbt_linkcmd_dsolib.c index a3361db..a00a8df 100644 --- a/src/logic/linkcmd/slbt_linkcmd_dsolib.c +++ b/src/logic/linkcmd/slbt_linkcmd_dsolib.c @@ -115,6 +115,14 @@ int slbt_exec_link_create_library( ? dctx->cctx->output : 0; + char wl_soname[24]; + + if (!strcmp(dctx->cctx->host.host,"darwin")) { + strcpy(wl_soname,"-Wl,-install_name"); + } else { + strcpy(wl_soname,"-Wl,-soname"); + } + if ((dctx->cctx->drvflags & SLBT_DRIVER_IMAGE_MACHO)) { (void)0; @@ -123,7 +131,7 @@ int slbt_exec_link_create_library( "-Wl,%s",dctx->cctx->output) < 0) return SLBT_BUFFER_ERROR(dctx); - *ectx->soname = "-Wl,-soname"; + *ectx->soname = wl_soname; *ectx->lsoname = soname; } else if (relfilename && dctx->cctx->verinfo.verinfo) { @@ -137,7 +145,7 @@ int slbt_exec_link_create_library( dctx->cctx->settings.osdfussix) < 0) return SLBT_BUFFER_ERROR(dctx); - *ectx->soname = "-Wl,-soname"; + *ectx->soname = wl_soname; *ectx->lsoname = soname; } else if (relfilename) { @@ -149,7 +157,7 @@ int slbt_exec_link_create_library( dctx->cctx->settings.dsosuffix) < 0) return SLBT_BUFFER_ERROR(dctx); - *ectx->soname = "-Wl,-soname"; + *ectx->soname = wl_soname; *ectx->lsoname = soname; } else if (dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION) { @@ -160,7 +168,7 @@ int slbt_exec_link_create_library( dctx->cctx->settings.dsosuffix) < 0) return SLBT_BUFFER_ERROR(dctx); - *ectx->soname = "-Wl,-soname"; + *ectx->soname = wl_soname; *ectx->lsoname = soname; } else { @@ -173,7 +181,7 @@ int slbt_exec_link_create_library( dctx->cctx->settings.osdfussix) < 0) return SLBT_BUFFER_ERROR(dctx); - *ectx->soname = "-Wl,-soname"; + *ectx->soname = wl_soname; *ectx->lsoname = soname; } |