Coder Social home page Coder Social logo

oladas / curl-for-windows Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jcmais/curl-for-windows

0.0 0.0 0.0 27.64 MB

An unofficial mirror of the curl library with support for static linking on Windows.

C 24.64% Python 2.77% Makefile 0.01% Assembly 42.62% C++ 0.17% Shell 0.07% Perl 29.66% eC 0.01% Emacs Lisp 0.01% DIGITAL Command Language 0.01% M4 0.04% Objective-C 0.01% Module Management System 0.01% CMake 0.01% Batchfile 0.01% Dockerfile 0.01% sed 0.01%

curl-for-windows's Introduction

Curl for windows

Curl is a command line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. Find out how to install Curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software.

About

This is repo is mostly being used by the Node.js native addon node-libcurl

This was originally a fork of the project https://github.com/peters/curl-for-windows

This repository is a collection of dependencies that curl need to build successfully. Each submodule tries to track the latest known git release tag. When not using a git submodule for the dependency, the direct source code was added to this repository, this is the case for nghttp2, openssl, and cares, for these, their .gyp files were retrieved from the Node.js source code.

Both x86 and x64 builds are supported.

libcurl dependencies

Prerequisites

Obtaining prerequisites

$ git clone https://github.com/JCMais/curl-for-windows.git
$ git submodule update --init --recursive

Configuration options

$ python configure.py --help
Usage: configure.py [options]

Options:
  -h, --help            show this help message and exit
  --toolchain=TOOLCHAIN
                        msvs toolchain to build for. [default: auto]
  --target-arch=TARGET_ARCH
                        CPU architecture to build for. [default: x86]

Generate project files

$ python configure.py 

Open respective curl.sln found in out folder ;)

Simple curl example

If you are new to curl you can checkout the example project found in curl.sln or you can view additional the examples in the official curl repository.

Linking with libcurl (without gyp)

  • Add preprocessor flag

    • CURL_STATICLIB
  • Add include directory

    • path/to/curl/include
  • Add additional library search directory

    • path/to/out/Debug|Release/obj
  • Link with the following libraries

    • libcurl.lib
    • openssl.lib
    • libssh2.lib
    • brotli.lib
    • cares.lib
    • zlib.lib
    • wsock32.lib
    • wldap32.lib
    • ws2_32.lib

The following libraries are available here, but not being used (yet):

  • nghttp3
  • ngtcp2

By now you should have sweet, statically linked, CURL! ;)

Contributing

Upgrading libcurl

  1. Download the zip archive from the latest tag from the curl official repo https://github.com/curl/curl
  2. Compare the contents of the extracted sources with the ones at the curl folder on this repo. (I recommend bcompare for that or any other tool that can compare folder contents)
  3. Make necessary changes to the curl.gyp file.

    For example, if a lib/src file was removed/added on the new version, it must be removed/added on the curl.gyp file at the specific target

  4. After changes are made, cd into the curl directory and run:
    $ git fetch origin
    $ git checkout <curl-tag-version>

Upgrading libssh2

Same than libcurl

Upgrading nghttp2

nghttp2 is based on Node.js version: https://github.com/nodejs/node/blob/v12.16.1/deps/nghttp2

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. on nghttp2/nghttp2.gyp:
    1. Comment:
          'msvs_settings': {
            'VCCLCompilerTool': {
              'CompileAs': '1'
            },
          },
      
  3. done.

Upgrading OpenSSL

OpenSSL is based on Node.js version: https://github.com/nodejs/node/blob/v10.15.0/deps/openssl

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. on openssl/openssl.gyp:
    1. Add 'experimental_quic%': '0', to the list of variables.
  3. done.

Upgrading c-ares

c-ares is based on Node.js version: https://github.com/nodejs/node/blob/v15.0.0/deps/cares

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. done.

Upgrading brotli

brotli is based on Node.js version: https://github.com/nodejs/node/blob/v15.0.0/deps/brotli

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. done.

Upgrading nghttp3

nghttp3 is based on Node.js version: https://github.com/nodejs/node/blob/v15.0.0/deps/nghttp3

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. done.

Upgrading ngtcp2

ngtcp2 is based on Node.js version: https://github.com/nodejs/node/blob/v15.0.0/deps/ngtcp2

At the time of writing this, the upgrade process was as easy as:

  1. copy the folder over.
  2. done.

curl-for-windows's People

Contributors

peters avatar jcmais avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.