On 2001-12-12, Mahdi Sbeih <[EMAIL PROTECTED]> wrote:
>When I ran sh Configure, I answered yes for a question, that
>asks if I want to build with dynamic loading, I answered no,
>then when I compiled DBI, I ran make perl, so a new perl executable was
>generated, finally I compiled DBD::Informix after setting the environment
>variable DBD_INFORMIX_RELOCATABLE_INFORMIXDIR which allow you to move the
>informix directory.

If you are statically linking DBD::Informix into perl (which is, as I
already suggested, a bad idea on Solaris), then you have a 'relocatable
INFORMIXDIR' anyway.  The significance of the environment variable is
that if you are using shared libraries for ESQL/C, normally
DBD::Informix builds the absolute pathnames of those libraries into the
DBD::Informix shared object, so that you don't run into problems when
you try to run Perl with DBD::Informix from environments such as web
servers and root-owned procedures where LD_LIBRARY_PATH is unset or does
not work.

>I already tried to move the Perl executable from on machine to another
>like from Solaris 2.6 to Solaris 2.7 and it is working just fine, but
>when using "use DBI" it complained as I said in the previous email, but
>when I moved the directroy structure to the new machine it works fine.
>
>It seems that I am missing the point here, so what I am asking is, when
>compiling DBI statically, why do I need DBI.pm? or this has nothing to
>with static and I still needs DBI.pm??

You need DBI.pm because that is the Perl script that controls access to
the DBI.a or DBI.so library that contains the C code used by DBI.  Basically,
when you say 'use DBI', Perl is looking for DBI.pm under a directory in @INC.
With a static build, you don't have to copy DBI.so around -- which is just as
well since if you do a static build, it doesn't exist :-) -- but you do need
the DBI.pm file.

>"Michael Wray"  wrote:
>How did you Statically link it?  If you just used a USE statement then chances
>are it's not linked at all....I know I have seen where the perlcc only links
>things that are REQUIRED ....unfortunately, last time I checked, you couldn't
>dynamically connect to different Databases with a compiled Perl
>Executable...because everything (and I mean everything) was assumed to be
>static, including the Database you were connecting to...I don't know if this
>is still true..that was almost a year ago now...
>
>*********** REPLY SEPARATOR  ***********
>
>On 12/12/01 at 3:30 PM Mahdi Sbeih wrote:
>>It seems I confused you from my question, I will
>>reformat it in different way:
>>
>>When Compiling Perl in Static mode...then
>>Compiling DBI Module...then
>>build a new perl executable with DBI statically linked into
>>it.....then
>>
>>If I move this Perl executable to an exact identical machine,
>>do I need anything other the Perl executable???

Yes; all the stuff in @INC.

>>I tried to run a small script
>>#!/tmp/perl -w
>>use DBI;
>>print("\nHi \n");
>>
>>When I run the script, the Perl complains that DBI.pm is not there,
>>so do I need to move also DBI.pm with the executable?,

Yes.

>>Am I missing anything, feed back please.

It says "I can't find this file" and you ask "Do I need this file" but
it already has told "I can't find this file and I can't go on without
it".  I have a feeling you aren't trusting the diagnostics enough.

-- 
Jonathan Leffler                         #include <disclaimer.h>
STSM, IBM Data Management Solutions.      Phone: +1 650-926-6921
Email: [EMAIL PROTECTED], [EMAIL PROTECTED]
Guardian of DBD::Informix v1.00.PC1 -- http://dbi.perl.org
     "I don't suffer from insanity; I enjoy every minute of it!"

Reply via email to