-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Conversation
ports/libspatialite/mingw.patch
Outdated
# 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.])) |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
051f685
to
2fd463b
Compare
2fd463b
to
f9ffcb8
Compare
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 asz
, 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