ksherlock / mpw

Macintosh Programmer's Workshop (mpw) compatibility layer
239 stars 21 forks source link

Compilation of MPW fails #24

Closed NSBrianWard closed 9 years ago

NSBrianWard commented 9 years ago

Now, it might be that I'm just on 10.10 and that isn't supported, since I note you mention 10.8 outright. On failure during compile, I get:

make[2]: *** [bin/CMakeFiles/mpw.dir/template_parser.cpp.o] Error 1

Any thoughts? I installed cmake, ragel and lemon through brew. Pretty sure clang++ supports C++11 on my machine, but maybe something weird is going on there. Not sure! Full barf follows:

[ 96%] Building CXX object bin/CMakeFiles/mpw.dir/template_parser.cpp.o
template_parser.c:399:3: warning: unused variable 'info' [-Wunused-variable]
  TemplateParseARG_FETCH;
  ^
template_parser.c:81:59: note: expanded from macro 'TemplateParseARG_FETCH'
#define TemplateParseARG_FETCH  Debug::TemplateParseInfo *info  = yypParser->info 
                                                      ^
template_parser.c:494:3: error: use of undeclared identifier 'assert'
  assert( iLookAhead!=YYNOCODE );
  ^
template_parser.c:550:3: error: use of undeclared identifier 'assert'
  assert( stateno<=YY_REDUCE_MAX );
  ^
template_parser.c:553:3: error: use of undeclared identifier 'assert'
  assert( i!=YY_REDUCE_USE_DFLT );
  ^
template_parser.c:554:3: error: use of undeclared identifier 'assert'
  assert( iLookAhead!=YYNOCODE );
  ^
template_parser.c:561:3: error: use of undeclared identifier 'assert'
  assert( i>=0 && i<YY_SZ_ACTTAB );
  ^
template_parser.c:562:3: error: use of undeclared identifier 'assert'
  assert( yy_lookahead[i]==iLookAhead );
  ^
template_parser.c:913:5: error: use of undeclared identifier 'assert'
    assert( yyact == YYNSTATE + YYNRULE + 1 );
    ^
template_parser.c:1031:7: error: use of undeclared identifier 'assert'
      assert( !yyendofinput );  /* Impossible to shift the $ token */
      ^
template_parser.c:1038:7: error: use of undeclared identifier 'assert'
      assert( yyact == YY_ERROR_ACTION );
      ^
1 warning and 9 errors generated.
make[2]: *** [bin/CMakeFiles/mpw.dir/template_parser.cpp.o] Error 1
make[1]: *** [bin/CMakeFiles/mpw.dir/all] Error 2
make: *** [all] Error 2

Hope you can help out. This is a super neat project!

steventroughtonsmith commented 9 years ago

MPW should compile fine on 10.10; using Xcode 6's version of clang & macports' cmake here. Not sure that helps!

NSBrianWard commented 9 years ago

Strange. I must just be doing something wacky. Running Xcode 6.1.1. Which version of cmake are you running? I've got 3.1.1.

steventroughtonsmith commented 9 years ago

3.0.2 here, and there are no references to assert() in template_parser.cpp - could be your lemon?

NSBrianWard commented 9 years ago

Managed to get a complete build! I had to add an include to <assert.h> in template_parser.lemon

Maybe something got changed in the repo recently? Or maybe it's just my environment? I have Lemon 1.0, which makes me wonder if that's an older version or something... Either way, looks like I'm good now! :)

Thanks for helping out, @steventroughtonsmith -- I enjoyed your write up the other day!

ksherlock commented 9 years ago

macports and brew have a slightly different lemon template file. The other lemon files include <assert.h> but template_parser.lemon was a newer addition and I forgot about that.

It should be fixed with 67cb2b6e09b5851cc79cc4b3768b17fb545515f2.

jake-b commented 9 years ago

Thanks for this. I was adding manually before the build, because I was too lazy to figure out where the lemon template was. Builds fine now.

NSBrianWard commented 9 years ago

Ha! I knew something brewy was going on. ;) Thanks!