Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update INSTALL #625

Open
wants to merge 1 commit into
base: libpng16
Choose a base branch
from
Open

Update INSTALL #625

wants to merge 1 commit into from

Conversation

Forelyl
Copy link

@Forelyl Forelyl commented Oct 27, 2024

When building libpng with cmake on Windows with MinGW encounter problems due to usage of default setting of core.autocrlf on Windows. Because this errors may be found by ones who also install lib on Windows, I am proposing this change to INSTALL file, to provide support with this issue

When building libpng with cmake on Windows with MinGW encounter problems due to usage of default setting of core.autocrlf on Windows. 
Because this errors may be found by ones who also install lib on Windows, I am proposing this change to INSTALL file, to provide support with this issue
@jbowler
Copy link
Contributor

jbowler commented Oct 27, 2024

This is a general problem with cross-system source control systems. Unfortunately it cuts both ways; if the lf<->crlf auto stuff is turned off in a Windows environment patches will come in with line endings and the same problem will emerge the other way round. Ideally the source control system would not be dependent on any particular whitespace representation or indentation style etc.

This has been reported before and I think the original reporter ended up with the same fix (i.e. turning off on Windows) but similar problems including the inverse one have been seen several times.

It's not completely clear to my why it happens on Windows. I would expect awk to use <cr><lf> on Windows because that is the format of text files on Windows and I would expect the autocrlf therefore to need to be true, not false.

@Forelyl can you test this patch:

diff --git a/scripts/options.awk b/scripts/options.awk
index b74223ab7..563dd2f5e 100755
--- a/scripts/options.awk
+++ b/scripts/options.awk
@@ -29,6 +29,11 @@
 # are copied to the preprocessed file).

 BEGIN{
+   # This allows the line endings of the input file to be any combination
+   # of <CR><LF>.  Blank lines get removed but this is safe because they have
+   # no semantic interpretation.
+   RS="[\r\n][\r\n]*"
+
    out=""                       # intermediate, preprocessed, file
    pre=-1                       # preprocess (first line)
    version="libpng version unknown" # version information

Please note that the same patch would be required in the other two files scripts/*.awk; what I'm interested in is whether the build manages to build pnglibconf.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants