From 3fee4a74f465752f1ebf70ee9c1c1363c59f5603 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 26 Oct 2021 12:02:00 +0200 Subject: [PATCH] ncurses: rework static linker script generation Rework the generation of the linker script to make it in par with ldscript, this also forces the regeneration of the .aldscript in the obj dir which might in the past have ended up empty. --- lib/ncurses/ncurses/Makefile | 17 ++++++++--------- lib/ncurses/ncurses/libncursesw.aldscript | 1 + 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 lib/ncurses/ncurses/libncursesw.aldscript diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 951e8a4ea63..06a89b347d8 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -170,13 +170,12 @@ SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a LIBADD+= tinfow SHLIB_LDSCRIPT= libncursesw.ldscript STATIC_LDSCRIPT= libncursesw.aldscript -CLEANFILES+= ${STATIC_LDSCRIPT} +CLEANFILES+= libncursesw.a -libncursesw.aldscript: - @${ECHO} "INPUT(-lncursesw_real -ltinfow)" >$@ - -libncurses.ldscript: - @${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@ +libncursesw.a: ${.CURDIR}/${STATIC_LDSCRIPT} + sed -e 's,@@LIB@@,${LIB},g' \ + -e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \ + ${.ALLSRC} > ${.TARGET} lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ @@ -185,13 +184,13 @@ lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c -all: ${STATIC_LDSCRIPT} +all: ${STATIC_LDSCRIPT} libncursesw.a -install-aldscript: ${STATIC_LDSCRIPT} +install-libncursesw.a: ${STATIC_LDSCRIPT} ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDIR}/lib${LIB}.a -realinstall: install-aldscript +realinstall: install-libncursesw.a .include diff --git a/lib/ncurses/ncurses/libncursesw.aldscript b/lib/ncurses/ncurses/libncursesw.aldscript new file mode 100644 index 00000000000..337995f095c --- /dev/null +++ b/lib/ncurses/ncurses/libncursesw.aldscript @@ -0,0 +1 @@ +INPUT(-l@@LIB@@@@STATICLIB_SUFFIX@@ -ltinfow) -- 2.33.0