public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* help with installing gcc in os x please.
@ 2002-12-22 19:27 Ben Dougall
  2002-12-23 12:10 ` Andrea 'fwyzard' Bocci
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Dougall @ 2002-12-22 19:27 UTC (permalink / raw)
  To: gcc-help

hiyer

could someone give me a hand as to how you go about installing gcc 
please? i've started to follow the installing documents but i'm not 
understanding them.

so far i've downloaded gcc 3.1

i've got two folders in an otherwise empty folder. one is the 
uncompressed/unpacked gcc 3.1 and the other is an empty folder called 
'objdir'

i'm on a mac with os x 10.2 which has apple's gcc, that comes with the 
developer tools, installed. i understand all this needs to be done 
through the terminal and i have navigated in the terminal to the 
previously mentioned 'objdir' folder.

i've typed 'limit stack 800' as instructed by the host/target specific 
installation notes - no error, so i assume that was successful.

also in the host/target specific notes is says:
"It's also convenient to use the GNU preprocessor instead of Apple's 
during the first stage of bootstrapping; this is automatic when doing 
make bootstrap, but to do it from the toplevel objdir you will need to 
say make CC='cc -no-cpp-precomp' bootstrap."
i didn't understand that bit at all. hopefully it's not important.

then near the top of the general configuration page it says to 
configure:

srcdir/configure [options] [target]

not sure what to do there. didn't get any further :/ if anyone could 
help me make sense of the instructions it'd be very much appreciated.

i think part of the problem is because i don't really have any previous 
experience of the command line/console thing. all i've done with it is 
compile c using the already installed gcc, so don't hold back with any 
'simple' information for fear of patronising. - any info is going to be 
appreciated.

thanks, ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-22 19:27 help with installing gcc in os x please Ben Dougall
@ 2002-12-23 12:10 ` Andrea 'fwyzard' Bocci
  2002-12-23 14:47   ` Ben Dougall
  0 siblings, 1 reply; 14+ messages in thread
From: Andrea 'fwyzard' Bocci @ 2002-12-23 12:10 UTC (permalink / raw)
  To: Ben Dougall; +Cc: gcc-help

At 21.58 22/12/2002 +0000, Ben Dougall wrote:
>hiyer

Hi Ben,
I'll try to help, but I've never uses MacOS, only Dos/Win/Linux, so I don't 
know if what I'm saying is meaningfull for you :-)

>could someone give me a hand as to how you go about installing gcc please? 
>i've started to follow the installing documents but i'm not understanding them.
>
>so far i've downloaded gcc 3.1

If you don't have a particular reason, I'd suggest you to download GCC 
3.2.1, which is the latest released version.

>i've got two folders in an otherwise empty folder. one is the 
>uncompressed/unpacked gcc 3.1 and the other is an empty folder called 'objdir'

Good. So "srcdir" would be the one where you unpacked gcc.

>i'm on a mac with os x 10.2 which has apple's gcc, that comes with the 
>developer tools, installed. i understand all this needs to be done through 
>the terminal and i have navigated in the terminal to the previously 
>mentioned 'objdir' folder.

Just curious. What version of GCC comes with apple dev tools ?
gcc -v should tell you.

>i've typed 'limit stack 800' as instructed by the host/target specific 
>installation notes - no error, so i assume that was successful.

Good.

>also in the host/target specific notes is says:
>"It's also convenient to use the GNU preprocessor instead of Apple's 
>during the first stage of bootstrapping; this is automatic when doing make 
>bootstrap, but to do it from the toplevel objdir you will need to say make 
>CC='cc -no-cpp-precomp' bootstrap."
>i didn't understand that bit at all. hopefully it's not important.

Not sure, but you'll be "bootstrapping" anyway, so you're in the "this is 
automatic when doing make bootstrap" case.

>then near the top of the general configuration page it says to configure:
>
>srcdir/configure [options] [target]
>
>not sure what to do there. didn't get any further :/ if anyone could help 
>me make sense of the instructions it'd be very much appreciated.

I think a brief summary of how gcc is built could help :-)
Read it all before trying to build your GCC, I'm not too good at writing 
things in the right order :-)

Step 1: Configure

The first step is the configuration: this stage sets things up to build GCC 
for your particular machine and usage, eg.: if you want to use it to 
compile for that same machine [native compiler] or to build binaries that 
will run on a different kind of machine (the target) [cross compiler]. You 
could alse make on a machine A a compiler that will run on machine B 
building binaries for machine C. :-)

I assume you want to make a native Darwin compiler.
 From the GCC Intructions:
"GCC has code to correctly determine the correct value for target for 
nearly all native systems. Therefore, we highly recommend you not provide a 
configure target when configuring a native compiler."
So we can skip the thing about the target. You'll probably get 
powerpc-apple-darwin*, anyway.

While configuring, you can specify quite a lot of options to fine tune the 
behaviour of the compiler you'll get.
As I don't know much about MacOS X, I just tried tu figure out things from 
other (successful) buiold reports.
So I'd try to configure gcc with

cd objdir
../[dir where you unpacked gcc]/configure --enable-threads=posix 
--enable-shared

If you feel lucky, you can try adding "--disable-multilib" to the configure 
options, maybe it will make the bootstrap go faster.

After running this command, you should see a good length of messages like 
"checking for blah blah blah: yes" or "no"... let it go on until it finishes.
Hopefully you'l get no errors :-).

Step 2: Bootstrap.

Building the compielr from the sources is a bit more complicated than 
building other SW from sources. This is mainly because 1.) GCC requires a 
very minimal, untrusted C compiler to build, and 2.) it (obviously) has the 
ability to build itself, so let's damn use it !
Bootstrapping comes in 3 stages:
1st, the C compiler is built using the system C compiler
2nd, various front-ends (ObjC, C++, Java) are build with this minimal C 
compiler, along with the necessary libraries.
3rd, everything is rebuilt with the full-fledged 2nd stage compiler.
Why this ? Because at this point, if all went smoothly, the 2nd and 3rd 
level compilers should be identical.
This is checked for automatically at the end of bootstrapping. If you see 
no error, it all went good, leaving you with a working compiler.

Now, to actually (try to) bootstrap GCC, you go to the objdir directory 
(the same as where you run ../[...]/configure etc..),  and run
make bootstrap

Cross you're finger, wait from half an hour to half a day (depending on how 
fast is your machine), and beg for a working compiler...
If you get no errors, wow, you only need to intall it, now !

Looking around I found that, in order to actually build GCC, you MIGHT need 
o apply a ptch to a system header.
I'm saying MIGHT because maybe this has been fixed in the latet GCC or 
MacOS X release.
If while bootstrapping you get errors about some undefined types, you can 
try to fix it applying this patch (stolen from other mail in this list):

--- gcc-04072002/gcc/ginclude/stddef.h  Wed Jan  9 13:28:06 2002
+++ gccsrc/gcc/gcc/ginclude/stddef.h    Thu Jul  4 18:37:27 2002
@@ -242,6 +242,7 @@
  #ifndef _WCHAR_T_
  #ifndef _BSD_WCHAR_T_
  #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_     /* Darwin */
  #ifndef _WCHAR_T_DEFINED_
  #ifndef _WCHAR_T_DEFINED
  #ifndef _WCHAR_T_H
@@ -278,6 +279,7 @@
  #ifdef _BSD_RUNE_T_
  #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
  typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_RUNE_T_DEFINED_
  #define _BSD_WCHAR_T_DEFINED_
  #if defined (__FreeBSD__)
  /* Why is this file so hard to maintain properly?  In constrast to
@@ -295,6 +297,7 @@
  #endif
  #ifndef __cplusplus
  typedef __WCHAR_TYPE__ wchar_t;
+#endif
  #endif
  #endif
  #endif

You just copy the text, save it in a simple text file in the [dir where you 
unpacked gcc] directory, and run from the terminal (in that directory)
patch -p1 < [filename of the patch]

Now go back to the objdir directory, and issue
make clean
make bootstrap

The same thing as above about begging apply...

OK, lets assume you eventually got a working compiler. You need to install it.
This is easily done, with

make install

In this way you'll get gcc & co. in /usr/local/bin.
Depeneding on how the search path for executables is setup on you machine 
(remember I know about nothing about MaxOS...), you'll automatically get 
this new version of GCC. Or not. Read on...

And - hey - what if you wanted to keep BOTH GCCs, the apple one, and the 
FSF one ?
Here the configure step helps us again.
In fact, it allows you to specify a different name for your brand new 
compiler & tools.
I usually chose something like "gcc32", naming it along the version.

To do this , you have to run the configure stage (the first one) with the 
additional flag "--program-suffix=suffix". Ie.,
adding "--program-suffix=32" will get you gcc32, g++32, etc...
adding "--program-suffix=-3.2.1" will get you gcc-3.2.1, g++-3.2.1, etc...

The choice is yours :-)
Remember, you need to do this at configure stage, before the make bootstrap 
thing.

>i think part of the problem is because i don't really have any previous 
>experience of the command line/console thing. all i've done with it is 
>compile c using the already installed gcc, so don't hold back with any 
>'simple' information for fear of patronising. - any info is going to be 
>appreciated.
>
>thanks, ben.

Well, I hope I haved said enough to help you.
If I didn't, happily mail back to me or the list the errors or problem you 
get :-)

Good luck,
fwyzard


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-23 12:10 ` Andrea 'fwyzard' Bocci
@ 2002-12-23 14:47   ` Ben Dougall
  2002-12-27  5:54     ` Andrea 'fwyzard' Bocci
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Dougall @ 2002-12-23 14:47 UTC (permalink / raw)
  To: Andrea 'fwyzard' Bocci; +Cc: gcc-help

