summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-07-21 02:23:17 +0000
committermidipix <writeonce@midipix.org>2024-07-22 00:10:51 +0000
commitf98cb2926767a4045a976b5f9b46d8b6d03a37ff (patch)
tree518c06bd9b1cc25594efe03a561c0641526219e7
parent99eb57ae04ee435a5d498c01badff4e7a58e5bf1 (diff)
downloadslibtool-f98cb2926767a4045a976b5f9b46d8b6d03a37ff.tar.bz2
slibtool-f98cb2926767a4045a976b5f9b46d8b6d03a37ff.tar.xz
slibtoolize: compatibility: install (copy or symlink) a no-op ar-lib as needed.
-rwxr-xr-xaux/ar-lib27
-rw-r--r--project/extras.mk1
-rw-r--r--src/logic/slbt_exec_stoolie.c24
3 files changed, 51 insertions, 1 deletions
diff --git a/aux/ar-lib b/aux/ar-lib
new file mode 100755
index 0000000..3ef4a41
--- /dev/null
+++ b/aux/ar-lib
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#####################################################################
+## slibtool: a strong libtool implementation, written in C ##
+## Copyright (C) 2016--2024 SysDeer Technologies, LLC ##
+## Released under the Standard MIT License; see COPYING.SLIBTOOL. ##
+#####################################################################
+
+#####################################################################
+## ar-lib: a placeholder script, currently not implemented ##
+## ------------------------------------------------------- ##
+#####################################################################
+
+set -eu
+
+error_msg()
+{
+ printf '%s\n' "$@" >&2
+}
+
+error_not_implemented()
+{
+ error_msg 'ar-lib: this script is a placeholder.'
+ exit 2
+}
+
+error_not_implemented
diff --git a/project/extras.mk b/project/extras.mk
index ba3ff0f..a254d9c 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -109,5 +109,6 @@ install-slibtoolize:
cp -p $(SOURCE_DIR)/m4/slibtool.m4 $(DESTDIR)$(DATADIR)/$(PACKAGE)
cp -p $(SOURCE_DIR)/aux/ltmain.sh $(DESTDIR)$(DATADIR)/$(PACKAGE)
cp -p $(SOURCE_DIR)/aux/slibtool.sh $(DESTDIR)$(DATADIR)/$(PACKAGE)
+ cp -p $(SOURCE_DIR)/aux/ar-lib $(DESTDIR)$(DATADIR)/$(PACKAGE)
.PHONY: install-slibtoolize
diff --git a/src/logic/slbt_exec_stoolie.c b/src/logic/slbt_exec_stoolie.c
index 698faaa..7701735 100644
--- a/src/logic/slbt_exec_stoolie.c
+++ b/src/logic/slbt_exec_stoolie.c
@@ -88,6 +88,7 @@ static int slbt_exec_stoolie_perform_actions(
char auxdir[PATH_MAX];
char slibm4[PATH_MAX];
char ltmain[PATH_MAX];
+ char arlib [PATH_MAX];
bool fslibm4;
bool fltmain;
@@ -106,6 +107,12 @@ static int slbt_exec_stoolie_perform_actions(
"ltmain.sh") < 0)
return SLBT_BUFFER_ERROR(dctx);
+ if (slbt_snprintf(
+ arlib,sizeof(arlib),"%s/%s",
+ SLBT_PACKAGE_DATADIR,
+ "ar-lib") < 0)
+ return SLBT_BUFFER_ERROR(dctx);
+
/* --force? */
if (dctx->cctx->drvflags & SLBT_DRIVER_STOOLIE_FORCE) {
if (ictx->fdm4 >= 0)
@@ -115,6 +122,9 @@ static int slbt_exec_stoolie_perform_actions(
if (slbt_exec_stoolie_remove_file(dctx,ictx->fdaux,"ltmain.sh") < 0)
return SLBT_NESTED_ERROR(dctx);
+ if (slbt_exec_stoolie_remove_file(dctx,ictx->fdaux,"ar-lib") < 0)
+ return SLBT_NESTED_ERROR(dctx);
+
fslibm4 = (ictx->fdm4 >= 0);
fltmain = true;
} else {
@@ -158,6 +168,9 @@ static int slbt_exec_stoolie_perform_actions(
if (slbt_util_copy_file(ectx,ltmain,auxdir) < 0)
return SLBT_NESTED_ERROR(dctx);
+
+ if (slbt_util_copy_file(ectx,arlib,auxdir) < 0)
+ return SLBT_NESTED_ERROR(dctx);
}
} else {
/* default to symlinks */
@@ -170,7 +183,7 @@ static int slbt_exec_stoolie_perform_actions(
SLBT_SYMLINK_LITERAL) < 0)
return SLBT_NESTED_ERROR(dctx);
- if (fltmain)
+ if (fltmain) {
if (slbt_create_symlink_ex(
dctx,ectx,
ictx->fdaux,
@@ -178,6 +191,15 @@ static int slbt_exec_stoolie_perform_actions(
"ltmain.sh",
SLBT_SYMLINK_LITERAL) < 0)
return SLBT_NESTED_ERROR(dctx);
+
+ if (slbt_create_symlink_ex(
+ dctx,ectx,
+ ictx->fdaux,
+ arlib,
+ "ar-lib",
+ SLBT_SYMLINK_LITERAL) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+ }
}
return 0;