--- ./meson.build_orig	2021-11-28 05:06:46 +0000
+++ ./meson.build	2021-11-28 05:12:34 +0000
@@ -14,18 +14,34 @@
 if get_option('with-zstd') == 'disabled'
     zstd_dep = dependency('', required : false)
 else
-    zstd_dep = dependency('libzstd', required : get_option('with-zstd') == 'enabled')
+    if build_machine.system() == 'aix'
+       zstd_dep = cc.find_library('zstd')
+    else
+       zstd_dep = dependency('libzstd', required : get_option('with-zstd') == 'enabled')
+    endif
     if zstd_dep.found()
         add_project_arguments('-DZCHUNK_ZSTD', language : 'c')
+        if build_machine.system() != 'aix' and zstd_dep.version().version_compare('<=1.4.9')
+           add_project_arguments('-DOLD_ZSTD', language : 'c')
+        endif
     endif
 endif
 
-curl_dep = dependency('libcurl')
+if build_machine.system() == 'aix'
+   curl_dep = cc.find_library('curl')
+else
+   curl_dep = dependency('libcurl')
+endif
 
 if get_option('with-openssl') == 'disabled'
     openssl_dep = dependency('', required : false)
 else
-    openssl_dep = dependency('openssl', required : get_option('with-openssl') == 'enabled')
+    if build_machine.system() == 'aix'
+        openssl_dep = cc.find_library('ssl')
+        openssl_dep = cc.find_library('crypto')
+    else
+        openssl_dep = dependency('openssl', required : get_option('with-openssl') == 'enabled')
+    endif
     if openssl_dep.found()
         add_project_arguments('-DZCHUNK_OPENSSL', language : 'c')
     endif
--- ./test/meson.build_orig	2021-11-28 05:24:34 +0000
+++ ./test/meson.build	2021-11-28 05:25:56 +0000
@@ -253,13 +253,13 @@
 endif
 
 check_sha = '9472ddc74dbd96291077bbb8d793e605824be8dba45e3e94bbc54b7de21a37a1'
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.5')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.5')
     check_sha = '6911b50cad5b6ed3ee89322338c559afdd0e72f614d3817b47ce370df52fd6b4'
 endif
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.4')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.4')
     check_sha = 'ded0d04884b13ba23d00f9b11b2b5950f8b9670d742f67d4195707ed85e73048'
 endif
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.3')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.3')
     check_sha = '437a0ec28def0c7f361402f6bb337cb963e6a3682bc742dd9e56171f6ece9881'
 endif
 test(
@@ -277,13 +277,13 @@
 )
 
 check_sha = '4e86b47410a3a5090c7d60040d24d8d390c31f16f96ea112c8f153888eaf8c6e'
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.5')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.5')
     check_sha = '62ee66fbf41a1f18617f400383eb38905050050f0f435a6e56df4a30d1bb694d'
 endif
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.4')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.4')
     check_sha = 'd5670c6ab81bdfa9b21eb21486a1cfa691a211fd83018914ea99ed9bdf509266'
 endif
-if zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.3')
+if build_machine.system() != 'aix' and zstd_dep.found() and zstd_dep.version().version_compare('<=1.3.3')
     check_sha = '71e6e770545df9bae2560d683d876d25df5e7f697ad20f9535b907d76db09876'
 endif
 test(
