Skip to content

Commit

Permalink
try compiling mbedtls in its own files tag against a c std version
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan63 committed Jun 16, 2024
1 parent b4ee945 commit fe6ec81
Showing 1 changed file with 147 additions and 133 deletions.
280 changes: 147 additions & 133 deletions src/hx/libs/ssl/Build.xml
Original file line number Diff line number Diff line change
@@ -1,148 +1,162 @@
<xml>

<pragma once="true" />
<pragma once="true" />

<set name="MBEDTLS_DIR" value="${HXCPP}/project/thirdparty/mbedtls-3.6.0" />
<set name="MBEDTLS_DIR" value="${HXCPP}/project/thirdparty/mbedtls-3.6.0" />

<files id="hxcpp_ssl" >
<depend files="hxcpp-depends"/>
<depend name="${this_dir}/Build.xml" dateOnly="true" />
<cache value="true" asLibrary="true" />
<compilerflag value="-I${MBEDTLS_DIR}/include"/>
<compilerflag value="-I${this_dir}"/>
<files id="mbedtls">
<depend name="${this_dir}/Build.xml" dateOnly="true" />

<cache value="true" asLibrary="true" />

<file name="${this_dir}/SSL.cpp"/>
<compilerflag value="-DWIN32_LEAN_AND_MEAN" if="windows"/>
<compilerflag value="-DMBEDTLS_CONFIG_FILE=&lt;mbedtls_config.h&gt;"/>
<compilerflag value="-I${MBEDTLS_DIR}/include"/>
<compilerflag value="-I${this_dir}"/>
<compilerflag value="/std:c11" if="windows"/>
<compilerflag value="-std=c99" unless="windows"/>