fwyzard: thanks very much for such a thorough response :)

> If you don't have a particular reason, I'd suggest you to download GCC 
> 3.2.1, which is the latest released version.

i've downloaded and used gcc-core-3.2.1

i went for the core version as i only want c compilation capabilities 
from the gcc that i'm trying to install. not all the other capabilities 
like c++ and the others. and i think you only need the gcc-core file 
for that.

> Just curious. What version of GCC comes with apple dev tools ?
> gcc -v should tell you.

Thread model: posix
Apple Computer, Inc. GCC version 1161, based on gcc version 3.1 
20020420 (prerelease)

i'm using os x 10.2
10.3 has been released, and there's a new developer tools, i noticed 
(which as you know contains apple's gcc), so there may now be a newer 
version of apple's gcc. not sure.


> Step 1: Configure
>
> The first step is the configuration: this stage sets things up to 
> build GCC for your particular machine and usage, eg.: if you want to 
> use it to compile for that same machine [native compiler] or to build 
> binaries that will run on a different kind of machine (the target) 
> [cross compiler]. You could alse make on a machine A a compiler that 
> will run on machine B building binaries for machine C. :-)

slightly separate question - this isn't what i'm trying to achieve at 
the moment, but i'd really like to know for future:
if the target machine and your machine are both macs and both running 
os x (but maybe not the same version of os x, but say at least both 
10.2 or higher) is it ok to copy the compiled gcc from your machine to 
another machine? copy gcc after it's been compiled on one machine, over 
to a similar but different machine?

> Hopefully you'l get no errors :-).

step 1 - no errors :)


> Step 2: Bootstrap.

> If you get no errors, wow, you only need to intall it, now !

.....
......
.....
In file included from ../../../gccfolder/gcc/intl/dcigettext.c:58:
../include/stdlib.h:84: syntax error before "rune_t"
make[3]: *** [dcigettext.o] Error 1
make[2]: *** [intl.all] Error 1
make[1]: *** [stage2_build] Error 2
make: *** [bootstrap] Error 2

> Looking around I found that, in order to actually build GCC, you MIGHT 
> need o apply a ptch to a system header.
> I'm saying MIGHT because maybe this has been fixed in the latet GCC or 
> MacOS X release.
> If while bootstrapping you get errors about some undefined types, you 
> can try to fix it applying this patch

yup, did the patch part which resulted in this response:

patching file gcc/ginclude/stddef.h
Hunk #1 succeeded at 239 (offset -3 lines).
Hunk #3 succeeded at 294 (offset -3 lines).

so that looks good.


> OK, lets assume you eventually got a working compiler....

i *think* i did. this was the last few lines of the output from 'make 
bootstrap':

   CONFIG_H="config.h auto-host.h 
../../gccfolder/gcc/../include/ansidecl.h 
../../gccfolder/gcc/config/rs6000/rs6000.h 
../../gccfolder/gcc/config/darwin.h 
../../gccfolder/gcc/config/rs6000/darwin.h defaults.h insn-constants.h 
insn-flags.h" MACHMODE_H="machmode.h machmode.def" \
   LIB1ASMSRC='' \
   MAKEOVERRIDES= \
   -f libgcc.mk all
for d in libgcc soft-float libgcc/soft-float; do \
   if [ -d $d ]; then true; else /bin/sh 
../../gccfolder/gcc/mkinstalldirs $d; fi; \
done
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
echo timestamp > stmp-multilib

so it doesn't look like it went wrong there. there were a *massive* 
amount of various warnings within all the output while it was working 
away though. not sure if that's ok or not. but no apparent outright 
errors.


>  You need to install it.
> This is easily done, with
>
> make install

got a bit stuck here.

[Ben-Ds-Computer:~/gcc/objdir] bend% make install
/bin/sh ../gccfolder/mkinstalldirs /usr/local /usr/local
(cd intl && make all)
make[2]: Nothing to be done for `all'.
for file in cc1 ; do \
   if [ -f $file ] ; then \
     rm -f /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
     /bin/sh /Users/bend/gcc/gccfolder/install-sh -c  $file 
/usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
   else true; \
   fi; \
done
mkdir: /usr/local/lib: Permission denied
mkdir: /usr/local/lib/gcc-lib: No such file or directory
mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2: No such file or 
directory
mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1: No such 
file or directory
cp: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/_inst.13869_: 
No such file or directory
make[1]: *** [install-common] Error 1
make: *** [install-gcc] Error 2
[Ben-Ds-Computer:~/gcc/objdir] bend%

because of the 'mkdir: /usr/local/lib: Permission denied' and the fact 
that os x requires a password whenever you install software in os x, i 
tried this:

make install -pword=mypassword

which, much to my surprise, seemed to work. here are the final lines of 
output from that install command:

....
....
         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
         MD5PROG="$(MD5PROG)" \
         SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"


# 610 files in 1007 hash buckets.
# average 0.606 files per bucket, max 4 files in one bucket.

# VPATH Search Paths

# No `vpath' search paths.

