-
Notifications
You must be signed in to change notification settings - Fork 3.2k
add SWOOLE_ODBC_LIBS variable to config.m4 #5847
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
Conversation
…link against a single library
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.
Pull Request Overview
This PR adds support for specifying custom ODBC library linking flags through a new SWOOLE_ODBC_LIBS
environment variable to address linking issues when statically compiling ODBC libraries with additional dependencies like libiconv.
- Introduces optional
SWOOLE_ODBC_LIBS
variable to specify custom linking flags for ODBC - Refactors library checking from
PHP_CHECK_LIBRARY
toAC_LINK_IFELSE
for better compatibility with custom library configurations - Preserves existing behavior when
SWOOLE_ODBC_LIBS
is not set
Comments suppressed due to low confidence (1)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
config.m4
Outdated
PHP_CHECK_LIBRARY($pdo_odbc_def_lib, SQLAllocHandle, | ||
[], [ | ||
AC_MSG_ERROR([ | ||
save_LIBS="$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.
The save_LIBS
should be changed to uppercase
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5847 +/- ##
==========================================
- Coverage 86.15% 86.13% -0.03%
==========================================
Files 109 109
Lines 16820 16820
Branches 2975 2975
==========================================
- Hits 14492 14488 -4
- Misses 2328 2332 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Background: when statically compiling libodbc.a with libiconv.a, linking against only libodbc.a leads to unresolved external symbols to libiconv_* functions.
Here we add an optional SWOOLE_ODBC_LIBC variable if the odbc library needs more than to link against a single library.
Now
./configure --enable-swoole-odbc=unixodbc,/path/to/unixodbc SWOOLE_ODBC_LIBS="-lodbc -liconv"
succeeds.Feel free to change this to a better way if you can think of one! crazywhalecc/static-php-cli#864