curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: libcurl - MacOS 10.14 ...

From: Jeroen Ooms via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 12 Nov 2019 21:50:03 +0100

On Tue, Nov 12, 2019 at 9:37 PM Jeroen Ooms <jeroenooms_at_gmail.com> wrote:
>
> On Tue, Nov 12, 2019 at 8:51 PM Daniel Stenberg via curl-library
> <curl-library_at_cool.haxx.se> wrote:
> >
> > On Tue, 12 Nov 2019, Bryan O'Brien via curl-library wrote:
> >
> > > Courtesy of curl_version(), heres the version I’m using
> > >
> > > libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
> > >
> > > If anyone is aware of a more recent version, or can point me towards some
> > > newbie build instructions, I’d appreciate it.
> >
> > You build and install libcurl the same way on mac as on any *nix:
> >
> > $ ./configure
> > $ make
> > $ make test (optional)
> > $ make install
> >
> > For more details, see https://curl.haxx.se/docs/install.html
> >
> > There are also package managers for mac as well, like homebrew, but it's not
> > clear to be if they offer libcurl installs (like with headers etc).
>
> Yes they do. There are two versions: one build with macos secure
> transport, and one build with openssl+nghttp2:
>
> - https://github.com/homebrew/homebrew-core/blob/master/Formula/curl.rb
> - https://github.com/homebrew/homebrew-core/blob/master/Formula/curl-openssl.rb
>
> Because this homebrew package would conflict with a native macos
> version of curl, it is not automatically linked into /usr/local, so
> you need to set PKG_CONFIG_PATH. For example use this to build the
> crawler example against the latest curl with http2 support:

Sorry there was a typo in my previous email. PKG_CONFIG_PATH has to be
set to the location of "libcurl.pc", which is inside lib/pkgconfig. So
the full code is this:

   brew install curl-openssl pkgconfig
   curl -OL https://github.com/curl/curl/raw/master/docs/examples/crawler.c
   export PKG_CONFIG_PATH="/usr/local/opt/curl-openssl/lib/pkgconfig"
   cc -o crawler crawler.c $(pkg-config --cflags --libs libxml-2.0 libcurl)

Use otool -L to confirm that executable links against the correct
libcurl shared library:

  otool -L crawler

# crawler:
# /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current
version 10.9.0)
# /usr/local/opt/curl-openssl/lib/libcurl.4.dylib (compatibility
version 11.0.0, current version 11.0.0)
# /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1252.250.1)

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-11-12