# General (`VPATH' variable) search path:
# ../gccfolder

# Finished Make data base on Mon Dec 23 17:06:14 2002

# make: Leaving directory `/Users/bend/gcc2/objdir'




i've done the process twice now, the first time without the 
--program-suffix=suffix modification and the second with. i just used c 
for the modification.

i've typed gcc -v after the first time and gccc -v after the second go 
- neither attempts appearing to have succeeded

gcc -v gave the same response as before the installation attempts - 
apple's gcc version info

and gccc -v after the second go gave 'command not found'

so i'm not sure if it's worked, and i'm not accessing it correctly, or 
if i'm accessing it correctly but the installation hasn't worked.




> In this way you'll get gcc & co. in /usr/local/bin.

i've never quite understand that - i've seen /usr/local/bin mentioned a 
lot but where/what is it? i don't seem to have a folder called bin in a 
folder called local... anywhere. is it a kind of virtual path?! i'm 
guessing. what i mean is, is it something that isn't going to be 
represented by folders/directories that i can see like normal folders 
represented as icons in the finder? i guess usr may be my user name 
rather than 'usr', but i still can't see what that means.

so i'm not sure if it's succeeded or not. it may easily have worked and 
i'm just not sure how to access the new gcc rather than the apple gcc.


> Depeneding on how the search path for executables is setup on you 
> machine (remember I know about nothing about MaxOS...), you'll 
> automatically get this new version of GCC. Or not. Read on...
>
> And - hey - what if you wanted to keep BOTH GCCs, the apple one, and 
> the FSF one ?

yes, i do want to be able to access both, definitely


2 more questions!:  :)

how should i go about doing all this, once i've got it working, but the 
resulting gcc compiler only having c compiling compatibilities? - i 
want the final thing to be as small/compact as possible, and i'm only 
going to be using it for compiling c. at the moment the final objdir 
folder is 154mb! which seems surprisingly large to me, but if that's 
the size it is, then there's nothing that can be done about that. (the 
size of it is important to me as i'm hoping to distribute this in/with 
another piece of software.)

does the installation process put files outside of the objdir folder, 
or is the final executable gcc all contained in that objdir folder?



so i've definitely got further than before, without doubt, but still 
not quite there. the main question is - has it worked and i'm just not 
accessing it correctly? or has it not installed correctly?

thanks again for a very helpful set of instructions,

ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-23 14:47   ` Ben Dougall
@ 2002-12-27  5:54     ` Andrea 'fwyzard' Bocci
  2002-12-28  3:39       ` Ben Dougall
  0 siblings, 1 reply; 14+ messages in thread
From: Andrea 'fwyzard' Bocci @ 2002-12-27  5:54 UTC (permalink / raw)
  To: Ben Dougall; +Cc: gcc-help


>At 20.09 23/12/2002 +0000, Ben Dougall wrote:
>fwyzard: thanks very much for such a thorough response :)

Hi Ben,
I'm happy I could help you somehow. Let's try to get it worked to the happy 
ending :-)

This time, I'll start answering from your last questions. Let's begin with 
some general infos, then.

>>In this way you'll get gcc & co. in /usr/local/bin.
>
>i've never quite understand that - i've seen /usr/local/bin mentioned a 
>lot but where/what is it? i don't seem to have a folder called bin in a 
>folder called local... anywhere. is it a kind of virtual path?! i'm 
>guessing. what i mean is, is it something that isn't going to be 
>represented by folders/directories that i can see like normal folders 
>represented as icons in the finder? i guess usr may be my user name rather 
>than 'usr', but i still can't see what that means.
>
>so i'm not sure if it's succeeded or not. it may easily have worked and 
>i'm just not sure how to access the new gcc rather than the apple gcc.

/usr/local/bin is a folder. There's nohing "special" about it, it's just a 
conventional folder to store "non-standard" binaries.
OK, maybe that was not too clear. From the beginnin', then.

Under Unix (and DOS, and Windows if you look around a bit), and MacOS, I 
guess, everyting is organized in folders.
The "position" where an executable, or any other file, is, is called "path".
   Under Unix, paths are of the form "/usr/bin", or 
"/home/fwyzard/Desktop", or "../../src/include".
The first two are "absolute" paths, meaning that thay start from the "root" 
("/") of the filesystem, and dig onward.
The last one is a "relative" path (it does not start with a "/"),. meaning 
that it starts from the current directory, and move backwards and onwards. 
Two special paths are defined for every folder: ".", meaning the current 
folder, and ".." meaning the current folder's parent.
   Under DOS/Windos, thigs are almost the same, with 2 differences: the 
"path separator" is backslash ("\") instead of a forward slash ("/"), and 
there is not just a single root (like / under Unix) for the filesystem, but 
one for each drive, identified by the drive letter followed by a colon 
(":") and a backslash ("\")  ("A:\" is usually the floppy disc, "C:\" 
usually the system HD, "D:\", "E:\" tend to be the CDs, etc...).
   Under MacOS I don't know haw it actually works, as of it I've seen only 
the surface (the GUI). As MacOS X is derived from a Unix kernel (the OS 
core), I guess it follows the Unix convention, using the POSIX style "/" as 
a path separator and starting from a single root. (This is confirmed by the 
chunks from your configure and make output).
   Note: POSIX stands for a kind of standard among different Unices, 
specifyng common formats and commands, like the pah separator, etc.
   History: I read that until MacOS 9, things were diferent, using a colon 
":" for the folder separator/current folder.

   When you run a program, the system needs a way to find it, and looking 
trough ALL of your HDs would take too long.
Under a Graphical Interface you usually run the program by clicking on an 
icon or menu item.
Under MacOS, if I remember correcly, the icon represent the "actual" 
program, and you usually have to navigate to it folder to run it. I guess 
you can also create "links" from the program to other locations, so that 
you can have many "links" to the programs you use most in a single, easy to 
access, location.
This is the way used under Windows, anyway, and in a way under Unix. The 
"link" points to the location where the program is, so that the system can 
find it and run it.
The first solution, then, is to (manually or via a link) explicitly tell 
the system where the program is.
   When you have lots of programs (eg., especially under a command line OS 
or when running from the "terminal", all the system commands to manipulate 
files and configure the system), this becomes increasingly cumbersome. The 
solution is to create a list of places where the executables are kept, and 
tell the system to search there when it needs to find a program. Such a 
list is usually an evironment variable (*) called PATH.
An example PATH under Unix might be 
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/fwyzard/bin...
   Sidenote: as a security measure, under most Unices if you want to run a 
program from the current location, ie. where you "are" in the terminal 
window, you need to explicitly say so, running the program as 
"./myprogram". The leading "." indicates the currend directory, the "/" is 
the folder separator, followed by the program you want to run.

Back to our problem.
/usr indicates the fodler under which most "user level" programs go.
When you install programs from an "official" distribution, it is usually 
installed under /usr/bin (/bin for the most important system utilities); on 
the othe hand, programs manually installed, ie. "local" to your system, 
like GCC compiled from the sources, usually go into /usr/local/bin.

Assuming that compiling went along alright (after patching), and 
installation, too (with your -pword thing), the only problem that remains 
is hat he sysytem cannot find your newly made GCC.
To test that everything alse is OK, and that the only problem is the PATH, 
you can try this:
1.) go to /usr/local/bin (from the 2nd make install output, I assume that 
creating the dir worked) with
cd /usr/local/bin
2.) try to run gcc from there, with
./gcc -v
and
./gccc -v
(to test both your installations).

If this works, then the only problem is the missing PATH variable setting. 
To solve this you need to ask a MacOS user, as I don't know how to set it 
up on your system (maybe somewhere in a kind of Control Panel, maybe :-).

If this fail, try to send to the list the erros that you got, I (and 
hopefully somone with more experience with MaxOS X) will try to figure out 
what is wrong.
If this actually works, I think we're almost done.

>>The first step is the configuration: this stage sets things up to build 
>>GCC for your particular machine and usage, eg.: if you want to use it to 
>>compile for that same machine [native compiler] or to build binaries that 
>>will run on a different kind of machine (the target) [cross compiler]. 
>>You could alse make on a machine A a compiler that will run on machine B 
>>building binaries for machine C. :-)
>
>slightly separate question - this isn't what i'm trying to achieve at the 
>moment, but i'd really like to know for future:
>if the target machine and your machine are both macs and both running os x 
>(but maybe not the same version of os x, but say at least both 10.2 or 
>higher) is it ok to copy the compiled gcc from your machine to another 
>machine? copy gcc after it's been compiled on one machine, over to a 
>similar but different machine?

I think that it is quite possible yes, and that it will probably work.
The best way to do it I can figure out is to install your newly made GCC in 
an empty, all for itself, folder, then copy it with all its subfolders IN 
THE VERY SAME PLACE on the 2nd machine.
To specify the install directory, you need to add another option to 
configure, namely "--prefix=installdir". A good place could be 
/usr/opt/gcc, for example, or whatever you like:

../[folder where you unpacked gcc]/configure --enable-threads=posix 
--enable-shared --prefix=/usr/opt/gcc --program-prefix=fsf- 
[--disable-multilib if you want]

The --program-prefix is just like the --program-suffix command, but it 
adds, strangely enough, a prefix instead of a suffix. Use whichever you 
prefere :-) .

Then you must add /usr/opt/gcc/bin to your PATH (or run gcc as 
/usr/opt/gcc/bin/gcc, but that's a bit awkward, I admit).
If it works, it'll probably work on any other similar enough machine, 
provided you unpack it exactly in the same plae and configure PATH on that 
machine, too.

>does the installation process put files outside of the objdir folder, or 
>is the final executable gcc all contained in that objdir folder?

The final GCC is contained in the objdir folder, along with all the 
temporary thiongs it used to boostrap (all in almost 3 copies, remember). 
After installing (make install) you can safely delete the objdir folder 
(and the srcdir one, or course, when you're done building all the things 
you need); the installed GCC should be way smaller. For example, the latest 
RedHat Linux package for the core (C only) GCC 3.2.1 is slighlty more than 
11 MB.

>thanks again for a very helpful set of instructions,
>
>ben.

I hope this time we can make it to the end !
Good luck,
fwyzard

PS.
If in the end you get it working, would you mind writing a small summary of 
the instrctions and posting it to gcc@gcc.gnu.org, so that it can be linked 
from GCC 3.2 results page ?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-27  5:54     ` Andrea 'fwyzard' Bocci
@ 2002-12-28  3:39       ` Ben Dougall
  2002-12-28  6:41         ` LLeweLLyn Reese
  2002-12-29  8:48         ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 2 replies; 14+ messages in thread
