From owner-p4-projects@FreeBSD.ORG Sat Jun 17 22:57:42 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 69F3716A47E; Sat, 17 Jun 2006 22:57:42 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B70416A47B for ; Sat, 17 Jun 2006 22:57:42 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDBA543D46 for ; Sat, 17 Jun 2006 22:57:41 +0000 (GMT) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5HMvfD9023659 for ; Sat, 17 Jun 2006 22:57:41 GMT (envelope-from gabor@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5HMvf7k023656 for perforce@freebsd.org; Sat, 17 Jun 2006 22:57:41 GMT (envelope-from gabor@FreeBSD.org) Date: Sat, 17 Jun 2006 22:57:41 GMT Message-Id: <200606172257.k5HMvf7k023656@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@FreeBSD.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 99475 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jun 2006 22:57:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=99475 Change 99475 by gabor@spitfire on 2006/06/17 22:57:24 Add IA32_BINARY_PORT macro. This is an enhancement for the existing NOT_FOR_ARCHS and ONLY_FOR_ARCHS system. It should be set instead of the previous two knobs for ports that fetch and install compiled i386 binaries. On ia64 and amd64 the kernel-level compatibility and the availability of the 32-bit libraries is checked and the port can only be installed if both succeeded. Also add SYSCTL variable for /sbin/sysctl. It makes the code easier to read. PR: ports/98105 Reviewed by: erwin Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#2 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#2 (text+ko) ==== @@ -216,6 +216,10 @@ # NOT_FOR_ARCHS_REASON_${ARCH} # - Reason why it's not for ${NOT_FOR_ARCHS}s # +# IA32_BINARY_PORT - It should be set 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 +1063,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 @@ -1088,6 +1093,30 @@ # Kludge for pre-3.0 systems MACHINE_ARCH?= i386 +# 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 + + # Get the operating system type .if !defined(OPSYS) OPSYS!= ${UNAME} -s @@ -1100,7 +1129,7 @@ # Get __FreeBSD_version .if !defined(OSVERSION) -OSVERSION!= /sbin/sysctl -n kern.osreldate +OSVERSION!= ${SYSCTL} -n kern.osreldate .endif # Get the object format. @@ -2685,7 +2714,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}