From a4dbf05b95779412f4f4036dad4e4ddcdd9b40f1 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 19 Nov 2009 09:39:35 +0000 Subject: [PATCH] Fixing various FreeBSD issues. --- Exception.hpp | 2 ++ FreeBSD.mk | 1 + Parser.hpp | 1 + makefile | 13 +++++++------ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Exception.hpp b/Exception.hpp index a6aa5ef..286fdeb 100644 --- a/Exception.hpp +++ b/Exception.hpp @@ -74,6 +74,8 @@ void CYThrow(JSContextRef context, JSValueRef value); return NULL; \ } +// XXX: fix this: _ is not safe; this is /not/ Menes ;P +#undef _assert #define _assert(test, args...) do { \ if (!(test)) \ CYThrow("*** _assert(%s):%s(%u):%s [errno=%d]", #test, __FILE__, __LINE__, __FUNCTION__, errno); \ diff --git a/FreeBSD.mk b/FreeBSD.mk index 3c39e46..ac4b846 100644 --- a/FreeBSD.mk +++ b/FreeBSD.mk @@ -1,2 +1,3 @@ export PATH := /usr/local/bin:/usr/local/GNUstep/System/Tools:$(PATH) +gcc := g++44 include PkgConfig.mk diff --git a/Parser.hpp b/Parser.hpp index a963d7b..f48e81b 100644 --- a/Parser.hpp +++ b/Parser.hpp @@ -50,6 +50,7 @@ #include #include +#include #include #include "location.hh" diff --git a/makefile b/makefile index efcb4eb..89e5475 100644 --- a/makefile +++ b/makefile @@ -6,6 +6,7 @@ else target := $(PKG_TARG)- endif +gcc := g++ flags ?= -g3 -O0 -DYYDEBUG=1 paths := $(foreach path,$(paths),$(wildcard $(path))) @@ -118,24 +119,24 @@ lex.cy.c: Cycript.l # ./Parser.py $@ Cycript.tab.o: Cycript.tab.cc $(header) - $(target)g++ $(flags) -c -o $@ $< + $(target)$(gcc) $(flags) -c -o $@ $< lex.cy.o: lex.cy.c $(header) - $(target)g++ $(flags) -c -o $@ $< + $(target)$(gcc) $(flags) -c -o $@ $< %.o: %.cpp $(header) - $(target)g++ $(flags) -c -o $@ $< + $(target)$(gcc) $(flags) -c -o $@ $< #objc := -x c++ %.o: %.mm $(header) - $(target)g++ $(objc) $(flags) -c -o $@ $< + $(target)$(gcc) $(objc) $(flags) -c -o $@ $< libcycript.$(dll): $(code) - $(target)g++ $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link) + $(target)$(gcc) $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link) $(ldid) $@ cycript: Console.o libcycript.$(dll) $(inject) - $(target)g++ $(flags) -o $@ $(filter %.o,$^) -L. -lcycript $(console) $(link) + $(target)$(gcc) $(flags) -o $@ $(filter %.o,$^) -L. -lcycript $(console) $(link) $(entitle) cycript package: $(deb) -- 2.45.2