apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
696 stars 158 forks source link

FreeBSD support: gclient sync fails on "gyp: Undefined variable yasm_path in ....libjpeg.gyp" #1007

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to follow the instructions here: 
https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source

________ running 'svn update /usr/home/user/mod_pagespeed/src/tools/gyp 
--revision 1860 --force --accept theirs-conflict --ignore-externals' in 
'/usr/home/user/mod_pagespeed'
Updating 'src/tools/gyp':
At revision 1860.
Syncing projects: 100% (43/43), done.

________ running '/usr/local/bin/python src/tools/clang/scripts/update.py 
--mac-only' in '/usr/home/user/mod_pagespeed'

________ running '/usr/local/bin/python src/build/gyp_chromium 
-Dchromium_revision=256281' in '/usr/home/user/mod_pagespeed'
Updating projects from gyp files...
gyp: Undefined variable yasm_path in 
/usr/home/user/mod_pagespeed/src/third_party/libjpeg_turbo/src/libjpeg.gyp
Error: Command /usr/local/bin/python src/build/gyp_chromium 
-Dchromium_revision=256281 returned non-zero exit status 1 in 
/usr/home/user/mod_pagespeed

I'm guessing the code doesn't consider FreeBSD when choosing how to 
install/build/use yasm

Original issue reported on code.google.com by miguelmc...@gmail.com on 23 Oct 2014 at 12:12

GoogleCodeExporter commented 9 years ago
Bummer... seems to be set in a few places.... I'll see if I can #if 
!defined(__FreeBSD__) all of the cases where this EXPECT_DEATH etc cases show 
up, If they are not that many...

the proper way however would be to test if "death tests" are support, I believe 
its how its done in chromium using "GTEST_HAS_DEATH_TEST" (which will or will 
not be defined by gtest depending on the OS, or so it seems: 
https://github.com/smarr/googletest/blob/2ccb2496fef815a1c18fcbc79c178f6cb4b5f98
2/include/gtest/internal/gtest-port.h)

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 1:27

GoogleCodeExporter commented 9 years ago
The good news is that after a few if's it finally builds successfully :)

But not so luck with building pagespeed_automatic.a which is what I need for 
ngx_pagespeed

       AR.target="$PWD/../../../build/wrappers/ar.sh" \                                                                                                                        CXX.target=g++ \                                                                                                                                                        CC.target=gcc \                                                                                                                                                         all
cd /home/miguelc/mod_pagespeed/src && gmake  BUILDTYPE=Release
gmake[1]: Entering directory '/usr/home/miguelc/mod_pagespeed/src'
  LD_LIBRARY_PATH=/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.host:/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd build; mkdir -p /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build; /bin/sh ../build/lastchange.sh .. -o "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE" -d ../LASTCHANGE.in
  LD_LIBRARY_PATH=/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.host:/usr/home/miguelc/mod_pagespeed/src/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd build; mkdir -p /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public; python version.py -f ../net/instaweb/public/VERSION -f "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE" ../net/instaweb/public/version.h.in "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h"
gmake[1]: Leaving directory '/usr/home/miguelc/mod_pagespeed/src'
gmake --no-print-directory examples
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/linux/x64/include 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/linux/x
64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src -I/usr/local/include PSOL 
= /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-g  -c static_rewriter_main.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o
g++: error: PSOL: No such file or directory
g++: error: =: No such file or directory
g++: error: 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a: 
No such file or directory
Makefile:275: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o] 
Error 1
Makefile:250: recipe for target 'all' failed
gmake: *** [all] Error 2

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 3:10

GoogleCodeExporter commented 9 years ago
Hmm, one thing that seems suspicious in that neighborhood:
~/modpagespeed/gslb-th/src/net/instaweb/automatic/Makefile, lime 213 or so 
explicitly uses make rather than $(MAKE).

Original comment by morlov...@google.com on 29 Oct 2014 at 2:22

GoogleCodeExporter commented 9 years ago
I've changed that already or else I couldn't even get to the error, it  would 
complain about missing operators and sure and so I noticed that it was 
explicitly doing that...

The issue now seem to be:
"g++: error: PSOL: No such file or directory"

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 10:43

