Ubuntu 22.04にlibcurlのインストールツールcurl-configをインストールする
環境
OSバージョンを確認します
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
操作方法
1.curlバージョンを確認します
# curl --version curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13 Release-Date: 2022-01-05 Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
2.システムパッケージを更新します
# sudo apt update
3.libcurl4-openssl-devをインストールします
# sudo apt install libcurl4-openssl-dev
4.libcurlのバージョンを確認します
# curl-config --version libcurl 7.81.0
5.ヘルプコマンドを確認します
# curl-config --help Usage: curl-config [OPTION] Available values for OPTION include: --built-shared says 'yes' if libcurl was built shared --ca ca bundle install path --cc compiler --cflags pre-processor and compiler flags --checkfor [version] check for (lib)curl of the specified version --configure the arguments given to configure when building curl --features newline separated list of enabled features --help display this help and exit --libs library linking information --prefix curl install prefix --protocols newline separated list of enabled protocols --ssl-backends output the SSL backends libcurl was built to support --static-libs static libcurl library linking information --version output version information --vernum output the version information as a number (hexadecimal)
6.libcurlのビルド時の設定を確認します
# curl-config --configure '--build='`dpkg-architecture -qDEB_BUILD_GNU_TYPE` '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=/usr/lib/'`dpkg-architecture -qDEB_HOST_MULTIARCH` '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-symbol-hiding' '--enable-versioned-symbols' '--enable-threaded-resolver' '--with-lber-lib=lber' '--with-gssapi=/usr' '--with-nghttp2' '--includedir=/usr/include/'`dpkg-architecture -qDEB_HOST_MULTIARCH` '--with-zsh-functions-dir=/usr/share/zsh/vendor-completions' '--with-libssh' '--without-libssh2' '--with-openssl' '--with-ca-path=/etc/ssl/certs' '--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt' 'build_alias='`dpkg-architecture -qDEB_BUILD_GNU_TYPE` 'CFLAGS=-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'