Permalink
Browse files

Fix compilation errors on Mac OS X 10.8.2

By default it was using Apple's clang compiler rather than GCC, and
that compiler didn't like the standard rope implementation
(/usr/include/c++/4.2.1/ext/rope) for whatever reason. I confirmed the
clang compiler couldn't even compile a simple hello-world program that
declared a rope in main(), so there's nothing wrong with the xhp code
in this regard. Clang just doesn't like rope.

Thanks for Andrew Rogers for the fix.
  • Loading branch information...
1 parent d478951 commit 8aa2d9fa6bf3a114e113ba5c554181279545fb2f @Swahvay Swahvay committed Jan 3, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 xhp/Makefile
View
@@ -28,7 +28,7 @@ fastpath.cpp: fastpath.re
re2c -c -o $@ $<
%.o: %.cpp
- $(CXX) -c $(CPPFLAGS) -o $@ $<
+ g++ -c $(CPPFLAGS) -o $@ $<
xhp_preprocess.o: xhp_preprocess.cpp scanner.lex.hpp parser.yacc.hpp
parser.yacc.o: scanner.lex.hpp
@@ -41,6 +41,6 @@ libxhp.so: code_rope.o scanner.lex.o parser.yacc.o fastpath.o xhp_preprocess.o
g++ -shared -Wl,-soname,libxhp.so -o libxhp.so $^
xhpize: xhpize.cpp libxhp.a
- $(CXX) $(CPPFLAGS) -o $@ $^
+ g++ $(CPPFLAGS) -o $@ $^
.PHONY: all clean tags

4 comments on commit 8aa2d9f

c9s replied Sep 14, 2014

Hey.... this way I can't even specify CC=.. CXX=.. when running ./configure. this spent me almost 1 hour to find this bug.

c9s replied Sep 14, 2014

Because g++ is linked to clang's c++ compiler on Mac OS X. we need to specify CXX=apple-gcc-4.2

Contributor

Swahvay replied Sep 15, 2014

If you through up a patch with a test plan I'll be happy to merge.

c9s replied Sep 15, 2014

Please sign in to comment.