GoogleCodeExporter commented 9 years ago
I got it it was caused by me, while adding "-I/usr/local/include" I leaft a "/" 
at the end of the line so PSOL was being added to the include path!

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 11:33

GoogleCodeExporter commented 9 years ago
This is were it end now:
$ gmake BUILDTYPE=Release \                                                     

               AR.host="$PWD/../../../build/wrappers/ar.sh" \                   

                       AR.target="$PWD/../../../build/wrappers/ar.sh" \         

                             CC.target=gcc\                                     

                                     all
cd /home/miguelc/mod_pagespeed/src && gmake --no-print-directory  
BUILDTYPE=Release
  ACTION Extracting last change to /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE out/Release/obj/gen/build/LASTCHANGE.always
  ACTION Generating version header file: "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h" out/Release/obj/gen/net/instaweb/public/version.h
gmake --no-print-directory examples
Merging libraries, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/merge.log ...
ar: warning: creating 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
Cleaning namespace, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log ...
Makefile:260: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a] 
Error 1
Makefile:251: recipe for target 'all' failed
gmake: *** [all] Error 2

https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSOL-From-Source 
refers that make all will always fail... I'm hopping the dirty 
pagespeed_automatic.a is all I need :|

Original comment by miguelmc...@gmail.com on 29 Oct 2014 at 11:34

GoogleCodeExporter commented 9 years ago
Hum... while building nginx with ngx_pagespeed It fails :

----------------------------------------
checking for psol

/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a(91.
html_parse.o.o): In function 
`net_instaweb::HtmlParse::HtmlParse(net_instaweb::MessageHa
ndler*)':
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseC2EPNS_14MessageHandlerE+0x2d8):
 undefined reference to `GURL::~GURL()'
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a(91.
html_parse.o.o): In function `net_instaweb::HtmlParse::~HtmlParse()':
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseD2Ev+0xf7): undefined reference 
to `GURL::~GURL()'
html_parse.cc:(.text._ZN12net_instaweb9HtmlParseD2Ev+0x24a): undefined 
reference to `GURL::~GURL()'

any idea why the "undefined reference to `GURL::~GURL()" ? 

Original comment by miguelmc...@gmail.com on 30 Oct 2014 at 1:50

GoogleCodeExporter commented 9 years ago
Not sure... It may be worth trying to see why 
net/instaweb/automatic/merge_libraries.sh fails; stuff won't quite work w/o it 
anyway.

Obvious option may be to hack it to run with bash rather than /bin/sh; also the 
log file  /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log may 
have some info.

Original comment by morlov...@google.com on 30 Oct 2014 at 2:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Seems I've missplace a comment in the Makefile while trying to fix it... now I 
get 

cd /home/miguelc/mod_pagespeed/src && gmake --no-print-directory  
BUILDTYPE=Release
  ACTION Extracting last change to /usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/build/LASTCHANGE out/Release/obj/gen/build/LASTCHANGE.always
  ACTION Generating version header file: "/usr/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/net/instaweb/public/version.h" out/Release/obj/gen/net/instaweb/public/version.h
gmake --no-print-directory examples
gmake[1]: *** No rule to make target 
'/home/miguelc/mod_pagespeed/src/out/Release/obj.target/third_party/apr/libapr.a
', needed by 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a'. 
 Stop.
Makefile:248: recipe for target 'all' failed
gmake: *** [all] Error 2

The BASE_LIBS list seems to directly to the files, but apr should be the 
system's one, and surely others will give problems!

I see in the code:
# TODO(jmarantz): this library-list should be automatically generated
# from the 'gyp' flow, rather than hand-entered here.
BASE_LIBS = \
  base/libbase.a \
  base/libbase_static.a \

So jamrantz is aware of this and probably will be fixed in a more recent build, 
for now I'll point to them manually!

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 12:00

GoogleCodeExporter commented 9 years ago
Or just remove the ones pointing to libs I already have on system and use:
-SYSLIBS = -lpthread -lrt
+SYSLIBS = -lpthread -lrt -lapr-1.0 ....

for example... 

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 12:52

GoogleCodeExporter commented 9 years ago
I've set "sh -x" on the merge file:

