[PATCH] argp-standalone: generate a shared library instead of static library

Thomas Langer tlanger at maxlinear.com
Tue Sep 13 08:47:56 PDT 2022


Change the argp-standalone package to produce a shared library instead
of a static library for the target. The host build is not changed.

Update related packages to add it as a direct dependency, otherwise the
buildsystem will complain.

Signed-off-by: Thomas Langer <tlanger at maxlinear.com>
---

Please check also https://github.com/openwrt/packages/pull/19357,
a related pull request for the packages feed, to avoid that this change
is breaking all the packages that depend on argp-standalone.

With that said, this should only be merged after the pull-request is also merged.

---
 package/libs/argp-standalone/Makefile         | 12 ++++-
 .../003-argp-standalone-1.3-shared.patch      | 51 +++++++++++++++++++
 package/libs/elfutils/Makefile                |  5 +-
 package/system/iucode-tool/Makefile           |  5 +-
 4 files changed, 65 insertions(+), 8 deletions(-)
 create mode 100644 package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch

diff --git a/package/libs/argp-standalone/Makefile b/package/libs/argp-standalone/Makefile
index 1a48dcb2cd..a73c0311bf 100644
--- a/package/libs/argp-standalone/Makefile
+++ b/package/libs/argp-standalone/Makefile
@@ -9,13 +9,16 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=argp-standalone
 PKG_VERSION:=1.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/
 PKG_HASH:=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be
 PKG_MAINTAINER:=Ted Hess <thess at kitschensync.net>
 
+PKG_FIXUP:=patch-libtool autoreconf
+PKG_INSTALL=1
+
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE:=Makefile.am
 
@@ -44,7 +47,7 @@ define Build/InstallDev
 	$(CP)   $(PKG_BUILD_DIR)/argp.h \
 		$(1)/usr/include/
 	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP)   $(PKG_BUILD_DIR)/libargp.a \
+	$(CP)   $(PKG_INSTALL_DIR)/usr/lib/*.so* \
 		$(1)/usr/lib/
 endef
 
@@ -57,5 +60,10 @@ define Host/Install
 		$(1)/lib/
 endef
 
+define Package/argp-standalone/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+endef
+
 $(eval $(call BuildPackage,argp-standalone))
 $(eval $(call HostBuild))
diff --git a/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch b/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch
new file mode 100644
index 0000000000..6eac7a41b2
--- /dev/null
+++ b/package/libs/argp-standalone/patches/003-argp-standalone-1.3-shared.patch
@@ -0,0 +1,51 @@
+This argp patch comes from https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -21,20 +21,20 @@
+ AUTOMAKE_OPTIONS = foreign
+ SUBDIRS = . testsuite
+ 
+-LIBOBJS = @LIBOBJS@
++LTLIBOBJS = @LTLIBOBJS@
+ 
+-noinst_LIBRARIES = libargp.a
++lib_LTLIBRARIES = libargp.la
+ noinst_PROGRAMS = argp-test
+ noinst_HEADERS = argp.h argp-fmtstream.h argp-namefrob.h # argp-comp.h
+ 
+ EXTRA_DIST = mempcpy.c strchrnul.c strndup.c Versions
+ 
+ # Leaves out argp-fs-xinl.c and argp-xinl.c 
+-libargp_a_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
++libargp_la_SOURCES = argp-ba.c argp-eexst.c argp-fmtstream.c \
+ 		    argp-help.c argp-parse.c argp-pv.c \
+ 		    argp-pvh.c
+ 
+-libargp_a_LIBADD = $(LIBOBJS)
++libargp_la_LIBADD = $(LTLIBOBJS)
+ 
+-argp_test_LDADD = libargp.a
++argp_test_LDADD = libargp.la
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,6 +17,7 @@ AC_PROG_CC
+ AC_PROG_MAKE_SET
+ AC_PROG_RANLIB
+ AM_PROG_CC_STDC
++AC_PROG_LIBTOOL
+ 
+ if test "x$am_cv_prog_cc_stdc" = xno ; then
+   AC_ERROR([the C compiler doesn't handle ANSI-C])
+--- a/testsuite/Makefile.am
++++ b/testsuite/Makefile.am
+@@ -5,7 +5,7 @@ TS_ALL = $(TS_PROGS) $(TS_SH)
+ 
+ noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
+ 
+-LDADD = ../libargp.a
++LDADD = -L../.libs -largp
+ 
+ EXTRA_DIST = $(TS_SH) run-tests
+ CLEANFILES = test.out
diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
index 4ca37d3b06..64e778048b 100644
--- a/package/libs/elfutils/Makefile
+++ b/package/libs/elfutils/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=elfutils
 PKG_VERSION:=0.187
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
@@ -22,7 +22,6 @@ PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=1
-PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -43,7 +42,7 @@ endef
 
 define Package/libdw
   $(call Package/elfutils/Default)
-  DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts
+  DEPENDS:=+libelf +libbz2 +USE_MUSL:musl-fts +!USE_GLIBC:argp-standalone
   TITLE+= (libdw)
 endef
 
diff --git a/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile
index d7c85b2d42..8ee7cd5328 100644
--- a/package/system/iucode-tool/Makefile
+++ b/package/system/iucode-tool/Makefile
@@ -9,13 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iucode-tool
 PKG_VERSION:=2.3.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest
 PKG_HASH:=12b88efa4d0d95af08db05a50b3dcb217c0eb2bfc67b483779e33d498ddb2f95
 
-PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
 HOST_BUILD_DEPENDS:=HOST_OS_MACOS:argp-standalone/host
 
 PKG_MAINTAINER:=Zoltan HERPAI <wigyori at uid0.hu>
@@ -32,7 +31,7 @@ define Package/iucode-tool
   SECTION:=utils
   CATEGORY:=Base system
   URL:=$(PKG_SOURCE_URL)
-  DEPENDS:=@TARGET_x86
+  DEPENDS:=@TARGET_x86 +!USE_GLIBC:argp-standalone
   TITLE:=Intel microcode loader
 endef
 
-- 
2.17.1




More information about the openwrt-devel mailing list