From f98cb2926767a4045a976b5f9b46d8b6d03a37ff Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 21 Jul 2024 02:23:17 +0000 Subject: slibtoolize: compatibility: install (copy or symlink) a no-op ar-lib as needed. --- src/logic/slbt_exec_stoolie.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3