Opened 6 years ago

Closed 6 years ago

#530 closed defect (invalid)

http_xslt_module always looks for libxml2/libxslt in OS locations ignoring the custom location if provided

Reported by: Anshul Agrawal Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.5.x
Keywords: xslt libxml libxslt Cc:
uname -a: Linux precise64 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: 1.4.6

Description

It seems the first location where the xml libs are searched is hardcoded in auto/lib/libxslt/conf:15 and hence it ignores the compile time flags.

Should the hardcoded path be removed? To note, no other module has such default hardcoded.

Change History (3)

comment:1 by Ruslan Ermilov, 6 years ago

Can you try this patch?

diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf
--- a/auto/lib/libxslt/conf
+++ b/auto/lib/libxslt/conf
@@ -12,7 +12,7 @@
                       #include <libxslt/xsltInternals.h>
                       #include <libxslt/transform.h>
                       #include <libxslt/xsltutils.h>"
-    ngx_feature_path="/usr/include/libxml2"
+    ngx_feature_path=
     ngx_feature_libs="-lxml2 -lxslt"
     ngx_feature_test="xmlParserCtxtPtr    ctxt = NULL;
                       xsltStylesheetPtr   sheet = NULL;
@@ -24,6 +24,15 @@
 
 if [ $ngx_found = no ]; then
 
+    ngx_feature="libxslt in /usr/"
+    ngx_feature_path="/usr/include/libxml2"
+
+    . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
     # FreeBSD port
 
     ngx_feature="libxslt in /usr/local/"
@@ -95,11 +104,21 @@ fi
     ngx_feature_name=NGX_HAVE_EXSLT
     ngx_feature_run=no
     ngx_feature_incs="#include <libexslt/exslt.h>"
-    ngx_feature_path="/usr/include/libxml2"
+    ngx_feature_path=
     ngx_feature_libs="-lexslt"
     ngx_feature_test="exsltRegisterAll();"
     . auto/feature
 
+
+if [ $ngx_found = no ]; then
+
+    ngx_feature="libexslt in /usr/"
+    ngx_feature_path="/usr/include/libxml2"
+
+    . auto/feature
+fi
+
+
 if [ $ngx_found = no ]; then
 
     # FreeBSD port

comment:2 by Anshul Agrawal, 6 years ago

I tried the patch but then got the same error. Then, I specified explicit include for the libxml2 directory and it worked this time.

Earlier (not working with or without patch):

--with-cc-opt='-fPIC -L/opt/nginx/embedded/lib -I/opt/nginx/embedded/include'

Now (works fine with or without patch):

--with-cc-opt='-fPIC -L/opt/nginx/embedded/lib -I/opt/nginx/embedded/include -I/opt/nginx/embedded/include/libxml2'

Sorry to bother. I think the bug can be marked as invalid and closed.

comment:3 by Ruslan Ermilov, 6 years ago

Resolution: invalid
Status: newclosed

Bingo!

-I's specified in --with-cc-opt come before -I's from auto/lib/libxslt/conf, so no patch is necessary.

Note: See TracTickets for help on using tickets.