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

[libspatialite] mingw support #25881

Merged
merged 1 commit into from
Jul 27, 2022
Merged

Conversation

m-kuhn
Copy link
Contributor

@m-kuhn m-kuhn commented Jul 20, 2022

Describe the pull request

  • What does your PR fix?

    Fixes building libspatialite with MinGW. In MinGW the name of zlib is libzlib, configure hardcodes it as z, switch to whatever pkgconfig communicates.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    all, Yes

  • Does your PR follow the maintainer guide?

    Yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes

github-actions[bot]
github-actions bot previously approved these changes Jul 20, 2022
# Checks for installed libraries
AC_CHECK_LIB(sqlite3,sqlite3_prepare_v2,,AC_MSG_ERROR(['libsqlite3' is required but it doesn't seem to be installed on this system.]),-lm)
-AC_CHECK_LIB(z,inflateInit_,,AC_MSG_ERROR(['libz' is required but it doesn't seem to be installed on this system.]),-lm)
+PKG_CHECK_MODULES([ZLIB], [zlib], , AC_MSG_ERROR(['libz' is required but it doesn't seem to be installed on this system.]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the check. But probably you still need to explicitly add ZLIB_CFLAGS and ZLIB_LIBS to CFLAGS and LIBS. (AC_CHECK_LIB does it implicitly.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it easier to change AC_CHECK_LIB to AC_SEARCH_LIBS since the behavior is similar ? (https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Libraries.html)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I generally prefer pkg-config due to all the name variants, including debug suffixes, in vcpkg.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but it requires so much extra code in action-if-found

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It compiles all the way through here and has -lzlib in spatialite.pc. Is there something else to check for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dg0yt @Neumann-A Any questions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is not valid because it doesn't use the result of PKG_CHECK_MODULES on success. Check ....config.log for -lz:
-lzlib[d] is already passed via LIBS to configure - because the portfile looks for zlib.pc.
The solution is much easier then: The check can be removed entirely, given that the presence of zlib is determined by the header, and the lib is provided via LIBS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point, I'll adjust

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this autotools change myself; @Neumann-A and/or @dg0yt are you happy with @m-kuhn 's fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy. See my previous comment: we already pass the right lib via config. So we can remove the original check which finds and adds the wrong lib at least for mingw.

@JackBoosY JackBoosY added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Jul 20, 2022
github-actions[bot]
github-actions bot previously approved these changes Jul 20, 2022
@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Jul 27, 2022
@BillyONeal BillyONeal merged commit dd73b02 into microsoft:master Jul 27, 2022
@m-kuhn m-kuhn deleted the libspatialite_mingw branch July 27, 2022 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants