Code Monkey home page Code Monkey logo

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 repository is a collection of submodules (dependencies) that curl need to build successfully. Each submodule tracks the latest known git release tag. In order to make this easy to maintain i converted the buildsystem to GYP. Please note that this is not a FORK and no patches has been applied or sent upstream.

By following the tutorial below, you should be able build a working, statically linked version of the latest libcurl.

Both x86 and x64 builds are supported.

Happy linking ;)

Download prebuilt version of curl

Download available for your convenience over at SourceForge which also includes the static libraries.

Obtaining a free copy of visual studio

If you do not have a visual studio license you can download Visual Studio 2013 Express edition for free.

Curl dependencies

Prerequisites

Obtaining prerequisites

$ git clone https://github.com/peters/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
    • zlib.lib
    • wsock32.lib
    • wldap32.lib
    • ws2_32.lib

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

curl-for-windows's People

Contributors

peters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

curl-for-windows's Issues

Tried to run configure

I did the recursive pull, installed Python 2.7.x (latest) and got this when I ran the scripts:

  File "C:\Python27\lib\multiprocessing\forking.py", line 358, in get_command_line
            Attempt to start a new process before the current process
            has finished its bootstrapping phase.

            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:

                if __name__ == '__main__':
                    freeze_support()
                    ...

            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.
is not going to be frozen to produce a Windows executable.''')
RuntimeError:
            Attempt to start a new process before the current process
            has finished its bootstrapping phase.

            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:

                if __name__ == '__main__':
                    freeze_support()
                    ...

            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 495, in prepare
    '__parents_main__', file, path_name, etc
  File "C:\Users\Robin\Documents\curl-for-windows\configure.py", line 115, in <module>
    run_gyp(gyp_args)
  File "C:\Users\Robin\Documents\curl-for-windows\configure.py", line 101, in run_gyp
    rc = gyp.main(args)
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 525, in main
    return gyp_main(args)
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 501, in gyp_main
    params, options.check, options.circular_check)
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 129, in Load
Traceback (most recent call last):
      File "<string>", line 1, in <module>
params['parallel'], params['root_targets'])
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\input.py", line 2730, in Load
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 495, in prepare
    '__parents_main__', file, path_name, etc
  File "C:\Users\Robin\Documents\curl-for-windows\configure.py", line 115, in <module>
    check, generator_input_info)
      File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\input.py", line 596, in LoadTargetBuildFilesParallel
run_gyp(gyp_args)
  File "C:\Users\Robin\Documents\curl-for-windows\configure.py", line 101, in run_gyp
    parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count())
      File "C:\Python27\lib\multiprocessing\__init__.py", line 232, in Pool
rc = gyp.main(args)
      File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 525, in main
return Pool(processes, initializer, initargs, maxtasksperchild)
  File "C:\Python27\lib\multiprocessing\pool.py", line 159, in __init__
    self._repopulate_pool()
  File "C:\Python27\lib\multiprocessing\pool.py", line 223, in _repopulate_pool
        return gyp_main(args)
w.start()
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 501, in gyp_main
  File "C:\Python27\lib\multiprocessing\process.py", line 130, in start
        params, options.check, options.circular_check)
self._popen = Popen(self)
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\__init__.py", line 129, in Load
  File "C:\Python27\lib\multiprocessing\forking.py", line 258, in __init__
    params['parallel'], params['root_targets'])
      File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\input.py", line 2730, in Load
cmd = get_command_line() + [rhandle]
  File "C:\Python27\lib\multiprocessing\forking.py", line 358, in get_command_line
    check, generator_input_info)
  File "C:\Users\Robin\Documents\curl-for-windows\build\gyp\pylib\gyp\input.py", line 596, in LoadTargetBuildFilesParallel
    is not going to be frozen to produce a Windows executable.''')
    RuntimeErrorparallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count())
:   File "C:\Python27\lib\multiprocessing\__init__.py", line 232, in Pool

                Attempt to start a new process before the current process
            has finished its bootstrapping phase.

            This probably means that you are on Windows and you have
            forgotten to use the proper idiom in the main module:

                if __name__ == '__main__':
                    freeze_support()
                    ...

            The "freeze_support()" line can be omitted if the program
            is not going to be frozen to produce a Windows executable.return Pool(processes, initializer, initargs, maxtasksperchild)

I'm not a python expert to know what to do here... FYI - VS2013 on Win8.1

Minor comment on the readme

Hi, big fan of your work, really useful :)

Minor comment on the readme, wondering if you could link to Visual Studio Community Edition as opposed to the express edition? No big deal of course, thanks for the project ๐Ÿ‘

Just FYI: full attempted build under git shell, which dies with 'Error running GYP'

[This is the behaviour when I try to download and build from github on Windows 7.
I'll debug GYP next and add my comments here...]

Windows PowerShell

Copyright (C) 2009 Microsoft Corporation. All rights reserved.

Identity added: C:\Users\davidc.ssh\id_rsa (C:\Users\davidc.ssh\id_rsa)

C:\Users\davidc\Documents\GitHub> ls

Directory: C:\Users\davidc\Documents\GitHub

Mode LastWriteTime Length Name


d---- 12/12/2013 3:37 PM source-sdk-2013

C:\Users\davidc\Documents\GitHub> git clone https://github.com/peters/curl-for-w

indows.git

Cloning into 'curl-for-windows'...

remote: Reusing existing pack: 2806, done.

emote: Total 2806 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (2806/2806), 5.56 MiB | 4.56 MiB/s, done.

Resolving deltas: 100% (766/766), done.

Checking connectivity... done

Checking out files: 100% (2423/2423), done.

C:\Users\davidc\Documents\GitHub> cd curl*

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> git submodule update

--init --recursive

Submodule 'build/gyp' (git://github.com/svn2github/gyp.git) registered for path

'build/gyp'

Submodule 'curl' (git://github.com/bagder/curl.git) registered for path 'curl'

Submodule 'libssh2' (git://git.libssh2.org/libssh2.git) registered for path 'lib

ssh2'

Submodule 'zlib' (https://github.com/madler/zlib) registered for path 'zlib'

Cloning into 'build/gyp'...

remote: Reusing existing pack: 14591, done.

remote: Total 14591 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (14591/14591), 11.21 MiB | 2.62 MiB/s, done.

Resolving deltas: 100% (7795/7795), done.

Checking connectivity... done

Submodule path 'build/gyp': checked out '0203b47450704863c671bcfcfe53405e1b9f6f0

2'

Cloning into 'curl'...

remote: Reusing existing pack: 97079, done.

remote: Counting objects: 93, done.

remote: Compressing objects: 89% (83/93) eceiving objects: 0% (1/97172)

remote: Compressing objects: 100% (93/93), done.

remote: Total 97172 (delta 45), reused 0 (delta 0)

Receiving objects: 100% (97172/97172), 23.35 MiB | 1.74 MiB/s, done.

Resolving deltas: 100% (75339/75339), done.

Checking connectivity... done

Submodule path 'curl': checked out '2bf90d071016e279796e789f0ac223d635671a41'

Cloning into 'libssh2'...

remote: Counting objects: 8611, done.

remote: Compressing objects: 100% (4156/4156), done.

remote: Total 8611 (delta 6362), reused 5893 (delta 4380)

Receiving objects: 100% (8611/8611), 1.71 MiB | 1024.00 KiB/s, done.

Resolving deltas: 100% (6362/6362), done.

Checking connectivity... done

Submodule path 'libssh2': checked out 'f1cfa55b6064ba18fc0005713ed790da579361b5'

Cloning into 'zlib'...

remote: Reusing existing pack: 4194, done.

Windows PowerShell

Copyright (C) 2009 Microsoft Corporation. All rights reserved.

Identity added: C:\Users\davidc.ssh\id_rsa (C:\Users\davidc.ssh\id_rsa)

C:\Users\davidc\Documents\GitHub> ls

Directory: C:\Users\davidc\Documents\GitHub

Mode LastWriteTime Length Name


d---- 12/12/2013 3:37 PM source-sdk-2013

C:\Users\davidc\Documents\GitHub> git clone https://github.com/peters/curl-for-w

indows.git

Cloning into 'curl-for-windows'...

remote: Reusing existing pack: 2806, done.

emote: Total 2806 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (2806/2806), 5.56 MiB | 4.56 MiB/s, done.

Resolving deltas: 100% (766/766), done.

Checking connectivity... done

Checking out files: 100% (2423/2423), done.

C:\Users\davidc\Documents\GitHub> git submodule update --init --recursive

fatal: Not a git repository (or any of the parent directories): .git

C:\Users\davidc\Documents\GitHub> ls

Directory: C:\Users\davidc\Documents\GitHub

Mode LastWriteTime Length Name


d---- 2/11/2014 1:52 PM curl-for-windows

d---- 12/12/2013 3:37 PM source-sdk-2013

C:\Users\davidc\Documents\GitHub> cd curl*

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> git submodule update

--init --recursive

Submodule 'build/gyp' (git://github.com/svn2github/gyp.git) registered for path

'build/gyp'

Submodule 'curl' (git://github.com/bagder/curl.git) registered for path 'curl'

Submodule 'libssh2' (git://git.libssh2.org/libssh2.git) registered for path 'lib

ssh2'

Submodule 'zlib' (https://github.com/madler/zlib) registered for path 'zlib'

Cloning into 'build/gyp'...

remote: Reusing existing pack: 14591, done.

remote: Total 14591 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (14591/14591), 11.21 MiB | 2.62 MiB/s, done.

Resolving deltas: 100% (7795/7795), done.

Checking connectivity... done

Submodule path 'build/gyp': checked out '0203b47450704863c671bcfcfe53405e1b9f6f0

2'

Cloning into 'curl'...

remote: Reusing existing pack: 97079, done.

remote: Counting objects: 93, done.

remote: Compressing objects: 89% (83/93) eceiving objects: 0% (1/97172)

remote: Compressing objects: 100% (93/93), done.

remote: Total 97172 (delta 45), reused 0 (delta 0)

Receiving objects: 100% (97172/97172), 23.35 MiB | 1.74 MiB/s, done.

Resolving deltas: 100% (75339/75339), done.

Checking connectivity... done

Submodule path 'curl': checked out '2bf90d071016e279796e789f0ac223d635671a41'

Cloning into 'libssh2'...

remote: Counting objects: 8611, done.

remote: Compressing objects: 100% (4156/4156), done.

remote: Total 8611 (delta 6362), reused 5893 (delta 4380)

Receiving objects: 100% (8611/8611), 1.71 MiB | 1024.00 KiB/s, done.

Resolving deltas: 100% (6362/6362), done.

Checking connectivity... done

Submodule path 'libssh2': checked out 'f1cfa55b6064ba18fc0005713ed790da579361b5'

Cloning into 'zlib'...

remote: Reusing existing pack: 4194, done.

remote: Total 4194 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (4194/4194), 3.49 MiB | 2.01 MiB/s, done.

Resolving deltas: 100% (2453/2453), done.

Checking connectivity... done

Submodule path 'zlib': checked out '50893291621658f355bc5b4d450a8d06a563053d'

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> git submodule update

--init --recursive

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> C:\Python33\python.e

xe .\configure.py

File ".\configure.py", line 103

print 'Error running GYP'

                        ^

SyntaxError: invalid syntax

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]>

remote: Total 4194 (delta 0), reused 0 (delta 0)

Receiving objects: 100% (4194/4194), 3.49 MiB | 2.01 MiB/s, done.

Resolving deltas: 100% (2453/2453), done.

Checking connectivity... done

Submodule path 'zlib': checked out '50893291621658f355bc5b4d450a8d06a563053d'

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> git submodule update

--init --recursive

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]> C:\Python33\python.e

xe .\configure.py

File ".\configure.py", line 103

print 'Error running GYP'

                        ^

SyntaxError: invalid syntax

C:\Users\davidc\Documents\GitHub\curl-for-windows [master]>

No asm for openssl?

Judging from the performance of RSA encryption/decryption using the version of OpenSLL that this system builds, it seems that asm code is not being used. Inspection of the preprocessor symbols in the VS project reveals a "NO_ASM" macro.

Is it possible to configure/build openssl with the assembler code paths enabled?

I have access to a pre-built openssl binary, which the provider says was built with NASM, and it's significantly faster. But, I'd prefer the nicely integrated curl/openssl/zlib/ssh2 solution your sytem provides...

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.