r.o.o 93.caching_headers.o.o 93.content_type.o.o 93.google_url.o.o 
93.http_names.o.o 93.query_params.o.o 93.semantic_type.o.o 
94.bot_checker.gp.o.o 95.http.pb.o.o 96.gif_reader.o.o 96.image_analysis.o.o 
96.image_converter.o.o 96.image_frame_interface.o.o 96.image_resizer.o.o 
96.image_util.o.o 96.jpeg_optimizer.o.o 96.jpeg_reader.o.o 96.jpeg_utils.o.o 
96.pixel_format_optimizer.o.o 96.png_optimizer.o.o 96.read_image.o.o 
96.scanline_interface_frame_adapter.o.o 96.scanline_utils.o.o 
96.webp_optimizer.o.o 97.js_keywords.gp.o.o 98.inprocess_shared_mem.o.o 
98.shared_circular_buffer.o.o 98.shared_dynamic_string_map.o.o 
98.shared_mem_cache.o.o 98.shared_mem_cache_data.o.o 
98.shared_mem_lock_manager.o.o 98.shared_mem_statistics.o.o 
99.shared_mem_cache_snapshot.pb.o.o
+ echo ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ ls -l 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ rm -rf /tmp/merge_libraries.miguelc.31553
Cleaning namespace, logs in 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log ...
sh -x ./rename_c_symbols.sh 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
> /home/miguelc/mod_pagespeed/src/net/instaweb/automatic/rename.log
+ set -e
+ set -u
+ readlink -f 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
+ 
IN=/usr/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automati
c.a.dirty
+ readlink -f 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ OUT=''
Makefile:251: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a' 
failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a] 
Error 1
Makefile:242: recipe for target 'all' failed
gmake: *** [all] Error 2

Don't see much more info I'm afraid... except that "OUT" is '' and maybe 
shouldn't?

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 2:51

GoogleCodeExporter commented 9 years ago
re: libapr.a --- yep, they will have to be removed manually, and corresponding 
-l lines also added to ngx_pagespeed's config file.
Basically the build tool we use doesn't really do static libraries as output 
(last I checked), so we have to hand-make them.

rr: last comment: seems like readlink -f behaves differently on freebsd when 
the file doesn't exist. It will probably work to just set OUT=$2

Original comment by morlov...@google.com on 31 Oct 2014 at 12:27

GoogleCodeExporter commented 9 years ago
Hum... readlink on freebsd show's no output if not found, and shows the path if 
found (IMHO makes more sense then showing the path in both cases, however the 
exit code should still tell if it worked or not.

for nginx I'm using:
MOD_PAGESPEED_DIR="$HOME/mod_pagespeed/src" ./configure  
--prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' 
--with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf 
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid 
--error-log-path=/var/log/nginx-error.log --user=www --group=www --with-ipv6 
--with-google_perftools_module 
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp 
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp 
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp 
--http-scgi-temp-path=/var/tmp/nginx/scgi_temp 
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp 
--http-log-path=/var/log/nginx-access.log --with-http_gzip_static_module 
--with-http_gunzip_module --with-http_image_filter_module 
--with-http_stub_status_module --with-http_xslt_module --with-pcre 
--with-http_spdy_module --with-http_ssl_module 
--add-module=$HOME/gitstuff/ngx_pagespeed/

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 1:08

GoogleCodeExporter commented 9 years ago
The script also uses set -e, so the readlink command failing results in the 
script straight up exiting, like you saw.

Original comment by morlov...@google.com on 31 Oct 2014 at 1:13

GoogleCodeExporter commented 9 years ago
readlink issue fixed, I still get a error:

+ rm /tmp/tmp.7B4Glal1
+ objcopy -v --redefine-syms /tmp/tmp.7Ec7UNQU 
/usr/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
.dirty 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ echo ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
+ ranlib 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a
rm 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a.dir
ty
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src -I/usr/local/include 
-I/usr/include 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/freebsd/x64/includ
e -I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/freebsd
/x64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src  -g  -c 
static_rewriter_main.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o
/usr/local/bin/g++ -I/home/miguelc/mod_pagespeed/src -I/usr/local/include 
-I/usr/include 
-I/home/miguelc/mod_pagespeed/src/out/Release/obj/gen/protoc_out/instaweb 
-I/home/miguelc/mod_pagespeed/src/third_party/chromium/src 
-I/home/miguelc/mod_pagespeed/src/third_party/gflags/gen/arch/freebsd/x64/includ
e -I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/src 
-I/home/miguelc/mod_pagespeed/src/third_party/google-sparsehash/gen/arch/freebsd
/x64/include -I/home/miguelc/mod_pagespeed/src/third_party/protobuf/src 
-I/home/miguelc/mod_pagespeed/src/third_party/re2/src  -g  -c 
static_rewriter.cc -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o
/usr/local/bin/g++ -g -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-lpthread -lrt -lcrypto -lz  -lcrypto -lssl -lapr-1 -licudata -licuuc -ljpeg
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
--rewriters=collapse_whitespace 
/home/miguelc/mod_pagespeed/src/install/mod_pagespeed_example 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic \
                collapse_whitespace.html
Makefile:273: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/collapse_whitespace.html
' failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/collapse_whitespace.html
] Segmentation fault (core dumped)
Makefile:242: recipe for target 'all' failed

