X-Git-Url: https://git.saurik.com/apple/system_cmds.git/blobdiff_plain/34d340d711a2b033f5da480ed7b5eb147679a588..d52496fdbb8dd3d53ac142500a42d06f3720ea6c:/arch.tproj/arch.1 diff --git a/arch.tproj/arch.1 b/arch.tproj/arch.1 index dcae9ef..afc984c 100644 --- a/arch.tproj/arch.1 +++ b/arch.tproj/arch.1 @@ -31,7 +31,7 @@ .\" Modifications made 8/20/97 (c) Apple Computer, Inc. .\" Modifications made 11/12/06 (c) Apple Computer, Inc. -.Dd November 12, 2006 +.Dd July 8, 2010 .Dt ARCH 1 .Os "Mac OS X" .Sh NAME @@ -40,10 +40,15 @@ .Sh SYNOPSIS .Nm arch .Nm arch -.Op Fl h +.Op Fl 32 +.Op Fl 64 .Oo .Oo Fl Ns Ar arch_name | Fl arch Ar arch_name Oc Ns ... .Oc +.Op Fl c +.Oo Fl d Ar envname Oc Ns ... +.Oo Fl e Ar envname=value Oc Ns ... +.Op Fl h .Ar prog .Op Ar args No ... .Sh DESCRIPTION @@ -53,13 +58,13 @@ command with no arguments, displays the machine's architecture type. .Pp The other use of the .Nm arch -command it to run a selected architecture of a universal binary. +command is to run a selected architecture of a universal binary. A universal binary contains code that can run on different architectures. By default, the operating system will select the architecture that most closely matches the processor type. This means that an intel architecture is selected on intel processors and a powerpc architecture is selected on powerpc processors. -A 64-bit architecuture is preferred over a 32-bit architecture on a 64-bit +A 64-bit architecture is preferred over a 32-bit architecture on a 64-bit processor, while only 32-bit architectures can run on a 32-bit processor. .Pp When the most natural architecture is unavailable, the operating system will @@ -71,24 +76,16 @@ Otherwise, no architecture is run, and an error results. .Pp The .Nm arch -command can be use to alter the operating system's normal selection order. +command can be used to alter the operating system's normal selection order. The most common use is to select the 32-bit architecture on a 64-bit processor, even if a 64-bit architecture is available. .Pp The -.Fl h -option prints a usage message and exits. -.Pp -The .Ar arch_name argument must be one of the currently supported architectures: .Bl -tag -width x86_64 -offset indent .It i386 32-bit intel -.It ppc -32-bit powerpc -.It ppc64 -64-bit powerpc .It x86_64 64-bit intel .El @@ -102,11 +99,30 @@ If more than one architecture is specified, the operating system will try each one in order, skipping an architecture that is not supported on the current processor, or is unavailable in the universal binary. .Pp +The other options are: +.Bl -tag -width ".Fl e Ar envname=value" +.It Fl 32 +Add the native 32-bit architecture to the list of architectures. +.It Fl 64 +Add the native 64-bit architecture to the list of architectures. +.It Fl c +Clears the environment that will be passed to the command to be run. +.It Fl d Ar envname +Deletes the named environment variable from the environment that will be passed +to the command to be run. +.It Fl e Ar envname=value +Assigns the given value to the named environment variable in the environment +that will be passed to the command to be run. +Any existing environment variable with the same name will be replaced. +.It Fl h +Prints a usage message and exits. +.El +.Pp The .Ar prog argument is the command to run, followed by any arguments to pass to the command. -It can be a full or partial path, while a lone name will be lookup in the user's +It can be a full or partial path, while a lone name will be looked up in the user's command search path. .Pp If no architectures are specified on the command line, the @@ -141,13 +157,7 @@ On an intel processor: 1234 .Ed .Pp -shows the intel little endian byte order, while: -.Bd -literal -offset indent -% arch -ppc perl -MConfig -e 'printf "%s\\n", $Config{byteorder}' -4321 -.Ed -.Pp -runs the powerpc architecture, and displays big endian byte order. +shows the intel little endian byte order. .Ss Making links to the arch command When a link is made to .Nm arch @@ -199,17 +209,17 @@ If not specified as a second field in a specifier, the executable path will be looked up in the corresponding property list file. .Ss Example ARCHPREFERENCE Values .Bl -tag -width " " -.It ppc,i386,ppc64,x86_64 +.It i386,x86_64 A specifier that matches any name. -.It foo:ppc,i386,ppc64,x86_64 +.It foo:i386,x86_64 A specifier that matches the program named .Nm foo (the full executable path is in the .Pa foo.plist file). -.It foo:/op/bin/boo:ppc,i386,ppc64,x86_64 +.It foo:/op/bin/boo:i386,x86_64 A specifier with all fields specified. -.It baz:ppc,i386;i386,ppc +.It baz:i386;x86_64 A specifier for .Nm baz and a second specifier that would match any other name.