Subject: Re: bug#9960: Compiling Emacs trunk with MSVC

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Nov 2011 21:33:51 +0200

> From: Christoph Scholtes <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 05 Nov 2011 12:20:22 -0600
> 
> nmake does not like the relative path invocation of make-docfile with
> forward slashes (makefile.w32-in, l.235)
> 
> "../lib-src/$(BLD)/make-docfile" -d . -g $(SOME_MACHINE_OBJECTS) $(obj) > gl-tmp

Why?? even cmd.exe is in peace with forward slashes, as long as they
are in quotes.  What is the error message? are you sure the problem is
with forward slashes, and not with something else?  If the problem is
with forward slashes, how come invocations of make-docfile and other
commands in lib-src/makefile.w32-in, which also use forward slashes,
did work?

Are you sure you are using nmake that came with the version of Studio
that you are using to compile, and not some ancient version?

> If I hardcode this to 
> 
> "..\\lib-src\\obj\\i386\\make-docfile" -d . -g $(SOME_MACHINE_OBJECTS)
> $(obj) > gl-tmp
> 
> it works. We might have to use forward slashes here and change BLD accordingly?

That way lies madness.  This worked with nmake for ages.  We cannot
possibly change all slashes in all the makefile's, I don't even know
any portable method of doing that, without breaking builds with a
Unixy shell, which we also support.

We must to get to the bottom of this problem.

> d:\devel\emacs\emacs-bzr\trunk_jenkins\src\lisp.h(2499) : error C2061: syntax er
> ror : identifier 'cons_to_signed'
> d:\devel\emacs\emacs-bzr\trunk_jenkins\src\lisp.h(2499) : error C2059: syntax er
> ror : ';'
> d:\devel\emacs\emacs-bzr\trunk_jenkins\src\lisp.h(2499) : error C2059: syntax er
> ror : 'type'

Is the problem with Lisp_Object or with intmax_t?  (You can find out
if you change each one to some standard type, like `int'.)

> emacs.c(537) : error C2059: syntax error : '<<'
> emacs.c(537) : error C2059: syntax error : 'constant'
> emacs.c(537) : error C2059: syntax error : ')'
> emacs.c(545) : error C2059: syntax error : '<<'
> emacs.c(545) : error C2059: syntax error : 'constant'
> emacs.c(545) : error C2059: syntax error : ')'
> emacs.c(1992) : error C2059: syntax error : '<<'
> emacs.c(1992) : error C2059: syntax error : 'constant'
> emacs.c(1992) : error C2059: syntax error : ')'
> emacs.c(2130) : error C2059: syntax error : '<<'
> emacs.c(2130) : error C2059: syntax error : 'constant'
> emacs.c(2130) : error C2059: syntax error : ')'
> emacs.c(2337) : error C2059: syntax error : '<<'
> emacs.c(2337) : error C2059: syntax error : 'constant'
> emacs.c(2337) : error C2059: syntax error : ')'
> emacs.c(2352) : error C2059: syntax error : '<<'
> emacs.c(2352) : error C2059: syntax error : 'constant'
> emacs.c(2352) : error C2059: syntax error : ')'

These all are about DEFUN.  The only thing I changed in the definition
provided by Fabrice was to add "static" here:

  +#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
  +   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                         \
  +   static DECL_ALIGN (struct Lisp_Subr, sname) =                       \
      ^^^^^^
Please remove the "static" part and see if that helps.

> I am starting to wonder how Fabrice ever got this to compile. Are all of
> these errors due to changes made between his original patch and the
> current trunk state?

Yes.  You now have an idea how many water goes under the bridge in one
year of Emacs development.