commit:     a8825abf797e520308e8f26cbab81adc8dbb590e
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 19 02:46:39 2025 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Jan 19 21:18:28 2025 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=a8825abf

libsbutil: avoid unnecessary use of libtool

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 Makefile.am         | 2 +-
 libsandbox/local.mk | 9 +--------
 libsbutil/local.mk  | 8 ++++----
 src/local.mk        | 2 +-
 tests/local.mk      | 2 +-
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 108eecc..8889ed7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@ dist_conf_DATA = etc/sandbox.conf
 confd_DATA = etc/sandbox.d/00default
 dist_pkgdata_DATA  = data/sandbox.bashrc
 lib_LTLIBRARIES =
-noinst_LTLIBRARIES =
+noinst_LIBRARIES =
 
 CLEANFILES =
 DISTCLEANFILES =

diff --git a/libsandbox/local.mk b/libsandbox/local.mk
index d2fb1d1..4027e9c 100644
--- a/libsandbox/local.mk
+++ b/libsandbox/local.mk
@@ -9,14 +9,7 @@ lib_LTLIBRARIES += %D%/libsandbox.la
        -I$(top_srcdir)/libsbutil/include
 
 %C%_libsandbox_la_CFLAGS = $(CFLAG_EXCEPTIONS)
-# Could use the following to libsandbox_la_LIBADD, but then libtool links it
-# with --whole-archive, and libsandbox.so increase with a few KB in size:
-#      libsbutil/libsbutil.la
-libsbutil/.libs/libsbutil.a: libsbutil/libsbutil.la
-%C%_libsandbox_la_LIBSBLIB = libsbutil/.libs/libsbutil.a
-%C%_libsandbox_la_LIBADD = \
-       $(%C%_libsandbox_la_LIBSBLIB) \
-       $(LIBDL)
+%C%_libsandbox_la_LIBADD = libsbutil/libsbutil.a $(LIBDL)
 # Do not add -nostdlib or -nostartfiles, as then our constructor
 # and destructor will not be executed ...
 %C%_libsandbox_la_LDFLAGS = \

diff --git a/libsbutil/local.mk b/libsbutil/local.mk
index 44c3e20..dc6937f 100644
--- a/libsbutil/local.mk
+++ b/libsbutil/local.mk
@@ -1,12 +1,12 @@
-noinst_LTLIBRARIES += %D%/libsbutil.la
+noinst_LIBRARIES += %D%/libsbutil.a
 
-%C%_libsbutil_la_CPPFLAGS = \
+%C%_libsbutil_a_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        $(SIXTY_FOUR_FLAGS) \
        -I$(top_srcdir)/%D% \
        -I$(top_srcdir)/%D%/include
-%C%_libsbutil_la_LDFLAGS = -no-undefined
-%C%_libsbutil_la_SOURCES = \
+%C%_libsbutil_a_CFLAGS = -fPIC
+%C%_libsbutil_a_SOURCES = \
        %D%/sbutil.h                              \
        %D%/get_sandbox_conf.c                    \
        %D%/get_sandbox_confd.c                   \

diff --git a/src/local.mk b/src/local.mk
index 363ed17..6fe00ef 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -6,7 +6,7 @@ bin_PROGRAMS += %D%/sandbox
        -I$(top_srcdir)/libsbutil \
        -I$(top_srcdir)/libsbutil/include
 
-%C%_sandbox_LDADD = libsbutil/libsbutil.la $(LIBDL)
+%C%_sandbox_LDADD = libsbutil/libsbutil.a $(LIBDL)
 %C%_sandbox_SOURCES = \
        %D%/environ.c \
        %D%/namespaces.c \

diff --git a/tests/local.mk b/tests/local.mk
index 4ba6630..b5dd0d5 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -113,7 +113,7 @@ AM_LDFLAGS = `expr $@ : .*_static >/dev/null && echo 
-all-static`
 %C%_trace_memory_static_tst_CPPFLAGS = $(SIXTY_FOUR_FLAGS)
 
 %C%_sb_printf_tst_CFLAGS = -I$(top_srcdir)/libsbutil 
-I$(top_srcdir)/libsbutil/include
-%C%_sb_printf_tst_LDADD = libsbutil/libsbutil.la
+%C%_sb_printf_tst_LDADD = libsbutil/libsbutil.a
 
 %C%_malloc_hooked_tst_LDFLAGS = $(AM_LDFLAGS) -pthread
 

Reply via email to