Patrick LeBoutillier [31/01/02 08:30 -0500]:
> The perl that is installed there is built with 'cc'.
> If I put /usr/ucb/bin if my path, I can't compile anything (I get errors on
> almost every line).

This compiler is an unbelievably crappy one. Apparently it can't compile
anything except the Solaris kernel itself. I've had troubles compiling
hello_world.c with it.

> If I put /opt/SUNWspro/bin, in my path, it says it can't find the license
> server.

This is a configuration problem. Licenses tend not to work "out of the box"
on Sun machines. You probably need to call your Sun rep. That isn't as lousy
as it sounds -- the Vancouver rep sent me (@ ActiveState) six sample licenses
last year for one of our boxes that had expired.

Here's some info grokked from the bottom of that correspondence:

Sun License Center(US)
Voice  : 1-800-USA-4SUN, 3, 4, International: 1-801-431-1595
FAX    : 1-801-431-3657
E-Mail : [EMAIL PROTECTED]
Website: www.sun.com/licensing

> If one wants to do any kind of no-cost Perl-with-C-modules development on
> Solaris, does one absolutely need to build a Perl with gcc (not that I mind
> doing that, it's just thast I'm trying
> to use an as out-of-the-box environment as possible)?

Depends what you mean by "no-cost". Once set up, using Sun's compiler with
Perl is just like using any other compiler: it Just Works. So your "wasted
time" cost drops to zero quickly. If you buy a permanent license, your "real"
cost will asymptote to zero too.

Of course, gcc's "real" cost is zero, but you have to either compile it
(which won't work without a compiler) or get the binaries from somewhere.
The process of installing binaries may or may not be simple, I've never done
it. I've always gone the compiling-my-own route, and that seems simple
enough.

You don't have to compile your extensions with the same compiler used to
build Perl. You can use gcc for Inline, even if Perl was built with Forte C.
But you'll have to "translate" the compile flags into equivalent gcc options
by hand.

> If not, what's the best way to override the compiler settings when building
> modules on
> Solaris? Do I need to modify the Makefile.PL for each module I wan't to
> install?

You never touch Makefile.PL yourself. Here's an example (not tested) of doing
it from the source file.

use Inline C => DATA =>
           CC => 'gcc',
           LD => 'gcc',
           INC => '-I/usr/local/include',
           CCFLAGS => join(' ', qw(-D_REENTRANT
                                   -DUSE_REENTRANT_API
                                   -D_POSIX_PTHREAD_SEMANTICS
                                   -fno-strict-aliasing
                                   -D_LARGEFILE_SOURCE
                                   -D_FILE_OFFSET_BITS=64)),
           CCCDLFLAGS => '-fPIC',
           LDDLFLAGS => '-G /usr/local/lib';

You'll have to experiment a bit with those values.

--- #YAML:1.0 !perl/$crazy |
Maybe someone should write a module or some stub code to help with this:

  use Inline C => 'DATA', CC => 'gcc', ENABLE => 'TRANSLATE_FLAGS';

But I don't know how feasible it is to translate compile flags between
compilers. There are lots of compilers out there.
---

Later,
Neil

Reply via email to