Quantcast
Viewing all articles
Browse latest Browse all 22087

Trouble building gcc on Mac - can't find system headers

I'm on a Mac running OS-X High Sierra and wanted to create a separate build of gcc. Lemme share a little of the process it took me a week to work out so it will help others:

I made a safe directory "gcc" and used svn to get the latest source code from gcc, which it created in a subdirectory called "trunk". I initially created a directory called "build" in the top level of trunk.

It wouldn't compile without the 4 dependencies, so I ran ./contrib/download prerequisites to get them, but it still wouldn't compile, so I went into each of those 4 directories individually and did ./configure, ./make, ./make install, and ./make check. I did the install part because even these dependencies depended on each other, so installing seemed like a safe way to make sure they could be found. Later I found out there is no other way, despite instructions to the contrary...

I succeeded in building the dependencies GMP, MPFR, ISL, and MPC. Then I went back to ./build and the ../configure succeeded, but the build (make) quickly failed saying "source directory already configured; run "make distclean there first". Googling showed this was when you configure in the source directory. I thought maybe my trunk/build directory was considered "in the source directory", so I moved it and tried again and the same thing happened. When I tried to go into trunk and type "make distclean" is just said No rule to make target distclean.

So I thought, maybe it's the 4 dependency directories? Maybe now that they're installed it's safe to distclean them all? There, make distclean worked and took out everything - even the tests I ran. Seems wasteful and necessitates pre make-installing them, but it worked.

Back in build, make then started some serious compile work during the make, but crashed saying "the directory that should contain system headers does not exist: /usr/include".

How should I bootstrap this? Where would I find the system headers to copy into /usr/include? And will I have the same problem with missing libc and libraries later on? Also, if I want to transplant this to a new computer without rebuilding, what do I need to copy besides the executables and the headers? And where would I put them?

Thanks for any advice... - Jeff


Viewing all articles
Browse latest Browse all 22087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>