summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-10 21:56:17 +0000
committermidipix <writeonce@midipix.org>2024-03-10 22:12:34 +0000
commitb975cb04c10daf6d2b50044390536c4bd40d01db (patch)
treed8b7ae5515b87c19ee0da015895058cdd87734d8 /src/internal
parentde1405fddd8cb3104c04b1a11524745ec26853ce (diff)
downloadslibtool-b975cb04c10daf6d2b50044390536c4bd40d01db.tar.bz2
slibtool-b975cb04c10daf6d2b50044390536c4bd40d01db.tar.xz
slbt_create_library_wrapper(): properly handle --disable-shared and --disable-static.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/slibtool_libmeta_impl.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/internal/slibtool_libmeta_impl.c b/src/internal/slibtool_libmeta_impl.c
index 0db0686..d288fd5 100644
--- a/src/internal/slibtool_libmeta_impl.c
+++ b/src/internal/slibtool_libmeta_impl.c
@@ -29,6 +29,7 @@ static int slbt_create_default_library_wrapper(
const char * base;
bool fnover;
bool fvernum;
+ bool fspace;
int current;
int revision;
int age;
@@ -55,6 +56,7 @@ static int slbt_create_default_library_wrapper(
fnover = !!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION);
fvernum = !!(dctx->cctx->verinfo.vernumber);
+ fspace = !!soname[0];
verinfo = slbt_api_source_version();
/* wrapper header */
@@ -68,7 +70,7 @@ static int slbt_create_default_library_wrapper(
"# [commit reference: %s]\n\n"
"dlname='%s'\n"
- "library_names='%s %s %s'\n"
+ "library_names='%s%s%s%s%s'\n"
"old_library='%s'\n\n"
"inherited_linker_flags='%s'\n"
@@ -100,7 +102,9 @@ static int slbt_create_default_library_wrapper(
/* library_names */
fnover ? solnk : soxyz,
+ fspace ? " " : "",
fnover ? solnk : soname,
+ fspace ? " " : "",
solnk,
/* old_library */
@@ -141,6 +145,7 @@ static int slbt_create_compatible_library_wrapper(
const char * base;
bool fnover;
bool fvernum;
+ bool fspace;
int current;
int revision;
int age;
@@ -174,6 +179,7 @@ static int slbt_create_compatible_library_wrapper(
fnover = !!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION);
fvernum = !!(dctx->cctx->verinfo.vernumber);
+ fspace = !!soname[0];
verinfo = slbt_api_source_version();
/* wrapper content */
@@ -189,7 +195,7 @@ static int slbt_create_compatible_library_wrapper(
"dlname='%s'\n\n"
"# Names of this library.\n"
- "library_names='%s %s %s'\n\n"
+ "library_names='%s%s%s%s%s'\n\n"
"# The name of the static archive.\n"
"old_library='%s'\n\n"
@@ -234,7 +240,9 @@ static int slbt_create_compatible_library_wrapper(
/* library_names */
fnover ? solnk : soxyz,
+ fspace ? " " : "",
fnover ? solnk : soname,
+ fspace ? " " : "",
solnk,
/* old_library */
@@ -275,6 +283,16 @@ slbt_hidden int slbt_create_library_wrapper(
const char * soxyz,
const char * solnk)
{
+ if (!arname) {
+ arname = "";
+ }
+
+ if (!soname) {
+ soname = "";
+ soxyz = "";
+ solnk = "";
+ }
+
if (dctx->cctx->drvflags & SLBT_DRIVER_LEGABITS)
return slbt_create_compatible_library_wrapper(
dctx,ectx,arname,soxyz,soname,solnk);