[DGD] DGD For MSys, mark 2

Felix A. Croes felix at dworkin.nl
Sun Jan 6 14:09:14 CET 2013


Jared Maddox <absinthdraco at gmail.com> wrote:

> At first I was wondering how this was so, since I distinctly remember
> successfully compiling it with the first AND second patches (the
> second was because the first was somewhat dubious), but then I
> remembered that I actually DO have a second Makefile variable:
> PLATFORM_DEFINES= -D_WIN32_WINNT=0x501
> This is one of the things that is added in the first patch, and
> actually originates with my previous MSys port. Some declarations in
> the windows headers won't even show up without that specific variable
> being set to either that value, or a higher one.

Your Makefiles compile with -DMSys -D_WIN32_WINNT=0x501.  To get DGD to
compile, you have to define WIN32, which your patches don't do.  If you
can compile DGD with your patches, there must either be other changes
that were not included with your patches, or MSYS has WIN32 as a
predefined macro.  Platforms are not supposed to predefine macros
without a leading underscore, and Visual Studio does not predefine it,
but who knows what MSYS does. :)


> There might be a larger set of variables that it would be wise to set,
> but that one seems to get the compilation done.
>
> Note that I'm not actually certain about specifically setting the host
> to MSys. MSys itself is distinguished with a variable called MSYSTEM,
> the value of which indicates whether you're compiling ON MSys, or ON
> MSys FOR MSys (these aren't actually the same, since MSys apparently
> adds something to better simulate a *nix environment). I ignored the
> value itself, since DGD already has code to compile for Windows.

GNU Make has the annoying feature that any environment (shell) variable
is copied as a Makefile variable.  So if someone, somewhere, has an
environment variable MSYSTEM set on a non-MSYS host, your Makefile
will break.  That is why I ignored pre-set variables and used my own
OS detection code.


> Am I using HOST correctly?

HOST is supposed to be set to a symbol that selects the platform in
dgd/src/host.h.


> What's your opinion on makeheader.win? I wanted to make that code
> somewhat modular, so that it could be adapted to e.g. Haiku, if anyone
> wanted to do that in the future. Also, I thought that it was impairing
> readability by being in the main makefile.

It's messy.  I think your patches are still far from ready for merging
into the master branch, but I've created an msys branch for them in the
DGD repository.


> I'm worried that this patch series will prevent compilation on Cygwin.
> Can you test this? I don't have Cygwin installed on my machine, and
> would prefer to not dabble in it.

All I have installed is Visual Studio 2010 Express, on which DGD compiles
without a hitch.


> Should the "HOST_OVERRIDE" switch be enough for any other *nix-ish
> platforms on Windows?

Due to the automatic import of environment variables into GNU Make,
depending on a predefined symbol is a bad idea.


> Also, any idea why comp/parser.h / comp/parser.c, host/dosfile.c /
> host/dosfile.o, and host/windgd.c / host/windgd.o don't get deleted on
> "make clean"? Did I accidentally break something?

The files parser.c and parser.h are not removed so "make clean" will not
disable compilation on a system without yacc installed.  Why the others
are not removed, I don't know.


> Anything else that I should work on for this patch series (I recall
> some of the pre-compiler stuff causing problems, but I don't want to
> deal with that yet)?

Take a look at the msys branch of the DGD repository.  It is probably
easier, for both of us, if you start to work with a proper git
repository rather than by posting patches to the mailing list.


> Incidentally, it looks like the web browsing for the mailing list is
> down (Secure Connection Failed error on Firefox). Is there somewhere
> to check for it other than your site?

The mailing list archive is not down.  The host certificate was replaced,
which is probably why Firefox gives that message.  Remove the old
certificate for www.dworkin.nl from Firefox, import the new one, and
you'll be all set.

Regards,
Felix Croes



More information about the DGD mailing list