From: Ben Dougall @ 2002-12-28  3:39 UTC (permalink / raw)
  To: Andrea 'fwyzard' Bocci; +Cc: gcc-help

hiyer fwyzard,

well, i'm not sure. i think i'm just having trouble accessing it, but 
i'm not sure.

putting 'bin' and the linking issue aside, trying to access it directly 
from the objdir folder -

in the objdir are these files & folders:

config.cache		(a 16k document)
config.status		(a 4k document)
gcc				(folder 289 items inside totaling 153mb)
libiberty			(folder 49 items inside totaling 1mb)
Makefile			(a 64k document)
powerpc-apple-darwin6.2		(an empty folder)

while in (in meaning located in, while i'm using the terminal) these 
locations:
the 'objdir' folder, the 'gcc' folder mentioned in the above list, the 
'libiberty' folder and the folder that contains 'objdir',
i've tried both './gcc -v' and './gccc -v'
i tried in the gccfolder as well although that was silly - i knew that 
wasn't going to work but still worth a go.

i've deleted the first install that was without the prefix c option, so 
i guess trying ./gcc was not going to work anyway, but still worth a go.

so the responses to typing those in were:
./gcc: Permission denied.
and
./gccc: Command not found.

but it only says 'permission denied' in response to './gcc -v' when 
there happens to be a folder in the directory that i'm  in, called 
'gcc', otherwise it says 'command not found'.

to me, it appears as if the whole thing has installed successfully and 
it's all there but i'm just not accessing it correctly. that's what it 
looks like to me but i'm not completely sure on that.

> The final GCC is contained in the objdir folder, along with all the 
> temporary thiongs it used to boostrap (all in almost 3 copies, 
> remember). After installing (make install) you can safely delete the 
> objdir folder (and the srcdir one, or course, when you're done 
> building all the things you need)

:/ if the final gcc is contained in the objdir, deleting objdir would 
delete the final installed gcc wouldn't it?! :)

> If in the end you get it working, would you mind writing a small 
> summary of the instrctions and posting it to gcc@gcc.gnu.org, so that 
> it can be linked from GCC 3.2 results page ?

ok, no problem. will do. is gcc@gcc.gnu.org another list like this one?


aha! look what i've found:
[Ben-Ds-Computer:~/cprac] bend% cd ../gcc/objdir/gcc
[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% ./xgcc
xgcc: no input files
[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% ./xgcc -v
Using built-in specs.
Configured with: ../gccfolder/configure --enable-threads=posix 
--enable-shared--program-suffix=c
Thread model: posix
gcc version 3.2.1
[Ben-Ds-Computer:~/gcc/objdir/gcc] bend%

:) so it is there and it's called xgcc ! (for some reason). i thought 
it would be there somewhere. and it's in the gcc folder that's in the 
objdir folder. so surely, deleting the objdir folder is not a good 
thing to do?! but some of it must be redundant. i'm sure the folder 
that's got all the original installation stuff can go. but the objdir 
folder is 150mb so some of it must be erasable too.

> If this works, then the only problem is the missing PATH variable 
> setting. To solve this you need to ask a MacOS user, as I don't know 
> how to set it up on your system (maybe somewhere in a kind of Control 
> Panel, maybe :-)

ok i'll look into that.

thanks a-lot for all the info fwyzard. much appreciated.

ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-28  3:39       ` Ben Dougall
@ 2002-12-28  6:41         ` LLeweLLyn Reese
  2002-12-28  7:56           ` Ben Dougall
  2002-12-29  8:48         ` Andrea 'Fyre Wyzard' Bocci
  1 sibling, 1 reply; 14+ messages in thread
From: LLeweLLyn Reese @ 2002-12-28  6:41 UTC (permalink / raw)
  To: Ben Dougall; +Cc: Andrea 'fwyzard' Bocci, gcc-help

Ben Dougall <bend@freenet.co.uk> writes:

> hiyer fwyzard,
> 
> well, i'm not sure. i think i'm just having trouble accessing it, but
> i'm not sure.
> 
> putting 'bin' and the linking issue aside, trying to access it
> directly from the objdir folder -
> 
> in the objdir are these files & folders:
> 
> config.cache		(a 16k document)
> config.status		(a 4k document)
> gcc				(folder 289 items inside totaling 153mb)
> libiberty			(folder 49 items inside totaling 1mb)
> Makefile			(a 64k document)
> powerpc-apple-darwin6.2		(an empty folder)

Empty? Are you sure your build succeeded? AFAIK, powerpc-apple-darwin6
    should contain at least a config.cache and another libiberty folder (as
    well as libstdc++-v3 folder, if one builds the c++ front end.)
[snip]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-28  6:41         ` LLeweLLyn Reese
@ 2002-12-28  7:56           ` Ben Dougall
  0 siblings, 0 replies; 14+ messages in thread
From: Ben Dougall @ 2002-12-28  7:56 UTC (permalink / raw)
  To: LLeweLLyn Reese; +Cc: gcc-help

>> powerpc-apple-darwin6.2		(an empty folder)
>
> Empty? Are you sure your build succeeded? AFAIK, powerpc-apple-darwin6
>     should contain at least a config.cache and another libiberty 
> folder (as
>     well as libstdc++-v3 folder, if one builds the c++ front end.)
> [snip]

you're right - there is a problem. i thought this:

[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% ./xgcc -v
Using built-in specs.
Configured with: ../gccfolder/configure --enable-threads=posix 
--enable-shared--program-suffix=c
Thread model: posix
gcc version 3.2.1

...was enough to indicate that it had worked but i've just tried 
compiling something with it and got this:
xgcc: installation problem, cannot exec `cc1': No such file or directory

so yes, there is something very wrong with it. oh dear. :/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-28  3:39       ` Ben Dougall
  2002-12-28  6:41         ` LLeweLLyn Reese
@ 2002-12-29  8:48         ` Andrea 'Fyre Wyzard' Bocci
  1 sibling, 0 replies; 14+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2002-12-29  8:48 UTC (permalink / raw)
  To: Ben Dougall; +Cc: gcc-help

At 04:55 28/12/2002 (GMT +0000), Ben Dougall wrote:
>hiyer fwyzard,
>
>well, i'm not sure. i think i'm just having trouble accessing it, but i'm 
>not sure.
>
>putting 'bin' and the linking issue aside, trying to access it directly 
>from the objdir folder -
>
>in the objdir are these files & folders:
>
>config.cache            (a 16k document)
>config.status           (a 4k document)
>gcc                             (folder 289 items inside totaling 153mb)
>libiberty                       (folder 49 items inside totaling 1mb)
>Makefile                        (a 64k document)
>powerpc-apple-darwin6.2         (an empty folder)

Sorry, you're right.
You should be able to access it like
gcc/xgcc -v

It's called xgcc to not confuse it with an installed one during bootstrap, 
I guess.

It's rather strange that the "powerpc-apple-darwin6.2" folder is empty. It 
should contain one or more support libraries.

>while in (in meaning located in, while i'm using the terminal) these 
>locations:
>the 'objdir' folder, the 'gcc' folder mentioned in the above list, the 
>'libiberty' folder and the folder that contains 'objdir',
>i've tried both './gcc -v' and './gccc -v'
>i tried in the gccfolder as well although that was silly - i knew that 
>wasn't going to work but still worth a go.
>
>i've deleted the first install that was without the prefix c option, so i 
>guess trying ./gcc was not going to work anyway, but still worth a go.
>
>so the responses to typing those in were:
>./gcc: Permission denied.
>and
>./gccc: Command not found.
>
>but it only says 'permission denied' in response to './gcc -v' when there 
>happens to be a folder in the directory that i'm  in, called 'gcc', 
>otherwise it says 'command not found'.

It says "permission denied" because you are trying to execute the gcc 
folder itself, not a file.

>to me, it appears as if the whole thing has installed successfully and 
>it's all there but i'm just not accessing it correctly. that's what it 
>looks like to me but i'm not completely sure on that.
>
>>The final GCC is contained in the objdir folder, along with all the 
>>temporary thiongs it used to boostrap (all in almost 3 copies, remember). 
>>After installing (make install) you can safely delete the objdir folder 
>>(and the srcdir one, or course, when you're done building all the things 
>>you need)
>
>:/ if the final gcc is contained in the objdir, deleting objdir would 
>delete the final installed gcc wouldn't it?! :)

No.
After "make install" everthing will be in the directory specified by 
--prefix during configure.
But, if you cannot install, in the gcc subfolder of the objdir folder there 
should be a (working ?) GCC called xgcc.
If not, bootstrap was not succesfull.
So, after installation, you can safely delete the objdir folder.

>>If in the end you get it working, would you mind writing a small summary 
>>of the instrctions and posting it to gcc@gcc.gnu.org, so that it can be 
>>linked from GCC 3.2 results page ?
>
>ok, no problem. will do. is gcc@gcc.gnu.org another list like this one?

Similar.
gcc@gcc.gnu.org is used for the *development* of GCC itself, and feedback 
from succesfull bootstrp and installation is sent thre to be added to the 
"succesfull build" page.
gcc-help@gcc.gnu.org is used to ask help on *using* (and installing, of 
course) GCC.

>aha! look what i've found:
>[Ben-Ds-Computer:~/cprac] bend% cd ../gcc/objdir/gcc
>[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% ./xgcc
>xgcc: no input files
>[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% ./xgcc -v
>Using built-in specs.
>Configured with: ../gccfolder/configure --enable-threads=posix 
>--enable-shared--program-suffix=c
>Thread model: posix
>gcc version 3.2.1
>[Ben-Ds-Computer:~/gcc/objdir/gcc] bend%
>
>:) so it is there and it's called xgcc ! (for some reason). i thought it 
>would be there somewhere. and it's in the gcc folder that's in the objdir 
>folder. so surely, deleting the objdir folder is not a good thing to do?! 
>but some of it must be redundant. i'm sure the folder that's got all the 
>original installation stuff can go. but the objdir folder is 150mb so some 
>of it must be erasable too.

See above.
However, I've just done a clean boostrap under Linux (w/ C, C++, Fortran 
and Ada), and the *installation* folder is slightly bigger than 200 MB...

>>If this works, then the only problem is the missing PATH variable 
>>setting. To solve this you need to ask a MacOS user, as I don't know how 
>>to set it up on your system (maybe somewhere in a kind of Control Panel, 
>>maybe :-)

At this point, I'd try somthing along these lines:
completely erase the objdir folder
make a new one
configure with the same options as before, plus --prefix=whatever you 
coose, with
   ../[srcdir]/configure > ../"configure output".txt 2> ../"configure 
errors".txt
bootstrap the compiler with
   make bootstrap > ../"GCC output".txt 2> ../"GCC errors".txt
try to install with
   make install > ../"installation output".txt 2> ../"installation errors".txt

If you DON'T get a working compiler in the --prefix= direcotry (under its 
bin subfolder, actually), put those 6 files in an archive (possibly .zip, 
.tgz, anything but a MacOS archive) and mail them to me, so that I can try 
to see wht went wrong.

Good luck,
fwyzard



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-31  6:19   ` Ben Dougall
@ 2002-12-31  7:17     ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 0 replies; 14+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2002-12-31  7:17 UTC (permalink / raw)
  To: Ben Dougall; +Cc: gcc-help

At 22:58 30/12/2002 (GMT +0000), Ben Dougall wrote:
>fwyzard: i've done all that, successfully (apart from the search path), i 
>think!

Glad to hear it !

>about the make install/password issue - the solution is:
>sudo make install
>this makes it ask for a password first. and then goes ahead without the 
>permission denied error.

Good solution. I didn't know MacOS X had that :-)

>[...]
>
>back to my fixation. where/what is this?:
>./../lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/specs

It's in /usr/opt/gcc/libgcc-lib/powerpc-apple-darwin6.2/3.2.1/specs.
OK, I know this is not the answer you wanted :-)

BTW, this is getting off topic for the GCC (help) mailing list, so I'm not 
forwarding it there.

I must say I have exactly the opposite fixation : I don't trust "icons" and 
menus, if I can't find *where* on my disk they are. But I grew up with 
MS-DOS, that had actually no idea of icons. Under Unix, it's the same: 
icons and menus are more an afterouch - graphical file managers are seldom 
used, if at all.
With a Mac, I guess it's the opposite.

The only Macs I used were rather old - still in black and white ! - but I 
remember having on desktop the Hard Disk, and the Floppy when I inserted 
it. The finder was used to give a faster access to the most used things...
That approach (I think this was usued up to MacOS 9) is quite similar to 
what is now used win Windows (guess why...): each "physical" medium (HD, 
floppy, CD, etc...) is represented individually, with folders and files in 
it appearing as browsable icons. This is, in fact, quite "user friendly", 
and creates a strong association between the "virtual" file and its 
physical presence on the medium.

Under Unix, things are a bit different.
Every physical medium corresponds to a "device". These are special files, 
that usually only the administrator and the system have access to, which 
give access to the medium itself in a low level fashion. These files are 
usually "kept" in the /dev folder. I put kept among " because what is there 
is not (obviously) a regular file, but more a pointer, an interface to the 
object that it represents (eg., a hard drive).
For example, under Linux, the file /dev/hda is an interface to the content 
of the 1st EIDE Hard Drive, while /dev/hda1, /dev/hda2, etc. represent the 
partitions 1, 2, etc.. on that hard disk. If you read those files, you are 
actually reading the hard disk byte after byte, with no consideration of 
files, folders, permissions, etc...
At home, I have 2 HDs, so my Linux OS sees them as /dev/hda and /dev/hdb 
(1st and 2nd disk), while my DVD and CR-RW are /dev/hdc and /dev/hdd, and 
the floppy is (usually) accessed via /dev/floppy.

As it would be ather painfull to use these special files directly, they are 
then "mounted" under a directory tree. The File Sytem on the devices is 
read and connected to a "tree" of directories starting from the system 
root: the "/" folder.
The device that corresponds to this starting directory is mapped when first 
loading the OS, while all the other can be, and are, added after.
So, the directory tree starts at "/", and has all the files and folders 
that the system can access mounted under it. For axample, a Linux machine 
here at my University has this structure:
/               is /dev/hda7
/boot           is /dev/hda1
/home           is /dev/hda8
/var            is /dev/hda5

All the other folders are "normal" folders:
/bin, /mnt, /usr, /usr/local, ... are in the "/" partition and thus in the 
/dev/hda7 partition.
/home/fwyzard, /home/ciccio, ... are in the "/home" folder, and thus in the 
/dev/hda8 partition.

When I insert a floppy, it gets (manually or automatically) mounted under 
/mnt/floppy.
/mnt/floppy     is then /dev/floppy
/mnt/cdrom      is then /dev/hdc
and so on...

So, coming back to your "where is /usr/opt/gcc/... ?" question, and why you 
can't find it.
I don't knwow how the disks are usually managed under MacOS, but you can 
give a try at this. From the terminal, run

mount

You should get a list like this:

/dev/hda7 on / type ext2 (rw)
/dev/hda1 on /boot type ext2 (rw)
/dev/hda8 on /home type ext3 (rw)
/dev/hda5 on /var type ext3 (rw)

which tells you the same that I said above:
/dev/hda7 is mounted as "/" (the system root), and all the other folder are 
mounted under it.
ext2 and ext3 are the types or fylsystems used, while (rw) means that the 
partition is readable and writeble.

If you have a kind of graphical file manager, try to point to /usr/opt/gcc, 
there you should *see* all the installed files.
Concerning why you saw no new files in the system library folders, this has 
to do (at least) with the way I made you configure GCC:
if you had used --prefix=/usr, GCC would have been installed under 
/usr/bin, /usr/lib, etc., putting then some of it librais (maybe) in a 
place where you could have *seen* them.
This would have made it more difficult to uninstall or redistribute GCC, 
however, and could have caused some conflicts with the installed GCC.

At this point, I think I've told you all I can think of that could be 
helpfull. The best advices I can give you are:
1.) Try to explore all the depht or your MacOS. Have a look at the Darwin 
web site <http://developer.apple.com/darwin/>, maybe that can help you.
2.) Find someone who unlike myself has used a MacOS X machine for some 
time, and get him/her to teach you :-)
3.) Google around !

Good luck Ben, and Happy New Year !
fwyzard



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-30  7:06 ` Andrea 'fwyzard' Bocci
@ 2002-12-31  6:19   ` Ben Dougall
  2002-12-31  7:17     ` Andrea 'Fyre Wyzard' Bocci
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Dougall @ 2002-12-31  6:19 UTC (permalink / raw)
  To: Andrea 'fwyzard' Bocci; +Cc: gcc-help

fwyzard: i've done all that, successfully (apart from the search path), 
i think!

about the make install/password issue - the solution is:
sudo make install
this makes it ask for a password first. and then goes ahead without the 
permission denied error.

so i've done all the installation. i've even deleted both the objdir 
and srcdir folders as i was so skeptical that it's done anything 
outside of those folders - but my skepticism seems to be wrong, but i 
still don't understand where it has put it. physically i mean. for some 
reason i've got this fixation about being able to view the file(s) in 
the finder - icons in windows and i just can't see where they are. (in 
fact that's something that's always mystified me about apple's gcc - 
i've never found the actual file(s))

but in anycase, putting not being able to see/find the files to one 
side, it does seem to have worked! :) weheee! after deleting the objdir 
and srcdir, i did as you said:
cd /usr/opt/gcc/bin
./fsf-gcc -v
which gave:
Reading specs from ./../lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/specs
Configured with: ../gccfolder/configure --enable-threads=posix 
--enable-shared --prefix=/usr/opt/gcc --program-prefix=fsf- 
--disable-libgcj --enable-version-specific-runtime-libs 
--enable-languages=c
Thread model: posix
gcc version 3.2.1

back to my fixation. where/what is this?:  
./../lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/specs
i've searched in the finder for 'gcc-lib' and 'powerpc-apple-darwin6.2' 
and '3.2.1' and 'specs'. none of those folders exist. i've probably got 
the wrong end of the stick here, but why can't i see they don't seem to 
exist. i've also looked in both the main and local library folders - 
nothing's been added there. and in the system folder. where is it?! ok 
i won't mention this issue again (for a while).

i did actually successfully compile a test bit of code, with an earlier 
attempt, by using ./xgcc test.c which compiled the test.c file i'd put 
in the same folder as xgcc (which was in the objdir folder).

so it looks like i just need to sort out the search path, which i 
haven't really tried to do yet. - i'm going to have a go at that later. 
need a break.

so thanks very much again fwyzard, for your extensive help.

i'll report back how the path thing goes when i have a go at it later.

thanks, ben.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
  2002-12-28 22:49 Ben Dougall
@ 2002-12-30  7:06 ` Andrea 'fwyzard' Bocci
  2002-12-31  6:19   ` Ben Dougall
  0 siblings, 1 reply; 14+ messages in thread
From: Andrea 'fwyzard' Bocci @ 2002-12-30  7:06 UTC (permalink / raw)
  To: Ben Dougall; +Cc: gcc-help

At 16.57 28/12/2002 +0000, Ben Dougall wrote:
>about the patch. i've done it like this ('patch' being the text file name 
>that's in the srcdir):
>patch -p1 <patch
>
>which gave this output:
>
>patching file gcc/ginclude/stddef.h
>Hunk #1 succeeded at 239 (offset -3 lines).
>patch unexpectedly ends in middle of line
>Hunk #3 succeeded at 294 with fuzz 1 (offset -3 lines).
>
>patch unexpectedly ends in middle of line  - that's not good. what could 
>be the matter there? i notice a comment style that i recognize from c as in:
>
>/* words words words
>[...]

This is not a problem, as a patch only displays some lines of the full 
file. At most, that could be a problem in the file being patched, not in 
the patch itself, if the comment wasn't closed.
I don't know if "patch" has problem reading newline different from unix's 
but what you see happening is strange.
I tried applying the same patch to a fresh uncompressed source tree and I 
got no problems (the same
Hunk #1 succeeded at 239 (offset -3 lines).
Hunk #3 succeeded at 292 (offset -3 lines).
message that you reported).
Here's an updated patch, however:

*** gcc/ginclude/stddef.h.orig  2002-12-30 13:54:24.000000000 +0100
--- gcc/ginclude/stddef.h       2002-12-30 13:56:49.000000000 +0100
***************
*** 239,244 ****
--- 239,245 ----
   #ifndef _WCHAR_T_
   #ifndef _BSD_WCHAR_T_
   #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+ #ifndef _BSD_RUNE_T_DEFINED_     /* Darwin */
   #ifndef _WCHAR_T_DEFINED_
   #ifndef _WCHAR_T_DEFINED
   #ifndef _WCHAR_T_H
***************
*** 275,280 ****
--- 276,282 ----
   #ifdef _BSD_RUNE_T_
   #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
   typedef _BSD_RUNE_T_ rune_t;
+ #define _BSD_RUNE_T_DEFINED_
   #define _BSD_WCHAR_T_DEFINED_
   #if defined (__FreeBSD__)
   /* Why is this file so hard to maintain properly?  In constrast to
***************
*** 306,311 ****
--- 308,314 ----
   #endif
   #endif
   #endif
+ #endif
   #endif /* __WCHAR_T__ */
   #endif /* __wchar_t__ */
   #undef        __need_wchar_t

Save it in a file (say patch) in the gcc-3.2.1 folder (the source folder, 
that is), and apply it with
patch -p0 < patch (or wahtever the filename).
You should only get as output:
patching file gcc/ginclude/stddef.h
with no errors, etc.

Concernig your other problem (w/ installation):

>mkdir: /usr/local/lib: Permission denied
>mkdir: /usr/local/lib/gcc-lib: No such file or directory
>mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2: No such file or 
>directory
>mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1: No such file 
>or directory
>cp: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/_inst.1796_: No 
>such file or directory
>make[1]: *** [install-common] Error 1
>make: *** [install-gcc] Error 2

>mkdir: /usr/local/lib: Permission denied
shows that the problem is that you are not allowed to create the folder
/usr/local/lib ,
while the other errors follow from this folder not existing.

I don't know the policies for creating folder under MacOS X, but if it were 
a Unix box, I'd say this:
"The error comes from you trying to install GCC in a system folder or any 
other folder that you have not write access to.
You need to be root, or have the same administrator privileges, and have 
/usr/local not readonly, for the installation to succeed."

OK, mea culpa. While instructing you in the opther mail, I forgot to tell 
you about the privileges you need in order to write in system directories.
So, not my suggestions are:

1.) delete everything but the GCC source archive

2.) uncompress it again in a clean folder, which from now on I will call 
the "starting" folder: you should find a folder named "gcc-3.2.1" in that 
folder.

