「curl-config」-

  LINUX MANUAL PAGES

获取libcurl的安装信息

命令语法格式

curl-config [options]

命令描述

命令curl-config显示有关curl和libcurl安装的信息。

命令支持的选项及含义

–ca Displays the built-in path to the CA cert bundle this libcurl uses.

–cc Displays the compiler used to build libcurl.

–cflags
Set of compiler options (CFLAGS) to use when compiling files that use libcurl. Currently that is only the include path to the

curl include files.

–checkfor [version]
Specify the oldest possible libcurl version string you want, and this script will return 0 if the current installation is new

enough or it returns 1 and outputs a text saying that the current version is not new enough. (Added in 7.15.4)

–configure
Displays the arguments given to configure when building curl.

–feature
Lists what particular main features the installed libcurl was built with. At the time of writing, this list may include SSL,

KRB4 or IPv6. Do not assume any particular order. The keywords will be separated by newlines. There may be none, one, or sev‐

eral keywords in the list.

–help Displays the available options.

–libs Shows the complete set of libs and other linker options you will need in order to link your application with libcurl.

–prefix
This is the prefix used when libcurl was installed. Libcurl is then installed in $prefix/lib and its header files are installed

in $prefix/include and so on. The prefix is set with “configure –prefix”.

–protocols
Lists what particular protocols the installed libcurl was built to support. At the time of writing, this list may include HTTP,

HTTPS, FTP, FTPS, FILE, TELNET, LDAP, DICT. Do not assume any particular order. The protocols will be listed using uppercase

and are separated by newlines. There may be none, one, or several protocols in the list. (Added in 7.13.0)

–ssl-backends
Lists the SSL backends that were enabled when libcurl was built. It might be no, one or several names. If more than one name,

they will appear comma-separated. (Added in 7.58.0)

–static-libs
Shows the complete set of libs and other linker options you will need in order to link your application with libcurl stati‐

cally. (Added in 7.17.1)

–version
Outputs version information about the installed libcurl.

–vernum
Outputs version information about the installed libcurl, in numerical mode. This outputs the version number, in hexadecimal,

with 8 bits for each part; major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and libcurl 12.13.14 would appear

as 0c0d0e… Note that the initial zero might be omitted. (This option was broken in the 7.15.0 release.)

使用示例

What linker options do I need when I link with libcurl?

$ curl-config –libs

What compiler options do I need when I compile using libcurl functions?

$ curl-config –cflags

How do I know if libcurl was built with SSL support?

$ curl-config –feature | grep SSL

What’s the installed libcurl version?

$ curl-config –version

How do I build a single file with a one-line command?

$ `curl-config –cc –cflags` -o example example.c `curl-config –libs`

相关手册

curl(1)

参考文献

  • man 1 curl-config, Version 7.60.0-2

更新日志

  • 08/12/2018 创建文章