-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
configure: looking for strcasecmp in -lresolve (sic) #770
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
Labels
Comments
Irfy
pushed a commit
to Irfy/curl
that referenced
this issue
Apr 17, 2016
These configure vars are modified in a curl-specific way but never evaluated or loaded from cache, even though they are designated as _cv_. We could either implement proper AC_CACHE_CHECKs for them, or remove them completely. Fixes curl#603 as ac_cv_func_gethostbyname is no longer clobbered, and AC_CHECK_FUNC(gethostbyname...) will no longer spuriously succeed after the first configure run with caching. `ac_cv_func_strcasecmp` is curious, see curl#770. `eval "ac_cv_func_$func=yes"` can still cause problems as it works in tandem with AC_CHECK_FUNCS and then potentially modifies its result. It would be best to rewrite this test to use a new CURL_CHECK_FUNCS macro, which works the same as AC_CHECK_FUNCS but relies on caching the values of curl_cv_func_* variables, without modifiying ac_cv_func_*.
I think that configure check worked at some point but the wrong lib name makes it seem unlikely to work at all like this. I think we can just remove that check now. |
Should I piggyback a commit removing this code to #766? |
bagder
added a commit
that referenced
this issue
Apr 18, 2016
'strncasecmp' was once provided by libresolv (no trailing e) for SunOS, but this check is broken and most likely adds nothing useful. Removing now. Reported-by: Irfan Adilovic Discussed in #770
I just pushed this change individually to master in commit fb823d2 |
Thanks! |
bagder
pushed a commit
that referenced
this issue
Apr 21, 2016
These configure vars are modified in a curl-specific way but never evaluated or loaded from cache, even though they are designated as _cv_. We could either implement proper AC_CACHE_CHECKs for them, or remove them completely. Fixes #603 as ac_cv_func_gethostbyname is no longer clobbered, and AC_CHECK_FUNC(gethostbyname...) will no longer spuriously succeed after the first configure run with caching. `ac_cv_func_strcasecmp` is curious, see #770. `eval "ac_cv_func_$func=yes"` can still cause problems as it works in tandem with AC_CHECK_FUNCS and then potentially modifies its result. It would be best to rewrite this test to use a new CURL_CHECK_FUNCS macro, which works the same as AC_CHECK_FUNCS but relies on caching the values of curl_cv_func_* variables, without modifiying ac_cv_func_*.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following code is located immediately after searching for
gethostbyname
inconfigure.ac
:There are several issues with this code:
libresolve
, onlylibresolv
strcasecmp
being searched for in a networking libraryAC_CHECK_LIB
succeeds,-lresolve
is never added toLIBS
which makes no senseI have the feeling this is some really old, untested code that was never executed, simply because(I originally confused the location ofAC_CHECK_FUNC
re-used the cached variableac_cv_func_strcasecmp
which is set earlier, in a call toCURL_CHECK_FUNC_STRCASECMP
, and which is highly likely to be "yes".CURL_CHECK_FUNC_STRCASECMP
relative to this piece of code)When
this variable is "no"AC_CHECK_FUNC
fails, assuming the library name is a typo,AC_CHECK_LIB
will never succeed and nothing will happen. WhenAC_CHECK_FUNC
succeeds, the rest is never executed and nothing will happen.The code seems to be from 1999/2000, which fits with the existence of the library
libresolv
.I have the feeling, the author meant to look for
gethostbyname
inlibresolv
, as this function is searched in multiple libraries right before this piece of code.If I'm wrong about any of this, I beg for a reference to
libresolve
and for an explanation about looking forstrcasecmp
there.If I'm right about this, I would gladly rewrite the code to look for
gethostbyname
(seems to have been inlibresolv
in 1997)The text was updated successfully, but these errors were encountered: