You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by gotta go <on...@gmail.com> on 2005/02/08 09:33:18 UTC
Problem Installing libapreq2-2.04-dev on Freebsd
trying to install libapreq2-2.04-dev on freebsd 4.8 results in the
following error.
su-2.05b# perl Makefile.PL --with-apache2-apxs=/usr/local/sbin/apxs
....
su-2.05b# make
Making all in src
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c apreq.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq.c -fPIC -DPIC -o .libs/apreq.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq.c -o apreq.o >/dev/null 2>&1
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
apreq_version.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_version.c -fPIC -DPIC -o
.libs/apreq_version.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_version.c -o apreq_version.o >/dev/null
2>&1
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
apreq_cookie.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_cookie.c -fPIC -DPIC -o
.libs/apreq_cookie.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_cookie.c -o apreq_cookie.o >/dev/null
2>&1
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
apreq_params.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_params.c -fPIC -DPIC -o
.libs/apreq_params.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_params.c -o apreq_params.o >/dev/null
2>&1
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
apreq_parsers.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_parsers.c -fPIC -DPIC -o
.libs/apreq_parsers.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_parsers.c -o apreq_parsers.o >/dev/null
2>&1
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I. -I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
apreq_env.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_env.c -fPIC -DPIC -o .libs/apreq_env.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c apreq_env.c -o apreq_env.o >/dev/null 2>&1
/usr/local/bin/bash ../libtool --mode=link gcc -g -O2
-L/usr/local/lib -o libapreq2.la -rpath /usr/local/lib -version-info
2:20:0 apreq.lo apreq_version.lo apreq_cookie.lo apreq_params.lo
apreq_parsers.lo apreq_env.lo -L/usr/local/lib/apache2 -lapr-0 -lm
-lcrypt -L/usr/local/lib/apache2 -laprutil-0 -lexpat -liconv
gcc -shared .libs/apreq.o .libs/apreq_version.o .libs/apreq_cookie.o
.libs/apreq_params.o .libs/apreq_parsers.o .libs/apreq_env.o
-L/usr/local/lib -L/usr/local/lib/apache2 -lapr-0 -lm -lcrypt
-laprutil-0 -lexpat -liconv -Wl,-soname -Wl,libapreq2.so.2 -o
.libs/libapreq2.so.2
(cd .libs && rm -f libapreq2.so && ln -s libapreq2.so.2 libapreq2.so)
(cd .libs && rm -f libapreq2.so && ln -s libapreq2.so.2 libapreq2.so)
ar cru .libs/libapreq2.a apreq.o apreq_version.o apreq_cookie.o
apreq_params.o apreq_parsers.o apreq_env.o
ranlib .libs/libapreq2.a
creating libapreq2.la
(cd .libs && rm -f libapreq2.la && ln -s ../libapreq2.la libapreq2.la)
Making all in env
/usr/local/bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I. -I../src -I../src -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include -D_REENTRANT -D_THREAD_SAFE -g -O2 -c
mod_apreq.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../src
-I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c mod_apreq.c -fPIC -DPIC -o .libs/mod_apreq.o
gcc -DHAVE_CONFIG_H -I. -I. -I../src -I../src
-I/usr/local/include/apache2 -I/usr/local/include/apache2
-I/usr/local/include/apache2 -I/usr/local/include -D_REENTRANT
-D_THREAD_SAFE -g -O2 -c mod_apreq.c -o mod_apreq.o >/dev/null 2>&1
/usr/local/bin/bash ../libtool --mode=link gcc -g -O2
-L/usr/local/lib -o mod_apreq.la -export-dynamic -module
-avoid-version -rpath `/usr/local/sbin/apxs -q LIBEXECDIR`
mod_apreq.lo ../src/libapreq2.la -L/usr/local/lib/apache2 -lapr-0
-lm -lcrypt -L/usr/local/lib/apache2 -laprutil-0 -lexpat -liconv
gcc -shared .libs/mod_apreq.o -Wl,--rpath
-Wl,/root/.cpan/build/libapreq2-2.04-dev/src/.libs -Wl,--rpath
-Wl,/usr/local/lib -L/usr/local/lib/apache2 -L/usr/local/lib
../src/.libs/libapreq2.so -lapr-0 -lm -lcrypt -laprutil-0 -lexpat
-liconv -Wl,-soname -Wl,mod_apreq.so -o .libs/mod_apreq.so
ar cru .libs/mod_apreq.a mod_apreq.o
ranlib .libs/mod_apreq.a
creating mod_apreq.la
(cd .libs && rm -f mod_apreq.la && ln -s ../mod_apreq.la mod_apreq.la)
make: don't know how to make all-local. Stop
*** Error code 1
I unsure why this happens.
Any insight much appriciated
Re: contention for require()'d code library
Posted by Perrin Harkins <pe...@elem.com>.
On Tue, 2005-02-08 at 11:28 -0500, Matthew Berk wrote:
> Besides not keeping strict, which I'm doing intentionally to support a
> bit of older code, am I violating a fundamental rule of mod_perl around
> namespace contention?
http://perl.apache.org/docs/1.0/guide/troubleshooting.html#Undefined_subroutine__Apache__ROOT__perl__test_2epl__some_function_called_at
I would highly recommend porting your code to perl5-style modules with
packages and strict/warnings.
- Perrin
Re: contention for require()'d code library
Posted by Perrin Harkins <pe...@elem.com>.
On Thu, 2005-02-10 at 12:01 -0500, Matthew Berk wrote:
> I have come up with a bit of a hackish, near term solution. Wanted to
> share it with the group.
>
> - check to see if a subroutine in the library is defined()
> - if not, delete() the library name from %INC
> - require() the library
I do something like that when porting legacy code in a hurry. I use a
do('library.pl') inside a BEGIN block, so that it ignores %INC but only
happens once per script.
You definitely want to fix this in the long-term though. Duplicating
these subs in multiple scripts eats up memory.
- Perrin
Re: contention for require()'d code library
Posted by Matthew Berk <ma...@local-i.com>.
I have come up with a bit of a hackish, near term solution. Wanted to
share it with the group.
- check to see if a subroutine in the library is defined()
- if not, delete() the library name from %INC
- require() the library
This corrects the behavior we were seeing quite well, without much
overhead for recompilation. Again, the case was:
- registry script foo.pl
- registry script bar.pl
- library lib.pl
- both scripts require() the library
Best,
Matthew
On Feb 8, 2005, at 11:52 AM, Joe Schaefer wrote:
> Matthew Berk <ma...@local-i.com> writes:
>
>> Apologies in advance for the conceptual nature of this inquiry.
>>
>> I have two chunks of code that are being run as separate scripts under
>> Registry. Both are using require() (I know, I know) to pull in a
>> library of subroutines.
>
> If you're abusing require() as a means of adding external
> subroutines directly into your script, then that's not
> going to work with Registry. One thing that works, I think,
> would be to use a package declaration at the start of the library,
> and change the script to call those subroutines by their
> package-qualified names:
>
> old lib: sub foo {} ...
> new lib: package Foo; sub foo{} ...
> old script: require $mylib; foo(4); ...
> new script: require $mylib; Foo::foo(4); ...
>
> This may not be the best solution, but I'm sure this issue is well
> documented somewhere on the perl.apache.org site.
>
> --
> Joe Schaefer
>
Re: contention for require()'d code library
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Matthew Berk <ma...@local-i.com> writes:
> Apologies in advance for the conceptual nature of this inquiry.
>
> I have two chunks of code that are being run as separate scripts under
> Registry. Both are using require() (I know, I know) to pull in a
> library of subroutines.
If you're abusing require() as a means of adding external
subroutines directly into your script, then that's not
going to work with Registry. One thing that works, I think,
would be to use a package declaration at the start of the library,
and change the script to call those subroutines by their
package-qualified names:
old lib: sub foo {} ...
new lib: package Foo; sub foo{} ...
old script: require $mylib; foo(4); ...
new script: require $mylib; Foo::foo(4); ...
This may not be the best solution, but I'm sure this issue is well
documented somewhere on the perl.apache.org site.
--
Joe Schaefer
contention for require()'d code library
Posted by Matthew Berk <ma...@local-i.com>.
Apologies in advance for the conceptual nature of this inquiry.
I have two chunks of code that are being run as separate scripts under
Registry. Both are using require() (I know, I know) to pull in a
library of subroutines. The behavior I'm seeing, which is quite odd, is
that without warning, one or the other of the scripts will all of the
sudden return a server error, complaining about an "undefined
subroutine" reference in the script. It's as if the functions in the
library of a sudden disappear, and I wonder whether or not there's some
strange contention between the two scripts for use of the library which
they both include().
Besides not keeping strict, which I'm doing intentionally to support a
bit of older code, am I violating a fundamental rule of mod_perl around
namespace contention?
Thanks in advance,
Matthew
Re: Problem Installing libapreq2-2.04-dev on Freebsd
Posted by Joe Schaefer <jo...@sunstarsys.com>.
William McKee <wi...@knowmad.com> writes:
> You can get gnumake from your ports/packages collection and retry
> the build using gmake instead of make.
gmake should work; at least that's what the INSTALL doc seems
to think:
INSTRUCTIONS:
FreeBSD users must substitute "gmake" for "make" below.
--
Joe Schaefer
Re: Problem Installing libapreq2-2.04-dev on Freebsd
Posted by gotta go <on...@gmail.com>.
thank you.
that was the source of the problem along with a couple of other things
on freebsd
on Freebsd 4.8
for the bebefit of others reading
ln -s 'ed (all in usr/local/bin/)
automake14 -> automake
autoconf259 -> autoconf
autoheader259 -> autoheader
aclocal14 -> aclocal-1.4
export CPPFLAG=" -I/usr/local/include/apache2/modules/perl"
not all were needed but clean up the configure..
alias make=/usr/local/bin/gmake
then ran normal setup
thankz again
On Tue, 8 Feb 2005 08:50:39 -0500, William McKee <wi...@knowmad.com> wrote:
> On Tue, Feb 08, 2005 at 08:33:18AM +0000, gotta go wrote:
> > trying to install libapreq2-2.04-dev on freebsd 4.8 results in the
> > following error.
>
> <snip>
>
> > make: don't know how to make all-local. Stop
> > *** Error code 1
>
> This looks like a make error. I've not tried to build mp2 under FreeBSD,
> but I know that some programs prefer gnumake (the make program that
> comes with FreeBSD is not the same; hopefully these issues will be
> resolved when more projects are ported to using Module::Build).
>
> You can get gnumake from your ports/packages collection and retry the
> build using gmake instead of make.
>
> Good luck,
> William
>
> --
> Knowmad Services Inc.
> http://www.knowmad.com
>
Re: Problem Installing libapreq2-2.04-dev on Freebsd
Posted by William McKee <wi...@knowmad.com>.
On Tue, Feb 08, 2005 at 08:33:18AM +0000, gotta go wrote:
> trying to install libapreq2-2.04-dev on freebsd 4.8 results in the
> following error.
<snip>
> make: don't know how to make all-local. Stop
> *** Error code 1
This looks like a make error. I've not tried to build mp2 under FreeBSD,
but I know that some programs prefer gnumake (the make program that
comes with FreeBSD is not the same; hopefully these issues will be
resolved when more projects are ported to using Module::Build).
You can get gnumake from your ports/packages collection and retry the
build using gmake instead of make.
Good luck,
William
--
Knowmad Services Inc.
http://www.knowmad.com