Bug 98105 - [patch] new feature: IA32_BINARY_PORT macro
Summary: [patch] new feature: IA32_BINARY_PORT macro
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-29 20:40 UTC by Gabor Kovesdan
Modified: 2006-07-18 05:23 UTC (History)
1 user (show)

See Also:


Attachments
bsd.port.mk.diff (1.83 KB, patch)
2006-05-29 20:40 UTC, Gabor Kovesdan
no flags Details | Diff
file.diff (998 bytes, patch)
2006-05-29 20:40 UTC, Gabor Kovesdan
no flags Details | Diff
bsd.port.mk.diff (2.25 KB, patch)
2006-06-18 00:04 UTC, Gabor Kovesdan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kovesdan freebsd_committer freebsd_triage 2006-05-29 20:40:14 UTC
This patch adds a new macro (IA32_BINARY_PORT), which can be set in port Makefiles.
This feature is an axtension to the existing NOT_FOR_ARCHS / ONLY_FOR_ARCHS
system, especially for i386 binary ports that fetch compiled i386 binaries.
These ports can also be used on amd64/ia64 architectures, but the compatibility
layer must be installed. Currently, we don't have a method to check if it is
installed, so the affected ports can't be handled appropriately.
While here, I added a ${SYSCTL} variable, I think, it enhances the readability.
An update for Porter's Handbook is also attached.

Reviewed by: erwin
More info: http://wikitest.freebsd.org/G%C3%A1borK%C3%B6vesd%C3%A1n
Comment 1 Erwin Lansing freebsd_committer freebsd_triage 2006-05-29 20:59:50 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to portmgr to schedule for next -exp run.
Comment 2 Gabor Kovesdan 2006-06-18 00:04:29 UTC
Here's a new patch that also adds a comment into the header of 
bsd.port.mk. I forgot this at the first time.

Gabor Kovesdan
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-06-20 08:49:23 UTC
State Changed
From-To: open->feedback

Here is the latest corrected patch.  (Note I have moved the first block 
down a bit for what I consider to be better readability).  Submitter, does 
this look right for you? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98105 

Adding to audit trail (forgot to include the patch):

--- bsd.port.mk.made	Tue Jun 20 02:45:57 2006
+++ bsd.port.mk	Tue Jun 20 02:50:17 2006
@@ -215,6 +215,8 @@
 # NOT_FOR_ARCHS_REASON
 # NOT_FOR_ARCHS_REASON_${ARCH}
 #				- Reason why it's not for ${NOT_FOR_ARCHS}s
+# IA32_BINARY_PORT	- Set this instead of ONLY_FOR_ARCHS if the given port
+#				  fetches and installs compiled i386 binaries.
 #
 # Dependency checking.  Use these if your port requires another port
 # not in the list below.  (Default: empty.)
@@ -1059,6 +1061,7 @@
 SORT?=		/usr/bin/sort
 STRIP_CMD?=	/usr/bin/strip
 SU_CMD?=	/usr/bin/su root -c
+SYSCTL?=	/sbin/sysctl
 TAIL?=		/usr/bin/tail
 TEST?=		test				# Shell builtin
 TR?=		LANG=C /usr/bin/tr
@@ -1100,7 +1103,7 @@
 
 # Get __FreeBSD_version
 .if !defined(OSVERSION)
-OSVERSION!=	/sbin/sysctl -n kern.osreldate
+OSVERSION!=	${SYSCTL} -n kern.osreldate
 .endif
 
 # Get the object format.
@@ -1118,6 +1121,29 @@
 MASTER_PORT?=
 .endif
 
+# Check the compatibility layer for amd64/ia64
+
+.if ${ARCH} == "amd64" || ${ARCH} =="ia64"
+.if exists(/usr/lib32)
+HAVE_COMPAT_IA32_LIBS?=  YES
+.endif
+.if !defined(HAVE_COMPAT_IA32_KERN)
+HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -a compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi
+.endif
+.endif
+
+.if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
+.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
+.if !defined(HAVE_COMPAT_IA32_KERN)
+IGNORE= you need a kernel with compiled-in IA32 compatibility to use this port.
+.elif !defined(HAVE_COMPAT_IA32_LIBS)
+IGNORE= you need the 32-bit libraries installed under /usr/lib32 to use this port.
+.endif
+.else
+IGNORE= you have to use i386 (or compatible) platform to use this port.
+.endif
+.endif
+
 # If they exist, include Makefile.inc, then architecture/operating
 # system specific Makefiles, then local Makefile.local.
 
@@ -2693,7 +2719,7 @@
 .if defined(GNU_CONFIGURE)
 # Maximum command line length
 .if !defined(CONFIGURE_MAX_CMD_LEN)
-CONFIGURE_MAX_CMD_LEN!=	/sbin/sysctl -n kern.argmax
+CONFIGURE_MAX_CMD_LEN!=	${SYSCTL} -n kern.argmax
 .endif
 CONFIGURE_ARGS+=	--prefix=${PREFIX} ${CONFIGURE_TARGET}
 CONFIGURE_ENV+=		lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
@@ -5658,3 +5684,4 @@
 
 .endif
 # End of post-makefile section.
+

Comment 4 Gabor Kovesdan 2006-06-20 10:58:55 UTC
Ok, this seems good to me.

Gabor Kovesdan
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2006-06-20 11:02:11 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2006-06-27 21:12:54 UTC
State Changed
From-To: open->analyzed

Accepted for a test build on the cluster.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2006-07-05 02:48:08 UTC
State Changed
From-To: analyzed->open

I missed this one in my patchset.  We'll try it again in a future run.
Comment 8 Erwin Lansing freebsd_committer freebsd_triage 2006-07-08 09:25:38 UTC
A sysctl section was added to the porters handbook today. After this
change, that should be updated to reflect the new ${SYSCTL} variable.
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2006-07-10 06:29:04 UTC
State Changed
From-To: open->analyzed

Currently being tested on the cluster.
Comment 10 Mark Linimon freebsd_committer freebsd_triage 2006-07-18 05:23:23 UTC
State Changed
From-To: analyzed->closed

Committed, thanks.