apxsが入ってなかったので、
# apt-cache search apxs apache-dev - development kit for the Apache webserver apache2-prefork-dev - development headers for apache2 apache2-threaded-dev - development headers for apache2
apacheのバージョンは2.2.3
# /usr/sbin/apache2 -v Server version: Apache/2.2.3 Server built: Jan 27 2008 18:13:21
apxsをインストール
# apt-get install apache2-prefork-dev
/usr/bin/apxs2にインストールされました
makefile を作ります
# perl Makefile.PL MP_APXS=/usr/bin/apxs2 Reading Makefile.PL args from @ARGV MP_APXS = /usr/bin/apxs2 no conflicting prior mod_perl version found - good. Configuring Apache/2.2.3 mod_perl/2.0.4 Perl/v5.10.0 [ info] generating script t/TEST [ info] generating script ./t/cgi-bin/cookies.pl [ info] generating script ./t/cgi-bin/next_available_port.pl Writing Makefile for Apache::Test Checking for File::Spec...ok Checking for Cwd...ok [ info] generating script t/TEST Writing Makefile for ModPerl::Registry Writing Makefile for APR::Base64 Writing Makefile for APR::Brigade Writing Makefile for APR::Bucket Writing Makefile for APR::BucketAlloc Writing Makefile for APR::BucketType Writing Makefile for APR::Date Writing Makefile for APR::Error Writing Makefile for APR::Finfo Writing Makefile for APR::IpSubnet Writing Makefile for APR::OS Writing Makefile for APR::Pool Writing Makefile for APR::SockAddr Writing Makefile for APR::Socket Writing Makefile for APR::Status Writing Makefile for APR::String Writing Makefile for APR::Table Writing Makefile for APR::ThreadMutex Writing Makefile for APR::ThreadRWLock Writing Makefile for APR::URI Writing Makefile for APR::UUID Writing Makefile for APR::Util Writing Makefile for APR Writing Makefile for Apache2::Access Writing Makefile for Apache2::CmdParms Writing Makefile for Apache2::Command Writing Makefile for Apache2::Connection Writing Makefile for Apache2::ConnectionUtil Writing Makefile for Apache2::Directive Writing Makefile for Apache2::Filter Writing Makefile for Apache2::FilterRec Writing Makefile for Apache2::HookRun Writing Makefile for Apache2::Log Writing Makefile for Apache2::MPM Writing Makefile for Apache2::Module Writing Makefile for Apache2::Process Writing Makefile for Apache2::RequestIO Writing Makefile for Apache2::RequestRec Writing Makefile for Apache2::RequestUtil Writing Makefile for Apache2::Response Writing Makefile for Apache2::ServerRec Writing Makefile for Apache2::ServerUtil Writing Makefile for Apache2::SubProcess Writing Makefile for Apache2::SubRequest Writing Makefile for Apache2::URI Writing Makefile for Apache2::Util Writing Makefile for Apache2 Writing Makefile for ModPerl::Global Writing Makefile for ModPerl::Util Writing Makefile for ModPerl Writing Makefile for ModPerl::WrapXS Writing Makefile for APR Writing Makefile for APR::Const Writing Makefile for APR::PerlIO Writing Makefile for libaprext Writing Makefile for APR_build Writing Makefile for Apache2::Const Writing Makefile for Apache2_build Writing Makefile for ModPerl::Const Writing Makefile for ModPerl Writing Makefile for ModPerl::XS Writing Makefile for mod_perl2 [warning] mod_perl dso library will be built as mod_perl.so [warning] You'll need to add the following to httpd.conf: [warning] [warning] LoadModule perl_module modules/mod_perl.so [warning] [warning] depending on your build, mod_perl might not live in [warning] the modules/ directory. [warning] Check the results of [warning] [warning] $ /usr/bin/apxs2 -q LIBEXECDIR [warning] [warning] and adjust the LoadModule directive accordingly.
make でエラーになる
# make cd "src/modules/perl" && make make[1]: Entering directory `src/mod_perl-2.0.4/src/modules/perl' cc -Isrc/mod_perl-2.0.4/src/modules/perl -Isrc/mod_perl-2.0.4/xs -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/apache2 -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/local/lib/perl5/5.10.0/i686-linux/CORE -DMOD_PERL -DMP_COMPAT_1X -O2 -fPIC \ -c mod_perl.c && mv mod_perl.o mod_perl.lo In file included from /usr/include/apache2/ap_config.h:25, from /usr/include/apache2/httpd.h:43, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t' In file included from /usr/include/apr-1.0/apr_file_io.h:29, from /usr/include/apr-1.0/apr_network_io.h:26, from /usr/include/apache2/httpd.h:53, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr_file_info.h:210: error: expected specifier-qualifier-list before 'apr_off_t' In file included from /usr/include/apr-1.0/apr_network_io.h:26, from /usr/include/apache2/httpd.h:53, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr_file_io.h:548: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_file_io.h:740: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from /usr/include/apache2/httpd.h:53, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr_network_io.h:545: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from /usr/include/apr-1.0/apr_buckets.h:32, from /usr/include/apache2/httpd.h:54, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr_mmap.h:134: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_mmap.h:161: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from /usr/include/apache2/httpd.h:54, from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apr-1.0/apr_buckets.h:242: error: expected specifier-qualifier-list before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:706: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:718: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:754: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:890: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:891: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:1168: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:1367: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:1381: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:1431: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_buckets.h:1447: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from modperl_apache_includes.h:27, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apache2/httpd.h:826: error: expected specifier-qualifier-list before 'apr_off_t' In file included from /usr/include/apache2/http_protocol.h:34, from modperl_apache_includes.h:30, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apache2/util_filter.h:142: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apache2/util_filter.h:299: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from modperl_apache_includes.h:30, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apache2/http_protocol.h:111: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apache2/http_protocol.h:203: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from modperl_apache_includes.h:34, from mod_perl.h:20, from mod_perl.c:17: /usr/include/apache2/http_core.h:229: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ap_get_limit_req_body' /usr/include/apache2/http_core.h:510: error: expected specifier-qualifier-list before 'apr_off_t' /usr/include/apache2/http_core.h:611: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apache2/http_core.h:672: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from modperl_apr_includes.h:29, from modperl_common_includes.h:22, from mod_perl.h:21, from mod_perl.c:17: /usr/include/apr-1.0/apr_strings.h:297: error: expected declaration specifiers or '...' before 'apr_off_t' /usr/include/apr-1.0/apr_strings.h:313: error: expected ')' before '*' token /usr/include/apr-1.0/apr_strings.h:349: error: expected ')' before 'size' In file included from mod_perl.h:72, from mod_perl.c:17: modperl_types.h:232: error: expected specifier-qualifier-list before 'apr_off_t' In file included from mod_perl.h:85, from mod_perl.c:17: modperl_filter.h:56: error: expected declaration specifiers or '...' before 'apr_off_t' modperl_filter.h:94: error: expected declaration specifiers or '...' before 'apr_off_t' In file included from mod_perl.h:86, from mod_perl.c:17: modperl_bucket.h:21: error: expected declaration specifiers or '...' before 'apr_off_t' mod_perl.c: In function 'modperl_hook_create_request': mod_perl.c:738: error: 'request_rec' has no member named 'request_config' mod_perl.c:740: error: 'request_rec' has no member named 'request_config' mod_perl.c: In function 'modperl_response_init': mod_perl.c:965: error: 'request_rec' has no member named 'request_config' mod_perl.c:966: error: 'request_rec' has no member named 'per_dir_config' mod_perl.c:979: error: 'request_rec' has no member named 'output_filters' mod_perl.c: In function 'modperl_response_finish': mod_perl.c:988: error: 'request_rec' has no member named 'request_config' mod_perl.c: In function 'modperl_response_handler_run': mod_perl.c:1002: error: 'request_rec' has no member named 'content_type' mod_perl.c:1003: error: 'request_rec' has no member named 'handler' mod_perl.c:1003: error: 'request_rec' has no member named 'content_type' mod_perl.c: In function 'modperl_response_handler': mod_perl.c:1018: error: 'request_rec' has no member named 'per_dir_config' mod_perl.c:1019: error: 'request_rec' has no member named 'request_config' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c:1027: error: 'request_rec' has no member named 'handler' mod_perl.c: In function 'modperl_response_handler_cgi': mod_perl.c:1059: error: 'request_rec' has no member named 'per_dir_config' mod_perl.c:1062: error: 'request_rec' has no member named 'request_config' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' mod_perl.c:1068: error: 'request_rec' has no member named 'handler' make[1]: *** [mod_perl.lo] Error 1 make[1]: Leaving directory `src/mod_perl-2.0.4/src/modules/perl' make: *** [modperl_lib] Error 2
apr.hでエラーが出てるみたいなので、「apr.h」で検索してみました。
/usr/include/apr-1.0/apr.h:270: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'apr_off_t'
で見つけたのが
この結果から先ほどのapr.hを以下のように編集した所コンパイルが通った
typedef __off64_t apr_off_t;
上記のとおりapr.hを編集したらmakeうまいこといきました。ありがとうございます。