Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Created February 23, 2018 16:13
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shin1x1/6718b8c708c9b921b32e33084d52a75c to your computer and use it in GitHub Desktop.
Save shin1x1/6718b8c708c9b921b32e33084d52a75c to your computer and use it in GitHub Desktop.
Build curl with openssl in CentOS/RHEL/Amazon Linux
#!/bin/sh
set -eux
VERSION=7.58.0
OUTPUT=/opt/build
rm -rf ${OUTPUT}
mkdir ${OUTPUT}
yum install -y openssl-devel gcc bzip2 make
curl -O https://curl.haxx.se/download/curl-${VERSION}.tar.bz2
tar xvf curl-${VERSION}.tar.bz2
cd curl-${VERSION}
./configure --prefix=${OUTPUT} \
--with-ssl \
--enable-libcurl-option \
--enable-static=no \
--disable-manual
make
make install-strip
cd ../
rm -rf curl-${VERSION}*
rm -rf ${OUTPUT}/bin/curl-config
rm -rf ${OUTPUT}/include
rm ${OUTPUT}/lib/libcurl.la
rm -rf ${OUTPUT}/lib/pkgconfig
rm -rf ${OUTPUT}/share
@shin1x1
Copy link
Author

shin1x1 commented Feb 23, 2018

CentOS 7.x

$ docker run -v `pwd`:/opt -w /opt centos:7 /bin/sh build_curl.sh
$ find build
build
build/bin
build/bin/curl
build/lib
build/lib/libcurl.so.4
build/lib/libcurl.so.4.5.0
build/lib/libcurl.so

Amazon Linux 2017.09

$ docker run -v `pwd`:/opt -w /opt amazonlinux:2017.09 /bin/sh build_curl.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment