Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/lib32.mk
- This file was added.
# $FreeBSD$ | |||||
# | |||||
# Create a 'lib32-' companion port. | |||||
# | |||||
# For ports need to ship 32-bit components, or who have dependant's who need | |||||
# 32-bit libraries, this USES adds a FLAVOR that will compile this port | |||||
# targetting a 32-bit architecture. | |||||
# | |||||
# To use this USES a port most not define FLAVORS or PKGNAMEPREFIX and MUST | |||||
# define USE_LDCONFIG. All files under ${PREFIX}/lib will then be compiled | |||||
# targetting 32-bit and moved to ${PREFIX}/lib32. | |||||
# | |||||
# All ports with USES=lib32 can be concurrently installed with both the | |||||
# native and 32-bit packages (which gets a 'lib32-' prefix). | |||||
# | |||||
# Usage: | |||||
# USES=lib32 | |||||
# | |||||
# Variables set by lib32: | |||||
# | |||||
# LIBDIR The path to the library directory | |||||
# ${PREFIX}/lib; or | |||||
# ${PREFIX}/lib32 | |||||
.if !defined(_LIB32_MK_INCLUDED) | |||||
_LIB32_MK_INCLUDED= lib32.mk | |||||
_USES_POST+= lib32 | |||||
LIBDIR= ${PREFIX}/lib | |||||
. for var in FLAVORS PKGNAMEPREFIX | |||||
. if defined(${var}) | |||||
#ERROR+= "USES=lib32: not compatible with ${var}" | |||||
mat: `DEV_ERROR`? | |||||
dbnAuthorUnsubmitted Done Inline ActionsAfter your suggestion, this is no longer needed. dbn: After your suggestion, this is no longer needed. | |||||
. endif | |||||
. endfor | |||||
. if !defined(USE_LDCONFIG) | |||||
ERROR+= "USES=lib32: USE_LDCONFIG must be defined" | |||||
. endif | |||||
. if ${USE_LDCONFIG} != yes && "${USE_LDCONFIG:N${LIBDIR}}" != "" | |||||
ERROR+= "USES=lib32: USE_LDCONFIG must only define libraries under $${PREFIX}/lib" | |||||
. endif | |||||
. if ${ARCH} == amd64 | |||||
FLAVORS= default lib32 | |||||
. endif | |||||
.endif // _LIB32_MK_INCLUDED | |||||
.if defined(_POSTMKINCLUDED) && !defined(_LIB32_MK_POST_INCLUDED) | |||||
_LIB32_MK_POST_INCLUDED= yes | |||||
. if ${FLAVOR} == lib32 | |||||
LIBDIR= ${PREFIX}/lib32 | |||||
PKGNAMEPREFIX= lib32- | |||||
matUnsubmitted Done Inline ActionsIf you write it as: PKGNAMEPREFIX:= lib32-${PKGNAMEPREFIX} You can remove PKGNAMEPREFIX from the incompatible variables above. mat: If you write it as:
```
PKGNAMEPREFIX:= lib32-${PKGNAMEPREFIX}
```
You can remove… | |||||
dbnAuthorUnsubmitted Done Inline ActionsNice suggestion, implemented :-) dbn: Nice suggestion, implemented :-) | |||||
. if defined(LIB_DEPENDS) | |||||
LIB32_DEPENDS:= ${LIB_DEPENDS:C|^|${LOCALBASE}/lib32/|g:C/$$/@lib32/g} | |||||
BUILD_DEPENDS+= ${LIB32_DEPENDS} | |||||
RUN_DEPENDS+= ${LIB32_DEPENDS} | |||||
. undef LIB_DEPENDS | |||||
. endif | |||||
. for flags in CFLAGS CPPFLAGS | |||||
${flags}:= ${CFLAGS:S|${LOCALBASE}/lib|${LOCALBASE}/lib32|g} -m32 | |||||
. endfor | |||||
. if ${USE_LDCONFIG} == yes | |||||
USE_LDCONFIG32= ${LIBDIR} | |||||
. else | |||||
USE_LDCONFIG32:=${USE_LDCONFIG:S|${PREFIX}/lib/|${LIBDIR}/} | |||||
. endif | |||||
. if defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE) | |||||
CONFIGURE_ARGS:=${CONFIGURE_ARGS:S|${LOCALBASE}/lib|${LOCALBASE}/lib32|} --libdir=${LIBDIR} | |||||
. endif | |||||
_USES_stage+= 935:post-plist-lib32 | |||||
Not Done Inline ActionsI am unsure what this does. Having USE_LDCONFIG32 set should already be doing the right thing, no? mat: I am unsure what this does. Having `USE_LDCONFIG32` set should already be doing the right… | |||||
LIB32_PATTERN= (^lib\/|^@post(un)?exec .* ldconfig|${PREFIX:S|/|\/|g}\/share\/licenses|${PREFIX:S|/|\/|g}\/libdata\/ldconfig32) | |||||
post-plist-lib32: | |||||
${SED} -E -e '/${LIB32_PATTERN}/d' -e '/^@/d' -e 's|^|${STAGEDIR}${PREFIX}/|g' ${TMPPLIST} | ${XARGS} ${RM} | |||||
${REINPLACE_CMD} -E -e '/${LIB32_PATTERN}/!d' -e 's|^lib/|lib32/|g' ${TMPPLIST} | |||||
. undef USE_LDCONFIG | |||||
. endif | |||||
.endif // _LIB32_MK_POST_INCLUDED |
DEV_ERROR?