tong / hxssl

Haxe→C++/Neko OpenSSL bindings
30 stars 45 forks source link

Mobile builds #54

Open soywiz opened 8 years ago

soywiz commented 8 years ago

I have created a library for handling websockets: https://github.com/soywiz/haxe-ws

And I am using hxssl for secure websockets in sys platforms. But it happens that it is not including Android/iOS builds.

Is there any reason for that? May I help with this?

hpgood commented 7 years ago

1. 1)openssl\project\tars\openssl-1.0.2e.tar.gz 解压到 openssl\project\unpack\openssl-1.0.2e 2)openssl\tools\Build.hx

  //run("tar", [ inBZ ? "xf" : "xzf", "tars/" + inTar, "--no-same-owner", "-C", baseDir ]);
  //if (inCheckDir!="")
  //   File.saveContent(inCheckDir+"/.extracted","extracted");

3)修改src\build.xml a)

            <lib name="-lssl"  />
  <lib name="-lcrypto"   />
    改成
    <lib name="../openssl/lib/Android/libopenssl${LIBSUFFIX}.a" if="android"/>
b)
<target id="hxssl.ndll" ...> 改成:
    <set name="DEBUGEXTRA" value="-debug" if="fulldebug" />

    <set name="DEBUGEXTRA" value="-debug" if="debug" />

    <set name="LIBSUFFIX" value="${HX_TARGET_SUFFIX}" if="HX_TARGET_SUFFIX" />

    <set name="LIBSUFFIX" value="${LIBEXTRA}" unless="LIBSUFFIX" />

    <target id="hxssl" tool="linker" toolid="dll" output="${LIBPREFIX}hxssl${DEBUGEXTRA}${LIBSUFFIX}">
c)  <target id="default">

    <target id="hxssl.ndll"/>

    </target>
改成:
    <target id="default">

    <target id="hxssl"/>

    </target>

2. cd openssl/tools; haxe compile.hxml

cd openssl/project; neko build.n android -v

cd src haxelib run hxcpp build.xml clean haxelib run hxcpp build.xml -Dandroid -DHXCPP_ARMV7 haxelib run hxcpp build.xml -Dandroid