3.) save the patch from this mail in that gcc-3.2.1 folder, taking care of 
not overwriting any file in there. The name "patch" is OK.

4.) from the "gcc-3.21." foder, apply the patch, running "patch -p0 < 
patch" at the terminal. You should see the massage:
patching file gcc/ginclude/stddef.h

5.) (optional, but cleaner) delete the file you used for the patch (from 
the terminal: rm patch).

6.) create a build folder, say "build", under the same starting folder.
 From the terminal, do
mkdir build
You should now have in that folder both "gcc-3.2.1" and "build" folders, 
and nothing else.

7.) configure GCC
from the starting folder
cd build
../gcc-3.2.1/configure --enable-threads=posix --enable-shared 
--prefix=/usr/opt/gcc --program-prefix=fsf- --disable-libgcj 
--enable-version-specific-runtime-libs --enable-languages=c

The last options will tell the framework only to build the C frontned, eg. 
you will only be able to compile C programs with this compiler.
Use --enable-languages=c,c++ to also build C++ support. The other languages 
that you can add are "ada, f77, java, objc".
The but-last one will put the all the libraries in a subfolder of the gcc 
install folder, along with their version number. This will help you using 
more than one GCC and packing it if you plan to rredistribute it, after 
building.
The --disable-libgcj option disable the java libraries. If you don't use 
java, you don't need them.
The --prefix option specify the install folder. I chose that /usr/opt/gcc 
so that it will not conflict with system files (I hope !)
For more info, see <http://gcc.gnu.org/install/configure.html>

