From 1bd69867d1bf8cf5e196a621a7b24f444cb36fd8 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sat, 9 Dec 2023 06:56:21 -0800 Subject: [PATCH] Explain how to build FOSS in cosmocc README --- tool/cosmocc/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tool/cosmocc/README.md b/tool/cosmocc/README.md index 0f346ed6d..cef09338b 100644 --- a/tool/cosmocc/README.md +++ b/tool/cosmocc/README.md @@ -163,6 +163,23 @@ being passed to the freestanding Linux compiler. (cd /home/jart/cosmocc; bin/pecheck hello) ``` +## Building Open Source Software + +Assuming you put `cosmocc/bin/` on your `$PATH`, integrating with GNU +Autotools projects becomes easy. The trick here is to use a `--prefix` +that *only* contains software that's been built by cosmocc. That's +because Cosmopolitan Libc uses a different ABI than your distro. + +```sh +export CC="cosmocc -I/opt/cosmos/include -L/opt/cosmos/lib" +export CXX="cosmoc++ -I/opt/cosmos/include -L/opt/cosmos/lib" +export INSTALL=cosmoinstall +export AR=cosmoar +./configure --prefix=/opt/cosmos +make -j +make install +``` + ## Tools While the GNU GCC and Binutils programs included in your `cosmocc`