ports/114235: [patch] Allow dynamic linking in sysutils/env4801

Henrik Brix Andersen henrik at brixandersen.dk
Tue Jul 3 10:10:04 UTC 2007


>Number:         114235
>Category:       ports
>Synopsis:       [patch] Allow dynamic linking in sysutils/env4801
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 03 10:10:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Henrik Brix Andersen
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
pil.dk
>Environment:
System: FreeBSD lothlorien.brixandersen.dk 7.0-CURRENT FreeBSD 7.0-CURRENT #47: Sun Jul 1 22:08:49 CEST 2007 root at lothlorien.brixandersen.dk:/usr/obj/usr/src/sys/LOTHLORIEN i386


	
>Description:
The sysutils/env4801 utility is always statically linked. This causes
problems when the utility is compiled and linked on a system with a
libc optimized for e.g. prescott (a build box) and later deployed on
an i586 net4801.

	
>How-To-Repeat:
	

# cd /usr/ports/sysutils/env4801
# make install clean
# ldd /usr/local/sbin/env4801

>Fix:

The patch below adds an option for linking env4801 dynamically instead
of statically.

	

--- env4801.diff begins here ---
diff -urp /usr/ports/sysutils/env4801/Makefile sysutils/env4801/Makefile
--- /usr/ports/sysutils/env4801/Makefile	2005-12-18 15:22:22.000000000 +0100
+++ sysutils/env4801/Makefile	2007-07-03 11:45:39.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=		env4801
 PORTVERSION=		0.3
+PORTREVISION=		1
 CATEGORIES=		sysutils
 MASTER_SITES=		http://phk.freebsd.dk/soekris/env4801/
 DISTFILES=		Makefile env4801.c
@@ -25,6 +26,15 @@ MAKE_ARGS=		-DNOMAN
 
 PLIST_FILES=		sbin/env4801 etc/rc.d/env4801.sh
 
+OPTIONS=		STATIC "Build a statically linked executable" On
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+.ifdef(WITHOUT_STATIC)
+	@${REINPLACE_CMD} -e '/-static/d' ${WRKSRC}/Makefile
+.endif
+
 post-extract:
 	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
 		${FILESDIR}/env4801.sh > ${WRKSRC}/env4801.sh
@@ -36,4 +46,4 @@ do-install:
 post-install:
 	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PKGMESSAGE}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
--- env4801.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list