site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Le 6 août 2010 à 16:43, Peter Speck a écrit :
On 06/08/2010, at 14:40, Shantonu Sen wrote:
Our product does not run on PPC hardware. The installer installation check script checks if the current hardware is Intel in order to continue.
If Apple switches to another platform, but provides a Rosetta that makes it possible to run Intel apps on the new platform, would this new platform be acceptable?
If it is, you could simply test if the host is able to execute x86 binaries instead of looking at sysctl. In the perl script, embed the hexdump of the simplest C app and unpack("H*", $_) it into a file, set the execute bit, and then check the result value of system(("/path/to/executable")).
Compiling "int main() { return 0; }" creates a ~8KB binary.
Alternatively it might be possible to parse the output of file on /bin/sh, here it gives: $ file /bin/sh /bin/sh: Mach-O universal binary with 2 architectures /bin/sh (for architecture x86_64): Mach-O 64-bit executable x86_64 /bin/sh (for architecture i386): Mach-O executable i386 Though I can't test on ppc to see what it gives. François. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
François Revol