pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat Introduce a variable, LIBNBCOMPAT...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a77012695a74
branches:  trunk
changeset: 538968:a77012695a74
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Fri Feb 22 04:07:55 2008 +0000

description:
Introduce a variable, LIBNBCOMPAT_USE_PIC, which if set to yes before
including inplace.mk causes a PIC version of libnbcompat to be built
alongside the regular static libnbcompat.

This will be used to extend the features framework in two ways:
1) Support linking features into shared modules
2) Ability to cherry-pick individual objects to link from the libnbcompat
   build directory rather than linking the whole archive.

diffstat:

 pkgtools/libnbcompat/inplace.mk |  32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diffs (69 lines):

diff -r 8e29e565f5d2 -r a77012695a74 pkgtools/libnbcompat/inplace.mk
--- a/pkgtools/libnbcompat/inplace.mk   Fri Feb 22 02:47:08 2008 +0000
+++ b/pkgtools/libnbcompat/inplace.mk   Fri Feb 22 04:07:55 2008 +0000
@@ -1,15 +1,15 @@
-# $NetBSD: inplace.mk,v 1.7 2007/11/20 18:55:25 rillig Exp $
+# $NetBSD: inplace.mk,v 1.8 2008/02/22 04:07:55 tnn Exp $
 #
 # This file should not be included directly. Use USE_FEATURES instead.
 #
 # This Makefile fragment builds a working copy of libnbcompat inside
 # ${WRKDIR}.
 #
-# XXX: Why isn't libnbcompat installed as shared library?
-#
 
 .include "../../mk/bsd.prefs.mk"
 
+LIBNBCOMPAT_USE_PIC?=  no
+
 LIBNBCOMPAT_FILESDIR=  ${.CURDIR}/../../pkgtools/libnbcompat/files
 LIBNBCOMPAT_SRCDIR=    ${WRKDIR}/libnbcompat
 
@@ -17,10 +17,20 @@
 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
+
 post-extract: libnbcompat-extract
+.PHONY: libnbcompat-extract
 libnbcompat-extract:
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${CP} -R ${LIBNBCOMPAT_FILESDIR} ${LIBNBCOMPAT_SRCDIR}
+       ${RUN} ${CP} -R ${LIBNBCOMPAT_FILESDIR} ${LIBNBCOMPAT_SRCDIR}
+.if !empty(LIBNBCOMPAT_USE_PIC:M[Yy][Ee][Ss])
+       ${RUN} ${CP} -R ${LIBNBCOMPAT_FILESDIR} ${LIBNBCOMPAT_PICDIR}
+.endif
 
 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
 NBCOMPAT_CONFIGURE_ARGS+=      --build=${NATIVE_MACHINE_GNU_PLATFORM:Q}
@@ -28,12 +38,22 @@
 NBCOMPAT_CONFIGURE_ARGS+=      --host=${MACHINE_GNU_PLATFORM:Q}
 
 pre-configure: libnbcompat-build
+.PHONY: libnbcompat-build
 libnbcompat-build:
        @${STEP_MSG} "Configuring and building libnbcompat"
-       ${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD}                       \
+       ${RUN} ${_ULIMIT_CMD}                                           \
        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} &&       \
                ${MAKE_PROGRAM}
+.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"     \
+               ${CONFIG_SHELL}                                         \
+               ${CONFIGURE_SCRIPT} ${NBCOMPAT_CONFIGURE_ARGS} &&       \
+               ${MAKE_PROGRAM}
+.endif



Home | Main Index | Thread Index | Old Index