(2013/02/08 20:18), kv wrote:
Hi,
I have an extension on FF17, which works fine on Windows. But on Linux i
ran into some compilation issues while building my native extension, I was
suggested to compile the same with gcc 4.5.2.
But I found on 32 bit linux, there is no update avaible for gcc 4.5.2.
Can some body help me how can i compile native extension on 32 bit RHEL
with gcc 4.5.2, if the package is not available for update.
Installing a particular version of GCC from source is easy.
I checked to see that 4.5.4 is the latest in the 4.5 series of GCC, and
also found the current release is 4.7.2 ( and luckly on my Debian distribution
I have 4.7.2).
http://gcc.gnu.org
Maybe you can install the latest GCC 4.7.2 yourself (Not sure if this helps
you?)
or if you need to install the 4.5 series,
install the up-to-date 4.5.4 or not so updated particular version, 4.5.2,
on your PC.
(I am compiling the whole TB source tree from comm-central using GCC 4.7.2 and
I wonder why you need 4.5.2, but I digress.)
The compilation and installation of GCC is a series of simple steps.
run configure
run make
The above would prepare gcc and friends to be installed under
/usr/local/{bin,lib}
then install by make install.
There is now a good documentation (there used to be also, but
now there are HTML versions, and such)
That said, I checked the latest doc and recall my experience.
Prerequisites.:
http://gcc.gnu.org/install/prerequisites.html
Possibly missing libraries
(We don't need gnat mentioned since we don't need ada compiler.)
I found that the following libraries were missing on my Debian GNU/Linux system
when I did the local install. Even if the library binaries were there,
under Debian GNU/Linux, their headers were missing and so had to
install the developer's packages that install headers.
I think you may be better off installing the sources suggested in the
documentation page and build them together with gcc. GCC building process
takes care of it automatically.
GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
MPFR Library version 2.4.2 (or later)
MPC Library version 0.8.1 (or later)
ISL Library version 0.11.1
CLooG 0.18.0
Tools:
Depending on your installation, some tools listed in
http://gcc.gnu.org/install/prerequisites.html
may need new installation or update.
But for the initial try, the best bet is to run ./configure and make first
and see the failure due to missing
tools and binaries (or check the versions by --version flag to see if
they are up to date if during the internal consistency checking of
binaries during compiler building, the failure occurs.
(This checking is near the part of three stage compilation : If you proceed
that far,
you can check the session log to learn the names of commands [tools] used
in the compilation. Most of the tools will print versions with --version flag.
If you find the tools outdated, you may need to install them and restart.
In my past experience, binutils were often outdated between the very different
GCC revisions.)
)
The error warnings are quite explicit about missing tools and libraries.
So the short summary is :
Beware: Use different source and object directories!
Install GCC source:
say under srcdir/ subdirectory
% mkdir srcdir
install the source (files) there.
Configure GCC:
% mkdir objdir
% cd objdir
% srcdir/configure <=== Different source and object directories
There are many options but you can ignore them for ordinary GCC install under
/usr/local
Build GCC
% cd objdir
% make
Again without the options.
This make proceeds with a three stage process.
The necessary tools and compile itself is generated by then available up-to-date
compiler. The generated binaries from stage2 and stage3 are compared.
If the comparison is OK, stage3 compiler will compile the related tools and
libraries and finishes.
On a slow hardware I was thrilled to see this happen, but I think
the compilation and checking will proceed much faster
to make less impression on modern PC hardware.
I bet this finishes faster than TB/FF compilation (a LOT faster.).
Default installation under /usr/local should be a breeze like I said.
Under object directory (objdir)
% su
% make install
(or % su make install )
I believe if you get stuck, the document at www.gcc.org is good enough.
Or try GCC newsroups.
Once the source files are ready on a reasonably modern OS, the
default compilation and installation should be a breeze like I said
(once the missing tools are all downloaded, that is.
So a few trials and errors may be inevitable. But since turnaround time
is NOT THAT LONG, and so should be OK.)
Well, yes, easy, but I needed to spend so many lines anyway (sorry for lengthy
posting.)
But it is certainly easier than installing perl, python and other small
language systems.
If you are really stuck, drop me a line.
Chiaki
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform