tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Snow Leopard ABI mess



        Hello,

I've committed the following change to "bsd.prefs.mk":

 .elif ${OPSYS} == "Darwin"
 LOWER_OPSYS?=          darwin
+.if empty(OS_VERSION:M[1-9].*.*)
+# Determine the ABI under Mac OS X Snow Leopard and adjust
+# the machine archicture accordingly.
+.  if !defined(ABI)
+_SYSCTL_HW_OPTIONAL_X86_64!=   /usr/sbin/sysctl -n hw.optional.x86_64
+.    if ${_SYSCTL_HW_OPTIONAL_X86_64} == "1"
+ABI=   64
+.else
+ABI=   32
+.    endif
+.  endif
+.if ${ABI} == "32"
+LOWER_ARCH=    i386
+.else
+LOWER_ARCH=    x86_64
+.endif
+.else
 LOWER_ARCH!=           ${UNAME} -p
+.endif
 MACHINE_ARCH=          ${LOWER_ARCH}
 MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH:Q}
 LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}

The nice bits abouts this code were:
1.) It automatically detects whether the machine can run 64-bit binaries
    and uses the appropriate ABI by default.
2.) It correct "LOWER_ARCH" to allow "pkgsrc" to figure out the
    architecture that we are actually building for. This fixed
    e.g. the build of the "gnupg" package.

Unfortunately the above change didn't work properly because "ABI"
could get changed by "mk.conf" later and as a result "LOWER_ARCH"
contained the wrong value.

Any ideas how to fix that?

        Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/


Home | Main Index | Thread Index | Old Index