zoukankan      html  css  js  c++  java
  • linux 下 openssl 编译和交叉编译

    此随便记录一下编译openssl时遇到的各种问题以及解决办法。

    点击此处下载 OpenSSL(version-1.0.1e)

    linux 64位系统编译32位版本:

    setarch i386 ./Configure linux-generic32 no-shared -m32
    setarch i386 make
    setarch i386 make install make test

    交叉编译 (mips),步骤如下:

    1.设置环境变量

    export STAGING_DIR=/path/to/toolchain
    export PATH=$PATH:/path/to/toolchain/bin

    2.进入openssl根目录,执行config命令,设置参数--prefix, --cross-compile-prefix以及相关参数

    .config --prefix=/path/to/you/defined/build-mips --cross-compile-prefix=mips-openwrt-linux-uclibc- no-shared no-asm no-apps

    3. 编辑生成的Makefile文件:

       (a) 在x86_64(uname -m)系统上,将字符串"linux-x86_64"替换成“mips”, 删除所有的"-m64"选项

       (b) 在x86系统上,将字符串“linux-elf”替换成“mips”, 删除所有的"-march"选项

    4. 执行编译(make)和安装(make install)

  • 相关阅读:
    4-10
    4-9
    第三章例3-4
    第三章例3-3
    第三章例3-2
    第三章例3-1
    第二章例2-11
    第二章例2-10
    第二章例2-9
    第二章例2-8
  • 原文地址:https://www.cnblogs.com/lovelylife/p/3517333.html
Copyright © 2011-2022 走看看