tried to build ngx_pagespeed anywway but failed, the error seems unrelated to 
the witespace failure though (or maybe not... what do I know :) )

attaching the log

Original comment by miguelmc...@gmail.com on 31 Oct 2014 at 4:22

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

tr1 issue fixed with:

--- 
src/third_party/google-sparsehash/gen/arch/freebsd/x64/include/google/sparsehash
/sparseconfig.h   2014-11-03 16:53:50.119845519 +0000
+++ 
src/third_party/google-sparsehash/gen/arch/linux/x64/include/google/sparsehash/s
parseconfig.h     2014-10-23 17:05:15.644683988 +0100
@@ -11,5 +11,5 @@

 /* the namespace of the hash<> function */
-#define HASH_NAMESPACE std
+#define HASH_NAMESPACE std::tr1

 /* Define to 1 if you have the <inttypes.h> header file. */

Found the fix here: 
https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-March/274533.html

Original comment by miguelmc...@gmail.com on 3 Nov 2014 at 5:03

GoogleCodeExporter commented 9 years ago
Actually that fixes it for ngx_pagespeed, but breaks the build of 
"pagespeed_automatic.a"

But, a port of google's sparsehash exists, so I'll try to use that instead.

Original comment by miguelmc...@gmail.com on 3 Nov 2014 at 5:41

GoogleCodeExporter commented 9 years ago
Using the ports version avoids any issues abouve but I get:
./pagespeed/kernel/base/timer.h:49:11: error: 'int64' does not name a type
   virtual int64 NowMs() const;
           ^
./pagespeed/kernel/base/timer.h:52:11: error: 'int64' does not name a type
   virtual int64 NowUs() const = 0;
           ^
./pagespeed/kernel/base/timer.h:55:24: error: 'int64' has not been declared
   virtual void SleepMs(int64 ms);
                        ^
./pagespeed/kernel/base/timer.h:58:24: error: 'int64' has not been declared
   virtual void SleepUs(int64 us) = 0;
                        ^
pagespeed/kernel/http/http_options.cc:24:7: error: 'kMinuteMs' is not a member 
of 'net_instaweb::Timer'
   5 * Timer::kMinuteMs,  // implicit_cache_ttl_ms
       ^
pagespeed/kernel/http/http_options.cc:26:1: error: too many initializers for 
'const net_instaweb::HttpOptions'

Seems to be missing initypes.h, likely due to the fact that this is defined in 
the genfiles!

Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 2:30

GoogleCodeExporter commented 9 years ago
Looking a bit more it to the sources.

HAVE_SYS_TYPES_H should add the "#include <sys/types.h>" however even after 
adding it to timer.h I get the same errors :|

Any help is appreciated.

Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 2:58

GoogleCodeExporter commented 9 years ago
int64 is supposed to be typedef's in 
src/third_party/chromium/src/base/basictypes.h
(included from pagespeed/kernel/base/basictypes.h)

Original comment by morlov...@google.com on 4 Nov 2014 at 3:20

GoogleCodeExporter commented 9 years ago
pagespeed/kernel/base/basictypes.h

Includes "base/basictypes.h" but I'm not sure what's the "root" for that... 

https://code.google.com/p/modpagespeed/source/browse/trunk/src/pagespeed/kernel/
base/basictypes.h

Original comment by miguelmc...@gmail.com on 4 Nov 2014 at 7:29

