LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 933|回复: 0

(转)solaris下安装gcc的又一方法

[复制链接]
发表于 2005-3-25 15:02:24 | 显示全部楼层 |阅读模式
--------------------------------------------------------------------------------

To use the gcc package from sunfreeware.com you MUST install all of the SUNW deveoper packages that come on Sun's Solaris CDs.

The software used to create gcc 3.4.2 (the steps are very similar for earlier versions of gcc) was all from packages on sunfreeware.com. These include the gcc-3.3.2, bison-1.875d, flex-2.5.31, texinfo-4.2, autoconf-2.59, make-3.80, and automake-1.9 packages. It may also be important to install the libiconv-1.8 package to use some of the languages in gcc 3.4.2. See also a comment below about the libgcc package.


I downloaded the gcc-3.4.2.tar.gz source from the GNU site.
I put the source in a directory with plenty of disk space.
I then ran

gunzip gcc-3.4.2.tar.gz

tar xvf gcc-3.4.2.tar

(this creates a directory gcc-3.4.2)

cd gcc-3.4.2

mkdir objdir

cd objdir

../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld
--disable-nls

(except in the case of Solaris 2.5 on SPARC where I used

../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls  --disable-libgcj --enable-languages=c,c++,objc

and left out the other language options - like the gnat ada.)

(I choose to use the as and ld that come with Solaris and are usually
in the /usr/ccs/bin directory.  These files are only there if the
SUNW developer packages from the Solaris have been installed.  I
have noticed problems with the NLS support and so I disable that. The
default installation directory is /usr/local.)

make bootstrap

make install

(this puts a lot of files in /usr/local subdirectories) and the gcc
and other executables in /usr/local/bin.



I put /usr/local/bin and /usr/ccs/bin in my PATH environment.
There are differences between this version of gcc and previous 2.95.x versions on Solaris systems. For details, go to
http://gcc.gnu.org/gcc-3.4/

In particular, gcc-3.4.2 offers support for the creation of 64-bit executables when the source code permits it. Programs like top, lsof, ipfilter, and others support, and may need, such compiles to work properly when running the 64-bit versions of Solaris 7, 8, and 9 on SPARC platforms. In some cases, simply using the -m64 flag for gcc during compiles (which may require either editing the Makefiles to add -m64 to CFLAGS or just doing gcc -m64 on command lines) works.

When you compile something with any of these compilers, the executable may end up depending on one or more of the libraries in /usr/local/lib such as libgcc_s.so. An end user may need these libraries, but not want the entire gcc file set. I have provided a package called libgcc (right now this is for gcc-3.3.x but a version for 3.4.x is being created) for each level of Solaris. This contains all the files from /usr/local/lib generated by a gcc package installation. An end user can install this or a subset. You can determine if one of these libraries is needed by running ldd on an executable to see the library dependencies.

I am happy to hear about better ways to create gcc or problems that may be specific to my packages. Detailed problems with gcc can be asked in the gnu.gcc.help newsgroup or related places.


--------------------------------------------------------------------------------
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表