「CPANシェルで mod_perl2 をインストールする。」からの続き。
libapreq2 も同じように、CPANシェルからインストールする。
CPANシェルを起動後、Makefile.PL にのパラメータを設定する。
$ cpan
CPAN: File::HomeDir loaded ok (v0.80)
cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support enabled
cpan[1]> o conf init makepl_arg
Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in separate processes. If you have
any parameters (e.g. PREFIX, LIB, UNINST or the like) you want to
pass to the calls, please specify them here.
If you don't understand this question, just press ENTER.
Typical frequently used settings:
PREFIX=~/perl # non-root users (please see manual for more hints)
Parameters for the 'perl Makefile.PL' command? [] --with-expat=/usr/local/apache2
Please remember to call 'o conf commit' to make the config permanent!
cpan[2]> o conf makepl_arg
makepl_arg [--with-expat=/usr/local/apache2]
Type 'o conf' to view all configuration items
cpan[3]>
一次的な設定なので、'o conf commit' はしない。
Makefile.PL にのパラメータを設定しないでインストールすると、次の様にエラーとなりインストールは出来ない。
cpan[1]> install J/JO/JOESUF/libapreq2-2.08.tar.gz
CPAN: Storable loaded ok (v2.18)
Going to read /home/suzu/.cpan/Metadata
Database was generated on Mon, 22 Sep 2008 18:02:49 GMT
CPAN: LWP::UserAgent loaded ok (v5.814)
CPAN: Time::HiRes loaded ok (v1.9711)
I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':
http://www.perl.org/CPAN/
ftp://ftp.perl.org/pub/CPAN/
Is it OK to try to connect to the Internet? [yes]
Fetching with LWP:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
CPAN: YAML loaded ok (v0.66)
Going to read /home/suzu/.cpan/sources/authors/01mailrc.txt.gz
Going to read /home/suzu/.cpan/build/
........................
(省略)
---- Unsatisfied dependencies detected during ----
---- JOESUF/libapreq2-2.08.tar.gz ----
ExtUtils::XSBuilder [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
(省略)
---- Unsatisfied dependencies detected during ----
---- GRICHTER/ExtUtils-XSBuilder-0.28.tar.gz ----
Tie::IxHash [requires]
Parse::RecDescent [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
(省略)
Checking if your kit is complete...
Looks good
Writing Makefile for Tie::IxHash
cp lib/Tie/IxHash.pm blib/lib/Tie/IxHash.pm
Manifying blib/man3/Tie::IxHash.3
GSAR/Tie-IxHash-1.21.tar.gz
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/ixhash....ok
All tests successful.
Files=1, Tests=25, 0 wallclock secs ( 0.04 usr 0.05 sys + 0.01 cusr 0.02 csys = 0.12 CPU)
Result: PASS
GSAR/Tie-IxHash-1.21.tar.gz
/usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/Tie-IxHash-1.21-Wkktf5/blib/arch /home/suzu/.cpan/build/Tie-IxHash-1.21-Wkktf5/blib/lib to PERL5LIB for 'install'
Password:
(省略)
/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
make[2]: *** [test_cgi] Error 1
make[2]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/module'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/module'
make: *** [all-recursive] Error 1
JOESUF/libapreq2-2.08.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
JOESUF/libapreq2-2.08.tar.gz : make NO
cpan[2]> bye
Lockfile removed.
この様になった場合、もう一度インストールする前に、次のようにして make clean する。
そうしないと、インストール出来ない。
cpan[3]> clean J/JO/JOESUF/libapreq2-2.08.tar.gz
libapreq2 をインストールする。
cpan[3]> install J/JO/JOESUF/libapreq2-2.08.tar.gz
CPAN: Storable loaded ok (v2.18)
Going to read /home/suzu/.cpan/Metadata
Database was generated on Sat, 27 Sep 2008 18:26:49 GMT
CPAN: YAML loaded ok (v0.66)
Going to read /home/suzu/.cpan/build/
............................................................................DONE
Found 17 old builds, restored the state of 17
Running make for J/JO/JOESUF/libapreq2-2.08.tar.gz
CPAN.pm: Going to build J/JO/JOESUF/libapreq2-2.08.tar.gz
perl: 5.10.0 ok
mod_perl2: 2.000004 ok
Apache::Test: 1.31 ok
ExtUtils::MakeMaker: 6.44 ok
ExtUtils::XSBuilder: 0.28 ok
Test::More: 0.8 ok
./configure --enable-perl-glue --with-expat="/usr/local/apache2" --with-apache2-apxs="/usr/local/apache2/bin/apxs" --with-perl="/usr/local/bin/perl"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
(省略)
waiting 60 seconds for server to start: ..
waiting 60 seconds for server to start: ok (waited 0 secs)
server localhost.localdomain:8529 started
t/api/cookie.........ok
t/api/error..........ok
t/api/module.........ok
t/api/param..........ok
t/apreq/big_input....ok
t/apreq/cgi..........ok
t/apreq/cookie.......ok
t/apreq/inherit......ok
t/apreq/request......ok
t/apreq/upload.......ok
All tests successful.
Files=10, Tests=191, 40 wallclock secs ( 2.79 usr 0.02 sys + 11.79 cusr 14.36 csys = 28.96 CPU)
Result: PASS
[warning] server localhost.localdomain:8529 shutdown
pod2test was not found, skipping inlined tests
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue/perl'
JOESUF/libapreq2-2.08.tar.gz
/usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/blib/arch /home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/blib/lib to PERL5LIB for 'install'
Password:
(省略)
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
(省略)
----------------------------------------------------------------------
Before you can use mod_apreq2, you must ensure that an appropriate
"LoadModule" line appears in your webserver's config file:
/usr/local/apache2/conf/httpd.conf
LoadModule apreq_module /usr/local/apache2/modules/mod_apreq2.so
----------------------------------------------------------------------
(省略)
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
(省略)
Installing /usr/local/share/man/man3/Apache2::Request.3
Installing /usr/local/share/man/man3/APR::Request::Cookie.3
Installing /usr/local/share/man/man3/APR::Request::CGI.3
Writing /usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/libapreq2/.packlist
Appending installation info to /usr/local/lib/perl5/5.10.0/i686-linux/perllocal.pod
make[3]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue/perl'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue'
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue'
JOESUF/libapreq2-2.08.tar.gz
sudo make install -- OK
cpan[4]>