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.

Tested by:	manu
This commit is contained in:
Baptiste Daroussin 2021-10-26 12:02:00 +02:00
parent 57e5da2c98
commit c0cf36bc02
2 changed files with 10 additions and 10 deletions

View file

@ -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: libncursesw.a
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDIR}/lib${LIB}.a
${_INSTALLFLAGS} libncursesw.a ${DESTDIR}${_LIBDIR}/lib${LIB}.a
realinstall: install-aldscript
realinstall: install-libncursesw.a
.include <bsd.lib.mk>

View file

@ -0,0 +1 @@
INPUT(-l@@LIB@@@@STATICLIB_SUFFIX@@ -ltinfow)