ncurses: convert libncursesw.a into a static ldscript
Introduce the notion of static linker scripts to allow libncursesw.a to track its dependency on libtinfow.a this allows the build of older freebsd source tree to happen and make static linking in part with dynamic linking which already provides a ldscript This fixes a bootstrapping FreeBSD 12 or 13 on recent FreeBSD 14 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D32435
This commit is contained in:
parent
0f14bcbe38
commit
9294a2c719
@ -169,6 +169,11 @@ SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a
|
||||
|
||||
LIBADD+= tinfow
|
||||
SHLIB_LDSCRIPT= libncursesw.ldscript
|
||||
STATIC_LDSCRIPT= libncursesw.aldscript
|
||||
CLEANFILES+= ${STATIC_LDSCRIPT}
|
||||
|
||||
libncursesw.aldscript:
|
||||
@${ECHO} "INPUT(-lncursesw_real -ltinfow)" >$@
|
||||
|
||||
libncurses.ldscript:
|
||||
@${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@
|
||||
@ -180,4 +185,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}
|
||||
|
||||
install-aldscript: ${STATIC_LDSCRIPT}
|
||||
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDI}/lib${LIB}.a
|
||||
|
||||
realinstall: install-aldscript
|
||||
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
@ -271,9 +271,12 @@ CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS}
|
||||
.endif
|
||||
|
||||
.if defined(LIB) && !empty(LIB)
|
||||
_LIBS= lib${LIB_PRIVATE}${LIB}.a
|
||||
.if defined(STATIC_LDSCRIPT)
|
||||
_STATICLIB_SUFFIX= _real
|
||||
.endif
|
||||
_LIBS= lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a
|
||||
|
||||
lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
|
||||
lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a: ${OBJS} ${STATICOBJS}
|
||||
@${ECHO} building static ${LIB} library
|
||||
@rm -f ${.TARGET}
|
||||
${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD}
|
||||
@ -477,7 +480,7 @@ realinstall: _libinstall installpcfiles
|
||||
_libinstall:
|
||||
.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
|
||||
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/
|
||||
${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/
|
||||
.endif
|
||||
.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
|
||||
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
|
||||
|
Loading…
Reference in New Issue
Block a user