From f05a6de77330da4e52619c02eaebe91404e80373 Mon Sep 17 00:00:00 2001
From: plowsof <77655812+plowsof@users.noreply.github.com>
Date: Sun, 9 Oct 2022 01:30:47 +0100
Subject: [PATCH 01/55] remove discontinued nodes
---
src/assets/nodes.json | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/assets/nodes.json b/src/assets/nodes.json
index aea3525..439751b 100644
--- a/src/assets/nodes.json
+++ b/src/assets/nodes.json
@@ -36,8 +36,7 @@
},
"testnet": {
"tor": [
- "rino4tpcrisugb2pt7bhs7cwkrkoigf366aetuzyqkqcakaad7vijiid.onion:28081",
- "plowsof7q4sexshcqfhoe2ksjalzsaxfblew26zleaq4ty647ly6qyid.onion:28089"
+ "rino4tpcrisugb2pt7bhs7cwkrkoigf366aetuzyqkqcakaad7vijiid.onion:28081"
],
"clearnet": [
"testnet.community.rino.io:28081",
@@ -49,8 +48,7 @@
"stagenet": {
"tor": [
"ct36dsbe3oubpbebpxmiqz4uqk6zb6nhmkhoekileo4fts23rvuse2qd.onion:38081",
- "rino4sek7bzoqgkgsn5qxlsic3gk2mj23t3shcaj5axfyipjnyoql4ad.onion:38081",
- "plowsof7q4sexshcqfhoe2ksjalzsaxfblew26zleaq4ty647ly6qyid.onion:38089"
+ "rino4sek7bzoqgkgsn5qxlsic3gk2mj23t3shcaj5axfyipjnyoql4ad.onion:38081"
],
"clearnet": [
"stagenet.community.rino.io:38081",
From 846a7234759cf0756d7b1eaef7444621b087a4fb Mon Sep 17 00:00:00 2001
From: piconero <117182073+piconero@users.noreply.github.com>
Date: Tue, 1 Nov 2022 13:56:16 +0000
Subject: [PATCH 02/55] Add Reddit frontend onion address
Resolves #52
---
src/SettingsDialog.ui | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/SettingsDialog.ui b/src/SettingsDialog.ui
index d24f871..ca7172d 100644
--- a/src/SettingsDialog.ui
+++ b/src/SettingsDialog.ui
@@ -535,6 +535,11 @@
teddit.net
+ -
+
+ reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion
+
+
-
From a744a237d40ec31467ee1a1bf237b474d1187dd7 Mon Sep 17 00:00:00 2001
From: tobtoht
Date: Thu, 10 Nov 2022 13:50:31 +0100
Subject: [PATCH 03/55] Update pubkey
---
utils/pubkeys/tobtoht.asc | 104 ++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 56 deletions(-)
diff --git a/utils/pubkeys/tobtoht.asc b/utils/pubkeys/tobtoht.asc
index 8fa20f4..16311b2 100644
--- a/utils/pubkeys/tobtoht.asc
+++ b/utils/pubkeys/tobtoht.asc
@@ -1,59 +1,51 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
-mQINBF2zfmoBEACrlG7MvTd0QpmSelCDHjO/speQpS34Up+PlJmtRqKXaTKap4ex
-RmG0rEfJtaybkckrxJvl+niphLZeQfuxukyUGiqhRsjQLpSD2y3CXqfHkAQYY8Kl
-ZGPRhRWCjGG9kbz+yoXz27/anszObHZwlK/JoBdn2u+O9tw8el+zaS5uewYCwEOn
-ixrUdRhPLCLqz9rpO8YAwdEOk83ENr6U4xAwKBo2rhWPNBlNtG2KJAz+mS/Yarpz
-vr/KFV09sDIgypJkkD+h6YpZ6xIRHa4mlDk6UvK2sGupMh6LU/LRMywaDurNMqOt
-F4ja1abmyR5zZclLtx8fNqgRM9/EdKFL4+N1fp5CbJqIbI5kEYeyHtrGZCNQYP1m
-yz8AcFIqd0BF9R0Fr0SYmnePqJWdIszE9JC+G0VccGzssHc30JUbvV4YyqlRq2m/
-ypb24Wr52ttHWVi+I+/LvRsfrRKpIG4VjQKAQ3FZF/MoY9YbPuZusVgx2X9RwtuO
-AxgsTCNnkqXg2FC/NkeYluHRwSFMSMX2lFQcMK0+qo7xQCZ6Wx+GXTPSk6NLmnqt
-l0J6fDUXLdKEr/wdVmeiyMcxjZGYOHLJOJ39QwxBiq11Y4BboYz4WUKtFDZJCkLJ
-YoMkFNgoiDqPher9TZ3xcPRdvfuoDcn9GCcAjs0RRFNGskjdx4ujfbxHgQARAQAB
-tEx0aG90Ym90ICgvdS9UaG90Ym90IG9uIERyZWFkLCAvdS90b2J0b2h0IG9uIFJl
-ZGRpdCkgPHRob3Rib3RAcHJvdG9ubWFpbC5jb20+iQJOBBMBCAA4FiEExavlwOUP
-orPxSrktHK3Sf0H0XDwFAl2zfmoCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AA
-CgkQHK3Sf0H0XDxtXQ//Uw7SAH2tlwTTE/ehJbg2fZG4Jfn91XKtpEE8yMtqIHQc
-QiGAp7pe/c851TTJ2aug6y0/9/usp4qMPhx4l/vNOHwe5sk+a2jm/Wxh+lfJqv6Q
-+En7JmKRE7ZFCaTirEY5u4Qxepg/tSqD29ZN2uHeAVx3RTHSO05R6RMe6PPjEvsB
-4xTOK7pKXI1Oxy0RJwRZSum8wwBUvmfeE78colyBekbl1A2TuIfEmfzPY+UjaxQj
-28DUYsZ6RqFGBRnf6cMWm2iZx9FaLEZhqZUFL746vxIGwADgJmanI+f25UMPQfTP
-EAlHZxpI/0oQb2QOGSJyFMQHgXVvR+u/QNbU0Uju/gW3/nqDRnPlBs5cwFcgjbPa
-Txvkak/sgXYb30Ed47OXSH/VBR19QN8gMl3uMnTBWxC3z0Ps8TCgAS3K8tFuuRNs
-eB2oLFlySbC3uFzDgh9DXmybF4MEdKckrjM4gGGf7uChjLBncUpGobsVDYTJuduJ
-7ZLWPwvaFMXMcXQuHlJjf8qW54TQFYikZHx1uSU5j4xvT5F9k0HofJQQqbamIo/0
-nsxdufZs4fH1f8uDXKt7sWOw+TZlJPI6lqewys+3JVHkp/ByaSYn/a9R6ZHMkRb+
-RI1ezumoBAuA8JQd0X6VeiW0HOCEQekFlPZcf0obtdiY/bZrLjYOA+g5ZRMT3T2J
-ATMEEAEIAB0WIQSDBDsI3YEB8o1xf+nlk5P7rJc+IAUCXbN/RQAKCRDlk5P7rJc+
-ICflB/9qji/RY09rTlUTLfXiKltQAEPjMvmmTIdNXHd+P5HsuZxn+dgJX8Vfk2R6
-GMF6XmUPTGe817/fnwzr+zU6rWwjLi/EATq8QlK1oJQ1H5proBHfRmDgnQRXB3JI
-mfUUvSpt7keiDkH0/s/xbr7L2v6bYlEGssShsL51tHHfLn5mon/6pRC3szWvzN77
-KpUAFRy7Q7gTifCEKO0rjzfOd7aE01bj6FMftSlSqiDrf8SZMhdgn6+RkPu1nggx
-Pf9pRSfhcaVWpZn9Y/DpESiLkHVo1WmgR7/TSjgmWTtWEeCe07X4bp2OCu5oFvfq
-XXWbekH8MOyeLN1FHL58uqdBg+wCuQINBF2zfmoBEADMsraEqzx8HSS+1lRfb15U
-T4yeIVNI5C58Z4WELxXzAYdeinlKgSIs0+fQf45UAR3q7gWQgxQZB8ojQPn1QfJE
-tQ60tpzLlY8pCZhnuhtqM164OLkVThu5wJABbv5zRaohLVTNykYoVD2t/syAgMgn
-1UuPPXBcG+I1fbAtclRyq3HnIcRkfym+adM08b7V6YEr4lHJOh8vGWmYuEzMpDnn
-gRyWcuTvaHnJ3LGX49TDdL0OXeiL557Vvv1tQKcyGEmA+Su/QArBEfVK5FUK7EgB
-gDxLVtqNOkaCSQykFr75ujXwTXV4VDFzsHXLA4js/robPkbaSFgn/NpFUuu82RPJ
-7T5YoMXliiV8flYsdZyVlMq9nMbUbZ8yjJAIuGT/I/Q1KbWNK1cKS8co8RirjxlW
-bS29Jak11f3XVqDg/Y1lT1LzQfDHSFY0c0hTjIWSOscGK4aQoNUJadwbuMBz2rSu
-BXoeIpj5c8W5fNGx3CU1N34eIH6DbLzuhz/Ofhg1y/33hDaIu2EB87pYcWBHsLWy
-6apmf8GctR4f8XtZrnfvaJTQkH05lP/d6uJr8bksPeUd6cM31eCX6DB/0MS2zY9i
-5bKPPt3SPqZXu7aVObh/wNBkkMD2Zq76/aDDoXrYpHG1mW0Eo6m6vye5aFuqWy16
-5kLfIbolignWOBR2b6frfwARAQABiQI2BBgBCAAgFiEExavlwOUPorPxSrktHK3S
-f0H0XDwFAl2zfmoCGwwACgkQHK3Sf0H0XDyM0hAAqcNPs83sLJcjMhIPIiLT7s1p
-ghe+/+New+e+CI+vTjAYMWe38CbDxUzHxnuirpnbThu73CU5YeEirNOTqKsd3wBL
-0xIHU/UtsBMX2TeRVUp4EzinbUJopP7wzTgLWEdSak9b0atuD6e9WRpgliL4fshu
-aQJo0muM8uYjXTPpxUPG96F1dDvxenKC7b1B0J/Rwd5Ok0srHyvvgzVejX3M+Jg4
-E0bAY0agkY0kIX2odYrB+sG8X/zrjeI/B2wgAq1hzXQ6lGz70te3vP2/0hyUVrsb
-TSnZB+2KWnveV3d8tBZBXzmYomIdgb+rOiDXQ5pccRq1+cf7X5ugwy4dNk7WbbQc
-imYk0e40NeNjbWTeiMa0MRiytuatPs9N7OnhWrdEsvznmFHwp1P7kOpKzivPJu5Z
-ijNMoBA+VDJN6L8Tz8M7efdUjOfz+Ak4GqjyFDy8VPomFS3PAz/7v2yhD+UjUl7o
-r5JEOdSE0ksqK1OpnShoFXrAXwVQAyqmU2yKey2tfPlGpJQeJBdMSUJDNgaIb8mj
-XZ0ls0fXknJfxhEZIdRGXT3m3GA6+AVELvlN94cY+1802h2bW/T2jKkzdor/AC6j
-FCdMtwLy/TkxMq50/Nomjqz/CzLpyTQhAc6KWJC09lYsRG47qQ0Vel0pt74TO2kF
-RR9alvpX5jGtupg5+1E=
-=hD7u
+mQINBGLhQcoBEADiEB9S7FRpHpnI8TpFhBoYgeugroHJgupRmSvMt+0myD9AkKbL
+6FG3F98HRyFA3ljq3UWd5kUxZIeljdwWn/sHd3eu+BXJ2gXU7jo8MzOFDQrW+bcE
+/4PFEdbLhsvmEvXkURFFZTyVA6CgAfsd86l2okG0X4dbDLwGRcVx30bYThH5a/lK
+buTKOANbP9Rw6hRkZAIZof2DDZgU4G5UEFvxf80lhbXQgPtQoCAad9b/cRGUnau8
+STtA6qKiVch1IS0Y2+EE91aN2MLmGxjTr5N6kQm/oYeIKqLiZuVBkGmNVVP5CyDw
+k4YjmrCyckewAWwsjDNZ6X/eAV06inblOxgX9g2VJKVHck4WtN9c+5SmTkWz5YZ0
+hXxj7h0ASukvud0uf9UwLOAIXRnXRUyxAAw0LhTmHIlsDHw1XJoqIjKnJNpCGIqE
+Hn/AQT5n8W5HYF7GJQAav1Qso7yclkUdXP1mfSpbC1Q+R92WAlgLrIwEeUG8iEeO
+6KZazSSzn8VwG7Z5VnE32LpIdGDDJOpqABd7CD7b9dtKP/QH8wbdZxVzcMsdD2Zk
+VARUSMsMRNKXpQuURN02zPPyu//jYwqrMXHbUE2Mt8quhJQya4xVRbjBW0LHwZQO
+/vpUm6reOO5vIJdkgqH0YP5WMyj4/BnhkkOGPjDgffzxMihue34fO+V05wARAQAB
+tB90b2J0b2h0IDx0b2JAZmVhdGhlcndhbGxldC5vcmc+iQJOBBMBCAA4FiEE6HvZ
+Ic3YhcnXijjF5FsQ3QJ9JHIFAmLhQcoCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC
+F4AACgkQ5FsQ3QJ9JHLw/hAA28cJgy2KOAFNaX3lSeOGC6ZdQUv4dtTkg1wZjmDq
+AKE8I1ANCaVHtB0Df7CJTnBnCvkLAhf8gA3ldNBD3PKySBmP1rnjRYjYmNOZ+9io
+EHwlgL7WyknXUtbitrpe/wM7xWN/cDdEmlRvOb9pf4GTPw2MaZLM+E43KnKoEWJ/
+Ms8vOLi2UIZNmpYhWzjS178EtC9AfvsCwWexVwYhIxlmqF++W2QYMVUEqDaVMKsJ
+BohhPrOb/SQJVd5D6vrcIGs/aZZOEuthvBp1ycFdCEGajwBNzmrmhLfl9CuP0NqM
+4KkYYHrvJio8QbsMxU27KJfDaGloNfSkk3V+MhZGvMqFUkTuabeyz6Uh/CREV6s/
+JApTPHvAmMeD9p6PNfxZvSq/jcbwbxPdqvWyy+dqEaaPIGbR1sOSJOOzxcJ84/1F
+VwA2FQENmlob6VRroqHWTZzKPmwOi2qFAjEleEHZrjfaaHlXrGbi1ucFOqn+2/Qh
+F4oi1gzFG0jQYajXxRC1CrM3ykKWgGt6cTeMDXQxEdQOkWdgP7pkVbpc9j4OW0aF
+WeUlr1i+BU6UwY6eibAwT57pBiU4A9TtJjHBBPUG+XGIB9JPAWD43mfXAONfmll3
+zyV0Y6Tq8NiQUs0yuWNWqo6fDn/EW5ldNsDz+PwDGGusEMJYrGc8emWqi+CsSg83
+imu5Ag0EYuFBygEQAMXwWjBPxiWN1wDrHNOwoVf4aX37mYjsgtQ+223x5uFD0ULl
+6pH2hUCg/FSVqsm+xvVqX6DV+WmzkGhhC1B2bnpEkzxQr79dXEq0V+hsKypa7t66
+8/e+4pNxeSz+4UMJApEc/lIGtEcWPgx2xNChagB2V/074hN3eZ6jpq4KJS4GG7ly
+ts+t2jNs8EArrWKWKzIp2vc+Upad5LD4SSWR5qQQUgXtVbJO3EoVfeK3+g0iiVOv
+o29yEStCUBrkbuK1Kwe1wjw6ePIDWKXkvo0vSRKxolCGALFhToLM0QNLjp1WNXJG
+TuZtcUYIY58b7WAcEoqM7uRc3YcFMjl1tW/e3UF8Ii6CBr69bxzeygfXEdXjM+XC
+H9WvxtHFFgelnloA2OHRqe1ehtsLtmlVHoJ1RArKEFYrMiApAiGSf9ztm/eQ3yX4
+6E28k3OOZSRUyyZHC++NxmNDKjQpcVQ2k5yCGje5xB4844n5fTMafWNGYnnveFTx
+ZlXwz+ZlwvGHKwwI6u+n+ZA5eV+R24mo9JaPQVlQ9MLpzbWhpUvGy8ugn4rhiaz2
+4gw6hdd1BaTzkMgrCh1uT4GxVSQxanX4ubHK06QiH5yiopAIcrLXQCtIaNwmQPD2
+1K9WvZ0xagrXDOInnsGAUM8V7ce5VhwWxwIjjP7QCh886P2HHg5KM7twSG6rABEB
+AAGJAjYEGAEIACAWIQToe9khzdiFydeKOMXkWxDdAn0kcgUCYuFBygIbDAAKCRDk
+WxDdAn0kcuc8EACCJWI0o5AYxDQ1tkbPcnfwzFQQ50vH6pfEmk3/YQXbaJxtNLVS
+ba13zC7rw5pBfVLXPDu7oOcf0x8/3HoeKfAFP/ChlU/PA2yojigZJV9zCpqCC0dm
+vV7N+Mgd/GD6FGwnSM3kHnkYPgbu1/uMDbm7OTq3fbNK5BTKikkmW8ZxDyNwGYlR
+5Smt2dymlxcEIYZSw27R5yyJhw6ri5trwJwJYay7LgKnWb+ePNDPUR0+ph0bXYl8
+DKa1c3vkNfmN17AUtzl0DByMZ+C0mJiu1cjWbbgg5PuQQXiNkV2xcDcMrLjVE686
+YkYI9KKLJQVLO8d57OEv0irE1bD7BlyILwemrdjuyHsPRBwHSnw8s1+Sy4qWg099
+rCGcK7wu+L9r/+fgTxONSyqb74pcO4JQDXZKKjsDfR1R2qhcvCbU4VpOvIdoiXh9
+wUBY4pBrMGDbtah3DOqvCEb7Jol754KWOaTkjDNbGrBZ5UBGdVa5flKOzIN+YOVQ
+ce9Nz8XeSVy8PzrUpf5P/DFBe4Gr/E4PZkuLtJGfzNHbzhBMVMv/vfbL24uACQM0
+DKQ3vplo+++Zcyey8Nz1MNJDYqcCD/o1SInMPWbtlytNNWLj+5i75K37TIOl3vkq
+Aa6OeR9y7rn8bJ88tKgnXiEalMy7HUyBDZbMCeE6IVGZvbUSdLz5VGpKmQ==
+=KI4D
-----END PGP PUBLIC KEY BLOCK-----
From cf7ed88526ce89dda7e35e3f7372a4acae222c6c Mon Sep 17 00:00:00 2001
From: tobtoht
Date: Thu, 10 Nov 2022 13:56:08 +0100
Subject: [PATCH 04/55] Update fingerprint
---
SECURITY.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SECURITY.md b/SECURITY.md
index d626c49..00b48fc 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -10,6 +10,6 @@ The following keys may be used to communicate sensitive information to developer
| Name | Fingerprint |
|------|-------------|
-| tobtoht | C5AB E5C0 E50F A2B3 F14A B92D 1CAD D27F 41F4 5C3C |
+| tobtoht | E87B D921 CDD8 85C9 D78A 38C5 E45B 10DD 027D 2472 |
Public keys can be found in `utils/pubkeys`.
From 5501da716f06c76da75b98a69ca80e5f837dc2b2 Mon Sep 17 00:00:00 2001
From: tobtoht
Date: Tue, 20 Dec 2022 15:43:44 +0100
Subject: [PATCH 05/55] Tails: workaround for QT_QPA_PLATFORM=wayland
---
contrib/AppImage/AppRun | 2 ++
1 file changed, 2 insertions(+)
diff --git a/contrib/AppImage/AppRun b/contrib/AppImage/AppRun
index 24ea3ec..def250b 100644
--- a/contrib/AppImage/AppRun
+++ b/contrib/AppImage/AppRun
@@ -5,5 +5,7 @@ echo $HERE
export GST_PLUGIN_SCANNER=$(readlink -f $(dirname "$0")/usr/lib/gst-plugin-scanner)
export GST_PLUGIN_SYSTEM_PATH=$(readlink -f $(dirname "$0")/usr/lib)
+# Tails 5.8 sets QT_QPA_PLATFORM to wayland which breaks our app
+export QT_QPA_PLATFORM=xcb
${APPDIR}/usr/bin/feather $*
From 2a7acddfaa765052b14cb37d0e8f088888c93fb3 Mon Sep 17 00:00:00 2001
From: tobtoht
Date: Tue, 20 Dec 2022 21:00:19 +0100
Subject: [PATCH 06/55] Bump version to 2.1.2
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e334e98..7f8b343 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(VERSION_MAJOR "2")
set(VERSION_MINOR "1")
-set(VERSION_REVISION "0")
+set(VERSION_REVISION "2")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
option(STATIC "Link libraries statically, requires static Qt")
From 09a3c7b15d473912e408b4d194addd6bac9d56c5 Mon Sep 17 00:00:00 2001
From: tobtoht
Date: Thu, 2 Jun 2022 14:50:33 +0200
Subject: [PATCH 07/55] Bootstrappable builds (WIP)
---
.gitignore | 2 +-
BUILDING.md | 154 -
CMakeLists.txt | 59 +-
Dockerfile.linux | 324 -
Dockerfile.windows | 189 -
Makefile | 11 +
README.md | 6 +-
cmake/Deploy.cmake | 1 +
cmake/FindZBAR.cmake | 8 -
cmake/FindZLIB.cmake | 6 +-
cmake/FindZlib.cmake | 21 +
cmake/GenVersion.cmake | 2 +-
contrib/depends/.gitignore | 14 +
contrib/depends/Makefile | 308 +
contrib/depends/builders/darwin.mk | 30 +
contrib/depends/builders/default.mk | 21 +
contrib/depends/builders/linux.mk | 2 +
contrib/depends/config.guess | 1702 +++++
contrib/depends/config.site.in | 154 +
contrib/depends/config.sub | 1864 +++++
contrib/depends/funcs.mk | 329 +
contrib/depends/gen_id | 77 +
contrib/depends/hosts/darwin.mk | 121 +
contrib/depends/hosts/default.mk | 39 +
contrib/depends/hosts/linux.mk | 33 +
contrib/depends/hosts/mingw32.mk | 17 +
contrib/depends/packages/boost.mk | 48 +
contrib/depends/packages/eudev.mk | 30 +
contrib/depends/packages/expat.mk | 32 +
contrib/depends/packages/fontconfig.mk | 32 +
contrib/depends/packages/freetype.mk | 27 +
contrib/depends/packages/graphviz.mk | 30 +
contrib/depends/packages/gtest.mk | 39 +
contrib/depends/packages/hidapi.mk | 40 +
contrib/depends/packages/icu4c.mk | 27 +
contrib/depends/packages/ldns.mk | 34 +
contrib/depends/packages/libICE.mk | 23 +
contrib/depends/packages/libSM.mk | 23 +
contrib/depends/packages/libXau.mk | 34 +
contrib/depends/packages/libevent.mk | 22 +
contrib/depends/packages/libgcrypt.mk | 35 +
contrib/depends/packages/libgpg-error.mk | 21 +
contrib/depends/packages/libiconv.mk | 35 +
contrib/depends/packages/libusb.mk | 39 +
contrib/depends/packages/libxcb.mk | 41 +
contrib/depends/packages/libxcb_util.mk | 32 +
contrib/depends/packages/libxcb_util_image.mk | 31 +
.../depends/packages/libxcb_util_keysyms.mk | 31 +
.../depends/packages/libxcb_util_render.mk | 31 +
contrib/depends/packages/libxcb_util_wm.mk | 31 +
contrib/depends/packages/libxkbcommon.mk | 36 +
contrib/depends/packages/libzip.mk | 23 +
contrib/depends/packages/native_ccache.mk | 25 +
contrib/depends/packages/native_cctools.mk | 37 +
contrib/depends/packages/native_clang.mk | 25 +
contrib/depends/packages/native_cmake.mk | 18 +
contrib/depends/packages/native_ds_store.mk | 15 +
contrib/depends/packages/native_libtapi.mk | 19 +
.../depends/packages/native_linuxdeployqt.mk | 18 +
contrib/depends/packages/native_mac_alias.mk | 15 +
contrib/depends/packages/native_patchelf.mk | 17 +
contrib/depends/packages/native_protobuf.mk | 27 +
contrib/depends/packages/native_qmake.mk | 60 +
.../depends/packages/native_squashfs-tools.mk | 15 +
contrib/depends/packages/ncurses.mk | 64 +
contrib/depends/packages/openssl.mk | 70 +
contrib/depends/packages/packages.mk | 32 +
contrib/depends/packages/polyseed.mk | 24 +
contrib/depends/packages/protobuf.mk | 31 +
contrib/depends/packages/qrencode.mk | 33 +
contrib/depends/packages/qt.mk | 307 +
contrib/depends/packages/readline.mk | 29 +
contrib/depends/packages/sodium.mk | 34 +
contrib/depends/packages/tor-macos.mk | 14 +
contrib/depends/packages/tor-win.mk | 13 +
contrib/depends/packages/tor.mk | 32 +
contrib/depends/packages/unbound.mk | 28 +
contrib/depends/packages/xcb_proto.mk | 21 +
contrib/depends/packages/xproto.mk | 26 +
contrib/depends/packages/zbar.mk | 31 +
contrib/depends/packages/zlib.mk | 25 +
.../depends/patches/boost/fix_arm_arch.patch | 11 +
.../depends/patches/boost/fix_aroptions.patch | 28 +
.../depends/patches/boost/fix_coalesce.patch | 17 +
.../depends/patches/cmake/cmake-1-fixes.patch | 67 +
.../fontconfig/gperf_header_regen.patch | 24 +
.../patches/hidapi/missing_win_include.patch | 21 +
...-001-dont-build-static-dynamic-twice.patch | 37 +
contrib/depends/patches/libgcrypt/gost-sb.h | 2127 ++++++
.../patches/libgcrypt/no_gen_gost-sb.patch | 13 +
.../patches/libiconv/fix-whitespace.patch | 13 +
.../patches/libxcb/remove_pthread_stubs.patch | 12 +
.../depends/patches/libzip/no-clonefile.patch | 10 +
.../patches/native_biplist/sorted_list.patch | 29 +
.../patches/native_cctools/skip_otool.patch | 12 +
.../native_cdrkit/cdrkit-deterministic.patch | 86 +
.../patches/native_mac_alias/python3.patch | 72 +
.../patches/native_qmake/no-xlib.patch | 69 +
contrib/depends/patches/native_qmake/qt.pro | 19 +
contrib/depends/patches/ncurses/fallback.c | 6621 +++++++++++++++++
.../depends/patches/openssl/fix_darwin.patch | 60 +
.../patches/polyseed/force-static-mingw.patch | 23 +
.../depends/patches/polyseed/no_shared.patch | 42 +
.../patches/qt/dont_hardcode_pwd.patch | 27 +
.../patches/qt/dont_hardcode_x86_64.patch | 119 +
.../patches/qt/duplicate_lcqpafonts.patch | 104 +
.../qt/fast_fixed_dtoa_no_optimize.patch | 20 +
.../patches/qt/fix_android_jni_static.patch | 18 +
.../patches/qt/fix_limits_header.patch | 33 +
.../patches/qt/fix_montery_include.patch | 21 +
.../depends/patches/qt/fix_no_printer.patch | 19 +
.../depends/patches/qt/fix_qt_pkgconfig.patch | 11 +
.../patches/qt/fix_rcc_determinism.patch | 15 +
.../patches/qt/guix_cross_lib_path.patch | 17 +
contrib/depends/patches/qt/mac-qmake.conf | 22 +
contrib/depends/patches/qt/no-xlib.patch | 69 +
contrib/depends/patches/qt/qt.pro | 18 +
.../qt/qtbase-moc-ignore-gcc-macro.patch | 17 +
contrib/depends/patches/qt/qttools_src.pro | 6 +
.../patches/qt/rcc_hardcode_timestamp.patch | 24 +
.../patches/qt/use_android_ndk23.patch | 13 +
.../disable-glibc-getrandom-getentropy.patch | 25 +
.../patches/sodium/fix-whitespace.patch | 13 +
.../patches/unwind/fix_obj_order.patch | 11 +
...a27b04c5822cb88a69677382a0f053367143.patch | 22 +
contrib/depends/toolchain.cmake.in | 182 +
contrib/guix/INSTALL.md | 786 ++
contrib/guix/LICENSE.txt | 23 +
contrib/guix/README.md | 433 ++
contrib/guix/guix-build | 461 ++
contrib/guix/guix-clean | 83 +
contrib/guix/libexec/build.sh | 295 +
contrib/guix/libexec/prelude.bash | 82 +
contrib/guix/manifest.scm | 646 ++
.../elfsteem-value-error-python-39.patch | 13 +
contrib/guix/patches/gcc-broken-longjmp.patch | 68 +
...c-2.24-elfm-loadaddr-dynamic-rewrite.patch | 62 +
contrib/guix/patches/glibc-2.24-fcommon.patch | 32 +
...bc-2.24-no-build-time-cxx-header-run.patch | 100 +
...libc-2.27-dont-redefine-nss-database.patch | 87 +
...as_include-to-include-asm-syscalls.h.patch | 76 +
contrib/guix/patches/glibc-ldd-x86_64.patch | 10 +
.../patches/glibc-versioned-locpath.patch | 240 +
.../guix/patches/nsis-gcc-10-memmove.patch | 23 +
.../patches/oscrypto-hard-code-openssl.patch | 13 +
contrib/guix/patches/vmov-alignment.patch | 267 +
contrib/shell/git-utils.bash | 14 +
contrib/shell/realpath.bash | 71 +
src/CMakeLists.txt | 64 +-
149 files changed, 20886 insertions(+), 728 deletions(-)
delete mode 100644 BUILDING.md
delete mode 100644 Dockerfile.linux
delete mode 100644 Dockerfile.windows
create mode 100644 cmake/FindZlib.cmake
create mode 100644 contrib/depends/.gitignore
create mode 100644 contrib/depends/Makefile
create mode 100644 contrib/depends/builders/darwin.mk
create mode 100644 contrib/depends/builders/default.mk
create mode 100644 contrib/depends/builders/linux.mk
create mode 100755 contrib/depends/config.guess
create mode 100644 contrib/depends/config.site.in
create mode 100755 contrib/depends/config.sub
create mode 100644 contrib/depends/funcs.mk
create mode 100755 contrib/depends/gen_id
create mode 100644 contrib/depends/hosts/darwin.mk
create mode 100644 contrib/depends/hosts/default.mk
create mode 100644 contrib/depends/hosts/linux.mk
create mode 100644 contrib/depends/hosts/mingw32.mk
create mode 100644 contrib/depends/packages/boost.mk
create mode 100644 contrib/depends/packages/eudev.mk
create mode 100644 contrib/depends/packages/expat.mk
create mode 100644 contrib/depends/packages/fontconfig.mk
create mode 100644 contrib/depends/packages/freetype.mk
create mode 100644 contrib/depends/packages/graphviz.mk
create mode 100644 contrib/depends/packages/gtest.mk
create mode 100644 contrib/depends/packages/hidapi.mk
create mode 100644 contrib/depends/packages/icu4c.mk
create mode 100644 contrib/depends/packages/ldns.mk
create mode 100644 contrib/depends/packages/libICE.mk
create mode 100644 contrib/depends/packages/libSM.mk
create mode 100644 contrib/depends/packages/libXau.mk
create mode 100644 contrib/depends/packages/libevent.mk
create mode 100644 contrib/depends/packages/libgcrypt.mk
create mode 100644 contrib/depends/packages/libgpg-error.mk
create mode 100644 contrib/depends/packages/libiconv.mk
create mode 100644 contrib/depends/packages/libusb.mk
create mode 100644 contrib/depends/packages/libxcb.mk
create mode 100644 contrib/depends/packages/libxcb_util.mk
create mode 100644 contrib/depends/packages/libxcb_util_image.mk
create mode 100644 contrib/depends/packages/libxcb_util_keysyms.mk
create mode 100644 contrib/depends/packages/libxcb_util_render.mk
create mode 100644 contrib/depends/packages/libxcb_util_wm.mk
create mode 100644 contrib/depends/packages/libxkbcommon.mk
create mode 100644 contrib/depends/packages/libzip.mk
create mode 100644 contrib/depends/packages/native_ccache.mk
create mode 100644 contrib/depends/packages/native_cctools.mk
create mode 100644 contrib/depends/packages/native_clang.mk
create mode 100644 contrib/depends/packages/native_cmake.mk
create mode 100644 contrib/depends/packages/native_ds_store.mk
create mode 100644 contrib/depends/packages/native_libtapi.mk
create mode 100644 contrib/depends/packages/native_linuxdeployqt.mk
create mode 100644 contrib/depends/packages/native_mac_alias.mk
create mode 100644 contrib/depends/packages/native_patchelf.mk
create mode 100644 contrib/depends/packages/native_protobuf.mk
create mode 100644 contrib/depends/packages/native_qmake.mk
create mode 100644 contrib/depends/packages/native_squashfs-tools.mk
create mode 100644 contrib/depends/packages/ncurses.mk
create mode 100644 contrib/depends/packages/openssl.mk
create mode 100644 contrib/depends/packages/packages.mk
create mode 100644 contrib/depends/packages/polyseed.mk
create mode 100644 contrib/depends/packages/protobuf.mk
create mode 100644 contrib/depends/packages/qrencode.mk
create mode 100644 contrib/depends/packages/qt.mk
create mode 100644 contrib/depends/packages/readline.mk
create mode 100644 contrib/depends/packages/sodium.mk
create mode 100644 contrib/depends/packages/tor-macos.mk
create mode 100644 contrib/depends/packages/tor-win.mk
create mode 100644 contrib/depends/packages/tor.mk
create mode 100644 contrib/depends/packages/unbound.mk
create mode 100644 contrib/depends/packages/xcb_proto.mk
create mode 100644 contrib/depends/packages/xproto.mk
create mode 100644 contrib/depends/packages/zbar.mk
create mode 100644 contrib/depends/packages/zlib.mk
create mode 100644 contrib/depends/patches/boost/fix_arm_arch.patch
create mode 100644 contrib/depends/patches/boost/fix_aroptions.patch
create mode 100644 contrib/depends/patches/boost/fix_coalesce.patch
create mode 100644 contrib/depends/patches/cmake/cmake-1-fixes.patch
create mode 100644 contrib/depends/patches/fontconfig/gperf_header_regen.patch
create mode 100644 contrib/depends/patches/hidapi/missing_win_include.patch
create mode 100644 contrib/depends/patches/icu4c/icu-001-dont-build-static-dynamic-twice.patch
create mode 100644 contrib/depends/patches/libgcrypt/gost-sb.h
create mode 100644 contrib/depends/patches/libgcrypt/no_gen_gost-sb.patch
create mode 100644 contrib/depends/patches/libiconv/fix-whitespace.patch
create mode 100644 contrib/depends/patches/libxcb/remove_pthread_stubs.patch
create mode 100644 contrib/depends/patches/libzip/no-clonefile.patch
create mode 100644 contrib/depends/patches/native_biplist/sorted_list.patch
create mode 100644 contrib/depends/patches/native_cctools/skip_otool.patch
create mode 100644 contrib/depends/patches/native_cdrkit/cdrkit-deterministic.patch
create mode 100644 contrib/depends/patches/native_mac_alias/python3.patch
create mode 100644 contrib/depends/patches/native_qmake/no-xlib.patch
create mode 100644 contrib/depends/patches/native_qmake/qt.pro
create mode 100644 contrib/depends/patches/ncurses/fallback.c
create mode 100644 contrib/depends/patches/openssl/fix_darwin.patch
create mode 100644 contrib/depends/patches/polyseed/force-static-mingw.patch
create mode 100644 contrib/depends/patches/polyseed/no_shared.patch
create mode 100644 contrib/depends/patches/qt/dont_hardcode_pwd.patch
create mode 100644 contrib/depends/patches/qt/dont_hardcode_x86_64.patch
create mode 100644 contrib/depends/patches/qt/duplicate_lcqpafonts.patch
create mode 100644 contrib/depends/patches/qt/fast_fixed_dtoa_no_optimize.patch
create mode 100644 contrib/depends/patches/qt/fix_android_jni_static.patch
create mode 100644 contrib/depends/patches/qt/fix_limits_header.patch
create mode 100644 contrib/depends/patches/qt/fix_montery_include.patch
create mode 100644 contrib/depends/patches/qt/fix_no_printer.patch
create mode 100644 contrib/depends/patches/qt/fix_qt_pkgconfig.patch
create mode 100644 contrib/depends/patches/qt/fix_rcc_determinism.patch
create mode 100644 contrib/depends/patches/qt/guix_cross_lib_path.patch
create mode 100644 contrib/depends/patches/qt/mac-qmake.conf
create mode 100644 contrib/depends/patches/qt/no-xlib.patch
create mode 100644 contrib/depends/patches/qt/qt.pro
create mode 100644 contrib/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch
create mode 100644 contrib/depends/patches/qt/qttools_src.pro
create mode 100644 contrib/depends/patches/qt/rcc_hardcode_timestamp.patch
create mode 100644 contrib/depends/patches/qt/use_android_ndk23.patch
create mode 100644 contrib/depends/patches/sodium/disable-glibc-getrandom-getentropy.patch
create mode 100644 contrib/depends/patches/sodium/fix-whitespace.patch
create mode 100644 contrib/depends/patches/unwind/fix_obj_order.patch
create mode 100644 contrib/depends/patches/zeromq/06aba27b04c5822cb88a69677382a0f053367143.patch
create mode 100644 contrib/depends/toolchain.cmake.in
create mode 100644 contrib/guix/INSTALL.md
create mode 100644 contrib/guix/LICENSE.txt
create mode 100644 contrib/guix/README.md
create mode 100755 contrib/guix/guix-build
create mode 100755 contrib/guix/guix-clean
create mode 100755 contrib/guix/libexec/build.sh
create mode 100644 contrib/guix/libexec/prelude.bash
create mode 100644 contrib/guix/manifest.scm
create mode 100644 contrib/guix/patches/elfsteem-value-error-python-39.patch
create mode 100644 contrib/guix/patches/gcc-broken-longjmp.patch
create mode 100644 contrib/guix/patches/glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch
create mode 100644 contrib/guix/patches/glibc-2.24-fcommon.patch
create mode 100644 contrib/guix/patches/glibc-2.24-no-build-time-cxx-header-run.patch
create mode 100644 contrib/guix/patches/glibc-2.27-dont-redefine-nss-database.patch
create mode 100644 contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch
create mode 100644 contrib/guix/patches/glibc-ldd-x86_64.patch
create mode 100644 contrib/guix/patches/glibc-versioned-locpath.patch
create mode 100644 contrib/guix/patches/nsis-gcc-10-memmove.patch
create mode 100644 contrib/guix/patches/oscrypto-hard-code-openssl.patch
create mode 100644 contrib/guix/patches/vmov-alignment.patch
create mode 100644 contrib/shell/git-utils.bash
create mode 100644 contrib/shell/realpath.bash
diff --git a/.gitignore b/.gitignore
index 5f92865..97fbf2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,7 @@ cmake-build-debug/*
*.user
*.stash
build/*
-build*/
+guix-*
CMakeCache.txt
CMakeFiles
cmake_install.cmake
diff --git a/BUILDING.md b/BUILDING.md
deleted file mode 100644
index 32c24de..0000000
--- a/BUILDING.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# Building Feather
-
-Release binaries (except macOS) are built using Docker. If you are looking to build Feather without Docker,
-see [HACKING.MD](https://github.com/feather-wallet/feather/blob/master/HACKING.md).
-
-## Docker
-
-Builds with Docker are done in 3 steps:
-
-1. Cloning this repository (+submodules)
-2. Creating a base image containing the build environment
-3. Building Feather using the base image
-
-### Linux x86-64 (reproducible)
-
-The instructions in this section are for 64-bit AMD/Intel processors. For ARM64 platforms see the next section.
-
-Binaries produced in this section are reproducible and their digests should match those of release binaries.
-
-#### 1. Clone
-
-Replace `master` with the desired version tag (e.g. `1.0.1`) to build the release binary.
-
-```bash
-git clone https://github.com/feather-wallet/feather.git
-cd feather
-git checkout master
-git submodule update --init --recursive
-```
-
-#### 2. Base image
-
-```bash
-docker build -t feather:linux -f Dockerfile.linux --build-arg THREADS=8 .
-```
-
-Building the base image takes a while. You only need to build the base image once per release.
-
-#### 3. Build
-
-##### Standalone static binary
-
-If you're re-running a build make sure to `rm -rf build/` first.
-
-```bash
-docker run --rm -it -v $PWD:/feather -w /feather feather:linux sh -c 'WITH_SCANNER=Off make release-static -j8'
-```
-
-The resulting binary can be found in `./build/bin/`.
-
-##### AppImage
-
-```bash
-rm -rf build
-docker run --rm -it -v $PWD:/feather -w /feather feather:linux sh -c 'make release-static -j8'
-docker run --rm -it -v $PWD:/feather -w /feather/build feather:linux ../contrib/build-appimage.sh
-```
-
-The resulting AppImage will be located in `./build`.
-
-### Linux ARM64 (reproducible)
-
-This section describes how to build Feather for ARM64 based platforms (including Raspberry Pi 3 and later, running 64-bit Rasbian).
-
-Binaries produced in this section are not yet reproducible.
-
-#### 1. Clone
-
-Replace `master` with the desired version tag (e.g. `1.0.1`) to build the release binary.
-
-```bash
-git clone https://github.com/feather-wallet/feather.git
-cd feather
-git checkout master
-git submodule update --init --recursive
-```
-
-#### 2. Base image
-
-```bash
-docker build --tag feather:linux-arm64 --platform linux/arm64 -f Dockerfile.linux --build-arg THREADS=8 .
-```
-
-Building the base image takes a while (especially when emulated on x86-64). You only need to build the base image once per release.
-
-#### 3. Build
-
-##### Standalone static binary
-
-```bash
-docker run --platform linux/arm64/v8 --rm -it -v $PWD:/feather -w /feather feather:linux-arm64 sh -c 'WITH_SCANNER=Off make release-static-linux-arm64 -j8'
-```
-
-Note: If you intend to run Feather on a Raspberry Pi or any device without AES hardware acceleration, use the following command instead:
-
-```bash
-docker run --platform linux/arm64/v8 --rm -it -v $PWD:/feather -w /feather feather:linux-arm64 sh -c 'WITH_SCANNER=Off make release-static-linux-arm64-rpi -j8'
-```
-
-The resulting binary can be found in `./build/bin/`.
-
-##### AppImage
-
-##### ARMv8-a (with AES hardware acceleration)
-
-```bash
-rm -rf build
-docker run --rm -it -v $PWD:/feather --platform linux/arm64/v8 -w /feather feather:linux-arm64 sh -c 'make release-static-linux-arm64 -j8'
-docker run --rm -it -v $PWD:/feather --platform linux/arm64/v8 -w /feather/build feather:linux-arm64 ../contrib/build-appimage-arm64.sh
-```
-
-##### Raspberry Pi
-
-```bash
-rm -rf build
-docker run --rm -it -v $PWD:/feather --platform linux/arm64/v8 -w /feather feather:linux-arm64 sh -c 'make release-static-linux-arm64-rpi -j8'
-docker run --rm -it -v $PWD:/feather --platform linux/arm64/v8 -w /feather/build feather:linux-arm64 ../contrib/build-appimage-arm64.sh
-```
-
-The resulting AppImage will be located in `./build`.
-
-### Windows (reproducible)
-
-#### 1. Clone
-
-```bash
-git clone --branch master --recursive https://github.com/feather-wallet/feather.git
-cd feather
-```
-
-Replace `master` with the desired version tag (e.g. `1.0.1`) to build the release binary.
-
-#### 2. Base image
-
-
-```bash
-docker build -f Dockerfile.windows --tag feather:win --build-arg THREADS=4 .
-```
-
-Building the base image takes a while. You only need to build the base image once.
-
-#### 3. Build
-
-```bash
-docker run --rm -it -v $PWD:/feather -w /feather feather:win sh -c 'make release-static-windows root=/depends target=x86_64-w64-mingw32 tag=win-x64 -j4'
-```
-
-If you're re-running a build make sure to `rm -rf build/` first.
-
-The resulting binary can be found in `./build/x86_64-w64-mingw32/release/bin/`.
-
-### macOS
-
-Docker builds for macOS are not currently supported. To build Feather on macOS follow the steps in [HACKING.md](HACKING.md).
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f8b343..57da17e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ project(feather)
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
-set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(VERSION_MAJOR "2")
@@ -11,6 +11,9 @@ set(VERSION_MINOR "1")
set(VERSION_REVISION "2")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
+set ( CMAKE_CXX_FLAGS "-no-pie" )
+#target_compile_options(feather PRIVATE -no-pie)
+
option(STATIC "Link libraries statically, requires static Qt")
option(SELF_CONTAINED "Disable when building Feather for packages" OFF)
@@ -28,6 +31,7 @@ include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckIncludeFile)
include(CheckSymbolExists)
+include(SelectLibraryConfigurations)
if(DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
@@ -84,7 +88,8 @@ if(Polyseed_SUBMODULE)
endif()
# libzip
-find_package(zlib CONFIG)
+set(ZLIB_USE_STATIC_LIBS "ON")
+find_package(ZLIB REQUIRED)
find_path(LIBZIP_INCLUDE_DIRS zip.h)
find_library(LIBZIP_LIBRARIES zip)
@@ -98,6 +103,8 @@ endif()
if(MINGW)
set(Boost_THREADAPI win32)
endif()
+
+set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.58 REQUIRED COMPONENTS
system
filesystem
@@ -107,7 +114,8 @@ find_package(Boost 1.58 REQUIRED COMPONENTS
regex
serialization
program_options
- locale)
+ locale
+ )
if(UNIX AND NOT APPLE)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -115,12 +123,12 @@ if(UNIX AND NOT APPLE)
set(CMAKE_SKIP_RPATH ON)
endif()
- find_package(X11 REQUIRED)
- message(STATUS "X11_FOUND = ${X11_FOUND}")
- message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
- message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
- include_directories(${X11_INCLUDE_DIR})
- link_directories(${X11_LIBRARIES})
+# find_package(X11 REQUIRED)
+# message(STATUS "X11_FOUND = ${X11_FOUND}")
+# message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
+# message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
+# include_directories(${X11_INCLUDE_DIR})
+# link_directories(${X11_LIBRARIES})
if(STATIC)
find_library(XCB_LIBRARY xcb)
message(STATUS "Found xcb library: ${XCB_LIBRARY}")
@@ -175,11 +183,11 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
- if(DEPENDS)
- set(ICU_LIBRARIES iconv)
- else()
- set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
- endif()
+# if(DEPENDS)
+# set(ICU_LIBRARIES iconv)
+# else()
+# set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv)
+# endif()
elseif(APPLE)
set(EXTRA_LIBRARIES "-framework AppKit")
elseif(OPENBSD)
@@ -217,7 +225,7 @@ add_c_flag_if_supported(-Wformat-security C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-Wformat-security CXX_SECURITY_FLAGS)
# -fstack-protector
-if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
+if (NOT OPENBSD)
add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS)
@@ -246,10 +254,10 @@ if (APPLE)
add_linker_flag_if_supported(-Wl,-dead_strip LD_SECURITY_FLAGS)
add_linker_flag_if_supported(-Wl,-dead_strip_dylibs LD_SECURITY_FLAGS)
endif()
-if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
- # Windows binaries die on startup with PIE when compiled with GCC
- add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
-endif()
+#if (NOT APPLE AND NOT (WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU"))
+# # Windows binaries die on startup with PIE when compiled with GCC
+# add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
+#endif()
add_linker_flag_if_supported(-Wl,-z,relro LD_SECURITY_FLAGS)
add_linker_flag_if_supported(-Wl,-z,now LD_SECURITY_FLAGS)
add_linker_flag_if_supported(-Wl,-z,noexecstack noexecstack_SUPPORTED)
@@ -268,19 +276,6 @@ if (WIN32)
add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS)
endif()
-if(STATIC)
- add_linker_flag_if_supported(-static-libgcc STATIC_FLAGS)
- add_linker_flag_if_supported(-static-libstdc++ STATIC_FLAGS)
- if(MINGW)
- add_linker_flag_if_supported(-static STATIC_FLAGS)
- endif()
-endif()
-
-# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
-# is fixed in the code (Issue #847), force compiler to be conservative.
-add_c_flag_if_supported(-fno-strict-aliasing C_SECURITY_FLAGS)
-add_cxx_flag_if_supported(-fno-strict-aliasing CXX_SECURITY_FLAGS)
-
add_c_flag_if_supported(-fPIC C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fPIC CXX_SECURITY_FLAGS)
diff --git a/Dockerfile.linux b/Dockerfile.linux
deleted file mode 100644
index 65c5b81..0000000
--- a/Dockerfile.linux
+++ /dev/null
@@ -1,324 +0,0 @@
-FROM ubuntu:bionic-20210723
-
-ARG THREADS=4
-
-ENV CFLAGS="-fPIC"
-ENV CPPFLAGS="-fPIC"
-ENV CXXFLAGS="-fPIC"
-ENV SOURCE_DATE_EPOCH=1397818193
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Feather build flags
-ENV CHECK_UPDATES=ON
-ENV WITH_SCANNER=ON
-
-COPY --from=featherwallet/feather-deps:linux-1.0.0 /deps /deps
-COPY --from=featherwallet/feather-deps:linux-1.0.0 /var/cache/apt/archives /archives
-
-RUN apt-get update && \
- apt-get install -y gpg xz-utils ca-certificates wget && \
- rm -rf /var/lib/apt/lists/*
-
-COPY contrib/build-deps/verify-packages.sh .
-RUN bash verify-packages.sh && \
- cd /archives && \
- dpkg -i --force-depends *.deb && \
- rm -rf /deps /archives
-
-# OpenSSL: Required for CMake, Qt 5.15, libwallet, Tor
-ENV OPENSSL_ROOT_DIR=/usr/local/openssl/
-RUN git clone -b OpenSSL_1_1_1p --depth 1 https://github.com/openssl/openssl.git && \
- cd openssl && \
- git reset --hard 8aaca20cf9996257d1ce2e6f4d3059b3698dde3d && \
- ./config no-shared no-dso --prefix=/usr/local/openssl && \
- make -j$THREADS && \
- make -j$THREADS install_sw && \
- rm -rf $(pwd)
-
-# CMake: Required to build libqrencode, monero-seed, libzip
-RUN git clone -b v3.22.2 --depth 1 https://github.com/Kitware/CMake && \
- cd CMake && \
- git reset --hard 8428e39ed9cddb3b7f1a6f7a58cb8617503183d2 && \
- ./bootstrap && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# freetype2: Required for Qt 5.15, fontconfig
-RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \
- cd freetype2 && \
- git reset --hard 132f19b779828b194b3fede187cee719785db4d8 && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static --with-zlib=no && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# expat: Required for fontconfig
-RUN git clone -b R_2_2_9 --depth 1 https://github.com/libexpat/libexpat && \
- cd libexpat/expat && \
- git reset --hard a7bc26b69768f7fb24f0c7976fae24b157b85b13 && \
- ./buildconf.sh && \
- ./configure --disable-shared --enable-static && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# fontconfig: Required for Qt 5.15
-RUN git clone -b 2.13.92 --depth 1 https://gitlab.freedesktop.org/fontconfig/fontconfig && \
- cd fontconfig && \
- git reset --hard b1df1101a643ae16cdfa1d83b939de2497b1bf27 && \
- ./autogen.sh --disable-shared --enable-static --sysconfdir=/etc --localstatedir=/var && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-COPY contrib/QTBUG-92199-fix.patch .
-
-ENV QT_VERSION=v5.15.5-lts-lgpl
-RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
- cd qt5 && \
- git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtx11extras.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \
- sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \
- sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \
- sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \
- cd qtbase && cat ../../QTBUG-92199-fix.patch && git apply ../../QTBUG-92199-fix.patch
-
-RUN cd qt5 && \
- if [ "$(uname -m)" = "aarch64" ]; then \
- export LIBDIR="/usr/lib/aarch64-linux-gnu"; \
- export QT_PLATFORM="linux-aarch64-gnu-g++"; \
- else \
- export LIBDIR="/usr/lib/x86_64-linux-gnu"; \
- export QT_PLATFORM="linux-g++-64"; \
- fi && \
- rm $LIBDIR/libX11.a && \
- rm $LIBDIR/libX11-xcb.a && \
- OPENSSL_LIBS="-lssl -lcrypto -lpthread -ldl" \
- ./configure --prefix=/usr -platform $QT_PLATFORM -opensource -confirm-license -release -static -no-avx \
- -no-opengl -qpa xcb --xcb -xcb-xlib -feature-xlib -openssl-linked -I /usr/local/openssl/include \
- -L /usr/local/openssl/lib -system-freetype -fontconfig -glib \
- -no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \
- -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
- -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \
- -skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \
- -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \
- -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \
- -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \
- -skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \
- -skip qtdeclarative -gstreamer \
- -no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation \
- -nomake examples -nomake tests -nomake tools && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# boost: Required for libwallet
-RUN wget https://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.bz2 && \
- echo "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402 boost_1_73_0.tar.bz2" | sha256sum -c && \
- tar -xvf boost_1_73_0.tar.bz2 && \
- rm boost_1_73_0.tar.bz2 && \
- cd boost_1_73_0 && \
- ./bootstrap.sh && \
- ./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \
- rm -rf $(pwd)
-
-# libusb: Required for libwallet
-RUN git clone -b v1.0.24 --depth 1 https://github.com/libusb/libusb && \
- cd libusb && \
- git reset --hard c6a35c56016ea2ab2f19115d2ea1e85e0edae155 && \
- ./autogen.sh --disable-shared --enable-static && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# hidapi: Required for libwallet
-RUN git clone -b hidapi-0.10.1 --depth 1 https://github.com/libusb/hidapi && \
- cd hidapi && \
- git reset --hard f6d0073fcddbdda24549199445e844971d3c9cef && \
- ./bootstrap && \
- ./configure --disable-shared --enable-static && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# libsodium: Required for libwallet
-RUN git clone -b 1.0.18-RELEASE --depth 1 https://github.com/jedisct1/libsodium.git && \
- cd libsodium && \
- git reset --hard 940ef42797baa0278df6b7fd9e67c7590f87744b && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# protobuf: Required for libwallet
-RUN git clone -b v3.10.0 --depth 1 https://github.com/protocolbuffers/protobuf && \
- cd protobuf && \
- git reset --hard 6d4e7fd7966c989e38024a8ea693db83758944f1 && \
- ./autogen.sh && \
- ./configure --enable-static --disable-shared && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# unbound: Required for libwallet
-RUN git clone -b release-1.13.2 --depth 1 https://github.com/NLnetLabs/unbound.git && \
- cd unbound && \
- git reset --hard 8e538dcaa8df2d0fab8ff3dcf94ac1f972450b66 && \
- ./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr/local/ --with-ssl=/usr/local/openssl --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# squashfs-tools: Used to create Feather AppImage
-RUN git clone https://github.com/plougher/squashfs-tools.git && \
- cd squashfs-tools/squashfs-tools && \
- git reset --hard 38fa0720526222827da44b3b6c3f7eb63e8f5c2f && \
- make && \
- make install && \
- rm -rf $(pwd)
-
-# patchelf: Required by linuxdeployqt
-RUN git clone -b 0.12 --depth 1 https://github.com/NixOS/patchelf.git && \
- cd patchelf && \
- git reset --hard 8d3a16e97294e3c5521c61b4c8835499c9918264 && \
- ./bootstrap.sh && \
- ./configure && \
- make -j$THREADS && \
- make install && \
- rm -rf $(pwd)
-
-# linuxdeployqt: Used to create Feather AppImage
-# build from source because latest release does not allow glibc 2.27
-RUN git clone https://github.com/probonopd/linuxdeployqt.git && \
- cd linuxdeployqt && \
- git reset --hard b4697483c98120007019c3456914cfd1dba58384 && \
- qmake && \
- make -j$THREADS && \
- make install && \
- rm -rf $(pwd)
-
-# libevent: Required for Tor
-RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz && \
- echo "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb libevent-2.1.12-stable.tar.gz" | sha256sum -c && \
- tar -zxvf libevent-2.1.12-stable.tar.gz && \
- cd libevent-2.1.12-stable && \
- PKG_CONFIG_PATH=/usr/local/openssl/lib/pkgconfig/ \
- ./configure --prefix=/usr/local/libevent \
- --disable-shared \
- --enable-static \
- --with-pic && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# zlib: Required for Tor
-RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \
- cd zlib && \
- git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f && \
- ./configure --static --prefix=/usr/local/zlib && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# Tor: Optional for Feather (-DTOR_DIR)
-# Binary can be embedded in Feather
-# TOR_VERSION is used by CMAKE to determine embedded version
-ENV TOR_VERSION=0.4.7.8
-ENV TOR_DIR=/usr/local/tor/bin/
-RUN git clone -b tor-0.4.7.8 --depth 1 https://git.torproject.org/tor.git && \
- cd tor && \
- git reset --hard 7528524aee3ffe3c9b7c69fa18f659e1993f59a3 && \
- ./autogen.sh && \
- ./configure \
- --disable-asciidoc \
- --disable-manpage \
- --disable-html-manual \
- --disable-system-torrc \
- --disable-module-relay \
- --disable-lzma \
- --disable-zstd \
- --enable-static-tor \
- --with-libevent-dir=/usr/local/libevent \
- --with-openssl-dir=/usr/local/openssl \
- --with-zlib-dir=/usr/local/zlib \
- --disable-tool-name-check \
- --enable-fatal-warnings \
- --prefix=/usr/local/tor && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd) && \
- strip -s -D /usr/local/tor/bin/tor && \
- rm /usr/local/tor/bin/tor?*
-
-# libqrencode: Required for Feather
-# Used to display QR Codes
-RUN git clone -b v4.1.1 --depth 1 https://github.com/fukuchi/libqrencode.git && \
- cd libqrencode && \
- git reset --hard 715e29fd4cd71b6e452ae0f4e36d917b43122ce8 && \
- cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# libzip: Required for Feather
-# Used to unzip updates downloaded by the built-in updater
-RUN git clone -b v1.7.3 --depth 1 https://github.com/nih-at/libzip.git && \
- cd libzip && \
- git reset --hard 66e496489bdae81bfda8b0088172871d8fda0032 && \
- cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# libgpg-error: Required for libgcrypt
-RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.git && \
- cd libgpg-error && \
- git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static --disable-doc --disable-tests && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# libgcrypt: Required for Feather
-# Used in src/openpgp to verify updates downloaded by the built-in updater
-RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git && \
- cd libgcrypt && \
- git reset --hard 56606331bc2a80536db9fc11ad53695126007298 && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static --disable-doc && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# zbar: Optional for Feather (-DWITH_SCANNER)
-# Used to scan for QR Codes
-RUN git clone -b stable-0.21 --recursive https://github.com/mchehab/zbar.git && \
- cd zbar && \
- git reset --hard 505f1a87b32cb7bb0edbaf37e20ccdd46bbae2a3 && \
- autoreconf -vfi && \
- ./configure --enable-static --disable-shared --without-imagemagick --with-gtk=no --with-python=no --enable-doc=no && \
- make -j$THREADS && \
- make install && \
- rm -rf $(pwd)
-
-# polyseed: Required for Feather
-RUN git clone https://github.com/tevador/polyseed.git && \
- cd polyseed && \
- git reset --hard 4945d8239d6b26dc12723ca2aaa9f8110ceff5af && \
- mkdir build && \
- cd build && \
- cmake .. && \
- make && \
- make install && \
- rm /usr/local/lib/libpolyseed.so* && \
- rm -rf $(pwd)
\ No newline at end of file
diff --git a/Dockerfile.windows b/Dockerfile.windows
deleted file mode 100644
index 230ca0e..0000000
--- a/Dockerfile.windows
+++ /dev/null
@@ -1,189 +0,0 @@
-FROM ubuntu:20.04
-
-ARG THREADS=1
-ARG QT_VERSION=v5.15.5-lts-lgpl
-ENV SOURCE_DATE_EPOCH=1397818193
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Feather build flags
-ENV CHECK_UPDATES=ON
-ENV WITH_SCANNER=ON
-
-ENV OPENSSL_ROOT_DIR=/usr/local/openssl/
-
-RUN apt update && \
- apt install -y \
- curl wget zip automake build-essential gcc-mingw-w64 g++-mingw-w64 gettext git libtool pkg-config \
- python \
-# zbar
- autopoint && \
- rm -rf /var/lib/apt/lists/*
-
-RUN update-alternatives --set x86_64-w64-mingw32-g++ $(which x86_64-w64-mingw32-g++-posix) && \
- update-alternatives --set x86_64-w64-mingw32-gcc $(which x86_64-w64-mingw32-gcc-posix)
-
-# The version from ubuntu repo is too old
-RUN git clone -b v3.22.2 --depth 1 https://github.com/Kitware/CMake && \
- cd CMake && \
- git reset --hard 8428e39ed9cddb3b7f1a6f7a58cb8617503183d2 && \
- ./bootstrap -- -DCMAKE_USE_OPENSSL=OFF && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-RUN git clone -b master https://github.com/monero-project/monero && \
- cd monero && \
- git reset --hard 9aab19f349433687c7aaf2c1cbc5751e5912c0aa && \
- cp -a contrib/depends / && \
- cd .. && \
- rm -rf monero
-
-RUN make -j$THREADS -C /depends HOST=x86_64-w64-mingw32 NO_QT=1
-
-COPY contrib/QTBUG-92199-fix.patch .
-RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \
- cd qt5 && \
- git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtxmlpatterns.git -b ${QT_VERSION} --depth 1 && \
- git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \
- cd qtbase && cat ../../QTBUG-92199-fix.patch && git apply ../../QTBUG-92199-fix.patch && cd .. && \
- OPENSSL_LIBS="-lssl -lcrypto -lws2_32" \
- ./configure --prefix=/depends/x86_64-w64-mingw32 -xplatform win32-g++ \
- -device-option CROSS_COMPILE=/usr/bin/x86_64-w64-mingw32- \
- -I $(pwd)/qtbase/src/3rdparty/angle/include \
- -opensource -confirm-license -release -static -static-runtime -no-opengl \
- -no-avx -openssl-linked -I /depends/x86_64-w64-mingw32/include -L /depends/x86_64-w64-mingw32/lib \
- -qt-freetype -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \
- -skip gamepad -skip location -skip qt3d -skip qtactiveqt -skip qtandroidextras \
- -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdoc \
- -skip qtgamepad -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing \
- -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
- -skip qtspeech -skip qttools -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel \
- -skip qtwebengine -skip qtwebview -skip qtwinextras -skip qtx11extras \
- -skip qtdeclarative -skip qtquickcontrols -skip qtquickcontrols2 \
- -skip serialbus -skip webengine \
- -nomake examples -nomake tests -nomake tools && \
- make -j$THREADS && \
- make -j$THREADS install && \
- cd qttools/src/linguist/lrelease && \
- ../../../../qtbase/bin/qmake && \
- make -j$THREADS && \
- make -j$THREADS install && \
- cd ../../../.. && \
- rm -rf $(pwd)
-
-RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.git && \
- cd libgpg-error && \
- git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static --disable-doc --disable-tests \
- --host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- cd .. && \
- rm -rf libgpg-error
-
-RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git && \
- cd libgcrypt && \
- git reset --hard 56606331bc2a80536db9fc11ad53695126007298 && \
- ./autogen.sh && \
- ./configure --disable-shared --enable-static --disable-doc \
- --host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 \
- --with-gpg-error-prefix=/depends/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- cd .. && \
- rm -rf libgcrypt
-
-# zlib -> libpng
-RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \
- cd zlib && \
- git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f && \
- CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar ./configure --static --prefix=/usr/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# libpng -> libqrencode
-RUN git clone -b libpng16 --depth 1 https://github.com/glennrp/libpng.git && \
- cd libpng && \
- git reset --hard a37d4836519517bdce6cb9d956092321eca3e73b && \
- CPPFLAGS="-I/depends/x86_64-w64-mingw32/include" LDFLAGS="-L/depends/x86_64-w64-mingw32/lib" \
- ./configure --host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-RUN git clone -b v4.0.2 --depth 1 https://github.com/fukuchi/libqrencode.git && \
- cd libqrencode && \
- git reset --hard 59ee597f913fcfda7a010a6e106fbee2595f68e4 && \
- ./autogen.sh && \
- CPPFLAGS="-I/depends/x86_64-w64-mingw32/include" LDFLAGS="-L/depends/x86_64-w64-mingw32/lib" \
- ./configure --disable-shared --enable-static --host=x86_64-w64-mingw32 --prefix=/depends/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-RUN wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz && \
- echo "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04 libiconv-1.16.tar.gz" | sha256sum -c && \
- tar -xzf libiconv-1.16.tar.gz && \
- rm libiconv-1.16.tar.gz && \
- cd libiconv-1.16 && \
- ./configure --enable-static --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-# TOR_VERSION is used by CMAKE to determine embedded version
-ENV TOR_VERSION=0.4.7.8
-ENV TOR_DIR=/tor/Tor/
-RUN wget https://dist.torproject.org/torbrowser/11.0.15/tor-win64-0.4.7.8.zip && \
- echo "14115567eb9674c79481509ac97d4a7b76c80a36966dd9864989a96670440757 tor-win64-0.4.7.8.zip" | sha256sum -c && \
- unzip tor-win64-0.4.7.8.zip -d tor && \
- rm tor-win64-0.4.7.8.zip
-
-RUN git clone https://github.com/nih-at/libzip.git && \
- cd libzip && \
- git reset --hard 66e496489bdae81bfda8b0088172871d8fda0032 && \
- cmake -DCMAKE_INSTALL_PREFIX=/depends/x86_64-w64-mingw32 \
- -DCMAKE_TOOLCHAIN_FILE=/depends/x86_64-w64-mingw32/share/toolchain.cmake \
- -DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_PREFIX_PATH=/usr/x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make -j$THREADS install && \
- rm -rf $(pwd)
-
-RUN git clone -b 0.23.92 --depth 1 --recursive https://github.com/mchehab/zbar.git && \
- cd zbar && \
- git reset --hard aac86d5f08d64ab4c3da78188eb622fa3cb07182 && \
- autoreconf -vfi && \
- ./configure --enable-static --disable-shared --without-imagemagick --disable-video --without-xv --with-gtk=no --with-python=no --enable-doc=no --host=x86_64-w64-mingw32 && \
- make -j$THREADS && \
- make install && \
- rm -rf $(pwd)
-
-COPY contrib/patches/polyseed/force-static-mingw.patch .
-COPY contrib/patches/polyseed/no_shared.patch .
-
-# polyseed: Required for Feather
-RUN git clone https://github.com/tevador/polyseed.git && \
- cd polyseed && \
- git reset --hard 4945d8239d6b26dc12723ca2aaa9f8110ceff5af && \
- git apply ../force-static-mingw.patch && \
- git apply ../no_shared.patch && \
- mkdir build && \
- cd build && \
- cmake -DCMAKE_INSTALL_PREFIX=/depends/x86_64-w64-mingw32 \
- -DCMAKE_TOOLCHAIN_FILE=/depends/x86_64-w64-mingw32/share/toolchain.cmake \
- -DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_PREFIX_PATH=/usr/x86_64-w64-mingw32 .. && \
- make && \
- make install && \
- rm -rf $(pwd)
-
-RUN git config --global --add safe.directory /feather/monero
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 16a5384..5c6f247 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,17 @@ CMAKEFLAGS = \
-DWITH_SCANNER=$(or ${WITH_SCANNER}, Off) \
-DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH}, Off)
+guix:
+ mkdir -p build/$(target)/release && \
+ cd build/$(target)/release && \
+ cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
+ -DCMAKE_PREFIX_PATH=/gnu/store \
+ -DCMAKE_PREFIX_PATH=$(CURDIR)/contrib/depends/$(target) \
+ -DCMAKE_PREFIX_PATH=$(CURDIR)/contrib/depends/$(target)/native/bin \
+ -DCMAKE_TOOLCHAIN_FILE=/feather/contrib/depends/$(target)/share/toolchain.cmake ../../.. \
+ $(CMAKEFLAGS) && \
+ $(MAKE)
+
release:
mkdir -p build/release && \
cd build/release && \
diff --git a/README.md b/README.md
index 3fef8f5..f7f2e36 100644
--- a/README.md
+++ b/README.md
@@ -24,11 +24,11 @@ Donations help pay for hosting, build servers, domain names, e-mail and other re
`47ntfT2Z5384zku39pTM6hGcnLnvpRYW2Azm87GiAAH2bcTidtq278TL6HmwyL8yjMeERqGEBs3cqC8vvHPJd1cWQrGC65f`
-## Building from source
+## Deterministic builds
-See [BUILDING.md](https://github.com/feather-wallet/feather/blob/master/BUILDING.md) for information on how to build from source.
+See [contrib/guix/README.md](https://github.com/feather-wallet/feather/blob/master/contrib/guix/README.md) for more information.
-## Developers
+## Development
If you are looking to set up a development environment for Feather, see [HACKING.md](https://github.com/feather-wallet/feather/blob/master/HACKING.md).
diff --git a/cmake/Deploy.cmake b/cmake/Deploy.cmake
index 726195b..55992b0 100644
--- a/cmake/Deploy.cmake
+++ b/cmake/Deploy.cmake
@@ -5,6 +5,7 @@ if(APPLE OR (WIN32 AND NOT STATIC))
if(APPLE AND NOT IOS)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
+ MESSAGE(INFO "MACDEPLOY ${MACDEPLOYQT_EXECUTABLE}")
add_custom_command(TARGET deploy
POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$/../.." -always-overwrite
diff --git a/cmake/FindZBAR.cmake b/cmake/FindZBAR.cmake
index 94f26df..290f333 100644
--- a/cmake/FindZBAR.cmake
+++ b/cmake/FindZBAR.cmake
@@ -9,14 +9,6 @@ if(PkgConfig_FOUND)
endif()
endif()
-if(NOT ZBAR_LIBRARIES AND ANDROID)
- find_library(ZBARJNI_LIBRARY NAMES zbarjni)
- find_library(ICONV_LIBRARY NAMES iconv)
- if(ZBARJNI_LIBRARY AND ICONV_LIBRARY)
- set(ZBAR_LIBRARIES ${ZBARJNI_LIBRARY} ${ICONV_LIBRARY})
- endif()
-endif()
-
if(NOT ZBAR_INCLUDE_DIR)
find_path(ZBAR_H_PATH zbar.h)
if(ZBAR_H_PATH)
diff --git a/cmake/FindZLIB.cmake b/cmake/FindZLIB.cmake
index c86758f..29a6381 100644
--- a/cmake/FindZLIB.cmake
+++ b/cmake/FindZLIB.cmake
@@ -87,7 +87,7 @@ if(NOT ZLIB_LIBRARY)
find_library(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
endforeach()
- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ include(SelectLibraryConfigurations)
select_library_configurations(ZLIB)
endif()
@@ -116,7 +116,7 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
endif()
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
VERSION_VAR ZLIB_VERSION_STRING)
@@ -151,4 +151,6 @@ if(ZLIB_FOUND)
IMPORTED_LOCATION "${ZLIB_LIBRARY}")
endif()
endif()
+
+ message(STATUS "Found zlib libraries ${ZLIB_LIBRARIES}")
endif()
\ No newline at end of file
diff --git a/cmake/FindZlib.cmake b/cmake/FindZlib.cmake
new file mode 100644
index 0000000..0f52f64
--- /dev/null
+++ b/cmake/FindZlib.cmake
@@ -0,0 +1,21 @@
+find_package(PkgConfig)
+
+if(PkgConfig_FOUND)
+ pkg_check_modules(PC_ZLIB QUIET ZLIB)
+ if(PC_ZLIB_FOUND)
+ set(ZLIB_DEFINITIONS ${PC_ZLIB_CFLAGS_OTHER})
+ find_library(ZLIB_LIBRARIES NAMES ZLIB HINTS ${PC_ZLIB_LIBDIR} ${PC_ZLIB_LIBRARY_DIRS})
+ find_path(ZLIB_INCLUDE_DIR Decoder.h HINTS ${PC_ZLIB_INCLUDEDIR} ${PC_ZLIB_INCLUDE_DIRS})
+ endif()
+endif()
+
+if(NOT ZLIB_INCLUDE_DIR)
+ find_path(ZLIB_H_PATH ZLIB.h)
+ if(ZLIB_H_PATH)
+ set(ZLIB_INCLUDE_DIR "${ZLIB_H_PATH}")
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIR)
+message(STATUS "Found ZLIB libraries ${ZLIB_LIBRARIES}")
diff --git a/cmake/GenVersion.cmake b/cmake/GenVersion.cmake
index 220a03a..c23acf2 100644
--- a/cmake/GenVersion.cmake
+++ b/cmake/GenVersion.cmake
@@ -1,5 +1,5 @@
# Copyright (c) 2014-2019, The Monero Project
-#
+#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
diff --git a/contrib/depends/.gitignore b/contrib/depends/.gitignore
new file mode 100644
index 0000000..2287886
--- /dev/null
+++ b/contrib/depends/.gitignore
@@ -0,0 +1,14 @@
+SDKs/
+work/
+built/
+sources/
+config.site
+x86_64*
+i686*
+mips*
+arm*
+aarch64*
+powerpc*
+riscv32*
+riscv64*
+s390x*
\ No newline at end of file
diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile
new file mode 100644
index 0000000..9dcac43
--- /dev/null
+++ b/contrib/depends/Makefile
@@ -0,0 +1,308 @@
+.NOTPARALLEL :
+
+# Pattern rule to print variables, e.g. make print-top_srcdir
+print-%: FORCE
+ @echo '$*'='$($*)'
+
+# When invoking a sub-make, keep only the command line variable definitions
+# matching the pattern in the filter function.
+#
+# e.g. invoking:
+# $ make A=1 C=1 print-MAKEOVERRIDES print-MAKEFLAGS
+#
+# with the following in the Makefile:
+# MAKEOVERRIDES := $(filter A=% B=%,$(MAKEOVERRIDES))
+#
+# will print:
+# MAKEOVERRIDES = A=1
+# MAKEFLAGS = -- A=1
+#
+# this is because as the GNU make manual says:
+# The command line variable definitions really appear in the variable
+# MAKEOVERRIDES, and MAKEFLAGS contains a reference to this variable.
+#
+# and since the GNU make manual also says:
+# variables defined on the command line are passed to the sub-make through
+# MAKEFLAGS
+#
+# this means that sub-makes will be invoked as if:
+# $(MAKE) A=1 blah blah
+MAKEOVERRIDES := $(filter V=%,$(MAKEOVERRIDES))
+SOURCES_PATH ?= $(BASEDIR)/sources
+WORK_PATH = $(BASEDIR)/work
+BASE_CACHE ?= $(BASEDIR)/built
+SDK_PATH ?= $(BASEDIR)/SDKs
+FALLBACK_DOWNLOAD_PATH ?= https://downloads.getmonero.org/depends-sources
+
+BUILD = $(shell ./config.guess)
+HOST ?= $(BUILD)
+PATCHES_PATH = $(BASEDIR)/patches
+BASEDIR = $(CURDIR)
+HASH_LENGTH:=11
+DOWNLOAD_CONNECT_TIMEOUT:=30
+DOWNLOAD_RETRIES:=3
+HOST_ID_SALT ?= salt
+BUILD_ID_SALT ?= salt
+
+host:=$(BUILD)
+ifneq ($(HOST),)
+host:=$(HOST)
+endif
+
+ifneq ($(DEBUG),)
+release_type=Debug
+else
+release_type=Release
+endif
+
+ifneq ($(TESTS),)
+build_tests=ON
+release_type=Debug
+else
+build_tests=OFF
+endif
+
+base_build_dir=$(WORK_PATH)/build
+base_staging_dir=$(WORK_PATH)/staging
+base_download_dir=$(WORK_PATH)/download
+canonical_host:=$(shell ./config.sub $(HOST))
+build:=$(shell ./config.sub $(BUILD))
+
+build_arch =$(firstword $(subst -, ,$(build)))
+build_vendor=$(word 2,$(subst -, ,$(build)))
+full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build))
+build_os:=$(findstring linux,$(full_build_os))
+build_os+=$(findstring darwin,$(full_build_os))
+build_os:=$(strip $(build_os))
+ifeq ($(build_os),)
+build_os=$(full_build_os)
+endif
+
+host_arch=$(firstword $(subst -, ,$(canonical_host)))
+host_vendor=$(word 2,$(subst -, ,$(canonical_host)))
+full_host_os:=$(subst $(host_arch)-$(host_vendor)-,,$(canonical_host))
+host_os:=$(findstring android,$(full_host_os))
+ifeq ($(host_os),)
+host_os:=$(findstring linux,$(full_host_os))
+endif
+host_os+=$(findstring darwin,$(full_host_os))
+host_os+=$(findstring freebsd,$(full_host_os))
+host_os+=$(findstring mingw32,$(full_host_os))
+host_os:=$(strip $(host_os))
+ifeq ($(host_os),)
+host_os=$(full_host_os)
+endif
+
+$(host_arch)_$(host_os)_prefix=$(BASEDIR)/$(host)
+$(host_arch)_$(host_os)_host=$(host)
+host_prefix=$($(host_arch)_$(host_os)_prefix)
+build_prefix=$(host_prefix)/native
+ifeq ($(host_os),mingw32)
+host_cmake=Windows
+endif
+ifeq ($(host_os),linux)
+host_cmake=Linux
+endif
+ifeq ($(host_os),freebsd)
+host_cmake=FreeBSD
+endif
+ifeq ($(host_os),darwin)
+host_cmake=Darwin
+endif
+ifeq ($(host_os),android)
+host_cmake=Android
+endif
+
+AT_$(V):=
+AT_:=@
+AT:=$(AT_$(V))
+build_host=$(build)
+
+all: install
+
+include hosts/$(host_os).mk
+include hosts/default.mk
+include builders/$(build_os).mk
+include builders/default.mk
+include packages/packages.mk
+
+# Previously, we directly invoked the well-known programs using $(shell ...)
+# to construct build_id_string. However, that was problematic because:
+#
+# 1. When invoking a shell, GNU Make special-cases exit code 127 (command not
+# found) by not capturing the output but instead passing it through. This is
+# not done for any other exit code.
+#
+# 2. Characters like '#' (from these programs' output) would end up in make
+# variables like build_id_string, which would be wrongly interpreted by make
+# when these variables were used.
+#
+# Therefore, we should avoid having arbitrary strings in make variables where
+# possible. The gen_id script used here hashes the output to construct a
+# "make-safe" id.
+#
+# Also note that these lines need to be:
+#
+# 1. After including {hosts,builders}/*.mk, since they rely on the tool
+# variables (e.g. build_CC, host_STRIP, etc.) to be set.
+#
+# 2. Before including packages/*.mk (excluding packages/packages.mk), since
+# they rely on the build_id variables
+#
+build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
+$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
+
+
+qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_)
+tor_packages_$(NO_TOR) = $(tor_packages) $(tor_$(host_os)_packages)
+
+packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(tor_packages_)
+native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
+
+all_packages = $(packages) $(native_packages)
+
+meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk
+
+$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils)
+$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
+
+include funcs.mk
+
+CONF_PKGS := cmake-conf mxe-conf
+
+build-only-$(1)_$(3): CMAKE_RUNRESULT_FILE = $(PREFIX)/share/cmake/modules/TryRunResults.cmake
+build-only-$(1)_$(3): CMAKE_TOOLCHAIN_FILE = $(PREFIX)/$(3)/share/cmake/mxe-conf.cmake
+build-only-$(1)_$(3): CMAKE_TOOLCHAIN_DIR = $(PREFIX)/$(3)/share/cmake/mxe-conf.d
+build-only-$(1)_$(3): CMAKE_STATIC_BOOL = $(if $(findstring shared,$(3)),OFF,ON)
+build-only-$(1)_$(3): CMAKE_SHARED_BOOL = $(if $(findstring shared,$(3)),ON,OFF)
+
+
+toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
+final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
+final_build_id_long+=$(shell $(build_SHA256SUM) toolchain.cmake.in)
+final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
+$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
+ rm -rf $(@D)
+ mkdir -p $(@D)
+ echo copying packages: $^
+ echo to: $(@D)
+ cd $(@D); $(foreach package,$^, $(build_TAR) xf $($(package)_cached); )
+ touch $@
+
+# $PATH is not preserved between ./configure and make by convention. Its
+# modification and overriding at ./configure time is (as I understand it)
+# supposed to be captured by the AC_{PROG_{,OBJ}CXX,PATH_{PROG,TOOL}} macros,
+# which will expand the program names to their full absolute paths. The notable
+# exception is command line overriding: ./configure CC=clang, which skips the
+# program name expansion step, and works because the user implicitly indicates
+# with CC=clang that clang will be available in $PATH at all times, and is most
+# likely part of the user's system.
+#
+# Therefore, when we "seed the autoconf cache"/"override well-known program
+# vars" by setting AR= in our config.site, either one of two things needs
+# to be true for the build system to work correctly:
+#
+# 1. If we refer to the program by name (e.g. AR=riscv64-gnu-linux-ar), the
+# tool needs to be available in $PATH at all times.
+#
+# 2. If the tool is _**not**_ expected to be available in $PATH at all times
+# (such as is the case for our native_cctools binutils tools), it needs to
+# be referred to by its absolute path, such as would be output by the
+# AC_PATH_{PROG,TOOL} macros.
+#
+# Minor note: it is also okay to refer to tools by their absolute path even if
+# we expect them to be available in $PATH at all times, more specificity does
+# not hurt.
+$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
+ @mkdir -p $(@D)
+ sed -e 's|@HOST@|$(host)|' \
+ -e 's|@CC@|$(toolchain_path)$(host_CC)|' \
+ -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
+ -e 's|@AR@|$(toolchain_path)$(host_AR)|' \
+ -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
+ -e 's|@NM@|$(toolchain_path)$(host_NM)|' \
+ -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
+ -e 's|@build_os@|$(build_os)|' \
+ -e 's|@host_os@|$(host_os)|' \
+ -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
+ -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
+ -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
+ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
+ -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
+ -e 's|@debug@|$(DEBUG)|' \
+ $< > $@
+ touch $@
+
+$(host_prefix)/share/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id)
+ @mkdir -p $(@D)
+ sed -e 's|@HOST@|$(host)|' \
+ -e 's|@CC@|$(host_CC)|' \
+ -e 's|@CXX@|$(host_CXX)|' \
+ -e 's|@AR@|$(toolchain_path)$(host_AR)|' \
+ -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \
+ -e 's|@NM@|$(toolchain_path)$(host_NM)|' \
+ -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \
+ -e 's|@build_os@|$(build_os)|' \
+ -e 's|@host_os@|$(host_os)|' \
+ -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
+ -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
+ -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
+ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
+ -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
+ -e 's|@debug@|$(DEBUG)|' \
+ -e 's|@release_type@|$(release_type)|' \
+ -e 's|@build_tests@|$(build_tests)|' \
+ -e 's|@depends@|$(host_cmake)|' \
+ -e 's|@prefix@|$($(host_arch)_$(host_os)_prefix)|'\
+ -e 's|@arch@|$(host_arch)|'\
+ $< > $@
+ touch $@
+
+define check_or_remove_cached
+ mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \
+ $(build_SHA256SUM) -c $($(package)_cached_checksum) >/dev/null 2>/dev/null || \
+ ( rm -f $($(package)_cached_checksum); \
+ if test -f "$($(package)_cached)"; then echo "Checksum mismatch for $(package). Forcing rebuild.."; rm -f $($(package)_cached_checksum) $($(package)_cached); fi )
+endef
+
+define check_or_remove_sources
+ mkdir -p $($(package)_source_dir); cd $($(package)_source_dir); \
+ test -f $($(package)_fetched) && ( $(build_SHA256SUM) -c $($(package)_fetched) >/dev/null 2>/dev/null || \
+ ( echo "Checksum missing or mismatched for $(package) source. Forcing re-download."; \
+ rm -f $($(package)_all_sources) $($(1)_fetched))) || true
+endef
+
+check-packages:
+ @$(foreach package,$(all_packages),$(call check_or_remove_cached,$(package));)
+check-sources:
+ @$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));)
+
+$(host_prefix)/share/config.site: check-packages
+$(host_prefix)/share/toolchain.cmake: check-packages
+
+check-packages: check-sources
+
+clean-all: clean
+ @rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64*
+
+clean:
+ @rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD) *.log
+
+install: check-packages $(host_prefix)/share/config.site
+install: check-packages $(host_prefix)/share/toolchain.cmake
+
+download-one: check-sources $(all_sources)
+
+download-osx:
+ @$(MAKE) -s HOST=x86_64-apple-darwin download-one
+download-linux:
+ @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one
+download-win:
+ @$(MAKE) -s HOST=x86_64-w64-mingw32 download-one
+download: download-osx download-linux download-win
+
+$(foreach package,$(all_packages),$(eval $(call ext_add_stages,$(package))))
+
+.PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources
+.PHONY: FORCE
+$(V).SILENT:
diff --git a/contrib/depends/builders/darwin.mk b/contrib/depends/builders/darwin.mk
new file mode 100644
index 0000000..8ed82b2
--- /dev/null
+++ b/contrib/depends/builders/darwin.mk
@@ -0,0 +1,30 @@
+build_darwin_CC:=$(shell xcrun -f clang) -isysroot$(shell xcrun --show-sdk-path)
+build_darwin_CXX:=$(shell xcrun -f clang++) -isysroot$(shell xcrun --show-sdk-path)
+build_darwin_AR:=$(shell xcrun -f ar)
+build_darwin_RANLIB:=$(shell xcrun -f ranlib)
+build_darwin_STRIP:=$(shell xcrun -f strip)
+build_darwin_OTOOL:=$(shell xcrun -f otool)
+build_darwin_NM:=$(shell xcrun -f nm)
+build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
+build_darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
+build_darwin_SHA256SUM=shasum -a 256
+build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
+
+#darwin host on darwin builder. overrides darwin host preferences.
+darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) -isysroot$(shell xcrun --show-sdk-path)
+darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ -isysroot$(shell xcrun --show-sdk-path)
+darwin_AR:=$(shell xcrun -f ar)
+darwin_RANLIB:=$(shell xcrun -f ranlib)
+darwin_STRIP:=$(shell xcrun -f strip)
+darwin_LIBTOOL:=$(shell xcrun -f libtool)
+darwin_OTOOL:=$(shell xcrun -f otool)
+darwin_NM:=$(shell xcrun -f nm)
+darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
+darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
+darwin_native_binutils=
+darwin_native_toolchain=
+
+x86_64_darwin_CFLAGS += -arch x86_64
+x86_64_darwin_CXXFLAGS += -arch x86_64
+aarch64_darwin_CFLAGS += -arch arm64
+aarch64_darwin_CXXFLAGS += -arch arm64
diff --git a/contrib/depends/builders/default.mk b/contrib/depends/builders/default.mk
new file mode 100644
index 0000000..a8b6b97
--- /dev/null
+++ b/contrib/depends/builders/default.mk
@@ -0,0 +1,21 @@
+default_build_CC = gcc
+default_build_CXX = g++
+default_build_AR = ar
+default_build_TAR = tar
+default_build_RANLIB = ranlib
+default_build_STRIP = strip
+default_build_NM = nm
+default_build_OTOOL = otool
+default_build_INSTALL_NAME_TOOL = install_name_tool
+
+define add_build_tool_func
+build_$(build_os)_$1 ?= $$(default_build_$1)
+build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1)
+build_$1=$$(build_$(build_arch)_$(build_os)_$1)
+endef
+$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_build_tool_func,$(var))))
+define add_build_flags_func
+build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)
+build_$1=$$(build_$(build_arch)_$(build_os)_$1)
+endef
+$(foreach flags, CFLAGS CXXFLAGS ARFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags))))
diff --git a/contrib/depends/builders/linux.mk b/contrib/depends/builders/linux.mk
new file mode 100644
index 0000000..b03f424
--- /dev/null
+++ b/contrib/depends/builders/linux.mk
@@ -0,0 +1,2 @@
+build_linux_SHA256SUM = sha256sum
+build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
diff --git a/contrib/depends/config.guess b/contrib/depends/config.guess
new file mode 100755
index 0000000..dc0a6b2
--- /dev/null
+++ b/contrib/depends/config.guess
@@ -0,0 +1,1702 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2021 Free Software Foundation, Inc.
+
+timestamp='2021-05-24'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see .
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
+#
+# Please send patches to .
+
+
+me=$(echo "$0" | sed -e 's,.*/,,')
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to ."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2021 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039
+ { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$driver"
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if test -f /.attbin/uname ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
+UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
+UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
+UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
+
+case $UNAME_SYSTEM in
+Linux|GNU|GNU/*)
+ LIBC=unknown
+
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
+ #include
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #elif defined(__GLIBC__)
+ LIBC=gnu
+ #else
+ #include
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
+ #endif
+ EOF
+ eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ fi
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown))
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
+ endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently (or will in the future) and ABI.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case $UNAME_VERSION in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "$machine-${os}${release}${abi-}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
+ exit ;;
+ *:SolidBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ *:OS108:*:*)
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:MirBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Twizzler:*:*)
+ echo "$UNAME_MACHINE"-unknown-twizzler
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
+ exit ;;
+ alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
+ ;;
+ *5.*)
+ UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)
+ case $ALPHA_CPU_TYPE in
+ "EV4 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE=alpha ;;
+ "EV5 (21164)")
+ UNAME_MACHINE=alphaev5 ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE=alphaev56 ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE=alphapca56 ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE=alphapca57 ;;
+ "EV6 (21264)")
+ UNAME_MACHINE=alphaev6 ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE=alphaev67 ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE=alphaev69 ;;
+ "EV7 (21364)")
+ UNAME_MACHINE=alphaev7 ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE=alphaev79 ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix"$UNAME_RELEASE"
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "$( (/bin/universe) 2>/dev/null)" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case $(/usr/bin/uname -p) in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux"$UNAME_RELEASE"
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ set_cc_for_build
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
+ exit ;;
+ sun4*:SunOS:*:*)
+ case $(/usr/bin/arch -k) in
+ Series*|S4*)
+ UNAME_RELEASE=$(uname -v)
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case $(/bin/arch) in
+ sun3)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ ;;
+ sun4)
+ echo sparc-sun-sunos"$UNAME_RELEASE"
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint"$UNAME_RELEASE"
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint"$UNAME_RELEASE"
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint"$UNAME_RELEASE"
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
+#ifdef __cplusplus
+#include /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
+ SYSTEM_NAME=$("$dummy" "$dummyarg") &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos"$UNAME_RELEASE"
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=$(/usr/bin/uname -p)
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
+ then
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
+ then
+ echo m88k-dg-dgux"$UNAME_RELEASE"
+ else
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ fi
+ else
+ echo i586-dg-dgux"$UNAME_RELEASE"
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if test -x /usr/bin/oslevel ; then
+ IBM_REV=$(/usr/bin/oslevel)
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+ case $UNAME_MACHINE in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if test -x /usr/bin/getconf; then
+ sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
+ sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
+ case $sc_cpu_version in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case $sc_kernel_bits in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
+
+ #define _HPUX_SOURCE
+ #include
+ #include
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if test "$HP_ARCH" = hppa2.0w
+ then
+ set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH=hppa2.0w
+ else
+ HP_ARCH=hppa64
+ fi
+ fi
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+ echo ia64-hp-hpux"$HPUX_REV"
+ exit ;;
+ 3050*:HI-UX:*:*)
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if test -x /usr/sbin/sysversion ; then
+ echo "$UNAME_MACHINE"-unknown-osf1mk
+ else
+ echo "$UNAME_MACHINE"-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
+ FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+ FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+ FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ *:BSD/OS:*:*)
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=$(uname -p)
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
+ else
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
+ fi
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=$(/usr/bin/uname -p)
+ case $UNAME_PROCESSOR in
+ amd64)
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
+ esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
+ exit ;;
+ i*:CYGWIN*:*)
+ echo "$UNAME_MACHINE"-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo "$UNAME_MACHINE"-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo "$UNAME_MACHINE"-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo "$UNAME_MACHINE"-pc-msys
+ exit ;;
+ i*:PW*:*)
+ echo "$UNAME_MACHINE"-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case $UNAME_MACHINE in
+ x86)
+ echo i586-pc-interix"$UNAME_RELEASE"
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ esac ;;
+ i*:UWIN*:*)
+ echo "$UNAME_MACHINE"-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-pc-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
+ exit ;;
+ *:Minix:*:*)
+ echo "$UNAME_MACHINE"-unknown-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ alpha:Linux:*:*)
+ case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arm*:Linux:*:*)
+ set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ else
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ cris:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ crisv32:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ frv:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ hexagon:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:Linux:*:*)
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
+ ia64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m32r*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m68*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ MIPS_ENDIAN=el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ MIPS_ENDIAN=
+ #else
+ MIPS_ENDIAN=
+ #endif
+ #endif
+EOF
+ eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-"$LIBC"
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-"$LIBC"
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-"$LIBC"
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-"$LIBC"
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-"$LIBC"
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-"$LIBC"
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
+ exit ;;
+ sh64*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sh*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ tile*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ vax:Linux:*:*)
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
+ exit ;;
+ x86_64:Linux:*:*)
+ set_cc_for_build
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_X32 >/dev/null
+ then
+ LIBCABI="$LIBC"x32
+ fi
+ fi
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo "$UNAME_MACHINE"-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo "$UNAME_MACHINE"-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo "$UNAME_MACHINE"-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo "$UNAME_MACHINE"-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ i*86:*DOS:*:*)
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:*)
+ UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case $(/bin/uname -X | grep "^Machine") in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=$(sed -n 's/.*Version //p' /dev/null >/dev/null ; then
+ UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv"$UNAME_RELEASE"
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+ echo "$UNAME_MACHINE"-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes .
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo "$UNAME_MACHINE"-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux"$UNAME_RELEASE"
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if test -d /usr/nec; then
+ echo mips-nec-sysv"$UNAME_RELEASE"
+ else
+ echo mips-unknown-sysv"$UNAME_RELEASE"
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ *:Rhapsody:*:*)
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ arm64:Darwin:*:*)
+ echo aarch64-apple-darwin"$UNAME_RELEASE"
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=$(uname -p)
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
+ fi
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
+ fi
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=$(uname -p)
+ if test "$UNAME_PROCESSOR" = x86; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "${cputype-}" = 386; then
+ UNAME_MACHINE=i386
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE="$cputype"
+ fi
+ echo "$UNAME_MACHINE"-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux"$UNAME_RELEASE"
+ exit ;;
+ *:DragonFly:*:*)
+ echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+ case $UNAME_MACHINE in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
+ exit ;;
+ i*86:rdos:*:*)
+ echo "$UNAME_MACHINE"-pc-rdos
+ exit ;;
+ *:AROS:*:*)
+ echo "$UNAME_MACHINE"-unknown-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo "$UNAME_MACHINE"-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+ *:Unleashed:*:*)
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+ exit ;;
+esac
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <
+#include
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <&2 <&2 </dev/null || echo unknown)
+uname -r = $( (uname -r) 2>/dev/null || echo unknown)
+uname -s = $( (uname -s) 2>/dev/null || echo unknown)
+uname -v = $( (uname -v) 2>/dev/null || echo unknown)
+
+/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
+/bin/uname -X = $( (/bin/uname -X) 2>/dev/null)
+
+hostinfo = $( (hostinfo) 2>/dev/null)
+/bin/universe = $( (/bin/universe) 2>/dev/null)
+/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null)
+/bin/arch = $( (/bin/arch) 2>/dev/null)
+/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null)
+/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
+
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
+EOF
+fi
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/contrib/depends/config.site.in b/contrib/depends/config.site.in
new file mode 100644
index 0000000..03dabee
--- /dev/null
+++ b/contrib/depends/config.site.in
@@ -0,0 +1,154 @@
+# shellcheck shell=sh disable=SC2034 # Many variables set will be used in
+ # ./configure but shellcheck doesn't know
+ # that, hence: disable=SC2034
+
+true # Dummy command because shellcheck treats all directives before first
+ # command as file-wide, and we only want to disable for one line.
+ #
+ # See: https://github.com/koalaman/shellcheck/wiki/Directive
+
+# shellcheck disable=SC2154
+depends_prefix="$(cd "$(dirname "$ac_site_file")/.." && pwd)"
+
+cross_compiling=maybe
+host_alias="@HOST@"
+ac_tool_prefix="${host_alias}-"
+
+if test -z "$with_boost"; then
+ with_boost="$depends_prefix"
+fi
+if test -z "$with_qt_plugindir"; then
+ with_qt_plugindir="${depends_prefix}/plugins"
+fi
+if test -z "$with_qt_translationdir"; then
+ with_qt_translationdir="${depends_prefix}/translations"
+fi
+if test -z "$with_qt_bindir" && test -z "@no_qt@"; then
+ with_qt_bindir="${depends_prefix}/native/bin"
+fi
+if test -z "$with_mpgen" && test -n "@multiprocess@"; then
+ with_mpgen="${depends_prefix}/native"
+fi
+
+if test -z "$with_qrencode" && test -n "@no_qr@"; then
+ with_qrencode=no
+fi
+
+if test -z "$enable_wallet" && test -n "@no_wallet@"; then
+ enable_wallet=no
+fi
+
+if test -z "$with_bdb" && test -n "@no_bdb@"; then
+ with_bdb=no
+fi
+
+if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
+ with_sqlite=no
+fi
+
+if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
+ enable_multiprocess=yes
+fi
+
+if test -z "$with_miniupnpc" && test -n "@no_upnp@"; then
+ with_miniupnpc=no
+fi
+
+if test -z "$with_natpmp" && test -n "@no_natpmp@"; then
+ with_natpmp=no
+fi
+
+if test -z "$with_gui" && test -n "@no_qt@"; then
+ with_gui=no
+fi
+
+if test -n "@debug@" && test -z "@no_qt@" && test "$with_gui" != "no"; then
+ with_gui=qt5_debug
+fi
+
+if test -z "$enable_zmq" && test -n "@no_zmq@"; then
+ enable_zmq=no
+fi
+
+if test -z "$enable_usdt" && test -n "@no_usdt@"; then
+ enable_usdt=no
+fi
+
+if test "@host_os@" = darwin; then
+ BREW=no
+fi
+
+PKG_CONFIG="$(which pkg-config) --static"
+
+# These two need to remain exported because pkg-config does not see them
+# otherwise. That means they must be unexported at the end of configure.ac to
+# avoid ruining the cache. Sigh.
+export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
+if test -z "@allow_host_packages@"; then
+ export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
+fi
+
+CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"
+LDFLAGS="-L${depends_prefix}/lib ${LDFLAGS}"
+
+if test -n "@CC@" -a -z "${CC}"; then
+ CC="@CC@"
+fi
+if test -n "@CXX@" -a -z "${CXX}"; then
+ CXX="@CXX@"
+fi
+PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}"
+
+if test -n "@AR@"; then
+ AR="@AR@"
+ ac_cv_path_ac_pt_AR="${AR}"
+fi
+
+if test -n "@RANLIB@"; then
+ RANLIB="@RANLIB@"
+ ac_cv_path_ac_pt_RANLIB="${RANLIB}"
+fi
+
+if test -n "@NM@"; then
+ NM="@NM@"
+ ac_cv_path_ac_pt_NM="${NM}"
+fi
+
+if test -n "@STRIP@"; then
+ STRIP="@STRIP@"
+ ac_cv_path_ac_pt_STRIP="${STRIP}"
+fi
+
+if test "@host_os@" = darwin; then
+ if test -n "@OTOOL@"; then
+ OTOOL="@OTOOL@"
+ ac_cv_path_ac_pt_OTOOL="${OTOOL}"
+ fi
+
+ if test -n "@INSTALL_NAME_TOOL@"; then
+ INSTALL_NAME_TOOL="@INSTALL_NAME_TOOL@"
+ ac_cv_path_ac_pt_INSTALL_NAME_TOOL="${INSTALL_NAME_TOOL}"
+ fi
+
+ if test -n "@DSYMUTIL@"; then
+ DSYMUTIL="@DSYMUTIL@"
+ ac_cv_path_ac_pt_DSYMUTIL="${DSYMUTIL}"
+ fi
+fi
+
+if test -n "@debug@"; then
+ enable_reduce_exports=no
+fi
+
+if test -n "@CFLAGS@"; then
+ CFLAGS="@CFLAGS@ ${CFLAGS}"
+fi
+if test -n "@CXXFLAGS@"; then
+ CXXFLAGS="@CXXFLAGS@ ${CXXFLAGS}"
+fi
+if test -n "@CPPFLAGS@"; then
+ CPPFLAGS="@CPPFLAGS@ ${CPPFLAGS}"
+fi
+if test -n "@LDFLAGS@"; then
+ LDFLAGS="@LDFLAGS@ ${LDFLAGS}"
+fi
diff --git a/contrib/depends/config.sub b/contrib/depends/config.sub
new file mode 100755
index 0000000..7384e91
--- /dev/null
+++ b/contrib/depends/config.sub
@@ -0,0 +1,1864 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2021 Free Software Foundation, Inc.
+
+timestamp='2021-04-30'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see .
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to .
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=$(echo "$0" | sed -e 's,.*/,,')
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to ."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2021 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo "$1"
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <&2
+ exit 1
+ ;;
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
+ ;;
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
+ ;;
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
+ ;;
+esac
+
+# Decode 1-component or ad-hoc basic machines
+case $basic_machine in
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
+ ;;
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
+ ;;
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
+ ;;
+ ibm*)
+ cpu=i370
+ vendor=ibm
+ ;;
+ orion105)
+ cpu=clipper
+ vendor=highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
+ ;;
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
+ ;;
+
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ cpu=m68000
+ vendor=att
+ ;;
+ 3b*)
+ cpu=we32k
+ vendor=att
+ ;;
+ bluegene*)
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
+ ;;
+ decsystem10* | dec10*)
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
+ ;;
+ decsystem20* | dec20*)
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ cpu=m68k
+ vendor=motorola
+ ;;
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
+ ;;
+ encore | umax | mmax)
+ cpu=ns32k
+ vendor=encore
+ ;;
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
+ ;;
+ fx2800)
+ cpu=i860
+ vendor=alliant
+ ;;
+ genix)
+ cpu=ns32k
+ vendor=ns
+ ;;
+ h3050r* | hiux*)
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ cpu=m68000
+ vendor=hp
+ ;;
+ hp9k3[2-9][0-9])
+ cpu=m68k
+ vendor=hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ cpu=hppa1.1
+ vendor=hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ cpu=hppa1.0
+ vendor=hp
+ ;;
+ i*86v32)
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv32
+ ;;
+ i*86v4*)
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv4
+ ;;
+ i*86v)
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv
+ ;;
+ i*86sol2)
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=solaris2
+ ;;
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
+ ;;
+ iris | iris4d)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
+ ;;
+ *)
+ basic_os=irix4
+ ;;
+ esac
+ ;;
+ miniframe)
+ cpu=m68000
+ vendor=convergent
+ ;;
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
+ ;;
+ news-3600 | risc-news)
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
+ ;;
+ ns2*)
+ basic_os=nextstep2
+ ;;
+ *)
+ basic_os=nextstep3
+ ;;
+ esac
+ ;;
+ np1)
+ cpu=np1
+ vendor=gould
+ ;;
+ op50n-* | op60c-*)
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
+ ;;
+ pa-hitachi)
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
+ ;;
+ pbd)
+ cpu=sparc
+ vendor=tti
+ ;;
+ pbb)
+ cpu=m68k
+ vendor=tti
+ ;;
+ pc532)
+ cpu=ns32k
+ vendor=pc532
+ ;;
+ pn)
+ cpu=pn
+ vendor=gould
+ ;;
+ power)
+ cpu=power
+ vendor=ibm
+ ;;
+ ps2)
+ cpu=i386
+ vendor=ibm
+ ;;
+ rm[46]00)
+ cpu=mips
+ vendor=siemens
+ ;;
+ rtpc | rtpc-*)
+ cpu=romp
+ vendor=ibm
+ ;;
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
+ ;;
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
+ ;;
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
+ ;;
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
+ ;;
+ w65)
+ cpu=w65
+ vendor=wdc
+ ;;
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
+ ;;
+ none)
+ cpu=none
+ vendor=none
+ ;;
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
+ ;;
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=$(echo "$basic_machine" | sed 's/-.*//')
+ ;;
+
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read cpu vendor <&2
+ exit 1
+ ;;
+ esac
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $vendor in
+ digital*)
+ vendor=dec
+ ;;
+ commodore*)
+ vendor=cbm
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if test x$basic_os != x
+then
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
+ ;;
+ os2-emx)
+ kernel=os2
+ os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read kernel os <&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
+ vendor=acorn
+ ;;
+ *-sunos*)
+ vendor=sun
+ ;;
+ *-cnk* | *-aix*)
+ vendor=ibm
+ ;;
+ *-beos*)
+ vendor=be
+ ;;
+ *-hpux*)
+ vendor=hp
+ ;;
+ *-mpeix*)
+ vendor=hp
+ ;;
+ *-hiux*)
+ vendor=hitachi
+ ;;
+ *-unos*)
+ vendor=crds
+ ;;
+ *-dgux*)
+ vendor=dg
+ ;;
+ *-luna*)
+ vendor=omron
+ ;;
+ *-genix*)
+ vendor=ns
+ ;;
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
+ vendor=ibm
+ ;;
+ s390-* | s390x-*)
+ vendor=ibm
+ ;;
+ *-ptx*)
+ vendor=sequent
+ ;;
+ *-tpf*)
+ vendor=ibm
+ ;;
+ *-vxsim* | *-vxworks* | *-windiss*)
+ vendor=wrs
+ ;;
+ *-aux*)
+ vendor=apple
+ ;;
+ *-hms*)
+ vendor=hitachi
+ ;;
+ *-mpw* | *-macos*)
+ vendor=apple
+ ;;
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
+ vendor=atari
+ ;;
+ *-vos*)
+ vendor=stratus
+ ;;
+ esac
+ ;;
+esac
+
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
+exit
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/contrib/depends/funcs.mk b/contrib/depends/funcs.mk
new file mode 100644
index 0000000..1cfd7de
--- /dev/null
+++ b/contrib/depends/funcs.mk
@@ -0,0 +1,329 @@
+define int_vars
+#Set defaults for vars which may be overridden per-package
+$(1)_cc=$$($$($(1)_type)_CC)
+$(1)_cxx=$$($$($(1)_type)_CXX)
+$(1)_objc=$$($$($(1)_type)_OBJC)
+$(1)_objcxx=$$($$($(1)_type)_OBJCXX)
+$(1)_ar=$$($$($(1)_type)_AR)
+$(1)_ranlib=$$($$($(1)_type)_RANLIB)
+$(1)_libtool=$$($$($(1)_type)_LIBTOOL)
+$(1)_nm=$$($$($(1)_type)_NM)
+$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CFLAGS)
+$(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CXXFLAGS)
+$(1)_arflags=$($($(1)_type)_ARFLAGS) $($($(1)_type)_$(release_type)_ARFLAGS)
+$(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_LDFLAGS) \
+ -L$$($($(1)_type)_prefix)/lib
+$(1)_cppflags=$$($$($(1)_type)_CPPFLAGS) \
+ $$($$($(1)_type)_$$(release_type)_CPPFLAGS) \
+ -I$$($$($(1)_type)_prefix)/include
+$(1)_recipe_hash:=
+endef
+
+define int_get_all_dependencies
+$(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies))))
+endef
+
+define fetch_file_inner
+ ( mkdir -p $$($(1)_download_dir) && echo Fetching $(3) from $(2) && \
+ $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" && \
+ echo "$(5) $$($(1)_download_dir)/$(4).temp" > $$($(1)_download_dir)/.$(4).hash && \
+ $(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \
+ mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \
+ rm -rf $$($(1)_download_dir) )
+endef
+
+define fetch_file
+ ( test -f $$($(1)_source_dir)/$(4) || \
+ ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \
+ $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))
+endef
+
+define int_get_build_recipe_hash
+$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1))
+$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1))
+endef
+
+define int_get_build_id
+$(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies))
+$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies)))
+$(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash)))
+$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id))
+$(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)))
+final_build_id_long+=$($(package)_build_id_long)
+
+#compute package-specific paths
+$(1)_build_subdir?=.
+$(1)_download_file?=$($(1)_file_name)
+$(1)_source_dir:=$(SOURCES_PATH)
+$(1)_source:=$$($(1)_source_dir)/$($(1)_file_name)
+$(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)
+$(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix)
+$(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)
+$(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version)
+$(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir)
+$(1)_cached_checksum:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz.hash
+$(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id)
+$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/
+$(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz
+$(1)_build_log:=$(BASEDIR)/$(1)-$($(1)_version)-$($(1)_build_id).log
+$(1)_all_sources=$($(1)_file_name) $($(1)_extra_sources)
+
+#stamps
+$(1)_fetched=$(SOURCES_PATH)/download-stamps/.stamp_fetched-$(1)-$($(1)_file_name).hash
+$(1)_extracted=$$($(1)_extract_dir)/.stamp_extracted
+$(1)_preprocessed=$$($(1)_extract_dir)/.stamp_preprocessed
+$(1)_cleaned=$$($(1)_extract_dir)/.stamp_cleaned
+$(1)_built=$$($(1)_build_dir)/.stamp_built
+$(1)_configured=$$($(1)_build_dir)/.stamp_configured
+$(1)_staged=$$($(1)_staging_dir)/.stamp_staged
+$(1)_postprocessed=$$($(1)_staging_prefix_dir)/.stamp_postprocessed
+$(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path))
+
+
+#default commands
+# The default behavior for tar will try to set ownership when running as uid 0 and may not succeed, --no-same-owner disables this behavior
+$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash))
+$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_TAR) --no-same-owner --strip-components=1 -xf $$($(1)_source)
+$(1)_preprocess_cmds ?= true
+$(1)_build_cmds ?=
+$(1)_config_cmds ?=
+$(1)_stage_cmds ?=
+$(1)_set_vars ?=
+
+
+all_sources+=$$($(1)_fetched)
+endef
+#$(foreach dep_target,$($(1)_all_dependencies),$(eval $(1)_dependency_targets=$($(dep_target)_cached)))
+
+
+define int_config_attach_build_config
+$(eval $(call $(1)_set_vars,$(1)))
+$(1)_cflags+=$($(1)_cflags_$(release_type))
+$(1)_cflags+=$($(1)_cflags_$(host_arch)) $($(1)_cflags_$(host_arch)_$(release_type))
+$(1)_cflags+=$($(1)_cflags_$(host_os)) $($(1)_cflags_$(host_os)_$(release_type))
+$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) $($(1)_cflags_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_cxxflags+=$($(1)_cxxflags_$(release_type))
+$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) $($(1)_cxxflags_$(host_arch)_$(release_type))
+$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) $($(1)_cxxflags_$(host_os)_$(release_type))
+$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) $($(1)_cxxflags_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_arflags+=$($(1)_arflags_$(release_type))
+$(1)_arflags+=$($(1)_arflags_$(host_arch)) $($(1)_arflags_$(host_arch)_$(release_type))
+$(1)_arflags+=$($(1)_arflags_$(host_os)) $($(1)_arflags_$(host_os)_$(release_type))
+$(1)_arflags+=$($(1)_arflags_$(host_arch)_$(host_os)) $($(1)_arflags_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_cppflags+=$($(1)_cppflags_$(release_type))
+$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) $($(1)_cppflags_$(host_arch)_$(release_type))
+$(1)_cppflags+=$($(1)_cppflags_$(host_os)) $($(1)_cppflags_$(host_os)_$(release_type))
+$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) $($(1)_cppflags_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_ldflags+=$($(1)_ldflags_$(release_type))
+$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) $($(1)_ldflags_$(host_arch)_$(release_type))
+$(1)_ldflags+=$($(1)_ldflags_$(host_os)) $($(1)_ldflags_$(host_os)_$(release_type))
+$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) $($(1)_ldflags_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_build_opts+=$$($(1)_build_opts_$(release_type))
+$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) $$($(1)_build_opts_$(host_arch)_$(release_type))
+$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) $$($(1)_build_opts_$(host_os)_$(release_type))
+$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) $$($(1)_build_opts_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_config_opts+=$$($(1)_config_opts_$(release_type))
+$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) $$($(1)_config_opts_$(host_arch)_$(release_type))
+$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) $$($(1)_config_opts_$(host_os)_$(release_type))
+$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) $$($(1)_config_opts_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_config_env+=$$($(1)_config_env_$(release_type))
+$(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_$(release_type))
+$(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type))
+$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_build_env+=$$($(1)_build_env_$(release_type))
+$(1)_build_env+=$($(1)_build_env_$(host_arch)) $($(1)_build_env_$(host_arch)_$(release_type))
+$(1)_build_env+=$($(1)_build_env_$(host_os)) $($(1)_build_env_$(host_os)_$(release_type))
+$(1)_build_env+=$($(1)_build_env_$(host_arch)_$(host_os)) $($(1)_build_env_$(host_arch)_$(host_os)_$(release_type))
+
+$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig
+$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
+$(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake
+$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH)
+$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH)
+$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH)
+
+# Setting a --build type that differs from --host will explicitly enable
+# cross-compilation mode. Note that --build defaults to the output of
+# config.guess, which is what we set it too here. This also quells autoconf
+# warnings, "If you wanted to set the --build type, don't use --host.",
+# when using versions older than 2.70.
+$(1)_autoconf=./configure --build=$(BUILD) --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
+ifneq ($($(1)_nm),)
+$(1)_autoconf += NM="$$($(1)_nm)"
+endif
+ifneq ($($(1)_ranlib),)
+$(1)_autoconf += RANLIB="$$($(1)_ranlib)"
+endif
+ifneq ($($(1)_ar),)
+$(1)_autoconf += AR="$$($(1)_ar)"
+endif
+ifneq ($($(1)_arflags),)
+$(1)_autoconf += ARFLAGS="$$($(1)_arflags)"
+endif
+ifneq ($($(1)_cflags),)
+$(1)_autoconf += CFLAGS="$$($(1)_cflags)"
+endif
+ifneq ($($(1)_cxxflags),)
+$(1)_autoconf += CXXFLAGS="$$($(1)_cxxflags)"
+endif
+ifneq ($($(1)_cppflags),)
+$(1)_autoconf += CPPFLAGS="$$($(1)_cppflags)"
+endif
+ifneq ($($(1)_ldflags),)
+$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)"
+endif
+
+$(1)_autoconff=./configure --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
+ifneq ($($(1)_nm),)
+$(1)_autoconff += NM="$$($(1)_nm)"
+endif
+ifneq ($($(1)_ranlib),)
+$(1)_autoconff += RANLIB="$$($(1)_ranlib)"
+endif
+ifneq ($($(1)_ar),)
+$(1)_autoconff += AR="$$($(1)_ar)"
+endif
+ifneq ($($(1)_arflags),)
+$(1)_autoconff += ARFLAGS="$$($(1)_arflags)"
+endif
+ifneq ($($(1)_cflags),)
+$(1)_autoconff += CFLAGS="$$($(1)_cflags)"
+endif
+ifneq ($($(1)_cxxflags),)
+$(1)_autoconff += CXXFLAGS="$$($(1)_cxxflags)"
+endif
+ifneq ($($(1)_cppflags),)
+$(1)_autoconff += CPPFLAGS="$$($(1)_cppflags)"
+endif
+ifneq ($($(1)_ldflags),)
+$(1)_autoconff += LDFLAGS="$$($(1)_ldflags)"
+endif
+
+$(1)_cmake=env CC="$$($(1)_cc)" \
+ CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \
+ CXX="$$($(1)_cxx)" \
+ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
+ LDFLAGS="$$($(1)_ldflags)" \
+ cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" $$($(1)_cmake_opts)
+ifeq ($($(1)_type),build)
+$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"
+else
+ifneq ($(host),$(build))
+$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
+$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host)
+$(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host)
+endif
+endif
+endef
+
+define int_add_cmds
+ifneq ($(LOG),)
+$(1)_logging = >>$$($(1)_build_log) 2>&1 || { if test -f $$($(1)_build_log); then cat $$($(1)_build_log); fi; exit 1; }
+endif
+
+$($(1)_fetched):
+ mkdir -p $$(@D) $(SOURCES_PATH)
+ rm -f $$@
+ touch $$@
+ cd $$(@D); $($(1)_fetch_cmds)
+ cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);)
+ touch $$@
+$($(1)_extracted): | $($(1)_fetched)
+ echo Extracting $(1)...
+ mkdir -p $$(@D)
+ cd $$(@D); $($(1)_extract_cmds)
+ touch $$@
+$($(1)_preprocessed): | $($(1)_extracted)
+ echo Preprocessing $(1)...
+ mkdir -p $$(@D) $($(1)_patch_dir)
+ $(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;)
+ cd $$(@D); $(call $(1)_preprocess_cmds, $(1))
+ touch $$@
+$($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed)
+ echo Configuring $(1)...
+ rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), $(build_TAR) --no-same-owner -xf $($(package)_cached); )
+ mkdir -p $$(@D)
+ $(AT)+cd $$(@D); export $($(1)_config_env); $(call $(1)_config_cmds, $(1))
+ touch $$@
+$($(1)_built): | $($(1)_configured)
+ echo Building $(1)...
+ mkdir -p $$(@D)
+ $(AT)+cd $$(@D); export $($(1)_build_env); $(call $(1)_build_cmds, $(1))
+ touch $$@
+$($(1)_staged): | $($(1)_built)
+ echo Staging $(1)...
+ mkdir -p $($(1)_staging_dir)/$(host_prefix)
+ $(AT)cd $($(1)_build_dir); export $($(1)_stage_env); $(call $(1)_stage_cmds, $(1))
+ rm -rf $($(1)_extract_dir)
+ touch $$@
+$($(1)_postprocessed): | $($(1)_staged)
+ echo Postprocessing $(1)...
+ cd $($(1)_staging_prefix_dir); $($(1)_postprocess_cmds)
+ touch $$@
+$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed)
+ echo Caching $(1)...
+ cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | $(build_TAR) --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -
+ mkdir -p $$(@D)
+ rm -rf $$(@D) && mkdir -p $$(@D)
+ mv $$($(1)_staging_dir)/$$(@F) $$(@)
+ rm -rf $($(1)_staging_dir)
+ if test -f $($(1)_build_log); then mv $($(1)_build_log) $$(@D); fi
+$($(1)_cached_checksum): $($(1)_cached)
+ cd $$(@D); $(build_SHA256SUM) $$( $$(@)
+
+.PHONY: $(1)
+$(1): | $($(1)_cached_checksum)
+.SECONDARY: $($(1)_cached) $($(1)_postprocessed) $($(1)_staged) $($(1)_built) $($(1)_configured) $($(1)_preprocessed) $($(1)_extracted) $($(1)_fetched)
+
+endef
+
+stages = fetched extracted preprocessed configured built staged postprocessed cached cached_checksum
+
+define ext_add_stages
+$(foreach stage,$(stages),
+ $(1)_$(stage): $($(1)_$(stage))
+ .PHONY: $(1)_$(stage))
+endef
+
+# These functions create the build targets for each package. They must be
+# broken down into small steps so that each part is done for all packages
+# before moving on to the next step. Otherwise, a package's info
+# (build-id for example) would only be available to another package if it
+# happened to be computed already.
+
+#set the type for host/build packages.
+$(foreach native_package,$(native_packages),$(eval $(native_package)_type=build))
+$(foreach package,$(packages),$(eval $(package)_type=$(host_arch)_$(host_os)))
+
+#set overridable defaults
+$(foreach package,$(all_packages),$(eval $(call int_vars,$(package))))
+
+#include package files
+$(foreach native_package,$(native_packages),$(eval include packages/$(native_package).mk))
+$(foreach package,$(packages),$(eval include packages/$(package).mk))
+
+#compute a hash of all files that comprise this package's build recipe
+$(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package))))
+
+#generate a unique id for this package, incorporating its dependencies as well
+$(foreach package,$(all_packages),$(eval $(call int_get_build_id,$(package))))
+
+#compute final vars after reading package vars
+$(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$(package))))
+
+#create build targets
+$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package))))
+
+#special exception: if a toolchain package exists, all non-native packages depend on it
+$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) ))
diff --git a/contrib/depends/gen_id b/contrib/depends/gen_id
new file mode 100755
index 0000000..6ecbcd9
--- /dev/null
+++ b/contrib/depends/gen_id
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+
+# Usage: env [ CC=... ] [ C_STANDARD=...] [ CXX=... ] [CXX_STANDARD=...] \
+# [ AR=... ] [ RANLIB=... ] [ STRIP=... ] [ DEBUG=... ] \
+# [ LTO=... ] ./build-id [ID_SALT]...
+#
+# Prints to stdout a SHA256 hash representing the current toolset, used by
+# depends/Makefile as a build id for caching purposes (detecting when the
+# toolset has changed and the cache needs to be invalidated).
+#
+# If the DEBUG environment variable is non-empty and the system has `tee`
+# available in its $PATH, the pre-image to the SHA256 hash will be printed to
+# stderr. This is to help developers debug caching issues in depends.
+
+# This script explicitly does not `set -e` because id determination is mostly
+# opportunistic: it is fine that things fail, as long as they fail consistently.
+
+# Command variables (CC/CXX/AR) which can be blank are invoked with `bash -c`,
+# because the "command not found" error message printed by shells often include
+# the line number, like so:
+#
+# ./depends/gen_id: line 43: --version: command not found
+#
+# By invoking with `bash -c`, we ensure that the line number is always 1
+
+(
+ # Redirect stderr to stdout
+ exec 2>&1
+
+ echo "BEGIN ALL"
+
+ # Include any ID salts supplied via command line
+ echo "BEGIN ID SALT"
+ echo "$@"
+ echo "END ID SALT"
+
+ # GCC only prints COLLECT_LTO_WRAPPER when invoked with just "-v", but we want
+ # the information from "-v -E -" as well, so just include both.
+ echo "BEGIN CC"
+ bash -c "${CC} -v"
+ bash -c "${CC} -v -E -xc -o /dev/null - < /dev/null"
+ bash -c "${CC} -v -E -xobjective-c -o /dev/null - < /dev/null"
+ echo "C_STANDARD=${C_STANDARD}"
+ echo "END CC"
+
+ echo "BEGIN CXX"
+ bash -c "${CXX} -v"
+ bash -c "${CXX} -v -E -xc++ -o /dev/null - < /dev/null"
+ bash -c "${CXX} -v -E -xobjective-c++ -o /dev/null - < /dev/null"
+ echo "CXX_STANDARD=${CXX_STANDARD}"
+ echo "END CXX"
+
+ echo "BEGIN AR"
+ bash -c "${AR} --version"
+ env | grep '^AR_'
+ echo "ZERO_AR_DATE=${ZERO_AR_DATE}"
+ echo "END AR"
+
+ echo "BEGIN RANLIB"
+ bash -c "${RANLIB} --version"
+ env | grep '^RANLIB_'
+ echo "END RANLIB"
+
+ echo "BEGIN STRIP"
+ bash -c "${STRIP} --version"
+ env | grep '^STRIP_'
+ echo "END STRIP"
+
+ echo "END ALL"
+) | if [ -n "$DEBUG" ] && command -v tee > /dev/null 2>&1; then
+ # When debugging and `tee` is available, output the preimage to stderr
+ # in addition to passing through stdin to stdout
+ tee >(cat 1>&2)
+ else
+ # Otherwise, passthrough stdin to stdout
+ cat
+ fi | ${SHA256SUM} - | cut -d' ' -f1
diff --git a/contrib/depends/hosts/darwin.mk b/contrib/depends/hosts/darwin.mk
new file mode 100644
index 0000000..bf9b762
--- /dev/null
+++ b/contrib/depends/hosts/darwin.mk
@@ -0,0 +1,121 @@
+OSX_MIN_VERSION=10.15
+OSX_SDK_VERSION=11.0
+XCODE_VERSION=12.2
+XCODE_BUILD_ID=12B45b
+LD64_VERSION=609
+
+OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
+
+darwin_native_binutils=native_cctools
+
+ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
+# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang
+# from llvm.org
+
+# Clang is a dependency of native_cctools when FORCE_USE_SYSTEM_CLANG is empty
+darwin_native_toolchain=native_cctools
+
+clang_prog=$(build_prefix)/bin/clang
+clangxx_prog=$(clang_prog)++
+
+clang_resource_dir=$(build_prefix)/lib/clang/$(native_clang_version)
+else
+# FORCE_USE_SYSTEM_CLANG is non-empty, so we use the clang from the user's
+# system
+
+darwin_native_toolchain=
+
+# We can't just use $(shell command -v clang) because GNU Make handles builtins
+# in a special way and doesn't know that `command` is a POSIX-standard builtin
+# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
+# At the time of writing, GNU Make v4.2.1 is still being used in supported
+# distro releases.
+#
+# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
+clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
+clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
+
+clang_resource_dir=$(shell clang -print-resource-dir)
+endif
+
+cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL
+
+# Make-only lowercase function
+lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
+
+# For well-known tools provided by cctools, make sure that their well-known
+# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
+# would.
+$(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL))))
+
+# Flag explanations:
+#
+# -mlinker-version
+#
+# Ensures that modern linker features are enabled. See here for more
+# details: https://github.com/bitcoin/bitcoin/pull/19407.
+#
+# -B$(build_prefix)/bin
+#
+# Explicitly point to our binaries (e.g. cctools) so that they are
+# ensured to be found and preferred over other possibilities.
+#
+# -stdlib=libc++ -stdlib++-isystem$(OSX_SDK)/usr/include/c++/v1
+#
+# Forces clang to use the libc++ headers from our SDK and completely
+# forget about the libc++ headers from the standard directories
+#
+# -Xclang -*system \
+# -Xclang -*system \
+# -Xclang -*system ...
+#
+# Adds path_a, path_b, and path_c to the bottom of clang's list of
+# include search paths. This is used to explicitly specify the list of
+# system include search paths and its ordering, rather than rely on
+# clang's autodetection routine. This routine has been shown to:
+# 1. Fail to pickup libc++ headers in $SYSROOT/usr/include/c++/v1
+# when clang was built manually (see: https://github.com/bitcoin/bitcoin/pull/17919#issuecomment-656785034)
+# 2. Fail to pickup C headers in $SYSROOT/usr/include when
+# C_INCLUDE_DIRS was specified at configure time (see: https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9)
+#
+# Talking directly to cc1 with -Xclang here grants us access to specify
+# more granular categories for these system include search paths, and we
+# can use the correct categories that these search paths would have been
+# placed in if the autodetection routine had worked correctly. (see:
+# https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9#the-treatment)
+#
+# Furthermore, it places these search paths after any "non-Xclang"
+# specified search paths. This prevents any additional clang options or
+# environment variables from coming after or in between these system
+# include search paths, as that would be wrong in general but would also
+# break #include_next's.
+#
+darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
+ -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
+ -u LIBRARY_PATH \
+ $(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
+ -B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
+ -isysroot$(OSX_SDK) \
+ -Xclang -internal-externc-isystem$(clang_resource_dir)/include \
+ -Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
+darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
+ -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
+ -u LIBRARY_PATH \
+ $(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
+ -B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
+ -isysroot$(OSX_SDK) \
+ -stdlib=libc++ \
+ -stdlib++-isystem$(OSX_SDK)/usr/include/c++/v1 \
+ -Xclang -internal-externc-isystem$(clang_resource_dir)/include \
+ -Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
+
+darwin_CFLAGS=-pipe
+darwin_CXXFLAGS=$(darwin_CFLAGS)
+
+darwin_release_CFLAGS=-O2
+darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
+
+darwin_debug_CFLAGS=-O1
+darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)
+
+darwin_cmake_system=Darwin
diff --git a/contrib/depends/hosts/default.mk b/contrib/depends/hosts/default.mk
new file mode 100644
index 0000000..b6f45c4
--- /dev/null
+++ b/contrib/depends/hosts/default.mk
@@ -0,0 +1,39 @@
+ifneq ($(host),$(build))
+host_toolchain:=$(host)-
+endif
+
+default_host_CC = $(host_toolchain)gcc
+default_host_CXX = $(host_toolchain)g++
+default_host_AR = $(host_toolchain)ar
+default_host_RANLIB = $(host_toolchain)ranlib
+default_host_STRIP = $(host_toolchain)strip
+default_host_LIBTOOL = $(host_toolchain)libtool
+default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool
+default_host_OTOOL = $(host_toolchain)otool
+default_host_NM = $(host_toolchain)nm
+
+define add_host_tool_func
+ifneq ($(filter $(origin $1),undefined default),)
+# Do not consider the well-known var $1 if it is undefined or is taking a value
+# that is predefined by "make" (e.g. the make variable "CC" has a predefined
+# value of "cc")
+$(host_os)_$1?=$$(default_host_$1)
+$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1)
+$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1)
+else
+$(host_os)_$1=$(or $($1),$($(host_os)_$1),$(default_host_$1))
+$(host_arch)_$(host_os)_$1=$(or $($1),$($(host_arch)_$(host_os)_$1),$$($(host_os)_$1))
+$(host_arch)_$(host_os)_$(release_type)_$1=$(or $($1),$($(host_arch)_$(host_os)_$(release_type)_$1),$$($(host_os)_$1))
+endif
+host_$1=$$($(host_arch)_$(host_os)_$1)
+endef
+
+define add_host_flags_func
+$(host_arch)_$(host_os)_$1 += $($(host_os)_$1)
+$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1)
+host_$1 = $$($(host_arch)_$(host_os)_$1)
+host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
+endef
+
+$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
+$(foreach flags,CFLAGS CXXFLAGS ARFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))
diff --git a/contrib/depends/hosts/linux.mk b/contrib/depends/hosts/linux.mk
new file mode 100644
index 0000000..a373325
--- /dev/null
+++ b/contrib/depends/hosts/linux.mk
@@ -0,0 +1,33 @@
+linux_CFLAGS=-pipe
+linux_CXXFLAGS=$(linux_CFLAGS)
+linux_ARFLAGS=cr
+
+linux_release_CFLAGS=-O2
+linux_release_CXXFLAGS=$(linux_release_CFLAGS)
+
+linux_debug_CFLAGS=-O1
+linux_debug_CXXFLAGS=$(linux_debug_CFLAGS)
+
+linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_DEBUG=1
+
+ifeq (86,$(findstring 86,$(build_arch)))
+i686_linux_CC=gcc -m32
+i686_linux_CXX=g++ -m32
+i686_linux_AR=ar
+i686_linux_RANLIB=ranlib
+i686_linux_NM=nm
+i686_linux_STRIP=strip
+
+x86_64_linux_CC=gcc -m64
+x86_64_linux_CXX=g++ -m64
+x86_64_linux_AR=ar
+x86_64_linux_RANLIB=ranlib
+x86_64_linux_NM=nm
+x86_64_linux_STRIP=strip
+else
+i686_linux_CC=$(default_host_CC) -m32
+i686_linux_CXX=$(default_host_CXX) -m32
+x86_64_linux_CC=$(default_host_CC) -m64
+x86_64_linux_CXX=$(default_host_CXX) -m64
+endif
+linux_cmake_system=Linux
diff --git a/contrib/depends/hosts/mingw32.mk b/contrib/depends/hosts/mingw32.mk
new file mode 100644
index 0000000..1985f38
--- /dev/null
+++ b/contrib/depends/hosts/mingw32.mk
@@ -0,0 +1,17 @@
+ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
+mingw32_CXX := $(host)-g++-posix
+endif
+
+mingw32_CFLAGS=-pipe
+mingw32_CXXFLAGS=$(mingw32_CFLAGS)
+mingw32_ARFLAGS=cr
+
+mingw32_release_CFLAGS=-O2
+mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)
+
+mingw32_debug_CFLAGS=-O1
+mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)
+
+mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
+
+mingw32_cmake_system=Windows
\ No newline at end of file
diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk
new file mode 100644
index 0000000..77fdf3a
--- /dev/null
+++ b/contrib/depends/packages/boost.mk
@@ -0,0 +1,48 @@
+package=boost
+$(package)_version=1_64_0
+$(package)_download_path=https://downloads.sourceforge.net/project/boost/boost/1.64.0/
+$(package)_file_name=$(package)_$($(package)_version).tar.bz2
+$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
+$(package)_dependencies=libiconv
+$(package)_patches=fix_aroptions.patch fix_arm_arch.patch fix_coalesce.patch
+
+define $(package)_set_vars
+$(package)_config_opts_release=variant=release
+$(package)_config_opts_debug=variant=debug
+$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
+$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
+$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
+$(package)_config_opts_android=threadapi=pthread runtime-link=static target-os=android
+$(package)_config_opts_darwin=--toolset=darwin runtime-link=static
+$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
+$(package)_config_opts_x86_64_mingw32=address-model=64
+$(package)_config_opts_i686_mingw32=address-model=32
+$(package)_config_opts_i686_linux=address-model=32 architecture=x86
+$(package)_toolset_$(host_os)=gcc
+$(package)_archiver_$(host_os)=$($(package)_ar)
+$(package)_toolset_darwin=darwin
+$(package)_archiver_darwin=$($(package)_libtool)
+$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale
+$(package)_cxxflags=-std=c++11
+$(package)_cxxflags_linux=-fPIC
+$(package)_cxxflags_freebsd=-fPIC
+endef
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/fix_aroptions.patch &&\
+ patch -p1 < $($(package)_patch_dir)/fix_arm_arch.patch &&\
+ patch -p1 < $($(package)_patch_dir)/fix_coalesce.patch &&\
+ echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$($(package)_arflags)\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam
+endef
+
+define $(package)_config_cmds
+ ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries)
+endef
+
+define $(package)_build_cmds
+ ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
+endef
+
+define $(package)_stage_cmds
+ ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/eudev.mk b/contrib/depends/packages/eudev.mk
new file mode 100644
index 0000000..0f60a80
--- /dev/null
+++ b/contrib/depends/packages/eudev.mk
@@ -0,0 +1,30 @@
+package=eudev
+$(package)_version=v3.2.6
+$(package)_download_path=https://github.com/gentoo/eudev/archive/
+$(package)_download_file=$($(package)_version).tar.gz
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=a96ecb8637667897b8bd4dee4c22c7c5f08b327be45186e912ce6bc768385852
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-gudev --disable-introspection --disable-hwdb --disable-manpages --disable-shared
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmd
+ $(MAKE)
+endef
+
+define $(package)_preprocess_cmds
+ cd $($(package)_build_subdir); autoreconf -f -i
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
diff --git a/contrib/depends/packages/expat.mk b/contrib/depends/packages/expat.mk
new file mode 100644
index 0000000..a57f6f9
--- /dev/null
+++ b/contrib/depends/packages/expat.mk
@@ -0,0 +1,32 @@
+package=expat
+$(package)_version=2.4.8
+$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
+$(package)_file_name=$(package)-$($(package)_version).tar.xz
+$(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
+
+# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional
+# definitions in endian.h, which are required for a working
+# endianess check in configure when building with -flto.
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples
+ $(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+ $(package)_config_opts += --without-xmlwf
+ $(package)_config_opts_linux=--with-pic
+ $(package)_cppflags += -D_DEFAULT_SOURCE
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share lib/cmake lib/*.la
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/fontconfig.mk b/contrib/depends/packages/fontconfig.mk
new file mode 100644
index 0000000..c8b2fc3
--- /dev/null
+++ b/contrib/depends/packages/fontconfig.mk
@@ -0,0 +1,32 @@
+package=fontconfig
+$(package)_version=2.12.6
+$(package)_download_path=https://www.freedesktop.org/software/fontconfig/release/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
+$(package)_dependencies=freetype expat
+$(package)_patches=gperf_header_regen.patch
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-docs --disable-static --disable-libxml2 --disable-iconv
+ $(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/gperf_header_regen.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf var lib/*.la
+endef
diff --git a/contrib/depends/packages/freetype.mk b/contrib/depends/packages/freetype.mk
new file mode 100644
index 0000000..6f5dbe0
--- /dev/null
+++ b/contrib/depends/packages/freetype.mk
@@ -0,0 +1,27 @@
+package=freetype
+$(package)_version=2.11.0
+$(package)_download_path=https://download.savannah.gnu.org/releases/$(package)
+$(package)_file_name=$(package)-$($(package)_version).tar.xz
+$(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7
+
+define $(package)_set_vars
+ $(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static
+ $(package)_config_opts += --enable-option-checking --without-brotli
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man lib/*.la
+endef
diff --git a/contrib/depends/packages/graphviz.mk b/contrib/depends/packages/graphviz.mk
new file mode 100644
index 0000000..1c4bc1b
--- /dev/null
+++ b/contrib/depends/packages/graphviz.mk
@@ -0,0 +1,30 @@
+package=graphviz
+$(package)_version=2.40.1
+$(package)_download_path=www.graphviz.org/pub/graphviz/stable/SOURCES/
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421
+
+define $(package)_preprocess_cmds
+ ./autogen.sh
+endef
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --enable-multibye --without-purify --without-curses
+ $(package)_config_opts_release=--disable-debug-mode
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+endef
diff --git a/contrib/depends/packages/gtest.mk b/contrib/depends/packages/gtest.mk
new file mode 100644
index 0000000..1208d7c
--- /dev/null
+++ b/contrib/depends/packages/gtest.mk
@@ -0,0 +1,39 @@
+package=gtest
+$(package)_version=1.8.1
+$(package)_download_path=https://github.com/google/googletest/archive/
+$(package)_download_file=release-$($(package)_version).tar.gz
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
+$(package)_cxxflags=-std=c++11
+$(package)_cxxflags_linux=-fPIC
+
+define $(package)_config_cmds
+ cd googletest && \
+ CC="$(host_prefix)/native/bin/$($(package)_cc)" \
+ CXX="$(host_prefix)/native/bin/$($(package)_cxx)" \
+ AR="$(host_prefix)/native/bin/$($(package)_ar)" \
+ RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
+ LIBTOOL="$(host_prefix)/native/bin/$($(package)_libtool)" \
+ CXXFLAGS="$($(package)_cxxflags)" \
+ CCFLAGS="$($(package)_ccflags)" \
+ CPPFLAGS="$($(package)_cppflags)" \
+ CFLAGS="$($(package)_cflags) $($(package)_cppflags)" \
+ LDLAGS="$($(package)_ldflags)" \
+ cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) \
+ -DTOOLCHAIN_PREFIX=$(host_toolchain) \
+ -DCMAKE_AR="$(host_prefix)/native/bin/$($(package)_ar)" \
+ -DCMAKE_RANLIB="$(host_prefix)/native/bin/$($(package)_ranlib)" \
+ -DCMAKE_CXX_FLAGS_DEBUG=ON
+endef
+# -DCMAKE_TOOLCHAIN_FILE=$(HOST)/share/toolchain.cmake
+
+define $(package)_build_cmds
+ cd googletest && CC="$(host_prefix)/native/bin/$($(package)_cc)" $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ mkdir $($(package)_staging_prefix_dir)/lib $($(package)_staging_prefix_dir)/include &&\
+ cp googletest/libgtest.a $($(package)_staging_prefix_dir)/lib/ &&\
+ cp googletest/libgtest_main.a $($(package)_staging_prefix_dir)/lib/ &&\
+ cp -a googletest/include/* $($(package)_staging_prefix_dir)/include/
+endef
diff --git a/contrib/depends/packages/hidapi.mk b/contrib/depends/packages/hidapi.mk
new file mode 100644
index 0000000..3ab98ec
--- /dev/null
+++ b/contrib/depends/packages/hidapi.mk
@@ -0,0 +1,40 @@
+package=hidapi
+$(package)_version=0.11.0
+$(package)_download_path=https://github.com/libusb/hidapi/archive
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=391d8e52f2d6a5cf76e2b0c079cfefe25497ba1d4659131297081fc0cd744632
+$(package)_linux_dependencies=libusb eudev
+$(package)_patches=missing_win_include.patch
+
+define $(package)_set_vars
+$(package)_config_opts=--enable-static --disable-shared
+$(package)_config_opts+=--prefix=$(host_prefix)
+#$(package)_config_opts_darwin+=RANLIB="$(host_prefix)/native/bin/x86_64-apple-darwin-ranlib" AR="$(host_prefix)/native/bin/x86_64-apple-darwin-ar" CC="$(host_prefix)/native/bin/$($(package)_cc)"
+$(package)_config_opts_linux+=libudev_LIBS="-L$(host_prefix)/lib -ludev"
+$(package)_config_opts_linux+=libudev_CFLAGS=-I$(host_prefix)/include
+$(package)_config_opts_linux+=libusb_LIBS="-L$(host_prefix)/lib -lusb-1.0"
+$(package)_config_opts_linux+=libusb_CFLAGS=-I$(host_prefix)/include/libusb-1.0
+$(package)_config_opts_linux+=--with-pic
+endef
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/missing_win_include.patch
+endef
+
+define $(package)_config_cmds
+ ./bootstrap &&\
+ $($(package)_autoconf) $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
+
diff --git a/contrib/depends/packages/icu4c.mk b/contrib/depends/packages/icu4c.mk
new file mode 100644
index 0000000..58ae637
--- /dev/null
+++ b/contrib/depends/packages/icu4c.mk
@@ -0,0 +1,27 @@
+package=icu4c
+$(package)_version=55.2
+$(package)_download_path=https://github.com/unicode-org/icu/releases/download/release-55-2/
+$(package)_file_name=$(package)-55_2-src.tgz
+$(package)_sha256_hash=eda2aa9f9c787748a2e2d310590720ca8bcc6252adf6b4cfb03b65bef9d66759
+$(package)_patches=icu-001-dont-build-static-dynamic-twice.patch
+
+define $(package)_set_vars
+ $(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -DU_USING_ICU_NAMESPACE=0 -DU_STATIC_IMPLEMENTATION -DU_COMBINED_IMPLEMENTATION -fPIC -DENABLE_STATIC=YES -DPGKDATA_MODE=static"
+endef
+
+define $(package)_config_cmds
+ patch -p1 < $($(package)_patch_dir)/icu-001-dont-build-static-dynamic-twice.patch &&\
+ mkdir builda &&\
+ mkdir buildb &&\
+ cd builda &&\
+ sh ../source/runConfigureICU Linux &&\
+ make &&\
+ cd ../buildb &&\
+ sh ../source/runConfigureICU MinGW --enable-static=yes --disable-shared --disable-layout --disable-layoutex --disable-tests --disable-samples --prefix=$(host_prefix) --with-cross-build=`pwd`/../builda &&\
+ $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ cd buildb &&\
+ $(MAKE) $($(package)_build_opts) DESTDIR=$($(package)_staging_dir) install lib/*
+endef
diff --git a/contrib/depends/packages/ldns.mk b/contrib/depends/packages/ldns.mk
new file mode 100644
index 0000000..90c63e8
--- /dev/null
+++ b/contrib/depends/packages/ldns.mk
@@ -0,0 +1,34 @@
+package=ldns
+$(package)_version=1.7.1
+$(package)_download_path=https://www.nlnetlabs.nl/downloads/$(package)/
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=8ac84c16bdca60e710eea75782356f3ac3b55680d40e1530d7cea474ac208229
+$(package)_dependencies=openssl
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --enable-static --with-drill
+ $(package)_config_opts+=--with-ssl=$(host_prefix)
+ $(package)_config_opts_release=--disable-debug-mode
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install-h install-lib
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
+
diff --git a/contrib/depends/packages/libICE.mk b/contrib/depends/packages/libICE.mk
new file mode 100644
index 0000000..a897d9a
--- /dev/null
+++ b/contrib/depends/packages/libICE.mk
@@ -0,0 +1,23 @@
+package=libICE
+$(package)_version=1.0.9
+$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202
+$(package)_dependencies=xtrans xproto
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-static --disable-docs --disable-specs --without-xsltproc
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/libSM.mk b/contrib/depends/packages/libSM.mk
new file mode 100644
index 0000000..83fcd4c
--- /dev/null
+++ b/contrib/depends/packages/libSM.mk
@@ -0,0 +1,23 @@
+package=libSM
+$(package)_version=1.2.2
+$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd
+$(package)_dependencies=xtrans xproto libICE
+
+define $(package)_set_vars
+ $(package)_config_opts=--without-libuuid --without-xsltproc --disable-docs --disable-static
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/libXau.mk b/contrib/depends/packages/libXau.mk
new file mode 100644
index 0000000..b7e032c
--- /dev/null
+++ b/contrib/depends/packages/libXau.mk
@@ -0,0 +1,34 @@
+package=libXau
+$(package)_version=1.0.9
+$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=ccf8cbf0dbf676faa2ea0a6d64bcc3b6746064722b606c8c52917ed00dcb73ec
+$(package)_dependencies=xproto
+
+# When updating this package, check the default value of
+# --disable-xthreads. It is currently enabled.
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --disable-lint-library --without-lint
+ $(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share lib/*.la
+endef
diff --git a/contrib/depends/packages/libevent.mk b/contrib/depends/packages/libevent.mk
new file mode 100644
index 0000000..5527151
--- /dev/null
+++ b/contrib/depends/packages/libevent.mk
@@ -0,0 +1,22 @@
+package=libevent
+$(package)_version=2.1.12
+$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/
+$(package)_file_name=libevent-$($(package)_version)-stable.tar.gz
+$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
+$(package)_dependencies=openssl
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --enable-static --with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/libgcrypt.mk b/contrib/depends/packages/libgcrypt.mk
new file mode 100644
index 0000000..0739a22
--- /dev/null
+++ b/contrib/depends/packages/libgcrypt.mk
@@ -0,0 +1,35 @@
+package=libgcrypt
+$(package)_version=1.8.9
+$(package)_download_path=https://www.gnupg.org/ftp/gcrypt/libgcrypt/
+$(package)_file_name=libgcrypt-$($(package)_version).tar.bz2
+$(package)_sha256_hash=2bda4790aa5f0895d3407cf7bf6bd7727fd992f25a45a63d92fef10767fa3769
+$(package)_dependencies=libgpg-error
+$(package)_patches=gost-sb.h no_gen_gost-sb.patch
+
+define $(package)_set_vars
+ $(package)_build_opts=CFLAGS="-fPIE"
+endef
+
+define $(package)_preprocess_cmds
+ mv $($(package)_patch_dir)/gost-sb.h cipher/gost-sb.h && \
+ patch -p1 < $($(package)_patch_dir)/no_gen_gost-sb.patch
+endef
+
+# building on linux with $($(package)_autoconf) fails for mysterious reasons
+ifeq ($(host_os),linux)
+define $(package)_config_cmds
+ CLAGS='-fPIE' CXXFLAGS='-fPIE' ./configure --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix) --prefix=$(host_prefix)
+endef
+else
+define $(package)_config_cmds
+ $($(package)_autoconf) --disable-shared --enable-static --disable-doc --with-libgpg-error-prefix=$(host_prefix)
+endef
+endif
+
+define $(package)_build_cmds
+ $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/libgpg-error.mk b/contrib/depends/packages/libgpg-error.mk
new file mode 100644
index 0000000..7eae42d
--- /dev/null
+++ b/contrib/depends/packages/libgpg-error.mk
@@ -0,0 +1,21 @@
+package=libgpg-error
+$(package)_version=1.45
+$(package)_download_path=https://www.gnupg.org/ftp/gcrypt/libgpg-error/
+$(package)_file_name=libgpg-error-1.45.tar.bz2
+$(package)_sha256_hash=570f8ee4fb4bff7b7495cff920c275002aea2147e9a1d220c068213267f80a26
+
+define $(package)_set_vars
+ $(package)_build_opts=CFLAGS="-fPIE"
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf) --enable-static --disable-shared
+endef
+
+define $(package)_build_cmds
+ $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/libiconv.mk b/contrib/depends/packages/libiconv.mk
new file mode 100644
index 0000000..698aa8b
--- /dev/null
+++ b/contrib/depends/packages/libiconv.mk
@@ -0,0 +1,35 @@
+package=libiconv
+$(package)_version=1.15
+$(package)_download_path=https://ftp.gnu.org/gnu/libiconv
+$(package)_file_name=libiconv-$($(package)_version).tar.gz
+$(package)_sha256_hash=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
+$(package)_patches=fix-whitespace.patch
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-nls
+ $(package)_config_opts=--enable-static
+ $(package)_config_opts=--disable-shared
+ $(package)_config_opts_linux=--with-pic
+ $(package)_config_opts_freebsd=--with-pic
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux/ &&\
+ patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
diff --git a/contrib/depends/packages/libusb.mk b/contrib/depends/packages/libusb.mk
new file mode 100644
index 0000000..d865d2a
--- /dev/null
+++ b/contrib/depends/packages/libusb.mk
@@ -0,0 +1,39 @@
+package=libusb
+$(package)_version=1.0.22
+$(package)_download_path=https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-$($(package)_version)/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=75aeb9d59a4fdb800d329a545c2e6799f732362193b465ea198f2aa275518157
+
+define $(package)_preprocess_cmds
+ autoreconf -i
+endef
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared
+ $(package)_config_opts_linux=--with-pic --disable-udev
+ $(package)_config_opts_mingw32=--disable-udev
+ $(package)_config_opts_darwin=--disable-udev
+endef
+
+ifneq ($(host_os),darwin)
+ define $(package)_config_cmds
+ cp -f $(BASEDIR)/config.guess config.guess &&\
+ cp -f $(BASEDIR)/config.sub config.sub &&\
+ $($(package)_autoconf)
+ endef
+else
+ define $(package)_config_cmds
+ $($(package)_autoconf)
+ endef
+endif
+
+define $(package)_build_cmd
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds cp -f lib/libusb-1.0.a lib/libusb.a
+endef
diff --git a/contrib/depends/packages/libxcb.mk b/contrib/depends/packages/libxcb.mk
new file mode 100644
index 0000000..0fa41fd
--- /dev/null
+++ b/contrib/depends/packages/libxcb.mk
@@ -0,0 +1,41 @@
+package=libxcb
+$(package)_version=1.14
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=$(package)-$($(package)_version).tar.xz
+$(package)_sha256_hash=a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34
+$(package)_dependencies=xcb_proto libXau
+$(package)_patches = remove_pthread_stubs.patch
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen --without-launchd
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+# Disable unneeded extensions.
+# More info is available from: https://doc.qt.io/qt-5.15/linux-requirements.html
+$(package)_config_opts += --disable-composite --disable-damage --disable-dpms
+$(package)_config_opts += --disable-dri2 --disable-dri3 --disable-glx
+$(package)_config_opts += --disable-present --disable-record --disable-resource
+$(package)_config_opts += --disable-screensaver --disable-xevie --disable-xfree86-dri
+$(package)_config_opts += --disable-xinput --disable-xprint --disable-selinux
+$(package)_config_opts += --disable-xtest --disable-xv --disable-xvmc
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux && \
+ patch -p1 -i $($(package)_patch_dir)/remove_pthread_stubs.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share lib/*.la
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/libxcb_util.mk b/contrib/depends/packages/libxcb_util.mk
new file mode 100644
index 0000000..6f1b9cd
--- /dev/null
+++ b/contrib/depends/packages/libxcb_util.mk
@@ -0,0 +1,32 @@
+package=libxcb_util
+$(package)_version=0.4.0
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=xcb-util-$($(package)_version).tar.bz2
+$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9
+$(package)_dependencies=libxcb
+
+define $(package)_set_vars
+$(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+$(package)_config_opts += --with-pic
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man share/doc lib/*.la
+endef
diff --git a/contrib/depends/packages/libxcb_util_image.mk b/contrib/depends/packages/libxcb_util_image.mk
new file mode 100644
index 0000000..d12d67e
--- /dev/null
+++ b/contrib/depends/packages/libxcb_util_image.mk
@@ -0,0 +1,31 @@
+package=libxcb_util_image
+$(package)_version=0.4.0
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=xcb-util-image-$($(package)_version).tar.bz2
+$(package)_sha256_hash=2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc
+$(package)_dependencies=libxcb libxcb_util
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
+$(package)_config_opts+= --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man share/doc lib/*.la
+endef
diff --git a/contrib/depends/packages/libxcb_util_keysyms.mk b/contrib/depends/packages/libxcb_util_keysyms.mk
new file mode 100644
index 0000000..d4f72de
--- /dev/null
+++ b/contrib/depends/packages/libxcb_util_keysyms.mk
@@ -0,0 +1,31 @@
+package=libxcb_util_keysyms
+$(package)_version=0.4.0
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=xcb-util-keysyms-$($(package)_version).tar.bz2
+$(package)_sha256_hash=0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9
+$(package)_dependencies=libxcb xproto
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man share/doc lib/*.la
+endef
diff --git a/contrib/depends/packages/libxcb_util_render.mk b/contrib/depends/packages/libxcb_util_render.mk
new file mode 100644
index 0000000..28f1fb0
--- /dev/null
+++ b/contrib/depends/packages/libxcb_util_render.mk
@@ -0,0 +1,31 @@
+package=libxcb_util_render
+$(package)_version=0.3.9
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=xcb-util-renderutil-$($(package)_version).tar.bz2
+$(package)_sha256_hash=c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b
+$(package)_dependencies=libxcb
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man share/doc lib/*.la
+endef
diff --git a/contrib/depends/packages/libxcb_util_wm.mk b/contrib/depends/packages/libxcb_util_wm.mk
new file mode 100644
index 0000000..3b905ba
--- /dev/null
+++ b/contrib/depends/packages/libxcb_util_wm.mk
@@ -0,0 +1,31 @@
+package=libxcb_util_wm
+$(package)_version=0.4.1
+$(package)_download_path=https://xcb.freedesktop.org/dist
+$(package)_file_name=xcb-util-wm-$($(package)_version).tar.bz2
+$(package)_sha256_hash=28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f
+$(package)_dependencies=libxcb
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-static --disable-devel-docs --without-doxygen
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share/man share/doc lib/*.la
+endef
diff --git a/contrib/depends/packages/libxkbcommon.mk b/contrib/depends/packages/libxkbcommon.mk
new file mode 100644
index 0000000..9040981
--- /dev/null
+++ b/contrib/depends/packages/libxkbcommon.mk
@@ -0,0 +1,36 @@
+package=libxkbcommon
+$(package)_version=0.8.4
+$(package)_download_path=https://xkbcommon.org/download/
+$(package)_file_name=$(package)-$($(package)_version).tar.xz
+$(package)_sha256_hash=60ddcff932b7fd352752d51a5c4f04f3d0403230a584df9a2e0d5ed87c486c8b
+$(package)_dependencies=libxcb
+
+# This package explicitly enables -Werror=array-bounds, which causes build failures
+# with GCC 12.1+. Work around that by turning errors back into warnings.
+# This workaround would be dropped if the package was updated, as that would require
+# a different build system (Meson)
+define $(package)_set_vars
+$(package)_config_opts = --enable-option-checking --disable-dependency-tracking
+$(package)_config_opts += --disable-static --disable-docs
+$(package)_cflags += -Wno-error=array-bounds
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
diff --git a/contrib/depends/packages/libzip.mk b/contrib/depends/packages/libzip.mk
new file mode 100644
index 0000000..b06dc5d
--- /dev/null
+++ b/contrib/depends/packages/libzip.mk
@@ -0,0 +1,23 @@
+package=libzip
+$(package)_version=1.9.2
+$(package)_download_path=https://libzip.org/download/
+$(package)_file_name=libzip-1.9.2.tar.gz
+$(package)_sha256_hash=fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f
+$(package)_dependencies=zlib native_cmake
+$(package)_patches += no-clonefile.patch
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/no-clonefile.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_cmake) -DZLIB_ROOT=$(host_prefix) -DENABLE_BZIP2=Off -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$(host_prefix) .
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_ccache.mk b/contrib/depends/packages/native_ccache.mk
new file mode 100644
index 0000000..966804c
--- /dev/null
+++ b/contrib/depends/packages/native_ccache.mk
@@ -0,0 +1,25 @@
+package=native_ccache
+$(package)_version=3.3.4
+$(package)_download_path=https://samba.org/ftp/ccache
+$(package)_file_name=ccache-$($(package)_version).tar.bz2
+$(package)_sha256_hash=fa9d7f38367431bc86b19ad107d709ca7ecf1574fdacca01698bdf0a47cd8567
+
+define $(package)_set_vars
+$(package)_config_opts=
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf lib include
+endef
diff --git a/contrib/depends/packages/native_cctools.mk b/contrib/depends/packages/native_cctools.mk
new file mode 100644
index 0000000..e711036
--- /dev/null
+++ b/contrib/depends/packages/native_cctools.mk
@@ -0,0 +1,37 @@
+package=native_cctools
+$(package)_version=2ef2e931cf641547eb8a68cfebde61003587c9fd
+$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive
+$(package)_file_name=$($(package)_version).tar.gz
+$(package)_sha256_hash=6b73269efdf5c58a070e7357b66ee760501388549d6a12b423723f45888b074b
+$(package)_build_subdir=cctools
+$(package)_dependencies=native_libtapi
+
+define $(package)_set_vars
+ $(package)_config_opts=--target=$(host)
+ $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
+ ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
+ $(package)_config_opts+=--enable-lto-support --with-llvm-config=$(build_prefix)/bin/llvm-config
+ endif
+ $(package)_cc=$(clang_prog)
+ $(package)_cxx=$(clangxx_prog)
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_clang.mk b/contrib/depends/packages/native_clang.mk
new file mode 100644
index 0000000..245269a
--- /dev/null
+++ b/contrib/depends/packages/native_clang.mk
@@ -0,0 +1,25 @@
+package=native_clang
+$(package)_version=10.0.1
+$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
+ifneq (,$(findstring aarch64,$(BUILD)))
+$(package)_file_name=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
+$(package)_sha256_hash=90dc69a4758ca15cd0ffa45d07fbf5bf4309d47d2c7745a9f0735ecffde9c31f
+else
+$(package)_file_name=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-16.04.tar.xz
+$(package)_sha256_hash=48b83ef827ac2c213d5b64f5ad7ed082c8bcb712b46644e0dc5045c6f462c231
+endif
+
+define $(package)_preprocess_cmds
+ rm -f $($(package)_extract_dir)/lib/libc++abi.so*
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include && \
+ mkdir -p $($(package)_staging_prefix_dir)/bin && \
+ cp bin/clang $($(package)_staging_prefix_dir)/bin/ && \
+ cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ && \
+ cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
+ cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \
+ cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
+ cp -r lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/
+endef
diff --git a/contrib/depends/packages/native_cmake.mk b/contrib/depends/packages/native_cmake.mk
new file mode 100644
index 0000000..f5c8cf7
--- /dev/null
+++ b/contrib/depends/packages/native_cmake.mk
@@ -0,0 +1,18 @@
+package=native_cmake
+$(package)_version=3.23.2
+$(package)_version_dot=v3.23
+$(package)_download_path=https://cmake.org/files/$($(package)_version_dot)/
+$(package)_file_name=cmake-$($(package)_version).tar.gz
+$(package)_sha256_hash=f316b40053466f9a416adf981efda41b160ca859e97f6a484b447ea299ff26aa
+
+define $(package)_config_cmds
+ ./bootstrap --prefix=$(build_prefix) -- -DCMAKE_USE_OPENSSL=OFF
+endef
+
+define $(package)_build_cmd
+ +$(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_ds_store.mk b/contrib/depends/packages/native_ds_store.mk
new file mode 100644
index 0000000..087c5ad
--- /dev/null
+++ b/contrib/depends/packages/native_ds_store.mk
@@ -0,0 +1,15 @@
+package=native_ds_store
+$(package)_version=1.3.0
+$(package)_download_path=https://github.com/al45tair/ds_store/archive/
+$(package)_file_name=v$($(package)_version).tar.gz
+$(package)_sha256_hash=76b3280cd4e19e5179defa23fb594a9dd32643b0c80d774bd3108361d94fb46d
+$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages
+
+define $(package)_build_cmds
+ python3 setup.py build
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_install_libdir) && \
+ python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_libtapi.mk b/contrib/depends/packages/native_libtapi.mk
new file mode 100644
index 0000000..6b06aa7
--- /dev/null
+++ b/contrib/depends/packages/native_libtapi.mk
@@ -0,0 +1,19 @@
+package=native_libtapi
+$(package)_version=664b8414f89612f2dfd35a9b679c345aa5389026
+$(package)_download_path=https://github.com/tpoechtrager/apple-libtapi/archive
+$(package)_file_name=$($(package)_version).tar.gz
+$(package)_sha256_hash=62e419c12d1c9fad67cc1cd523132bc00db050998337c734c15bc8d73cc02b61
+
+ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
+$(package)_dependencies=native_clang
+endif
+
+define $(package)_build_cmds
+ CC=$(clang_prog) CXX=$(clangxx_prog) INSTALLPREFIX=$($(package)_staging_prefix_dir) ./build.sh
+endef
+
+define $(package)_stage_cmds
+ ./install.sh && \
+ mkdir -p $($(package)_staging_prefix_dir)/include/llvm-c && \
+ cp src/llvm/include/llvm-c/lto.h $($(package)_staging_prefix_dir)/include/llvm-c
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_linuxdeployqt.mk b/contrib/depends/packages/native_linuxdeployqt.mk
new file mode 100644
index 0000000..2c2ae69
--- /dev/null
+++ b/contrib/depends/packages/native_linuxdeployqt.mk
@@ -0,0 +1,18 @@
+package=native_linuxdeployqt
+$(package)_version=8
+$(package)_download_path=https://github.com/probonopd/linuxdeployqt/archive/refs/tags/
+$(package)_file_name=8.tar.gz
+$(package)_sha256_hash=5597279392431aef16997c4b6892b5aa044392f7e8869439ebea33945a8bdbad
+$(package)_dependencies=qt
+
+define $(package)_config_cmds
+ qmake
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) INSTALL_ROOT=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_mac_alias.mk b/contrib/depends/packages/native_mac_alias.mk
new file mode 100644
index 0000000..5d9891e
--- /dev/null
+++ b/contrib/depends/packages/native_mac_alias.mk
@@ -0,0 +1,15 @@
+package=native_mac_alias
+$(package)_version=2.2.0
+$(package)_download_path=https://github.com/dmgbuild/mac_alias/archive/
+$(package)_file_name=v$($(package)_version).tar.gz
+$(package)_sha256_hash=421e6d7586d1f155c7db3e7da01ca0dacc9649a509a253ad7077b70174426499
+$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages
+
+define $(package)_build_cmds
+ python3 setup.py build
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_install_libdir) && \
+ python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_patchelf.mk b/contrib/depends/packages/native_patchelf.mk
new file mode 100644
index 0000000..8abb753
--- /dev/null
+++ b/contrib/depends/packages/native_patchelf.mk
@@ -0,0 +1,17 @@
+package=native_patchelf
+$(package)_version=0.14.5
+$(package)_download_path=https://github.com/NixOS/patchelf/releases/download/$($(package)_version)/
+$(package)_file_name=patchelf-$($(package)_version).tar.gz
+$(package)_sha256_hash=113ada3f1ace08f0a7224aa8500f1fa6b08320d8f7df05ff58585286ec5faa6f
+
+define $(package)_config_cmds
+ ./configure --prefix=$(build_prefix)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/native_protobuf.mk b/contrib/depends/packages/native_protobuf.mk
new file mode 100644
index 0000000..7e193d3
--- /dev/null
+++ b/contrib/depends/packages/native_protobuf.mk
@@ -0,0 +1,27 @@
+package=native_protobuf
+$(package)_version=3.6.1
+$(package)_download_path=https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/
+$(package)_file_name=protobuf-cpp-3.6.1.tar.gz
+$(package)_sha256_hash=b3732e471a9bb7950f090fd0457ebd2536a9ba0891b7f3785919c654fe2a2529
+$(package)_cxxflags=-std=c++11
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --prefix=$(build_prefix)
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) -C src
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/libprotoc.a
+endef
diff --git a/contrib/depends/packages/native_qmake.mk b/contrib/depends/packages/native_qmake.mk
new file mode 100644
index 0000000..3f66ef4
--- /dev/null
+++ b/contrib/depends/packages/native_qmake.mk
@@ -0,0 +1,60 @@
+package=native_qmake
+$(package)_version=5.15.3
+$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
+$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
+$(package)_file_name=qtbase-$($(package)_suffix)
+$(package)_sha256_hash=26394ec9375d52c1592bd7b689b1619c6b8dbe9b6f91fdd5c355589787f3a0b6
+$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
+$(package)_patches += no-xlib.patch
+
+define $(package)_set_vars
+$(package)_config_opts_release = -release
+$(package)_config_opts += -bindir $(build_prefix)/bin
+$(package)_config_opts += -c++std c++17
+$(package)_config_opts += -confirm-license
+$(package)_config_opts += -hostprefix $(build_prefix)
+$(package)_config_opts += -opensource
+$(package)_config_opts += -prefix $(host_prefix)
+$(package)_config_opts += -v
+$(package)_config_opts_linux = -xcb
+$(package)_config_opts_linux += -no-xcb-xlib
+$(package)_config_opts_linux += -no-feature-xlib
+$(package)_config_opts_linux += -no-opengl
+$(package)_config_opts_linux += -no-feature-vulkan
+$(package)_config_opts_linux += -dbus-runtime
+endef
+
+define $(package)_fetch_cmds
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash))
+endef
+
+define $(package)_extract_cmds
+ mkdir -p $($(package)_extract_dir) && \
+ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ mkdir qtbase && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase
+endef
+
+define $(package)_preprocess_cmds
+ patch -p1 -i $($(package)_patch_dir)/no-xlib.patch
+endef
+
+define $(package)_config_cmds
+ cd qtbase && \
+ ./configure $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ cd qtbase && \
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ cd qtbase && \
+ $(MAKE) INSTALL_ROOT=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ echo -n "" > lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
+endef
diff --git a/contrib/depends/packages/native_squashfs-tools.mk b/contrib/depends/packages/native_squashfs-tools.mk
new file mode 100644
index 0000000..b6ea9e8
--- /dev/null
+++ b/contrib/depends/packages/native_squashfs-tools.mk
@@ -0,0 +1,15 @@
+package=native_squashfs-tools
+$(package)_version=4.5.1
+$(package)_download_path=https://github.com/plougher/squashfs-tools/archive/refs/tags
+$(package)_file_name=$($(package)_version).tar.gz
+$(package)_sha256_hash=277b6e7f75a4a57f72191295ae62766a10d627a4f5e5f19eadfbc861378deea7
+
+define $(package)_build_cmds
+ cd squashfs-tools && \
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ cd squashfs-tools && \
+ $(MAKE) INSTALL_DIR=$($(package)_staging_dir)$(build_prefix) INSTALL_MANPAGES_DIR="" install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/ncurses.mk b/contrib/depends/packages/ncurses.mk
new file mode 100644
index 0000000..a69de5b
--- /dev/null
+++ b/contrib/depends/packages/ncurses.mk
@@ -0,0 +1,64 @@
+package=ncurses
+$(package)_version=6.1
+$(package)_download_path=https://ftp.gnu.org/gnu/ncurses
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17
+$(package)_patches=fallback.c
+
+define $(package)_set_vars
+ $(package)_build_opts=CC="$($(package)_cc)"
+ $(package)_config_env_mingw32=cf_cv_ar_flags=""
+ $(package)_config_env_linux=cf_cv_ar_flags=""
+ $(package)_config_opts=--prefix=$(host_prefix)
+ $(package)_config_opts+=--disable-shared
+ $(package)_config_opts+=--with-build-cc=gcc
+ $(package)_config_opts+=--without-debug
+ $(package)_config_opts+=--without-ada
+ $(package)_config_opts+=--without-cxx-binding
+ $(package)_config_opts+=--without-cxx
+ $(package)_config_opts+=--without-ticlib
+ $(package)_config_opts+=--without-tic
+ $(package)_config_opts+=--without-progs
+ $(package)_config_opts+=--without-tests
+ $(package)_config_opts+=--without-tack
+ $(package)_config_opts+=--without-manpages
+ $(package)_config_opts+=--with-termlib=tinfo
+ $(package)_config_opts+=--disable-tic-depends
+ $(package)_config_opts+=--disable-big-strings
+ $(package)_config_opts+=--disable-ext-colors
+ $(package)_config_opts+=--enable-pc-files
+ $(package)_config_opts+=--host=$(HOST)
+ $(pacakge)_config_opts+=--without-shared
+ $(pacakge)_config_opts+=--without-pthread
+ $(pacakge)_config_opts+=--disable-rpath
+ $(pacakge)_config_opts+=--disable-colorfgbg
+ $(pacakge)_config_opts+=--disable-ext-mouse
+ $(pacakge)_config_opts+=--disable-symlinks
+ $(pacakge)_config_opts+=--enable-warnings
+ $(pacakge)_config_opts+=--enable-assertions
+ $(package)_config_opts+=--with-default-terminfo-dir=/etc/_terminfo_
+ $(package)_config_opts+=--with-terminfo-dirs=/etc/_terminfo_
+ $(pacakge)_config_opts+=--enable-database
+ $(pacakge)_config_opts+=--enable-sp-funcs
+ $(pacakge)_config_opts+=--disable-term-driver
+ $(pacakge)_config_opts+=--enable-interop
+ $(pacakge)_config_opts+=--enable-widec
+ $(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
+endef
+
+define $(package)_preprocess_cmds
+ cp $($(package)_patch_dir)/fallback.c ncurses
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) $($(package)_build_opts) V=1
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) install.libs DESTDIR=$($(package)_staging_dir)
+endef
+
diff --git a/contrib/depends/packages/openssl.mk b/contrib/depends/packages/openssl.mk
new file mode 100644
index 0000000..79c94a3
--- /dev/null
+++ b/contrib/depends/packages/openssl.mk
@@ -0,0 +1,70 @@
+package=openssl
+$(package)_version=1.1.1l
+$(package)_download_path=https://www.openssl.org/source
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
+$(package)_patches=fix_darwin.patch
+
+define $(package)_set_vars
+$(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
+$(package)_config_env_android=ANDROID_NDK_HOME="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib
+$(package)_build_env_android=ANDROID_NDK_HOME="$(host_prefix)/native"
+$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl
+$(package)_config_opts+=no-capieng
+$(package)_config_opts+=no-dso
+$(package)_config_opts+=no-dtls1
+$(package)_config_opts+=no-ec_nistp_64_gcc_128
+$(package)_config_opts+=no-gost
+$(package)_config_opts+=no-heartbeats
+$(package)_config_opts+=no-md2
+$(package)_config_opts+=no-rc5
+$(package)_config_opts+=no-rdrand
+$(package)_config_opts+=no-rfc3779
+$(package)_config_opts+=no-sctp
+$(package)_config_opts+=no-shared
+$(package)_config_opts+=no-ssl-trace
+$(package)_config_opts+=no-ssl2
+$(package)_config_opts+=no-ssl3
+$(package)_config_opts+=no-unit-test
+$(package)_config_opts+=no-weak-ssl-ciphers
+$(package)_config_opts+=no-zlib
+$(package)_config_opts+=no-zlib-dynamic
+$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags)
+$(package)_config_opts_linux=-fPIC -Wa,--noexecstack
+$(package)_config_opts_freebsd=-fPIC -Wa,--noexecstack
+$(package)_config_opts_x86_64_linux=linux-x86_64
+$(package)_config_opts_i686_linux=linux-generic32
+$(package)_config_opts_arm_linux=linux-generic32
+$(package)_config_opts_aarch64_linux=linux-generic64
+$(package)_config_opts_arm_android=--static android-arm
+$(package)_config_opts_aarch64_android=--static android-arm64
+$(package)_config_opts_riscv64_linux=linux-generic64
+$(package)_config_opts_mipsel_linux=linux-generic32
+$(package)_config_opts_mips_linux=linux-generic32
+$(package)_config_opts_powerpc_linux=linux-generic32
+$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc
+$(package)_config_opts_x86_64_mingw32=mingw64
+$(package)_config_opts_i686_mingw32=mingw
+$(package)_config_opts_x86_64_freebsd=BSD-x86_64
+endef
+
+define $(package)_preprocess_cmds
+ sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure && \
+ patch -p1 < $($(package)_patch_dir)/fix_darwin.patch
+endef
+
+define $(package)_config_cmds
+ ./Configure $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) build_libs
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install_sw
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf share bin etc
+endef
diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk
new file mode 100644
index 0000000..8bf1b1f
--- /dev/null
+++ b/contrib/depends/packages/packages.mk
@@ -0,0 +1,32 @@
+native_packages := native_cmake
+packages := boost openssl libiconv ldns unbound qrencode zbar sodium polyseed hidapi protobuf libusb zlib libgpg-error libgcrypt ncurses readline expat
+
+hardware_packages := hidapi protobuf libusb
+hardware_native_packages := native_protobuf
+
+linux_packages := eudev libzip
+linux_native_packages = $(hardware_native_packages) native_patchelf
+# native_linuxdeployqt native_squashfs-tools native_qmake
+
+qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
+qt_darwin_packages=qt
+qt_mingw32_packages=qt
+
+# apt install python3-setuptools
+darwin_packages := libzip
+darwin_native_packages = $(hardware_native_packages) native_ds_store native_mac_alias
+
+tor_linux_packages := libevent tor
+tor_darwin_packages := tor-macos
+
+mingw32_packages = icu4c sodium $(hardware_packages) tor-win libzip
+mingw32_native_packages = $(hardware_native_packages)
+
+ifneq ($(build_os),darwin)
+darwin_native_packages += native_cctools native_libtapi
+
+ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
+darwin_native_packages+= native_clang
+endif
+
+endif
diff --git a/contrib/depends/packages/polyseed.mk b/contrib/depends/packages/polyseed.mk
new file mode 100644
index 0000000..76737a3
--- /dev/null
+++ b/contrib/depends/packages/polyseed.mk
@@ -0,0 +1,24 @@
+package=polyseed
+$(package)_version=1.0.0
+$(package)_download_path=https://github.com/tevador/polyseed/archive/refs/tags/
+$(package)_file_name=v$($(package)_version).tar.gz
+$(package)_sha256_hash=45f1e6c08575286581079e6e26d341a3a33abe1f1ee2d026bd098cf632ea2349
+$(package)_dependencies=native_cmake
+$(package)_patches=no_shared.patch force-static-mingw.patch
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/no_shared.patch && \
+ patch -p1 < $($(package)_patch_dir)/force-static-mingw.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_cmake) -DCMAKE_INSTALL_PREFIX=$(host_prefix) -DCMAKE_C_COMPILER= .
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/protobuf.mk b/contrib/depends/packages/protobuf.mk
new file mode 100644
index 0000000..81fa78a
--- /dev/null
+++ b/contrib/depends/packages/protobuf.mk
@@ -0,0 +1,31 @@
+package=protobuf
+$(package)_version=$(native_$(package)_version)
+$(package)_download_path=$(native_$(package)_download_path)
+$(package)_file_name=$(native_$(package)_file_name)
+$(package)_sha256_hash=$(native_$(package)_sha256_hash)
+$(package)_dependencies=native_$(package)
+$(package)_cxxflags=-std=c++11
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc
+ $(package)_config_opts_linux=--with-pic
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) -C src libprotobuf.la
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-libLTLIBRARIES install-nobase_includeHEADERS &&\
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/libprotoc.a &&\
+ rm lib/*.la
+endef
+
diff --git a/contrib/depends/packages/qrencode.mk b/contrib/depends/packages/qrencode.mk
new file mode 100644
index 0000000..d168788
--- /dev/null
+++ b/contrib/depends/packages/qrencode.mk
@@ -0,0 +1,33 @@
+package=qrencode
+$(package)_version=3.4.4
+$(package)_download_path=https://fukuchi.org/works/qrencode/
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5
+
+define $(package)_set_vars
+$(package)_config_opts=--disable-shared --without-tools --without-tests --disable-sdltest
+$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+$(package)_config_opts_linux=--with-pic
+$(package)_config_opts_android=--with-pic
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub use
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
diff --git a/contrib/depends/packages/qt.mk b/contrib/depends/packages/qt.mk
new file mode 100644
index 0000000..03c706a
--- /dev/null
+++ b/contrib/depends/packages/qt.mk
@@ -0,0 +1,307 @@
+package=qt
+$(package)_version=5.15.5
+$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
+$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
+$(package)_file_name=qtbase-$($(package)_suffix)
+$(package)_sha256_hash=0c42c799aa7c89e479a07c451bf5a301e291266ba789e81afc18f95049524edc
+$(package)_dependencies=openssl
+$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
+$(package)_qt_libs=corelib network widgets gui plugins testlib
+$(package)_linguist_tools = lrelease lupdate lconvert
+$(package)_patches = qt.pro
+$(package)_patches += qttools_src.pro
+$(package)_patches += mac-qmake.conf
+$(package)_patches += fix_qt_pkgconfig.patch
+$(package)_patches += no-xlib.patch
+$(package)_patches += dont_hardcode_x86_64.patch
+$(package)_patches += fix_montery_include.patch
+$(package)_patches += fix_android_jni_static.patch
+$(package)_patches += dont_hardcode_pwd.patch
+$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
+$(package)_patches += use_android_ndk23.patch
+$(package)_patches += rcc_hardcode_timestamp.patch
+$(package)_patches += duplicate_lcqpafonts.patch
+$(package)_patches += fast_fixed_dtoa_no_optimize.patch
+$(package)_patches += guix_cross_lib_path.patch
+
+$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
+$(package)_qttranslations_sha256_hash=c92af4171397a0ed272330b4fa0669790fcac8d050b07c8b8cc565ebeba6735e
+
+$(package)_qttools_file_name=qttools-$($(package)_suffix)
+$(package)_qttools_sha256_hash=6d0778b71b2742cb527561791d1d3d255366163d54a10f78c683a398f09ffc6c
+
+$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
+$(package)_qtsvg_sha256_hash=c4cf9e640ad43f157c6b14ee7624047f5945288991ad5de83c9eec673bacb031
+
+$(package)_qtwebsockets_file_name=qtwebsockets-$($(package)_suffix)
+$(package)_qtwebsockets_sha256_hash=66ab8b5bb2e64392fe43786ca1c2fd4be3306fbc4b969aa1748e568b5d062238
+
+
+$(package)_extra_sources = $($(package)_qttranslations_file_name)
+$(package)_extra_sources += $($(package)_qttools_file_name)
+$(package)_extra_sources += $($(package)_qtsvg_file_name)
+$(package)_extra_sources += $($(package)_qtwebsockets_file_name)
+
+define $(package)_set_vars
+$(package)_config_opts_release = -release
+$(package)_config_opts_release += -silent
+$(package)_config_opts_debug = -debug
+$(package)_config_opts_debug += -optimized-tools
+$(package)_config_opts += -bindir $(build_prefix)/bin
+$(package)_config_opts += -c++std c++17
+$(package)_config_opts += -confirm-license
+$(package)_config_opts += -hostprefix $(build_prefix)
+$(package)_config_opts += -no-compile-examples
+$(package)_config_opts += -no-cups
+$(package)_config_opts += -no-egl
+$(package)_config_opts += -no-eglfs
+$(package)_config_opts += -no-evdev
+$(package)_config_opts += -no-gif
+$(package)_config_opts += -no-glib
+$(package)_config_opts += -no-icu
+$(package)_config_opts += -no-ico
+$(package)_config_opts += -no-iconv
+$(package)_config_opts += -no-kms
+$(package)_config_opts += -no-linuxfb
+$(package)_config_opts += -no-libjpeg
+#$(package)_config_opts += -no-libproxy # Needed
+$(package)_config_opts += -no-libudev
+$(package)_config_opts += -no-mtdev
+#$(package)_config_opts += -no-openssl # Needed
+$(package)_config_opts += -no-openvg
+$(package)_config_opts += -no-reduce-relocations
+$(package)_config_opts += -no-schannel
+$(package)_config_opts += -no-sctp
+$(package)_config_opts += -no-securetransport
+$(package)_config_opts += -no-sql-db2
+$(package)_config_opts += -no-sql-ibase
+$(package)_config_opts += -no-sql-oci
+$(package)_config_opts += -no-sql-tds
+$(package)_config_opts += -no-sql-mysql
+$(package)_config_opts += -no-sql-odbc
+$(package)_config_opts += -no-sql-psql
+$(package)_config_opts += -no-sql-sqlite
+$(package)_config_opts += -no-sql-sqlite2
+$(package)_config_opts += -no-system-proxies
+$(package)_config_opts += -no-use-gold-linker
+$(package)_config_opts += -no-zstd
+$(package)_config_opts += -nomake examples
+$(package)_config_opts += -nomake tests
+$(package)_config_opts += -nomake tools
+$(package)_config_opts += -opensource
+$(package)_config_opts += -openssl-linked
+$(package)_config_opts += -pkg-config
+$(package)_config_opts += -prefix $(host_prefix)
+$(package)_config_opts += -qt-libpng
+$(package)_config_opts += -qt-pcre
+$(package)_config_opts += -qt-harfbuzz
+$(package)_config_opts += -qt-zlib
+$(package)_config_opts += -static
+$(package)_config_opts += -v
+$(package)_config_opts += -no-feature-bearermanagement
+$(package)_config_opts += -no-feature-colordialog
+$(package)_config_opts += -no-feature-dial
+$(package)_config_opts += -no-feature-fontcombobox
+$(package)_config_opts += -no-feature-ftp
+$(package)_config_opts += -no-feature-http
+$(package)_config_opts += -no-feature-image_heuristic_mask
+$(package)_config_opts += -no-feature-keysequenceedit
+$(package)_config_opts += -no-feature-lcdnumber
+$(package)_config_opts += -no-feature-networkdiskcache
+$(package)_config_opts += -no-feature-pdf
+$(package)_config_opts += -no-feature-printdialog
+$(package)_config_opts += -no-feature-printer
+$(package)_config_opts += -no-feature-printpreviewdialog
+$(package)_config_opts += -no-feature-printpreviewwidget
+$(package)_config_opts += -no-feature-sessionmanager
+$(package)_config_opts += -no-feature-sql
+$(package)_config_opts += -no-feature-sqlmodel
+$(package)_config_opts += -no-feature-statemachine
+$(package)_config_opts += -no-feature-syntaxhighlighter
+$(package)_config_opts += -no-feature-textmarkdownwriter
+$(package)_config_opts += -no-feature-textodfwriter
+$(package)_config_opts += -no-feature-topleveldomain
+$(package)_config_opts += -no-feature-undocommand
+$(package)_config_opts += -no-feature-undogroup
+$(package)_config_opts += -no-feature-undostack
+$(package)_config_opts += -no-feature-undoview
+$(package)_config_opts += -no-feature-vnc
+$(package)_config_opts += -no-feature-xml
+
+$(package)_config_opts_darwin = -no-dbus
+$(package)_config_opts_darwin += -no-opengl
+$(package)_config_opts_darwin += -pch
+$(package)_config_opts_darwin += -no-feature-corewlan
+$(package)_config_opts_darwin += -no-freetype
+$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION)
+
+ifneq ($(build_os),darwin)
+$(package)_config_opts_darwin += -xplatform macx-clang-linux
+$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK)
+$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION)
+$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-"
+$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
+$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION)
+endif
+
+ifneq ($(build_arch),$(host_arch))
+$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64
+$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64
+endif
+
+$(package)_config_opts_linux = -xcb
+$(package)_config_opts_linux += -no-xcb-xlib
+$(package)_config_opts_linux += -no-feature-xlib
+$(package)_config_opts_linux += -system-freetype
+$(package)_config_opts_linux += -fontconfig
+$(package)_config_opts_linux += -no-opengl
+$(package)_config_opts_linux += -no-feature-vulkan
+$(package)_config_opts_linux += -dbus-runtime
+ifneq ($(LTO),)
+$(package)_config_opts_linux += -ltcg
+endif
+$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
+$(package)_config_opts_i686_linux = -xplatform linux-g++-32
+ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
+$(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++
+else
+$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
+endif
+$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
+$(package)_config_opts_powerpc64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
+$(package)_config_opts_powerpc64le_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
+$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
+$(package)_config_opts_s390x_linux = -platform linux-g++ -xplatform bitcoin-linux-g++
+
+$(package)_config_opts_mingw32 = -no-opengl
+$(package)_config_opts_mingw32 += -no-dbus
+$(package)_config_opts_mingw32 += -no-freetype
+$(package)_config_opts_mingw32 += -xplatform win32-g++
+$(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
+$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'"
+$(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'"
+$(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
+$(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'"
+$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-"
+$(package)_config_opts_mingw32 += -pch
+
+$(package)_config_opts_android = -xplatform android-clang
+$(package)_config_opts_android += -android-sdk $(ANDROID_SDK)
+$(package)_config_opts_android += -android-ndk $(ANDROID_NDK)
+$(package)_config_opts_android += -android-ndk-platform android-$(ANDROID_API_LEVEL)
+$(package)_config_opts_android += -egl
+$(package)_config_opts_android += -no-dbus
+$(package)_config_opts_android += -opengl es2
+$(package)_config_opts_android += -qt-freetype
+$(package)_config_opts_android += -no-fontconfig
+$(package)_config_opts_android += -L $(host_prefix)/lib
+$(package)_config_opts_android += -I $(host_prefix)/include
+$(package)_config_opts_android += -pch
+$(package)_config_opts_android += -no-feature-vulkan
+
+$(package)_config_opts_aarch64_android += -android-arch arm64-v8a
+$(package)_config_opts_armv7a_android += -android-arch armeabi-v7a
+$(package)_config_opts_x86_64_android += -android-arch x86_64
+
+$(package)_openssl_flags_$(host_os)="-lssl -lcrypto -lpthread -ldl"
+$(package)_openssl_flags_mingw32="-lssl -lcrypto -lws2_32"
+endef
+
+define $(package)_fetch_cmds
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtsvg_file_name),$($(package)_qtsvg_file_name),$($(package)_qtsvg_sha256_hash)) && \
+$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_file_name),$($(package)_qtwebsockets_sha256_hash))
+endef
+
+define $(package)_extract_cmds
+ mkdir -p $($(package)_extract_dir) && \
+ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ echo "$($(package)_qtsvg_sha256_hash) $($(package)_source_dir)/$($(package)_qtsvg_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ echo "$($(package)_qtwebsockets_sha256_hash) $($(package)_source_dir)/$($(package)_qtwebsockets_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
+ mkdir qtbase && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
+ mkdir qttranslations && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
+ mkdir qttools && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \
+ mkdir qtsvg && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtsvg_file_name) -C qtsvg && \
+ mkdir qtwebsockets && \
+ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qtwebsockets_file_name) -C qtwebsockets
+endef
+
+# Preprocessing steps work as follows:
+#
+# 1. Apply our patches to the extracted source. See each patch for more info.
+#
+# 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf.
+#
+# 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named
+# bitcoin-linux-g++, replace instances of linux-arm-gnueabi with $(host). This
+# way we can generically support hosts like riscv64-linux-gnu, which Qt doesn't
+# ship a mkspec for. See it's usage in config_opts_* above.
+#
+# 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds.
+#
+# 5. Do similar for the win32-g++ mkspec.
+#
+# 6. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466.
+#
+# 7. Adjust a regex in toolchain.prf, to accommodate Guix's usage of
+# CROSS_LIBRARY_PATH. See #15277.
+define $(package)_preprocess_cmds
+ cp $($(package)_patch_dir)/qt.pro qt.pro && \
+ cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \
+ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fix_android_jni_static.patch && \
+ patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
+ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_x86_64.patch && \
+ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fix_montery_include.patch && \
+ patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
+ patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
+ patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
+ patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
+ mkdir -p qtbase/mkspecs/macx-clang-linux &&\
+ cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
+ cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
+ cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
+ sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
+ echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
+ echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
+ echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
+ sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \
+ sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf
+endef
+
+define $(package)_config_cmds
+ export OPENSSL_LIBS=${$(package)_openssl_flags_$(host_os)} \
+ export PKG_CONFIG_SYSROOT_DIR=/ && \
+ export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
+ export QT_MAC_SDK_NO_VERSION_CHECK=1 && \
+ cd qtbase && \
+ ./configure -top-level $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) -C qtbase INSTALL_ROOT=$($(package)_staging_dir) install && \
+ $(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_linguist_tools))) && \
+ $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \
+ $(MAKE) -C qtsvg/src INSTALL_ROOT=$($(package)_staging_dir) install && \
+ $(MAKE) -C qtwebsockets/src INSTALL_ROOT=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ echo -n "" > lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
+endef
diff --git a/contrib/depends/packages/readline.mk b/contrib/depends/packages/readline.mk
new file mode 100644
index 0000000..957b645
--- /dev/null
+++ b/contrib/depends/packages/readline.mk
@@ -0,0 +1,29 @@
+package=readline
+$(package)_version=8.0
+$(package)_download_path=https://ftp.gnu.org/gnu/readline
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461
+$(package)_dependencies=ncurses
+
+define $(package)_set_vars
+ $(package)_build_opts=CC="$($(package)_cc)"
+ $(package)_config_opts+=--prefix=$(host_prefix)
+ $(package)_config_opts+=--exec-prefix=$(host_prefix)
+ $(package)_config_opts+=--host=$(HOST)
+ $(package)_config_opts+=--disable-shared --with-curses
+ $(package)_config_opts_release=--disable-debug-mode
+ $(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) install DESTDIR=$($(package)_staging_dir) prefix=$(host_prefix) exec-prefix=$(host_prefix)
+endef
+
diff --git a/contrib/depends/packages/sodium.mk b/contrib/depends/packages/sodium.mk
new file mode 100644
index 0000000..c834409
--- /dev/null
+++ b/contrib/depends/packages/sodium.mk
@@ -0,0 +1,34 @@
+package=sodium
+$(package)_version=1.0.18
+$(package)_download_path=https://download.libsodium.org/libsodium/releases/
+$(package)_file_name=libsodium-$($(package)_version).tar.gz
+$(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
+$(package)_patches=disable-glibc-getrandom-getentropy.patch fix-whitespace.patch
+
+define $(package)_set_vars
+$(package)_config_opts=--enable-static --disable-shared
+$(package)_config_opts+=--prefix=$(host_prefix)
+endef
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/disable-glibc-getrandom-getentropy.patch &&\
+ autoconf &&\
+ patch -p1 < $($(package)_patch_dir)/fix-whitespace.patch
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm lib/*.la
+endef
+
diff --git a/contrib/depends/packages/tor-macos.mk b/contrib/depends/packages/tor-macos.mk
new file mode 100644
index 0000000..fd9af82
--- /dev/null
+++ b/contrib/depends/packages/tor-macos.mk
@@ -0,0 +1,14 @@
+package=tor-win
+$(package)_version=0.4.7.8
+$(package)_download_path=https://dist.torproject.org/torbrowser/11.5.1/
+$(package)_file_name=TorBrowser-11.5.1-osx64_en-US.dmg
+$(package)_sha256_hash=616d719572e4917d1264c622033afb1b4dd98e2553a0d09fd72470c99bad48e5
+$(package)_extract_cmds=mkdir -p $$($(1)_extract_dir) && \
+ echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
+ $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
+ 7z x $$($(1)_source)
+
+define $(package)_stage_cmds
+ mv Tor\ Browser.app/Contents/MacOS/Tor/tor.real Tor\ Browser.app/Contents/MacOS/Tor/tor && \
+ cp -a Tor\ Browser.app/Contents/MacOS/Tor $($(package)_staging_prefix_dir)/Tor/
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/tor-win.mk b/contrib/depends/packages/tor-win.mk
new file mode 100644
index 0000000..d724d1f
--- /dev/null
+++ b/contrib/depends/packages/tor-win.mk
@@ -0,0 +1,13 @@
+package=tor-win
+$(package)_version=0.4.7.8
+$(package)_download_path=https://dist.torproject.org/torbrowser/11.5.1/
+$(package)_file_name=tor-win64-$($(package)_version).zip
+$(package)_sha256_hash=6658aaf7d22052861631917590e248fdf8b3fe40a795d740811362b517113a47
+$(package)_extract_cmds=mkdir -p $$($(1)_extract_dir) && \
+ echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
+ $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && \
+ unzip $$($(1)_source)
+
+define $(package)_stage_cmds
+ cp -a Tor $($(package)_staging_prefix_dir)/Tor/
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/tor.mk b/contrib/depends/packages/tor.mk
new file mode 100644
index 0000000..0fc4efc
--- /dev/null
+++ b/contrib/depends/packages/tor.mk
@@ -0,0 +1,32 @@
+package=tor
+$(package)_version=0.4.7.7
+$(package)_download_path=https://dist.torproject.org/
+$(package)_file_name=tor-$($(package)_version).tar.gz
+$(package)_sha256_hash=3e131158b52b9435d7e43d1c47ef288b96d005342cc44b8c950bb403851a5b44
+$(package)_dependencies=libevent openssl zlib
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-asciidoc --disable-manpage --disable-html-manual --disable-system-torrc
+ $(package)_config_opts+=--disable-module-relay --disable-lzma --disable-zstd --enable-static-tor
+ $(package)_config_opts+=--with-libevent-dir=$(host_prefix) --with-openssl-dir=$(host_prefix)
+ $(package)_config_opts+=--with-zlib-dir=$(host_prefix) --disable-tool-name-check --enable-fatal-warnings
+ $(package)_config_opts+=--prefix=$(host_prefix)
+endef
+
+define $(package)_config_cmds
+ ./configure $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ strip -s -D bin/tor && \
+ mkdir $($(package)_staging_prefix_dir)/Tor/ && \
+ cp bin/tor $($(package)_staging_prefix_dir)/Tor
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/unbound.mk b/contrib/depends/packages/unbound.mk
new file mode 100644
index 0000000..2d870d6
--- /dev/null
+++ b/contrib/depends/packages/unbound.mk
@@ -0,0 +1,28 @@
+package=unbound
+$(package)_version=1.13.2
+$(package)_download_path=https://www.nlnetlabs.nl/downloads/$(package)/
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=0a13b547f3b92a026b5ebd0423f54c991e5718037fd9f72445817f6a040e1a83
+$(package)_dependencies=openssl expat ldns
+
+define $(package)_set_vars
+ $(package)_config_opts=--disable-shared --enable-static --without-pyunbound --prefix=$(host_prefix) --with-libexpat=$(host_prefix) --with-ssl=$(host_prefix) --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only
+ $(package)_config_opts_linux=--with-pic
+ $(package)_config_opts_w64=--enable-static-exe --sysconfdir=/etc --prefix=$(host_prefix) --target=$(host_prefix)
+ $(package)_build_opts_mingw32=LDFLAGS="$($(package)_ldflags) -lpthread"
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf) $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+endef
diff --git a/contrib/depends/packages/xcb_proto.mk b/contrib/depends/packages/xcb_proto.mk
new file mode 100644
index 0000000..9be8225
--- /dev/null
+++ b/contrib/depends/packages/xcb_proto.mk
@@ -0,0 +1,21 @@
+package=xcb_proto
+$(package)_version=1.14.1
+$(package)_download_path=https://xorg.freedesktop.org/archive/individual/proto
+$(package)_file_name=xcb-proto-$($(package)_version).tar.xz
+$(package)_sha256_hash=f04add9a972ac334ea11d9d7eb4fc7f8883835da3e4859c9afa971efdf57fcc3
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf lib/python*/site-packages/xcbgen/__pycache__
+endef
diff --git a/contrib/depends/packages/xproto.mk b/contrib/depends/packages/xproto.mk
new file mode 100644
index 0000000..7a43c52
--- /dev/null
+++ b/contrib/depends/packages/xproto.mk
@@ -0,0 +1,26 @@
+package=xproto
+$(package)_version=7.0.31
+$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto
+$(package)_file_name=$(package)-$($(package)_version).tar.bz2
+$(package)_sha256_hash=c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747
+
+define $(package)_set_vars
+$(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs
+$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
+endef
+
+define $(package)_preprocess_cmds
+ cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub .
+endef
+
+define $(package)_config_cmds
+ $($(package)_autoconf)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
diff --git a/contrib/depends/packages/zbar.mk b/contrib/depends/packages/zbar.mk
new file mode 100644
index 0000000..b0b6c2d
--- /dev/null
+++ b/contrib/depends/packages/zbar.mk
@@ -0,0 +1,31 @@
+package=zbar
+$(package)_version=0.23.92
+$(package)_download_path=https://github.com/mchehab/zbar/archive/refs/tags/
+$(package)_file_name=$($(package)_version).tar.gz
+$(package)_sha256_hash=dffc16695cb6e42fa318a4946fd42866c0f5ab735f7eaf450b108d1c3a19b4ba
+$(package)_dependencies=libiconv
+
+define $(package)_set_vars
+ $(package)_build_opts=CFLAGS="-fPIE"
+ $(package)_build_opts+=CXXFLAGS="-fPIE"
+endef
+
+define $(package)_preprocess_cmds
+ autoreconf -vfi
+endef
+
+define $(package)_set_vars
+ $(package)_config_opts=--prefix=$(host_prefix) --disable-shared --without-imagemagick --disable-video --without-xv --with-gtk=no --with-python=no --enable-doc=no --host=$(host)
+endef
+
+define $(package)_config_cmds
+ CFLAGS="-fPIE" CXXFLAGS="-fPIE" $($(package)_autoconf) $($(package)_config_opts)
+endef
+
+define $(package)_build_cmds
+ CFLAGS="-fPIE" CXXFLAGS="-fPIE" $(MAKE) $($(package)_build_opts)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/packages/zlib.mk b/contrib/depends/packages/zlib.mk
new file mode 100644
index 0000000..77a29c2
--- /dev/null
+++ b/contrib/depends/packages/zlib.mk
@@ -0,0 +1,25 @@
+package=zlib
+$(package)_version=1.2.11
+$(package)_download_path=https://github.com/madler/zlib/archive/refs/tags/
+$(package)_file_name=v1.2.11.tar.gz
+$(package)_sha256_hash=629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff
+
+define $(package)_config_cmds
+ CC="$($(package)_cc)" \
+ CXX="$($(package)_cxx)" \
+ AR="$($(package)_ar)" \
+ RANLIB="$($(package)_ranlib)" \
+ LIBTOOL="$($(package)_libtool)" \
+ LDLAGS="$($(package)_ldflags)" \
+ CFLAGS="-fPIE" \
+ CXXFLAGS="-fPIE" \
+ ./configure --static --prefix=$(host_prefix)
+endef
+
+define $(package)_build_cmds
+ $(MAKE)
+endef
+
+define $(package)_stage_cmds
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install
+endef
\ No newline at end of file
diff --git a/contrib/depends/patches/boost/fix_arm_arch.patch b/contrib/depends/patches/boost/fix_arm_arch.patch
new file mode 100644
index 0000000..3cf6b6f
--- /dev/null
+++ b/contrib/depends/patches/boost/fix_arm_arch.patch
@@ -0,0 +1,11 @@
+--- boost_1_64_0/tools/build/src/tools/darwin.jam.O 2017-04-17 03:22:26.000000000 +0100
++++ boost_1_64_0/tools/build/src/tools/darwin.jam 2022-05-04 17:26:29.984464447 +0000
+@@ -505,7 +505,7 @@
+ if $(instruction-set) {
+ options = -arch$(_)$(instruction-set) ;
+ } else {
+- options = -arch arm ;
++# options = -arch arm ;
+ }
+ }
+ }
diff --git a/contrib/depends/patches/boost/fix_aroptions.patch b/contrib/depends/patches/boost/fix_aroptions.patch
new file mode 100644
index 0000000..5b2ec10
--- /dev/null
+++ b/contrib/depends/patches/boost/fix_aroptions.patch
@@ -0,0 +1,28 @@
+--- boost_1_64_0/tools/build/src/tools/gcc.jam.O 2017-04-17 03:22:26.000000000 +0100
++++ boost_1_64_0/tools/build/src/tools/gcc.jam 2019-11-15 15:46:16.957937137 +0000
+@@ -243,6 +243,8 @@
+ {
+ ECHO notice: using gcc archiver :: $(condition) :: $(archiver[1]) ;
+ }
++ local arflags = [ feature.get-values : $(options) ] ;
++ toolset.flags gcc.archive .ARFLAGS $(condition) : $(arflags) ;
+
+ # - Ranlib.
+ local ranlib = [ common.get-invocation-command gcc
+@@ -970,6 +972,7 @@
+ # logic in intel-linux, but that is hardly worth the trouble as on Linux, 'ar'
+ # is always available.
+ .AR = ar ;
++.ARFLAGS = rc ;
+ .RANLIB = ranlib ;
+
+ toolset.flags gcc.archive AROPTIONS ;
+@@ -1011,7 +1014,7 @@
+ #
+ actions piecemeal archive
+ {
+- "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
++ "$(.AR)" $(AROPTIONS) $(.ARFLAGS) "$(<)" "$(>)"
+ "$(.RANLIB)" "$(<)"
+ }
+
diff --git a/contrib/depends/patches/boost/fix_coalesce.patch b/contrib/depends/patches/boost/fix_coalesce.patch
new file mode 100644
index 0000000..8ee2928
--- /dev/null
+++ b/contrib/depends/patches/boost/fix_coalesce.patch
@@ -0,0 +1,17 @@
+--- boost_1_64_0/tools/build/src/tools/darwin.jam
++++ boost_1_64_0/tools/build/src/tools/darwin.jam
+@@ -138,10 +138,10 @@ rule init ( version ? : command * : options * : requirement * )
+ common.handle-options darwin : $(condition) : $(command) : $(options) ;
+
+ # - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
+- if $(real-version) < "4.0.0"
+- {
+- flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
+- }
++ #if $(real-version) < "4.0.0"
++ #{
++ # flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
++ #}
+ # - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
+ if $(real-version) < "4.2.0"
+ {
diff --git a/contrib/depends/patches/cmake/cmake-1-fixes.patch b/contrib/depends/patches/cmake/cmake-1-fixes.patch
new file mode 100644
index 0000000..062c067
--- /dev/null
+++ b/contrib/depends/patches/cmake/cmake-1-fixes.patch
@@ -0,0 +1,67 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore
+Date: Fri, 12 Aug 2016 02:01:20 +1000
+Subject: [PATCH 1/3] fix windres invocation options
+
+windres doesn't recognise various gcc flags like -mms-bitfields,
+-fopenmp, -mthreads etc. (basically not `-D` or `-I`)
+
+diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake
+index 1111111..2222222 100644
+--- a/Modules/Platform/Windows-windres.cmake
++++ b/Modules/Platform/Windows-windres.cmake
+@@ -1 +1 @@
+-set(CMAKE_RC_COMPILE_OBJECT " -O coff