Discussion:
Recent MingW installation can not build Scintilla
Neil Hodgson
2013-08-24 04:42:59 UTC
Permalink
The main MingW system has been updated recently with a different installer and newer headers (1). Headers for Direct2D and DirectWrite are still not included although they are by the MingW64 project. Scintilla has relied on the symbol NTDDI_WIN7 as an indication that a sufficiently recent SDK was in use to enable Direct2D code but the new version of MingW has defined NTDDI_WIN7.

I'd like to update the make file to check whether the headers are available by trying to compile the CheckD2D.cxx file as is done by the nmake file but haven't been able to work out how to do that in GNU make. In nmake its

!IF [cl -c -nologo CheckD2D.cxx >NUL:]
CXXFLAGS=$(CXXFLAGS) -DDISABLE_D2D
!MESSAGE Direct2D is not available
!ENDIF

To ensure that Scintilla can still be built with new downloads from MingW, the -DDISABLE_D2D can be hard-coded into the compile flags. This means that Direct2D will be disabled even with MingW64.

(1) http://sourceforge.net/p/mingw/mingw-org-wsl/ci/4.0.0/tree/NEWS

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-08-25 03:36:11 UTC
Permalink
Post by Neil Hodgson
To ensure that Scintilla can still be built with new downloads from MingW, the -DDISABLE_D2D can be hard-coded into the compile flags. This means that Direct2D will be disabled even with MingW64.
This has now been pushed. Those that want to have Direct2D support while building with MingW variants such as MingW64 should edit the makefile.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Gur Stavi
2013-09-02 16:07:24 UTC
Permalink
Try:

HAS_D2D := $(shell cl -c -nologo CheckD2D.cxx>NUL 2>&1; echo -n $$?)

HAS_D2D will have the exit code of gcc. 0 if compilation is ok.

Gur
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-03 09:50:44 UTC
Permalink
Post by Gur Stavi
HAS_D2D := $(shell cl -c -nologo CheckD2D.cxx>NUL 2>&1; echo -n $$?)
HAS_D2D will have the exit code of gcc. 0 if compilation is ok.
$$? isn't available on Windows using the normal CMD shell.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Matthew Brush
2013-09-03 11:28:06 UTC
Permalink
Post by Neil Hodgson
Post by Gur Stavi
HAS_D2D := $(shell cl -c -nologo CheckD2D.cxx>NUL 2>&1; echo -n $$?)
HAS_D2D will have the exit code of gcc. 0 if compilation is ok.
$$? isn't available on Windows using the normal CMD shell.
You might get away with something like this (untested):

ifneq($(shell cl -c -nologo CheckD2D.cxx >NUL 2>&1),)
CXXFLAGS += -DDISABLE_D2D
endif

Although it assumes the compiler only outputs to stderr in case of
actual error, and not for any warnings or other reasons.

Cheers,
Matthew Brush
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-03 13:44:47 UTC
Permalink
Post by Matthew Brush
ifneq($(shell cl -c -nologo CheckD2D.cxx >NUL 2>&1),)
CXXFLAGS += -DDISABLE_D2D
endif
Although it assumes the compiler only outputs to stderr in case of actual error, and not for any warnings or other reasons.
That didn't quite work. The >NUL sent the redirected stderr to NUL. The ifneq syntax had to be changed a little. Since its for MinGW, the cl becomes g++.

This appeared to work but I don't know if it will work for cygwin or other cases:

ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
CXXFLAGS += -DDISABLE_D2D
endif

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-04 02:03:33 UTC
Permalink
Pushed a slightly different change as
http://sourceforge.net/p/scintilla/code/ci/1667f38d4fa377792ae27535bacf346e13dac279/

The test
ifneq "$(shell g++ -c CheckD2D.cxx 2>&1)" ""
may be sensitive to output formatting, in which case there may need to be some calls to $(strip) or $(subst).

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Gur Stavi
2013-09-04 13:22:59 UTC
Permalink
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF"
text="#000000">
The solution assumes that successful compilation is completely
silent. It will fail if there is ever a warning or if a different
compiler flavor prints additional information like logo or file
name. It would have been better to rely on the return code.<br>
Still haven't figured out what shell is being used by the make but
one of the following should work:<br>
<br>
For command prompt:<br>
ifneq "$(shell g++ -c CheckD2D.cxx &gt; NUL 2&gt;&amp;1 &amp;&amp;
echo 1)" "1"<br>
<br>
For bin/sh<br>
ifneq "$(shell g++ -c CheckD2D.cxx &amp;&gt; /dev/null &amp;&amp;
echo 1)" "1"<br>
<br>
Gur<br>
<br>
<div class="moz-cite-prefix">On 4/9/2013 5:03, Neil Hodgson wrote:<br>
</div>
<blockquote cite="mid:2CFBFA5F-5E52-4B78-8FE5-***@me.com"
type="cite">
<pre wrap=""> Pushed a slightly different change as
<a class="moz-txt-link-freetext" href="http://sourceforge.net/p/scintilla/code/ci/1667f38d4fa377792ae27535bacf346e13dac279/">http://sourceforge.net/p/scintilla/code/ci/1667f38d4fa377792ae27535bacf346e13dac279/</a>

The test
ifneq "$(shell g++ -c CheckD2D.cxx 2&gt;&amp;1)" ""
may be sensitive to output formatting, in which case there may need to be some calls to $(strip) or $(subst).

Neil

</pre>
</blockquote>
<br>
</body>
</html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &quot;scintilla-interest&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.<br />
To post to this group, send email to scintilla-***@googlegroups.com.<br />
Visit this group at <a href="http://groups.google.com/group/scintilla-interest">http://groups.google.com/group/scintilla-interest</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
Neil Hodgson
2013-09-04 23:30:54 UTC
Permalink
The solution assumes that successful compilation is completely silent. It will fail if there is ever a warning or if a different compiler flavor prints additional information like logo or file name.
While it could be a problem, both gcc and clang are completely silent when successful on this file. No warnings should occur for headers provided by the compiler distribution. If compilers show additional text by default then that'll have to be fixed.
It would have been better to rely on the return code.
Yes, if this can be done portably.
ifneq "$(shell g++ -c CheckD2D.cxx > NUL 2>&1 && echo 1)" "1"
For bin/sh
ifneq "$(shell g++ -c CheckD2D.cxx &> /dev/null && echo 1)" "1"
That's the problem - there is only a limited set of features that are portable between Windows and Unix shells. 2>&1 is but &> and the name of the null device aren't. It might be possible to try both but that produces strange texts with cmd.exe returning "&& was unexpected at this time." for the sh version.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Gur Stavi
2013-09-03 13:08:55 UTC
Permalink
I use cygwin and MinGW from a command prompt and they always spawn bin/sh
shell for their commands?
Do you override the SHELL parameter explicitly?


$$? isn't available on Windows using the normal CMD shell.
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-09-03 13:32:20 UTC
Permalink
I use cygwin and MinGW from a command prompt and they always spawn bin/sh shell for their commands?
Do you override the SHELL parameter explicitly?
I don't use cygwin.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...