<compilerflag value="-DWIN32_LEAN_AND_MEAN" if="windows"/>
<compilerflag value="-DMBEDTLS_CONFIG_FILE=&lt;mbedtls_config.h&gt;"/>
<file name="${MBEDTLS_DIR}/library/aes.c"/>
<file name="${MBEDTLS_DIR}/library/aesni.c"/>
<file name="${MBEDTLS_DIR}/library/aesce.c"/>
<file name="${MBEDTLS_DIR}/library/aria.c"/>
<file name="${MBEDTLS_DIR}/library/asn1parse.c"/>
<file name="${MBEDTLS_DIR}/library/asn1write.c"/>
<file name="${MBEDTLS_DIR}/library/base64.c"/>
<file name="${MBEDTLS_DIR}/library/bignum.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_core.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_mod.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_mod_raw.c"/>
<file name="${MBEDTLS_DIR}/library/block_cipher.c"/>
<file name="${MBEDTLS_DIR}/library/camellia.c"/>
<file name="${MBEDTLS_DIR}/library/ccm.c"/>
<file name="${MBEDTLS_DIR}/library/chacha20.c"/>
<file name="${MBEDTLS_DIR}/library/chachapoly.c"/>
<file name="${MBEDTLS_DIR}/library/cipher.c"/>
<file name="${MBEDTLS_DIR}/library/cipher_wrap.c"/>
<file name="${MBEDTLS_DIR}/library/constant_time.c"/>
<file name="${MBEDTLS_DIR}/library/cmac.c"/>
<file name="${MBEDTLS_DIR}/library/ctr_drbg.c"/>
<file name="${MBEDTLS_DIR}/library/des.c"/>
<file name="${MBEDTLS_DIR}/library/dhm.c"/>
<file name="${MBEDTLS_DIR}/library/ecdh.c"/>
<file name="${MBEDTLS_DIR}/library/ecdsa.c"/>
<file name="${MBEDTLS_DIR}/library/ecjpake.c"/>
<file name="${MBEDTLS_DIR}/library/ecp.c"/>
<file name="${MBEDTLS_DIR}/library/ecp_curves.c"/>
<file name="${MBEDTLS_DIR}/library/ecp_curves_new.c"/>
<file name="${MBEDTLS_DIR}/library/entropy.c"/>
<file name="${MBEDTLS_DIR}/library/entropy_poll.c"/>
<file name="${MBEDTLS_DIR}/library/error.c"/>
<file name="${MBEDTLS_DIR}/library/gcm.c"/>
<file name="${MBEDTLS_DIR}/library/hkdf.c"/>
<file name="${MBEDTLS_DIR}/library/hmac_drbg.c"/>
<file name="${MBEDTLS_DIR}/library/lmots.c"/>
<file name="${MBEDTLS_DIR}/library/lms.c"/>
<file name="${MBEDTLS_DIR}/library/md.c"/>
<file name="${MBEDTLS_DIR}/library/md5.c"/>
<file name="${MBEDTLS_DIR}/library/memory_buffer_alloc.c"/>
<file name="${MBEDTLS_DIR}/library/nist_kw.c"/>
<file name="${MBEDTLS_DIR}/library/oid.c"/>
<file name="${MBEDTLS_DIR}/library/padlock.c"/>
<file name="${MBEDTLS_DIR}/library/pem.c"/>
<file name="${MBEDTLS_DIR}/library/pk.c"/>
<file name="${MBEDTLS_DIR}/library/pk_ecc.c"/>
<file name="${MBEDTLS_DIR}/library/pk_wrap.c"/>
<file name="${MBEDTLS_DIR}/library/pkcs12.c"/>
<file name="${MBEDTLS_DIR}/library/pkcs5.c"/>
<file name="${MBEDTLS_DIR}/library/pkparse.c"/>
<file name="${MBEDTLS_DIR}/library/pkwrite.c"/>
<file name="${MBEDTLS_DIR}/library/platform.c"/>
<file name="${MBEDTLS_DIR}/library/platform_util.c"/>
<file name="${MBEDTLS_DIR}/library/poly1305.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_aead.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_cipher.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_client.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_driver_wrappers_no_static.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_ecp.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_ffdh.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_hash.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_mac.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_pake.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_rsa.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_se.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_slot_management.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_storage.c"/>
<file name="${MBEDTLS_DIR}/library/psa_its_file.c"/>
<file name="${MBEDTLS_DIR}/library/psa_util.c"/>
<file name="${MBEDTLS_DIR}/library/ripemd160.c"/>
<file name="${MBEDTLS_DIR}/library/rsa.c"/>
<file name="${MBEDTLS_DIR}/library/rsa_alt_helpers.c"/>
<file name="${MBEDTLS_DIR}/library/sha1.c"/>
<file name="${MBEDTLS_DIR}/library/sha256.c"/>
<file name="${MBEDTLS_DIR}/library/sha512.c"/>
<file name="${MBEDTLS_DIR}/library/sha3.c"/>
<file name="${MBEDTLS_DIR}/library/threading.c"/>
<file name="${MBEDTLS_DIR}/library/timing.c"/>
<file name="${MBEDTLS_DIR}/library/version.c"/>
<file name="${MBEDTLS_DIR}/library/version_features.c"/>

<file name="${MBEDTLS_DIR}/library/aes.c"/>
<file name="${MBEDTLS_DIR}/library/aesni.c"/>
<file name="${MBEDTLS_DIR}/library/aesce.c"/>
<file name="${MBEDTLS_DIR}/library/aria.c"/>
<file name="${MBEDTLS_DIR}/library/asn1parse.c"/>
<file name="${MBEDTLS_DIR}/library/asn1write.c"/>
<file name="${MBEDTLS_DIR}/library/base64.c"/>
<file name="${MBEDTLS_DIR}/library/bignum.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_core.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_mod.c"/>
<file name="${MBEDTLS_DIR}/library/bignum_mod_raw.c"/>
<file name="${MBEDTLS_DIR}/library/block_cipher.c"/>
<file name="${MBEDTLS_DIR}/library/camellia.c"/>
<file name="${MBEDTLS_DIR}/library/ccm.c"/>
<file name="${MBEDTLS_DIR}/library/chacha20.c"/>
<file name="${MBEDTLS_DIR}/library/chachapoly.c"/>
<file name="${MBEDTLS_DIR}/library/cipher.c"/>
<file name="${MBEDTLS_DIR}/library/cipher_wrap.c"/>
<file name="${MBEDTLS_DIR}/library/constant_time.c"/>
<file name="${MBEDTLS_DIR}/library/cmac.c"/>
<file name="${MBEDTLS_DIR}/library/ctr_drbg.c"/>
<file name="${MBEDTLS_DIR}/library/des.c"/>
<file name="${MBEDTLS_DIR}/library/dhm.c"/>
<file name="${MBEDTLS_DIR}/library/ecdh.c"/>
<file name="${MBEDTLS_DIR}/library/ecdsa.c"/>
<file name="${MBEDTLS_DIR}/library/ecjpake.c"/>
<file name="${MBEDTLS_DIR}/library/ecp.c"/>
<file name="${MBEDTLS_DIR}/library/ecp_curves.c"/>
<file name="${MBEDTLS_DIR}/library/ecp_curves_new.c"/>
<file name="${MBEDTLS_DIR}/library/entropy.c"/>
<file name="${MBEDTLS_DIR}/library/entropy_poll.c"/>
<file name="${MBEDTLS_DIR}/library/error.c"/>
<file name="${MBEDTLS_DIR}/library/gcm.c"/>
<file name="${MBEDTLS_DIR}/library/hkdf.c"/>
<file name="${MBEDTLS_DIR}/library/hmac_drbg.c"/>
<file name="${MBEDTLS_DIR}/library/lmots.c"/>
<file name="${MBEDTLS_DIR}/library/lms.c"/>
<file name="${MBEDTLS_DIR}/library/md.c"/>
<file name="${MBEDTLS_DIR}/library/md5.c"/>
<file name="${MBEDTLS_DIR}/library/memory_buffer_alloc.c"/>
<file name="${MBEDTLS_DIR}/library/nist_kw.c"/>
<file name="${MBEDTLS_DIR}/library/oid.c"/>
<file name="${MBEDTLS_DIR}/library/padlock.c"/>
<file name="${MBEDTLS_DIR}/library/pem.c"/>
<file name="${MBEDTLS_DIR}/library/pk.c"/>
<file name="${MBEDTLS_DIR}/library/pk_ecc.c"/>
<file name="${MBEDTLS_DIR}/library/pk_wrap.c"/>
<file name="${MBEDTLS_DIR}/library/pkcs12.c"/>
<file name="${MBEDTLS_DIR}/library/pkcs5.c"/>
<file name="${MBEDTLS_DIR}/library/pkparse.c"/>
<file name="${MBEDTLS_DIR}/library/pkwrite.c"/>
<file name="${MBEDTLS_DIR}/library/platform.c"/>
<file name="${MBEDTLS_DIR}/library/platform_util.c"/>
<file name="${MBEDTLS_DIR}/library/poly1305.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_aead.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_cipher.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_client.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_driver_wrappers_no_static.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_ecp.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_ffdh.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_hash.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_mac.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_pake.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_rsa.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_se.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_slot_management.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_storage.c"/>
<file name="${MBEDTLS_DIR}/library/psa_its_file.c"/>
<file name="${MBEDTLS_DIR}/library/psa_util.c"/>
<file name="${MBEDTLS_DIR}/library/ripemd160.c"/>
<file name="${MBEDTLS_DIR}/library/rsa.c"/>
<file name="${MBEDTLS_DIR}/library/rsa_alt_helpers.c"/>
<file name="${MBEDTLS_DIR}/library/sha1.c"/>
<file name="${MBEDTLS_DIR}/library/sha256.c"/>
<file name="${MBEDTLS_DIR}/library/sha512.c"/>
<file name="${MBEDTLS_DIR}/library/sha3.c"/>
<file name="${MBEDTLS_DIR}/library/threading.c"/>
<file name="${MBEDTLS_DIR}/library/timing.c"/>
<file name="${MBEDTLS_DIR}/library/version.c"/>
<file name="${MBEDTLS_DIR}/library/version_features.c"/>
<file name="${MBEDTLS_DIR}/library/pkcs7.c"/>
<file name="${MBEDTLS_DIR}/library/x509.c"/>
<file name="${MBEDTLS_DIR}/library/x509_create.c"/>
<file name="${MBEDTLS_DIR}/library/x509_crl.c"/>
<file name="${MBEDTLS_DIR}/library/x509_crt.c"/>
<file name="${MBEDTLS_DIR}/library/x509_csr.c"/>
<file name="${MBEDTLS_DIR}/library/x509write.c"/>
<file name="${MBEDTLS_DIR}/library/x509write_crt.c"/>
<file name="${MBEDTLS_DIR}/library/x509write_csr.c"/>

