如何解决lib_curl 依赖与 autoconf
在我的 autoconf 中,我们需要添加 CURL 库的依赖项。
我们正在使用 curl 存储库中提供的这个 m4 文件来添加依赖宏:https://github.com/curl/curl/blob/master/docs/libcurl/libcurl.m4
在 configure.ac 中,我们使用这个 end 宏来检查 libcurl,
LIBCURL_CHECK_CONFIG([],AC_MSG_FAILURE([LibCurl not found it is must for this install]))
然而,生成的配置脚本在执行时会出现以下错误,
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
checking for gawk... (cached) gawk
checking for curl-config... /usr/bin/curl-config
checking for the version of libcurl... 7.68.0
./configure: command substitution: line 5176: syntax error near unexpected token `}'
./configure: command substitution: line 5176: `$as_echo "$as_me: error: in `$ac_pwd':" >&2;}'
./configure: line 5177: test: -gt: unary operator expected
./configure: line 5201: test: -eq: unary operator expected
任何可能出错的指针,因为代码中没有什么特别的,而是一个简单的 helloworld c
解决方法
忘记贴我们找到的解决方案了,LibCURL检查的正确语法如下,使用后解决了问题
LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION],[MINIMUM-VERSION],[ACTION-IF-YES],[ACTION-IF-NO])
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。