openssl build MSYS2

The foregoing and other git source repository

https://www.cnblogs.com/marklove/p/11831539.html

x1
>>
THE
 
 
 
 
 
 
git clone https://github.com/openssl/openssl
git submodule update --init --recursive
./configure mingw64 shared

./Configure mingw64 initial configuration 2

pacman -S base-devel
pacman -S mingw64/mingw-w64-x86_64-gcc
windows 

just not able to find the beginning of the gcc compiler 

to add the environment variable 
Export the PATH = $ the PATH: / mingw64 / bin 
$ Source / etc / Profile 

Copy openssl source code to the C: \ msys64 \ \ home next world 

MSYS2 SHELL 

switch to 

/ home / world / OpenSSL 

./configure mingw64 

the make 

========================================== == 

Ubuntu lower 

into OpenSSL 

perl the Configure gcc Shared 

the make

Common package building

Common package we can simply use the command can be installed directly from the official website, such as installing openssl:

  • 32bit:pacman -S mingw-w64-i686-openssl
  • 64bit: pacman -S mingw-w64-x86_64-openssl

Sometimes based on project needs we have to rely on their own hands compiled packages, the following is recorded in the library I used compilation process.

openssl

  • 64bit

    mkdir openssl64
    cd openssl64
    tar zxvf openssl-1.0.2c.tar.gz
    cd openssl-1.0.2c ./configure mingw64 shared make make INSTALL_PREFIX=../ install
  • 32bit

    mkdir openssl32
    cd openssl32
    tar zxvf openssl-1.0.2c.tar.gz
    cd openssl-1.0.2c ./configure mingw shared make make INSTALL_PREFIX=../ install

zlib

    • 32bit 

      mkdir zlib32 
      cd zlib32 
      tar zxvf zlib-1.2.8.tar.gz 
      cd zlib-1.2.8/ 
      make -f ./win32/Makefile.gcc 
      make 
      make install -f win32/Makefile.gcc DESTDIR=../
Usually Linux system comes with OpenSSL, but it is so because there is no debug information file, and therefore can not track internal function, learning 
is not easy, need to re-install from source. 
        My Linux system is CentOS7, built-in version of OpenSSL is 1. 0 . 1e. . I downloaded the OpenSSL1 0 after .1f, by 
mounting a method 
[HTML] Plain View Copy 
 

    . / Config --prefix = / usr / local --openssldir = / usr / local / SSL     
    the make && the make the install     
    . / Config - Shared --prefix = D / usr / local --openssldir = / usr / local / SSL     
    the make Clean     
    the make && the make the install     


        installing the static library version, installing a dynamic library version. Installation directory under / usr / local. When installing a dynamic library increase - d option, since 
the use of a dynamic library when debugging, need tracking code. 
        So the following debugging debug code can be written as the following example:

#include <stdio.h>
#include <string.h>
#include <openssl/bio.h>
int main()
{
BIO *b = NULL;
int len = 0;
char *out = NULL;
b = BIO_new(BIO_s_mem());
 
if (NULL == b)
{
return 0;
}
 
len = BIO_write(b,"openssl",4);
len = BIO_printf(b,"%s"," ZCP " ); 
len = BIO_ctrl_pending (B); 
 
OUT = ( char * ) OPENSSL_malloc (len);
 IF (== NULL OUT ) 
{ 
return  0 ; 
} 
Memset ( OUT , 0 , len); 
 
len = BIO_READ (B, OUT , len); 
the printf ( " OUT iS:% S \ n- " , OUT ); 
 
OPENSSL_free ( OUT ); 
BIO_free (B); 
return  0 ; 
} 
    Create a new dynamic link libraries in the current path soft: 
    LN. -s /usr/local/lib64/libcrypto.so 1.0 . 0   . libcrypto.so 10 
   is then used when compiling the specified gcc libcrypto: 
    gcc -g -o openssl_mem_bio_test openssl_mem_bio_test.c -lcrypto -DDEBUG -Wl, -rpath =.
View Code

 

 

Question 1
 
Submodule 'boringssl' (https://boringssl.googlesource.com/boringssl) has path 'boringssl' Register
submodule 'krb5' (https://github.com/krb5/krb5) has path 'krb5 'Register
submodule' pyca.cryptography '(https://github.com/pyca/cryptography.git) has path' pyca-cryptography 'registered
positive cloned into' / d / 2017-2019 / 2018-11-05 -500G / Ubuntu / IProject / OpenSSL / OpenSSL / boringssl '...
fatal: can not access' https://boringssl.googlesource.com/boringssl/':Connection the After the Timed OUT 300002 milliseconds
fatal: can not clone' https: // boringssl.googlesource.com/boringssl 'to the sub-module path' / d / 2017-2019 / 2018-11-05-500G / ubuntu / iproject / openssl / openssl / boringssl '
clone' boringssl 'failed. Scheduled retry
n cloned into a '/ d / 2017-2019 / 2018-11-05-500G / ubuntu / iproject / openssl / openssl / krb5' ...
 
Google can not go their own way
Question 2

execvp:printf: Argument list too long

Documents https://github.com/imyller/meta-nodejs/issues/9

Source moved to the C: \ msys64 \ home \ freem \ openssl
 
 
 

Guess you like

Origin www.cnblogs.com/marklove/p/11869327.html