8.) bootstrap GCC. Simply do
make bootstrap
and wait.

9.) Now the tricky part. To install GCC out of your home, you need to be 
administrator. Either log in as administrato (don't know the exact name for 
MacOS X, ask some othe MacOS user).
Else, you can try to do it the Unix way: from the terminal, at the build 
folder, run the command
su
It will either ask a password, or fail with some error like "command not fond".
If it fails, you need to log in as administrator, or try something else 
(eg., use that -pword thing, maybe it works, ore create the /usr/opt and 
/usr/opt/gcc folders manually, and hope that the others inside can be made 
after you make the first).
If it asks for a password, enter the administrator password, and read on.

Assuming you somehow managed to get it right (creatign the folders 
manually, using "su", logging in as administrator), now you're at the 
terminal in the build folder. Do
make install
and hopefully get no errors.

To check that the installation went on alright, go in the installation 
dirctory:
cd /usr/opt/gcc/bin
and try
./fsf-gcc -v

If it works, you're almost done. If not, it's A Problem TM.

10.) Adjust the search path to find your newly build GCC.
Damn, I really have no clue with this, you should ask a MacOS X user !
Anyway, the thing to do is adding "/usr/opt/gcc/bin" at the end os the PATH 
list, which should be a list of folder names separated by a colon.

