mod_pythonãã³ã³ãã¤ã«ãããã¨ãã¦apxsã®ãã°ãè¦ã¤ãã
Pylonsãmod_pythonã§åããããã«mod_pythonãã³ã³ãã¤ã«ããã次ã®ãããªã¨ã©ã¼ãåºãã
$ cd mod_python-3.3.1 $ ./configure $ make ... /usr/lib/apr-1/build/libtool --silent --mode=link gcc -o mod_python.la -rpath -module -avoid-version finfoobject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo -L/usr/lib/python2.4/config -Xlinker -export-dynamic -lm -lpython2.4 -lpthread -ldl -lutil -lm libtool: link: only absolute run-paths are allowed apxs:Error: Command failed with rc=65536
ã©ãããlibtoolã-rpathã®å¼æ°ã絶対ãã¹ã§ã¯ãªãã¨æå¥ãè¨ã£ã¦ãããããããããã-rpathã«å¼æ°ã渡ã£ã¦ããªãã®ãåå ãªã®ã§ã調ã¹ã¦ã¿ãã¨ã©ããapxs (APache eXtenSion tool)ã®ãã°ã£ã½ãã
ã¾ããMakefileããapxsã¯æ¬¡ã®ããã«å¼ã³åºããã¦ãã¦ã
/usr/bin/apxs -I/home/nozom/rpm/BUILD/mod_python-3.3.1/src/include -I/usr/include/apache2 -I/usr/include/python2.4 -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c hlistobject.c finfoobject.c -L/usr/lib/python2.4/config -Xlinker -export-dynamic -lm -lpython2.4 -lpthread -ldl -lutil -lm
ããã«apxsã®ä¸ã§libtoolãå¼ã°ãã¦ããã
ããã§libtoolãå¼ã¶éã®ã³ãã³ãã©ã¤ã³ãã©ã®ããã«çµã¿ç«ã¦ããã¦ããã®ãè¦ã¦ã¿ãã¨ã次ã®ãããªè¡ãè¦ã¤ããã
/usr/bin/apxs:418:
$opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
$CFG_LIBEXECDIRãè¨å®ãã¦ããã®ã¯æ¬¡ã®ç®æï¼
/usr/bin/apxs:45:
my $libexecdir = get_vars("libexecdir"); my $CFG_LIBEXECDIR = eval qq("$libexecdir");
get_vars()ã®ä¸èº«ã§ã¯ä»¥ä¸ã®ãããªãã¨ããã¦ããï¼
/usr/bin/apxs:204:
if (exists $config_vars{$arg} or exists $config_vars{lc $arg}) { my $val = exists $config_vars{$arg} ? $config_vars{$arg} : $config_vars{lc $arg}; $val =~ s/[()]//g; $result .= eval "qq($val)" if defined $val; $result .= ";;"; $ok = 1; }
ãã¡ããã¡ããã£ã¦ãããã©è¦ããã«ããã§ã¯$config_vars{"libexecdir"}ãevalããã¦ããã
%config_varsãã©ãããæ¥ã¦ãããã¨ããã¨ã以ä¸ã®é¨åã
/usr/bin/apxs:28:
my $installbuilddir = "/usr/lib/apache2/build"; get_config_vars("$installbuilddir/config_vars.mk",\%config_vars);
get_config_vars()ã¯åã«ãã¡ã¤ã«ã®ä¸èº«ãèªãã§ããã·ã¥ãä½ã£ã¦ããã ããªã®ã§ããã¨ãã¦ã/usr/lib/apache2/build/config_vars.mkãè¦ã¦ã¿ãã¨ã
/usr/lib/apache2/build/config_vars.mk:40:
libdir = ${prefix}/lib libexecdir = ${libdir}/apache2/modules
libexecdirã®å®ç¾©ã¯ããã«ãã£ãã
ãããªã get_vars("libexecdir") ã§ãã®å¤ãè¿ã£ã¦ããããªãã®ã ããåé¡ãªã®ã¯get_vars()ã®ä¸ã®evalæã次ã®ããã«è©ä¾¡ããããã¨ã
$result .= eval "qq(${libdir}/apache2/modules)"
ãã®ã¨ã$libdirã¨ããå¤æ°ã¯å®ç¾©ããã¦ããªãã®ã§ããã®evalæã¯ä¾å¤ã§çµäºãã¦undefãè¿ãã
解決çã¯ç°¡åã§ã$libexecdirããåã«$libdirãè¨å®ãã¦ããã°ãããä¾ãã°/usr/bin/apxs 45è¡ç®ã®$libexecdirã®è¨å®ã®åã«ä»¥ä¸ã追å ããã
my $libdir = get_vars("libdir"); my $CFG_LIBDIR = eval qq("$libdir");
ä¿®æ£åã®apxsã®åºåï¼
$ apxs -q LIBEXECDIR Use of uninitialized value in concatenation (.) or string at /usr/bin/apxs line 209. Use of uninitialized value in concatenation (.) or string at /usr/bin/apxs line 209.
ä¿®æ£å¾ã®apxsã®åºåï¼
$ apxs -q LIBEXECDIR /usr/lib/apache2/modules
åé¡ã¯ãã®ä¿®æ£ãã©ãåæ ããããæ£ããæ¹æ³ã¯RPMããã±ã¼ã¸ãä½ãç´ããã¨ãªãã ãã©ãapxsã¯apache2ã®ä¸é¨ãªã®ã§ããã®ããã ãã«ããã±ã¼ã¸ãä¿®æ£ããã¨ãªãã¨ããªã大ããããªäºã«ãªã£ã¦ãã¾ããèããæ«ã«ã/usr/bin/apxsãç´æ¥ä¿®æ£ãããã¨ã«ãããapacheããã¼ã¸ã§ã³ã¢ãããããã³ã«å¿ è¦ãªããã®ä¿®æ£ãæ¯åæä½æ¥ã§ããªãã¨ãããªããã©ãapacheã®ãã¼ã¸ã§ã³ã¢ããé »åº¦ã¯ãããªã«é«ããªããã次ã®ãã¼ã¸ã§ã³ã¢ããã§ãã®åé¡ãä¿®æ£ããã¦ããå¯è½æ§ãååèãããããããããã±ã¼ã¸ç®¡çã«ãã ããå¿ è¦ã¯ããã»ã©ãªãã ããã