Date: Sat, 17 Jun 2006 22:57:41 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 99475 for review Message-ID: <200606172257.k5HMvf7k023656@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606172257.k5HMvf7k023656>