<file name="${MBEDTLS_DIR}/library/pkcs7.c"/>
<file name="${MBEDTLS_DIR}/library/x509.c"/>
<file name="${MBEDTLS_DIR}/library/x509_create.c"/>
<file name="${MBEDTLS_DIR}/library/x509_crl.c"/>
<file name="${MBEDTLS_DIR}/library/x509_crt.c"/>
<file name="${MBEDTLS_DIR}/library/x509_csr.c"/>
<file name="${MBEDTLS_DIR}/library/x509write.c"/>
<file name="${MBEDTLS_DIR}/library/x509write_crt.c"/>
<file name="${MBEDTLS_DIR}/library/x509write_csr.c"/>
<file name="${MBEDTLS_DIR}/library/debug.c"/>
<file name="${MBEDTLS_DIR}/library/mps_reader.c"/>
<file name="${MBEDTLS_DIR}/library/mps_trace.c"/>
<file name="${MBEDTLS_DIR}/library/net_sockets.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_cache.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_ciphersuites.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_cookie.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_debug_helpers_generated.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_msg.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_ticket.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls12_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls12_server.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_keys.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_server.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_generic.c"/>

<file name="${MBEDTLS_DIR}/library/debug.c"/>
<file name="${MBEDTLS_DIR}/library/mps_reader.c"/>
<file name="${MBEDTLS_DIR}/library/mps_trace.c"/>
<file name="${MBEDTLS_DIR}/library/net_sockets.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_cache.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_ciphersuites.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_cookie.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_debug_helpers_generated.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_msg.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_ticket.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls12_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls12_server.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_keys.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_server.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_client.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_tls13_generic.c"/>
<file name="${MBEDTLS_DIR}/library/error.c"/>
<file name="${MBEDTLS_DIR}/library/version_features.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_debug_helpers_generated.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_driver_wrappers_no_static.c"/>
</files>

<files id="hxcpp_ssl" >
<depend files="hxcpp-depends"/>
<depend name="${this_dir}/Build.xml" dateOnly="true" />

<cache value="true" asLibrary="true" />

<file name="${MBEDTLS_DIR}/library/error.c"/>
<file name="${MBEDTLS_DIR}/library/version_features.c"/>
<file name="${MBEDTLS_DIR}/library/ssl_debug_helpers_generated.c"/>
<file name="${MBEDTLS_DIR}/library/psa_crypto_driver_wrappers_no_static.c"/>
</files>
<compilerflag value="-DMBEDTLS_CONFIG_FILE=&lt;mbedtls_config.h&gt;"/>
<compilerflag value="-I${MBEDTLS_DIR}/include"/>
<compilerflag value="-I${this_dir}"/>

<target id="haxe">
<files id="hxcpp_ssl" />
<file name="${this_dir}/SSL.cpp"/>
</files>

<lib name="advapi32.lib" if="windows" unless="static_link" />
<lib name="crypt32.lib" if="windows" unless="static_link" />
<lib name="bcrypt.lib" if="windows" unless="static_link" />
<lib name="ws2_32.lib" if="windows" unless="static_link" />
<target id="haxe">
<files id="mbedtls"/>
<files id="hxcpp_ssl" />

<flag value="-framework" if="macos"/>
<flag value="Security" if="macos"/>
</target>
<lib name="advapi32.lib" if="windows" unless="static_link" />
<lib name="crypt32.lib" if="windows" unless="static_link" />
<lib name="bcrypt.lib" if="windows" unless="static_link" />
<lib name="ws2_32.lib" if="windows" unless="static_link" />

<flag value="-framework" if="macos"/>
<flag value="Security" if="macos"/>
</target>

</xml>

0 comments on commit fe6ec81

Please sign in to comment.