Mhm. Maybe I can help you, at least for running it from the command line:
Become administrator (either logging in as that, or via the "su" program, 
if it exists and is worklng). Edit the file /etc/profile with a text ditor.

If you see a line like
PATH=....:$PATH:....
add
:/usr/opt/gcc/bin
at the end.

If you see one or more lines like
pathmunge /usr/bin
pathmunge /something/somthing

add

pathmunge /usr/opt/gcc/bin after

after the others, just before
unset pathmunge
.

As always, good luck, and keep me informed...




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
@ 2002-12-28 22:49 Ben Dougall
  2002-12-30  7:06 ` Andrea 'fwyzard' Bocci
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Dougall @ 2002-12-28 22:49 UTC (permalink / raw)
  To: gcc-help

about the patch. i've done it like this ('patch' being the text file 
name that's in the srcdir):
patch -p1 <patch

which gave this output:

patching file gcc/ginclude/stddef.h
Hunk #1 succeeded at 239 (offset -3 lines).
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 294 with fuzz 1 (offset -3 lines).

patch unexpectedly ends in middle of line  - that's not good. what 
could be the matter there? i notice a comment style that i recognize 
from c as in:

/* words words words

isn't closed with a */  is that the problem? i tried fixing that and 
got this which is a bit better i think but still not there:

Hunk #1 succeeded at 239 (offset -3 lines).
Hunk #2 succeeded at 279 with fuzz 1.
patch unexpectedly ends in middle of line
Hunk #3 succeeded at 294 with fuzz 1 (offset -3 lines).

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
@ 2002-12-28  8:58 Ben Dougall
  0 siblings, 0 replies; 14+ messages in thread
From: Ben Dougall @ 2002-12-28  8:58 UTC (permalink / raw)
  To: gcc-help

starting from the start again.

got a problem with the patch

i've put this text:

--- gcc-04072002/gcc/ginclude/stddef.h  Wed Jan  9 13:28:06 2002
+++ gccsrc/gcc/gcc/ginclude/stddef.h    Thu Jul  4 18:37:27 2002
@@ -242,6 +242,7 @@
  #ifndef _WCHAR_T_
  #ifndef _BSD_WCHAR_T_
  #ifndef _BSD_WCHAR_T_DEFINED_    /* Darwin */
+#ifndef _BSD_RUNE_T_DEFINED_     /* Darwin */
  #ifndef _WCHAR_T_DEFINED_
  #ifndef _WCHAR_T_DEFINED
  #ifndef _WCHAR_T_H
@@ -278,6 +279,7 @@
  #ifdef _BSD_RUNE_T_
  #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
  typedef _BSD_RUNE_T_ rune_t;
+#define _BSD_RUNE_T_DEFINED_
  #define _BSD_WCHAR_T_DEFINED_
  #if defined (__FreeBSD__)
  /* Why is this file so hard to maintain properly?  In constrast to
@@ -295,6 +297,7 @@
  #endif
  #ifndef __cplusplus
  typedef __WCHAR_TYPE__ wchar_t;
+#endif
  #endif
  #endif
  #endif

into a text file, into the srcdir
i've navigated to the srcdir in the terminal and typed:
patch -patch
('patch' is the patch text file's name) and i get this:
patch: **** strip count atch is not a number

:/ i can't remember how i did that last time, but maybe the problem's 
here?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: help with installing gcc in os x please.
@ 2002-12-28  8:27 Ben Dougall
  0 siblings, 0 replies; 14+ messages in thread
From: Ben Dougall @ 2002-12-28  8:27 UTC (permalink / raw)
  To: gcc-help

so this is where it's gone wrong i think, at the make install stage.

while in the objdir folder i type make install (forgetting about my 
pword idea). this is the entire output of that:

[Ben-Ds-Computer:~/gcc/objdir] bend% make install
/bin/sh ../gccfolder/mkinstalldirs /usr/local /usr/local
(cd intl && make all)
make[2]: Nothing to be done for `all'.
for file in cc1 ; do \
   if [ -f $file ] ; then \
     rm -f /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
     /bin/sh /Users/bend/gcc/gccfolder/install-sh -c  $file 
/usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
   else true; \
   fi; \
done
mkdir: /usr/local/lib: Permission denied
mkdir: /usr/local/lib/gcc-lib: No such file or directory
mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2: No such file or 
directory
mkdir: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1: No such 
file or directory
cp: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/_inst.1796_: 
No such file or directory
make[1]: *** [install-common] Error 1
make: *** [install-gcc] Error 2
[Ben-Ds-Computer:~/gcc/objdir] bend% cd gcc
[Ben-Ds-Computer:~/gcc/objdir/gcc] bend% make install
(cd intl && make all)
make[1]: Nothing to be done for `all'.
for file in cc1 ; do \
   if [ -f $file ] ; then \
     rm -f /usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
     /usr/bin/install -c $file 
/usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/$file; \
   else true; \
   fi; \
done
/usr/bin/install: 
/usr/local/lib/gcc-lib/powerpc-apple-darwin6.2/3.2.1/cc1: No such file 
or directory
make: *** [install-common] Error 71
[Ben-Ds-Computer:~/gcc/objdir/gcc] bend%


that's that's the error i got to start with, and because of the 
'permission denied' bit in that, and the fact that you have to input a 
password in os x whenever you want to install anything i arrived at the 
pword thing ('password' didn't work and i've seen pword used in 
conjuction with command line stuff somewhere else so i tried it and it 
seemed to work) so i thought i'd cracked the problem but now it looks 
like i hadn't.

maybe the problem goes back even further than the make install, to the 
make bootstrap bit? i really have no idea.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-12-31 14:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-22 19:27 help with installing gcc in os x please Ben Dougall
2002-12-23 12:10 ` Andrea 'fwyzard' Bocci
2002-12-23 14:47   ` Ben Dougall
2002-12-27  5:54     ` Andrea 'fwyzard' Bocci
2002-12-28  3:39       ` Ben Dougall
2002-12-28  6:41         ` LLeweLLyn Reese
2002-12-28  7:56           ` Ben Dougall
2002-12-29  8:48         ` Andrea 'Fyre Wyzard' Bocci
2002-12-28  8:27 Ben Dougall
2002-12-28  8:58 Ben Dougall
2002-12-28 22:49 Ben Dougall
2002-12-30  7:06 ` Andrea 'fwyzard' Bocci
2002-12-31  6:19   ` Ben Dougall
2002-12-31  7:17     ` Andrea 'Fyre Wyzard' Bocci

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).