GoogleCodeExporter commented 9 years ago
The "root" should be ./third_party/chromium/src/.  Maybe on BSD it's 
considering .. to be a valid root?  In which case it #includes itself, hits the 
includeguard, and moves on?  You could try renaming the file...

Original comment by jefftk@google.com on 6 Nov 2014 at 4:19

GoogleCodeExporter commented 9 years ago
trying:
svn diff ~/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h                 
        Index: 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h
===================================================================
--- /home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h  
(revision 4322)
+++ /home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/basictypes.h  
(working copy)
@@ -18,7 +18,7 @@
 #define PAGESPEED_KERNEL_BASE_BASICTYPES_H_

-#include "base/basictypes.h"
+#include "third_party/chromium/src/base/basictypes.h"

 // The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through
 // between switch labels:

Which fixes that but then:
                 from static_rewriter_main.cc:21:
/home/miguelc/mod_pagespeed/src/third_party/chromium/src/base/basictypes.h:18:25
: fatal error: base/macros.h: No such file or directory

Missing the "root" path again...
Note that this is building "/mod_pagespeed/src/net/instaweb/automatic" and 
after I moved to using the systems (port) google sparsehash so maybe the 
"chromium root" is not being set now... but AFAIK this is set on 
base/base.gyp... 

The alternative is to use the full paths if similar issue come up  guess!

Original comment by miguelmc...@gmail.com on 7 Nov 2014 at 3:19

GoogleCodeExporter commented 9 years ago
Nvm, my bad accidentally removed: -    
-I$(MOD_PAGESPEED_ROOT)/third_party/chromium/src \

from the Makefile duh!!!

Original comment by miguelmc...@gmail.com on 7 Nov 2014 at 3:29

GoogleCodeExporter commented 9 years ago
With the changes to the Makefile I still get an error (but psol builds or so it 
seems)

g++ -g -o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter_main.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter.o 
/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/pagespeed_automatic.a 
-Wl, -lpthread -lrt -lcrypto -lz  -lcrypto -lssl -lprotobuf -lapr-1 -licudata 
-licuuc -ljpeg
/usr/local/bin/ld: cannot find : No such file or directory
collect2: error: ld returned 1 exit status
Makefile:267: recipe for target 
'/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter' failed
gmake[1]: *** 
[/home/miguelc/mod_pagespeed/src/net/instaweb/automatic/static_rewriter] Error 1
Makefile:239: recipe for target 'all' failed
gmake: *** [all] Error 2

"static_rewriter" fails but do I need it for ngx_pagespeed? I have no clue, the 
docs suggest page generating "pagespeed_automatic.a" is enough.

building nginx however still fails while checking for psol...

===
----------------------------------------
checking for psol

In file included from objs/autotest.cc:8:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/html/html_parse.h:36:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/symbol_table.h:31:
In file included from 
/home/miguelc/mod_pagespeed/src/pagespeed/kernel/base/dense_hash_map.h:21:
In file included from /usr/local/include/google/dense_hash_map:34:
In file included from /usr/local/include/sparsehash/dense_hash_map:104:
In file included from 
/usr/local/include/sparsehash/internal/densehashtable.h:102:
/usr/local/include/sparsehash/type_traits.h:94:41: error: expected class name
template <class T> struct is_integral : false_type { };
                                        ^
/usr/local/include/sparsehash/type_traits.h:95:39: error: expected class name
template<> struct is_integral<bool> : true_type { };
                                      ^
/usr/local/include/sparsehash/type_traits.h:96:39: error: expected class name
template<> struct is_integral<char> : true_type { };
                                      ^
/usr/local/include/sparsehash/type_traits.h:97:48: error: expected class name
template<> struct is_integral<unsigned char> : true_type { };
                                               ^
/usr/local/include/sparsehash/type_traits.h:98:46: error: expected class name
template<> struct is_integral<signed char> : true_type { };
                                             ^
/usr/local/include/sparsehash/type_traits.h:105:42: error: expected class name
template<> struct is_integral<wchar_t> : true_type { };
===
Full log attached!

Original comment by miguelmc...@gmail.com on 8 Nov 2014 at 3:13

jeffkaufman commented 9 years ago

Tracking this in https://github.com/pagespeed/mod_pagespeed/issues/1073