actually link against pagespeed_automatic.a, and properly test we're doing so

This commit is contained in:
Jeff Kaufman
2012-10-02 11:30:47 -04:00
parent 8d0decb332
commit fbec99cbaf
2 changed files with 34 additions and 6 deletions
+5
View File
@@ -12,6 +12,11 @@ the pagespeed optimization library.
First build mod_pagespeed, following these instructions: First build mod_pagespeed, following these instructions:
http://code.google.com/p/modpagespeed/wiki/HowToBuild http://code.google.com/p/modpagespeed/wiki/HowToBuild
Then build the pagespeed optimization library:
$ cd /where/you/built/mod_pagespeed/src/net/instaweb/automatic
$ make all
Then move the mod_pagespeed directory to a parallel directory to your Then move the mod_pagespeed directory to a parallel directory to your
ngx_pagespeed checkout: ngx_pagespeed checkout:
+29 -6
View File
@@ -12,17 +12,40 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
mod_pagespeed_dir="$ngx_addon_dir/../mod_pagespeed/src/out/Release" mod_pagespeed_dir="$ngx_addon_dir/../mod_pagespeed/src"
ngx_feature="psol" ngx_feature="psol"
ngx_feature_name="" ngx_feature_name=""
ngx_feature_run=no ngx_feature_run=no
ngx_feature_incs="#include \"net/instaweb/public/version.h\"" ngx_feature_incs="
pagespeed_include="$mod_pagespeed_dir/obj/gen" #include \"net/instaweb/htmlparse/public/html_parse.h\"
#include \"net/instaweb/htmlparse/public/html_writer_filter.h\"
#include \"net/instaweb/util/public/string.h\"
#include \"net/instaweb/util/public/string_writer.h\"
#include \"net/instaweb/util/public/null_message_handler.h\"
"
pagespeed_include="$mod_pagespeed_dir
$mod_pagespeed_dir/third_party/chromium/src/"
ngx_feature_path="$pagespeed_include" ngx_feature_path="$pagespeed_include"
pagespeed_lib_dir="$mod_pagespeed_dir/obj.target/net/instaweb/" pagespeed_automatic_dir="$mod_pagespeed_dir/net/instaweb/automatic"
pagespeed_libs="-linstaweb_automatic -L $pagespeed_lib_dir -lstdc++" pagespeed_libs="-lstdc++ -lrt $pagespeed_automatic_dir/pagespeed_automatic.a"
ngx_feature_libs="$pagespeed_libs" ngx_feature_libs="$pagespeed_libs"
ngx_feature_test="char c = MOD_PAGESPEED_VERSION_STRING[0]" ngx_feature_test="
GoogleString output_buffer;
net_instaweb::StringWriter write_to_string(&output_buffer);
net_instaweb::NullMessageHandler handler;
net_instaweb::HtmlParse html_parse(&handler);
net_instaweb::HtmlWriterFilter html_writer_filter(&html_parse);
html_writer_filter.set_writer(&write_to_string);
html_parse.AddFilter(&html_writer_filter);
html_parse.StartParse(\"http:example.com\");
html_parse.ParseText(
\"<html ><body ><h1 >Test</h1 ><p>Test Text</p></body></html>\n\");
html_parse.FinishParse();
printf(\"parsed as: %s\", output_buffer.c_str())"
# Test whether we have pagespeed and can compile and link against it. # Test whether we have pagespeed and can compile and link against it.
. "$ngx_addon_dir/cpp_feature" . "$ngx_addon_dir/cpp_feature"