Re: [rt.cpan.org #66085] make test fails at "test_cgi" because of missing LD_LIBRARY_PATH on SunOS with /opt/csw/lib/*

Fred Moyer <[email protected]> Wed, 23 Feb 2011 12:29:14 -0800
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
I like Marco's solution - am adding it to mod_perl.

On Wed, Feb 23, 2011 at 7:44 AM, Issac Goldstand via RT
<[email protected]> wrote:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=3D66085 >
>
> If you use
> $ CPPFLAGS=3D"-I/opt/csw/lib" LDFLAGS=3D"-L/opt/csw/lib" =A0./configure .=
..
>
> will that make it work? =A0I don't have access to a SunOS machine to test
> on, but off the top of my head, I believe it should do the trick...
>
> On Wed Feb 23 10:20:13 2011, [email protected] wrote:
>> Hi there,
>>
>> I have libiconv and other stuff in '/opt/csw/lib', so I configure
> this way:
>>
>> =A0 $ cat config.nice
>> =A0 #! /bin/sh
>> =A0 #
>> =A0 # Created by configure
>> =A0 CPPFLAGS=3D"-I/opt/csw/lib"; export CPPFLAGS
>> =A0 LDFLAGS=3D"-L/opt/csw/lib"; export LDFLAGS
>> =A0 ./configure '--with-apache2-apxs=3D/opt/apache22/bin/apxs'
>> =A0 'LDFLAGS=3D-L/opt/csw/lib' 'CPPFLAGS=3D-I/opt/csw/lib' "$@"
>>
>> It compiles fine, but it fails at "make test" on test_cgi:
>>
>> =A0 Test Summary Report
>> =A0 -------------------
>> =A0 t/cgi.t =A0 =A0 =A0 =A0(Wstat: 0 Tests: 31 Failed: 31)
>> =A0 Failed tests: =A01-31
>>
>> with many cries in 't/logs/error_log':
>>
>> =A0 =A0ld.so.1: test_cgi: fatal: libiconv.so.2: open failed: No such fil=
e
>> =A0 =A0or directory
>>
>> Indeed, anything gets correctly linked against iconv, f.i.:
>>
>> =A0 $ ldd module/t/cgi-bin/.libs/test_cgi =A0| egrep -i iconv
>> =A0 =A0 =A0 =A0 libiconv.so.2 =3D> =A0 =A0 =A0 =A0 /opt/csw/lib/libiconv=
.so.2
>>
>> but the running httpd/mod_cgi doesn't know about '/opt/csw/lib' (most
>> modules are DSO; I set the correct LD_LIBRARY_PATH).
>>
>> Adding the following snippet in 't/conf/extra.conf.in' solves the
> issue:
>>
>> =A0 <IfModule mod_env.c>
>> =A0 =A0 PassEnv LD_LIBRARY_PATH
>> =A0 </IfModule>
>>
>>
>> Cheers,
>>
>> =A0 ^m'e
>>
>>
>>
>
>
> --
> -----
> Maybe in order to understand mankind, we have to look at the word
> itself: "Mankind". Basically, it's made up of two separate words -
> =A0"mank" and "ind". What do these words mean ? It's a mystery, just as
> is mankind.
> =A0--Unknown
>