tinyos / nesc

Master nesc repository
GNU General Public License v2.0
100 stars 53 forks source link

Compile on Windows with Cygwin #12

Closed bradjc closed 10 years ago

bradjc commented 11 years ago

Is there a trick to getting nesC to compile with Cygwin? When I try I first get errors in the create AST files step:

cd . && emacs  -batch -load build-types.el AST nodetypes.def 42
Loading /home/Brad/git/nesc/src/build-basics.el (source)...
(lambda (attr) ...) quoted with ' rather than with #'
(lambda (field-name) ...) quoted with ' rather than with #'
Loading /home/Brad/git/nesc/src/nodetypes.def...
Unknown type declaration in node error_decl
Unknown type tag_ref in node attribute_ref
Unknown type tag_ref in node enum_ref
Unknown type statement in node error_stmt
Unknown type conditional_stmt in node while_stmt
Unknown type conditional_stmt in node dowhile_stmt
Unknown type expression in node error_expr
Unknown type binary in node array_ref
Unknown type unary in node dereference
Unknown type unary in node extension_expr
Unknown type unary in node sizeof_expr
Unknown type unary in node alignof_expr
Unknown type unary in node realpart
Unknown type unary in node imagpart
Unknown type unary in node address_of
Unknown type unary in node unary_minus
Unknown type unary in node unary_plus
Unknown type unary in node conjugate
Unknown type unary in node bitnot
Unknown type unary in node not
Unknown type increment in node preincrement
Unknown type increment in node predecrement
Unknown type increment in node postincrement
Unknown type increment in node postdecrement
Unknown type binary in node plus
Unknown type binary in node minus
Unknown type binary in node times
Unknown type binary in node divide
Unknown type binary in node modulo
Unknown type binary in node lshift
Unknown type binary in node rshift
Unknown type comparison in node leq
Unknown type comparison in node geq
Unknown type comparison in node lt
Unknown type comparison in node gt
Unknown type comparison in node eq
Unknown type comparison in node ne
Unknown type binary in node bitand
Unknown type binary in node bitor
Unknown type binary in node bitxor
Unknown type binary in node andand
Unknown type binary in node oror
Unknown type assignment in node assign
Unknown type assignment in node plus_assign
Unknown type assignment in node minus_assign
Unknown type assignment in node times_assign
Unknown type assignment in node divide_assign
Unknown type assignment in node modulo_assign
Unknown type assignment in node lshift_assign
Unknown type assignment in node rshift_assign
Unknown type assignment in node bitand_assign
Unknown type assignment in node bitor_assign
Unknown type assignment in node bitxor_assign
Unknown type connection in node rp_connection
Unknown type connection in node eq_connection
Unknown type struct_ref in node nx_struct_ref
Unknown type union_ref in node nx_union_ref
Unknown type gcc_attribute in node target_attribute
Loading cc-langs...
Saving file /home/Brad/git/nesc/src/AST_types.h...
Loading vc-git...
Wrote /home/Brad/git/nesc/src/AST_types.h
(lambda (field-name) ...) quoted with ' rather than with #'
Saving file /home/Brad/git/nesc/src/AST_defs.h...
Wrote /home/Brad/git/nesc/src/AST_defs.h
Saving file /home/Brad/git/nesc/src/AST_types.c...
Wrote /home/Brad/git/nesc/src/AST_types.c

This then causes bad files to be generated. For instance AST_types.h contains:

typedef enum {
  kind_error_decl = nil,
  postkind_error_decl = nil,
  kind_attribute_ref = nil,
  postkind_attribute_ref = nil,
  kind_enum_ref = nil,
...

I haven't been able to find what is different between these steps on Linux and Cygwin. Compiling nescc from source is relevant because it seems the way msp430-gcc handles flags changed, but so did the way nescc uses environment variables, and I can't build apps from tinyos-main using the nescc 1.3.1 rpm. I tried on two different Windows installs with Cygwin and got the same errors.

bradjc commented 11 years ago

Aha! It seems that the errors are due to emacs version 24.3.2. I downloaded emacs 24.2.1 and it builds without errors. I'm not sure what changed; it could be a change in the lisp parsing or a bug in emacs. Also, I'm not sure if it works with 24.3.2 on Ubuntu.

bradjc commented 11 years ago

I just confirmed that nesC will not compile with emacs 24.3.* on Ubuntu.

ppannuto commented 10 years ago

I just got bit by this again setting up a new machine. Can someone with more knowledge of what's happening here ( @dgay42 ?) look into this? I imagine it will only continue to be a problem and it's not good if no modern system can build nesc...

dgay42 commented 10 years ago

Should be fixed by https://github.com/tinyos/nesc/commit/da4a54897562f030dc9dfcd7f9942f6a9e79785e