pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/libnbcompat
Module Name: pkgsrc
Committed By: nia
Date: Tue Mar 19 23:18:21 UTC 2024
Modified Files:
pkgsrc/pkgtools/libnbcompat: inplace.mk
Log Message:
libnbcompat: Rework in-place linking.
Prevent libtool from detecting -lnbcompat in the command line arguments
then declaring it as a dependency in the resulting libtool archive.
Filter -lnbcompat from all of the environment when compiling an
in-place copy to prevent circular dependencies.
Drop LIBNBCOMPAT_USE_PIC, I can't find anywhere this is used in the
tree, it's incomplete (needs handling in mk/) and complicates things
needlessly.
What still needs to be done is figure out why certain packages don't
seem to properly link with libnbcompat when USE_FEATURES is used - it's
a long-term problem, might be related to some newer build systems not
using ${LIBS}.
Bootstrap tested on Darwin and NetBSD.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 pkgsrc/pkgtools/libnbcompat/inplace.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/libnbcompat/inplace.mk
diff -u pkgsrc/pkgtools/libnbcompat/inplace.mk:1.17 pkgsrc/pkgtools/libnbcompat/inplace.mk:1.18
--- pkgsrc/pkgtools/libnbcompat/inplace.mk:1.17 Sun Mar 17 21:44:21 2024
+++ pkgsrc/pkgtools/libnbcompat/inplace.mk Tue Mar 19 23:18:21 2024
@@ -1,4 +1,4 @@
-# $NetBSD: inplace.mk,v 1.17 2024/03/17 21:44:21 wiz Exp $
+# $NetBSD: inplace.mk,v 1.18 2024/03/19 23:18:21 nia Exp $
#
# This file should not be included directly. Use USE_FEATURES instead.
#
@@ -8,21 +8,20 @@
.include "../../mk/bsd.prefs.mk"
-LIBNBCOMPAT_USE_PIC?= no
-
LIBNBCOMPAT_FILESDIR= ${.CURDIR}/../../pkgtools/libnbcompat/files
LIBNBCOMPAT_SRCDIR= ${WRKDIR}/libnbcompat
+# Prevent libnbcompat from being embedded as a dependency in the libtool
+# archive.
+.if !empty(USE_LIBTOOL:tl:Myes)
+LIBNBCOMPAT_LIBNAME= ${LIBNBCOMPAT_SRCDIR}/libnbcompat.a
+.else
+LIBNBCOMPAT_LIBNAME= -lnbcompat
+.endif
+
CPPFLAGS.nbcompat= -DHAVE_NBCOMPAT_H=1 -I${LIBNBCOMPAT_SRCDIR}
LDFLAGS.nbcompat= -L${LIBNBCOMPAT_SRCDIR}
-LDADD.nbcompat= -lnbcompat
-
-.if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
-LIBNBCOMPAT_PICDIR= ${WRKDIR}/libnbcompat_pic
-CPPFLAGS.nbcompat_pic= -DHAVE_NBCOMPAT_H=1 -I${LIBNBCOMPAT_PICDIR}
-LDFLAGS.nbcompat_pic= -L${LIBNBCOMPAT_PICDIR}
-LDADD.nbcompat_pic= -lnbcompat
-.endif
+LDADD.nbcompat= ${LIBNBCOMPAT_LIBNAME}
post-extract: libnbcompat-extract
.PHONY: libnbcompat-extract
@@ -31,12 +30,6 @@ libnbcompat-extract:
${RM} -f ${LIBNBCOMPAT_SRCDIR}/config.guess ${LIBNBCOMPAT_SRCDIR}/config.sub
${LN} -fs ${PKGSRCDIR}/mk/gnu-config/config.guess ${LIBNBCOMPAT_SRCDIR}/config.guess
${LN} -fs ${PKGSRCDIR}/mk/gnu-config/config.sub ${LIBNBCOMPAT_SRCDIR}/config.sub
-.if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
- ${RUN} ${CP} -R ${LIBNBCOMPAT_FILESDIR} ${LIBNBCOMPAT_PICDIR}
- ${RM} -f ${LIBNBCOMPAT_PICDIR}/config.guess ${LIBNBCOMPAT_PICDIR}/config.sub
- ${LN} -fs ${PKGSRCDIR}/mk/gnu-config/config.guess ${LIBNBCOMPAT_PICDIR}/config.guess
- ${LN} -fs ${PKGSRCDIR}/mk/gnu-config/config.sub ${LIBNBCOMPAT_PICDIR}/config.sub
-.endif
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
NBCOMPAT_CONFIGURE_ARGS+= --build=${NATIVE_MACHINE_GNU_PLATFORM:Q}
@@ -62,15 +55,8 @@ libnbcompat-build:
cd ${LIBNBCOMPAT_SRCDIR} && ${SETENV} \
AWK=${AWK:Q} CC=${CC:Q} CFLAGS=${CFLAGS:M*:Q} \
CPPFLAGS=${CPPFLAGS:M*:Q} \
- ${CONFIGURE_ENV:NLIBS=*} ${CONFIG_SHELL} \
- ${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} && \
- ${SETENV} ${MAKE_ENV} ${MAKE} -j${MAKE_JOBS:U1:Q}
-.if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
- @${STEP_MSG} "Configuring and building libnbcompat (PIC version)"
- ${RUN} ${_ULIMIT_CMD} \
- cd ${LIBNBCOMPAT_PICDIR} && ${SETENV} \
- ${CONFIGURE_ENV:NLIBS=*} CFLAGS=${CFLAGS:Q}" -fPIC" \
+ ${CONFIGURE_ENV:S,${LIBNBCOMPAT_LIBNAME},,g} \
${CONFIG_SHELL} \
${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} && \
- ${SETENV} ${MAKE_ENV} ${MAKE} -j${MAKE_JOBS:U1:Q}
-.endif
+ ${SETENV} ${MAKE_ENV:S,${LIBNBCOMPAT_LIBNAME},,g} \
+ ${MAKE} -j${MAKE_JOBS:U1:Q}
Home |
Main Index |
Thread Index |
Old Index