* Re: Beginner in Mac OS X, and ADA and gtkAda: $prefix, and what bin, and home is usr/bob or OSX Users/bob
2017-09-11 23:17 Beginner in Mac OS X, and ADA and gtkAda: $prefix, and what bin, and home is usr/bob or OSX Users/bob Mace Ayres
@ 2017-09-12 0:23 ` Dennis Lee Bieber
2017-09-12 7:02 ` Georg Bauhaus
2017-09-12 7:33 ` Simon Wright
1 sibling, 1 reply; 4+ messages in thread
From: Dennis Lee Bieber @ 2017-09-12 0:23 UTC (permalink / raw)
On Mon, 11 Sep 2017 16:17:51 -0700 (PDT), Mace Ayres <mace.ayres@gmail.com>
declaimed the following:
>Sorry for some beginner's questions, but.
>
>New to Mac OSX. Various software instructions may say home directory; is that OS X ./USERS/Me
>or Unix's /usr/me:
>
>Sometime they refer to the bin directory. Which bin?
>
>Some instructions say $prefix .. what prefix is that?
>
>Is this even an understandable question?
None of these questions are applicable to Ada itself -- they are all
dependent upon the operating system in use, so the answer is really in the
OS documentation or guide books.
However...
Linux (UNIX) home directory is normally
/home/{username}
and often accessible using ~
wulfraed@stretch:~$ cd ~
wulfraed@stretch:~$ pwd
/home/wulfraed
wulfraed@stretch:~$
I do not know how Mac handles paths. In Linux, a leading "./" indicates
current directory (and is often used when one is trying to run a local
executable that is NOT in the search path: ./program or ./scriptfile -- for
safety, Linux will not run programs in the current directory by name only,
to avoid trojans; if someone had stuffed a virus program called, say, gcc
in your home directory, and you try to compile something by typing "gcc -o
myprog myprog.c" it will ignore the virus file and use the system gcc --
but "./gcc -o myprog myprog.c" would run the virus file )
/usr is NOT a home directory! It is a location where non-OS applications
tend to be installed...
Normally, "bin" is likely the one at the root level of the file system
(root is a simple /):
wulfraed@stretch:~$ ls /
bin home lib32 media root sys vmlinuz
boot initrd.img lib64 mnt run tmp vmlinuz.old
dev initrd.img.old libx32 opt sbin usr
etc lib lost+found proc srv var
wulfraed@stretch:~$
... however, you will also find a bin under /usr
wulfraed@stretch:~$ ls /usr
bin games include lib lib32 libx32 local sbin share src
wulfraed@stretch:~$
(sbin tends to be for privileged applications -- stuff that affects how the
system itself operates and may need root privileges to execute)
"$prefix" means the value of the environment variable "prefix"
wulfraed@stretch:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
wulfraed@stretch:~$
(I don't have a "prefix" variable defined, so I used the command search
path)
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Beginner in Mac OS X, and ADA and gtkAda: $prefix, and what bin, and home is usr/bob or OSX Users/bob
2017-09-11 23:17 Beginner in Mac OS X, and ADA and gtkAda: $prefix, and what bin, and home is usr/bob or OSX Users/bob Mace Ayres
2017-09-12 0:23 ` Dennis Lee Bieber
@ 2017-09-12 7:33 ` Simon Wright
1 sibling, 0 replies; 4+ messages in thread
From: Simon Wright @ 2017-09-12 7:33 UTC (permalink / raw)
Mace Ayres <mace.ayres@gmail.com> writes:
> New to Mac OSX. Various software instructions may say home directory;
> is that OS X ./USERS/Me
> or Unix's /usr/me:
It's wherever you get to when you log in! (also, the value of the HOME
environment variable). Mine, on macOS, is /Users/simon
> Sometime they refer to the bin directory. Which bin?
>
> Some instructions say $prefix .. what prefix is that?
When a Unix-style application is installed, all its components will be
under some directory.
System utilities will be under /usr normally, and the layout is fairly
standard: /usr/bin, /usr/include, /usr/lib etc.
Non-system utilities should be somewhere else, not least so that the
base system is still usable and can still be upgraded.
A typical place would be under /usr/local. But if you use just this, you
can end up with different utilities clashing; and you can't easily
remove a utility that you no longer need (I realise that package
managers such as RPM, aptitude, macports & homebrew achieve this too).
As far as I can remember, GNAT GPL wants to install under
/usr/local/gnat; I don't like this, because I want to keep different
versions on my machine. On Windows, GNAT caters to this by installing
under C:\GNAT\2017 for example.
So, I install GNAT GPL under /opt/gnat-gpl-2017 etc and FSF GCC under
/opt/gcc-7.1.0 etc. (the /opt comes from, I think, Solaris).
The layout of the compiler under that directory is the same, so it's
handy to have a way of referring to that directory. $prefix is that way!
That name is used because most Unix build tools (I mean, the tools for
building the application) use an environment variable $prefix for this
purpose.
But, it's only a handy name for "wherever you installed the application"
- there's no actual variable involved.
^ permalink raw reply [flat|nested] 4+ messages in thread