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

fix build for mingw32 #172

Closed
wants to merge 1 commit into from
Closed

fix build for mingw32 #172

wants to merge 1 commit into from

Conversation

aroig
Copy link

@aroig aroig commented Apr 30, 2016

Otherwise is_mingw32 is set too late and configure fails with missing
dlopen().

Otherwise is_mingw32 is set too late and configure fails with missing
dlopen().
@mgreter
Copy link
Contributor

mgreter commented May 1, 2016

Are you sure both lines need to be moved? Some info about your system would also be helpfull. We use the same pattern in other places. So I would like to know exactly if only the AS_CASE needs to be moved.

@aroig
Copy link
Author

aroig commented May 1, 2016

For my use case only the AS_CASE needs to be moved. I was compiling sassc for msys2 on Windows using the mingw compiler.

I figured that since both lines are related, it would be better to keep them together, but I admit I gave it very little thought.

If you prefer it any other way, I'm happy to force-push a different version here.

@mgreter
Copy link
Contributor

mgreter commented May 1, 2016

I need to further check this. My first try with msys2 lead to the opposite direction as your fix. I so far tried only libsass build. Needed to patch it for mingw64, but once it was working I moved the check as you did and then it started to fail. Indicating that the checks are actually also needed for mingw. But I need to further check if this is dependent on msys or not.

@aroig
Copy link
Author

aroig commented May 1, 2016

hmm... that's odd.

I've just cloned current sassc master and tried building with

$ autoreconf -i
$ ./configure --host=x86_64-pc-mingw32 --prefix=/mingw64
$ make

The configure fails as follows

[...]
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking for library containing dlopen... no
configure: error: unable to find the dlopen() function

The reason for this is clear, I think. On line 60 in configure.ac there is a test for $is_mingw32, but this variable is only defined later. So, configure does not skip the check for dlopen() as it should on mingw32. After moving those two lines, the thing builds just fine.

Anyway, current configure.ac is broken, as it uses $is_mingw32 before it is even defined. Those conditions on $is_mingw32 will always behave as in non-mingw32 systems.

@mgreter
Copy link
Contributor

mgreter commented May 1, 2016

I'm currently testing https://github.com/sass/libsass/blob/master/configure.ac. There is another fix needed for mingw64 as it now reports as mingw64. I'm pretty sure in some earlier tests I did it also reported as mingw32, but I might be wrong. Can you check #174?

As you see I removed the if for the check on top. I doesn't seem to be needed (in fact I guess that it made the build fail once I moved the check above). But I agree that the other check must be above the actual use, so that was indeed a bug.

@mgreter
Copy link
Contributor

mgreter commented May 2, 2016

Closed with #174. Thanks for the report @aroig

@mgreter mgreter closed this May 2, 2016
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