📄 install
字号:
_ _ ____ _ ___| | | | _ \| | / __| | | | |_) | | | (__| |_| | _ <| |___ \___|\___/|_| \_\_____| How To CompileCurl has been compiled and built on numerous different operating systems.Most systems build curl the same way (unix-style). Continue reading below formore details if you're one of them.If you're using Windows (95/98/NT/ME/2000/XP or similar), VMS, RISC OS or OS/2or cross-compile, you should continue reading from one the paragraphs furtherdown.UNIX==== A normal unix installation is made in three or four steps (after you've unpacked the source archive): ./configure make make test (optional) make install You probably need to be root when doing the last command. If you have checked out the sources from the CVS repository, read the CVS-INFO on how to proceed. Get a full listing of all available configure options by invoking it like: ./configure --help If you want to install curl in a different file hierarchy than /usr/local, you need to specify that already when running configure: ./configure --prefix=/path/to/curl/tree If you happen to have write permission in that directory, you can do 'make install' without being root. An example of this would be to make a local install in your own home directory: ./configure --prefix=$HOME make make install The configure script always tries to find a working SSL library unless explicitly told not to. If you have OpenSSL installed in the default search path for your compiler/linker, you don't need to do anything special. If you have OpenSSL installed in /usr/local/ssl, you can run configure like: ./configure --with-ssl If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL,) you can run configure like this: ./configure --with-ssl=/opt/OpenSSL If you insist on forcing a build without SSL support, even though you may have OpenSSL installed in your system, you can run configure like this: ./configure --without-ssl If you have OpenSSL installed, but with the libraries in one place and the header files somewhere else, you have to set the LDFLAGS and CPPFLAGS environment variables prior to running configure. Something like this should work: (with the Bourne shell and its clones): CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ ./configure (with csh, tcsh and their clones): env CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" \ ./configure If your SSL library was compiled with rsaref (usually for use in the United States), you may also need to set: LIBS=-lRSAglue -lrsaref (as suggested by Doug Kaufman) MORE OPTIONS To force configure to use the standard cc compiler if both cc and gcc are present, run configure like CC=cc ./configure or env Cc=cc ./configure To force a static library compile, disable the shared library creation by running configure like: ./configure --disable-shared To tell the configure script to skip searching for thread-safe functions, add an option like: ./configure --disable-thread To build curl with kerberos4 support enabled, curl requires the krb4 libs and headers installed. You can then use a set of options to tell configure where those are: --with-krb4-includes[=DIR] Specify location of kerberos4 headers --with-krb4-libs[=DIR] Specify location of kerberos4 libs --with-krb4[=DIR] where to look for Kerberos4 In most cases, /usr/athena is the install prefix and then it works with ./configure --with-krb4=/usr/athena If you're a curl developer and use gcc, you might want to enable more debug options with the --enable-debug option.Win32===== Without SSL: MingW32 (GCC-2.95) style ------------------------ Run the 'mingw32.bat' file to get the proper environment variables set, then run 'make mingw32' in the root dir. If you have any problems linking libraries or finding header files, be sure to verify that the provided "Makefile.m32" files use the proper paths, and adjust as necessary. Cygwin style ------------ Almost identical to the unix installation. Run the configure script in the curl root with 'sh configure'. Make sure you have the sh executable in /bin/ or you'll see the configure fail towards the end. Run 'make' Microsoft command line style ---------------------------- Run the 'vcvars32.bat' file to get the proper environment variables set, then run 'nmake vc' in the root dir. The vcvars32.bat file is part of the Microsoft development environment. IDE-style ------------------------- If you use VC++, Borland or similar compilers. Include all lib source files in a static lib "project" (all .c and .h files that is). (you should name it libcurl or similar) Make the sources in the src/ drawer be a "win32 console application" project. Name it curl. With VC++, add 'ws2_32.lib' to the link libs when you build curl! Borland seems to do that itself magically. Of course you have to make sure it links with the libcurl too! For VC++ 6, there's an included Makefile.vc6 that should be possible to use out-of-the-box. Microsoft note: add /Zm200 to the compiler options to increase the compiler's memory allocation limit, as the hugehelp.c won't compile due to "too long puts string". With SSL: MingW32 (GCC-2.95) style ------------------------ Run the 'mingw32.bat' file to get the proper environment variables set, then run 'make mingw32-ssl' in the root dir. If you have any problems linking libraries or finding header files, be sure to look at the provided "Makefile.m32" files for the proper paths, and adjust as necessary. Cygwin style ------------ Haven't done, nor got any reports on how to do. It should although be identical to the unix setup for the same purpose. See above. Microsoft command line style ---------------------------- Please read the OpenSSL documentation on how to compile and install the OpenSSL libraries. The build process of OpenSSL generates the libeay32.dll and ssleay32.dll files in the out32dll subdirectory in the OpenSSL home directory. OpenSSL static libraries (libeay32.lib, ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory. Run the 'vcvars32.bat' file to get a proper environment. The vcvars32.bat file is part of the Microsoft development environment and you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin' provided that you installed Visual C/C++ 6 in the default directory. Before running nmake define the OPENSSL_PATH environment variable with the root/base directory of OpenSSL, for example: set OPENSSL_PATH=c:\openssl-0.9.7a lib/Makefile.vc6 depends on zlib (http://www.gzip.org/zlib/) as well. Please read the zlib documentation on how to compile zlib. Define the ZLIB_PATH environment variable to the location of zlib.h and zlib.lib, for example: set ZLIB_PATH=c:\zlib-1.1.4 Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root directory. 'nmake vc-ssl' will create a libcurl static and dynamic libraries in the lib subdirectory, as well as a statically linked version of curl.exe in the src subdirectory. This statically linked version is a standalone executable not requiring any DLL at runtime. This make method requires that you have the static OpenSSL libraries available in OpenSSL's out32 subdirectory. 'nmake vc-ssl-dll' creates the libcurl dynamic library and links curl.exe against libcurl and OpenSSL dynamically. This executable requires libcurl.dll and the OpenSSL DLLs at runtime. Microsoft / Borland style ------------------------- If you have OpenSSL, and want curl to take advantage of it, edit your project properties to use the SSL include path, link with the SSL libs and define the USE_SSLEAY symbol. Disabling Specific Protocols: The configure utility, unfortunately, is not available for the Windows environment, therefore, you cannot use the various disable-protocol options of the configure utility on this platform. However, you can use the following defines to disable specific protocols: HTTP_ONLY disables all protocols except HTTP CURL_DISABLE_FTP disables FTP CURL_DISABLE_LDAP disables LDAP CURL_DISABLE_TELNET disables TELNET CURL_DISABLE_DICT disables DICT CURL_DISABLE_FILE disables FILE CURL_DISABLE_GOPHER disables GOPHER If you want to set any of these defines you have the following possibilities:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -