tech-pkg archive

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

Snow Leopard ABI mess


I've committed the following change to "":

 .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
+ABI=   32
+.    endif
+.  endif
+.if ${ABI} == "32"
+LOWER_ARCH=    i386
+LOWER_ARCH=    x86_64
 LOWER_ARCH!=           ${UNAME} -p

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                        

Home | Main Index | Thread Index | Old Index