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 non-linux architectures but still glibc-based #9877

Merged
merged 1 commit into from Oct 30, 2017

Conversation

mapreri
Copy link
Contributor

@mapreri mapreri commented Oct 17, 2017

Exampls of these are gnu/kfreebsd and gnu/hurd, both available as
unofficial Debian ports.

They don't define __linux__ (as they are non-linux…) but still define
__GLIBC__, so check on that.

Exampls of these are gnu/kfreebsd and gnu/hurd, both available as
unofficial Debian ports.

They don't define __linux__ (as they are non-linux…) but still define
__GLIBC__, so check on that.

Signed-off-by: Mattia Rizzolo <mattia@mapreri.org>
@alalek
Copy link
Member

alalek commented Oct 18, 2017

Does this really robust solution? For example, MinGW uses GLIBC/GLIBCXX internally, but we don't want to call "sysconf" in this case.

@mapreri
Copy link
Contributor Author

mapreri commented Oct 18, 2017

uhh, no idea really. I'm not a windows dev at all, and know next to nothing about it.
But I see a windows build on your CI, doesn't that cover what you just said?

@alalek
Copy link
Member

alalek commented Oct 18, 2017

We don't have MinGW builds actually (we test more native way: MSVS)

@vpisarev
Copy link
Contributor

@mapreri, thank you for the patch! FreeBSD flavors seem to be handled already. For HURD you can use more specific GNU macro, which will be consistent with other OS'es, such as Linux (we use linux), Mac (we use APPLE) etc.

@mapreri
Copy link
Contributor Author

mapreri commented Oct 27, 2017

@vpisarev

FreeBSD flavors seem to be handled already

Note that here I'm talking about kFreeBSD, which does not define __FreeBSD__ (besides, FreeBSD doesn't use GLIBC). In kFreeBSD __FreeBSD_kernel__ is defined though.

For HURD you can use more specific __GNU__ macro

Yes, __GNU__ would work great for Hurd, but wouldn't cover our (admittedly weird) kFreeBSD case.

@vpisarev
Copy link
Contributor

@mapreri, ok, I see. @mshabunin checked this with MinGW and seems to work well. Let's put it in 👍

@vpisarev vpisarev assigned vpisarev and unassigned mshabunin Oct 30, 2017
@mapreri
Copy link
Contributor Author

mapreri commented Oct 30, 2017

Great, thank you!

If it turns out this breaks some other arch/system combination, feel free to ping me to see about solving it differently :)

@opencv-pushbot opencv-pushbot merged commit d026d7d into opencv:master Oct 30, 2017
opencv-pushbot pushed a commit that referenced this pull request Oct 30, 2017
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.

None yet

5 participants